File manager - Edit - /home/capoccitel/www/wp-admin/editors-xtd.tar
Back
fields/fields.xml 0000705 00000001437 15242037052 0010005 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.7" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_fields</name> <author>Joomla! Project</author> <creationDate>February 2017</creationDate> <copyright>(C) 2017 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.7.0</version> <description>PLG_EDITORS-XTD_FIELDS_XML_DESCRIPTION</description> <files> <filename plugin="fields">fields.php</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors-xtd_fields.ini</language> <language tag="en-GB">en-GB.plg_editors-xtd_fields.sys.ini</language> </languages> </extension> fields/fields.php 0000705 00000003317 15242037052 0007773 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors-xtd.fields * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Editor Fields button * * @since 3.7.0 */ class PlgButtonFields extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.7.0 */ protected $autoloadLanguage = true; /** * Display the button * * @param string $name The name of the button to add * * @return JObject The button options as JObject * * @since 3.7.0 */ public function onDisplay($name) { // Check if com_fields is enabled if (!JComponentHelper::isEnabled('com_fields')) { return; } // Register FieldsHelper JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); // Guess the field context based on view. $jinput = JFactory::getApplication()->input; $context = $jinput->get('option') . '.' . $jinput->get('view'); // Validate context. $context = implode('.', FieldsHelper::extract($context)); if (!FieldsHelper::getFields($context)) { return; } $link = 'index.php?option=com_fields&view=fields&layout=modal&tmpl=component&context=' . $context . '&editor=' . $name . '&' . JSession::getFormToken() . '=1'; $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_EDITORS-XTD_FIELDS_BUTTON_FIELD'); $button->name = 'puzzle'; $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; return $button; } } image/image.xml 0000705 00000001413 15242037052 0007427 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.1" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_image</name> <author>Joomla! Project</author> <creationDate>August 2004</creationDate> <copyright>(C) 2005 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>PLG_IMAGE_XML_DESCRIPTION</description> <files> <filename plugin="image">image.php</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors-xtd_image.ini</language> <language tag="en-GB">en-GB.plg_editors-xtd_image.sys.ini</language> </languages> </extension> image/image.php 0000705 00000004175 15242037052 0007426 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors-xtd.image * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Editor Image buton * * @since 1.5 */ class PlgButtonImage extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = true; /** * Display the button. * * @param string $name The name of the button to display. * @param string $asset The name of the asset being edited. * @param integer $author The id of the author owning the asset being edited. * * @return JObject The button options as JObject or false if not allowed * * @since 1.5 */ public function onDisplay($name, $asset, $author) { $app = JFactory::getApplication(); $user = JFactory::getUser(); $extension = $app->input->get('option'); // For categories we check the extension (ex: component.section) if ($extension === 'com_categories') { $parts = explode('.', $app->input->get('extension', 'com_content')); $extension = $parts[0]; } $asset = $asset !== '' ? $asset : $extension; if ($user->authorise('core.edit', $asset) || $user->authorise('core.create', $asset) || (count($user->getAuthorisedCategories($asset, 'core.create')) > 0) || ($user->authorise('core.edit.own', $asset) && $author === $user->id) || (count($user->getAuthorisedCategories($extension, 'core.edit')) > 0) || (count($user->getAuthorisedCategories($extension, 'core.edit.own')) > 0 && $author === $user->id)) { $link = 'index.php?option=com_media&view=images&tmpl=component&e_name=' . $name . '&asset=' . $asset . '&author=' . $author; $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_IMAGE_BUTTON_IMAGE'); $button->name = 'pictures'; $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; return $button; } return false; } } image/index.html 0000705 00000000037 15242037052 0007621 0 ustar 00 <!DOCTYPE html><title></title> pagebreak/pagebreak.xml 0000705 00000001456 15242037052 0011134 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.1" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_pagebreak</name> <author>Joomla! Project</author> <creationDate>August 2004</creationDate> <copyright>(C) 2005 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>PLG_EDITORSXTD_PAGEBREAK_XML_DESCRIPTION</description> <files> <filename plugin="pagebreak">pagebreak.php</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors-xtd_pagebreak.ini</language> <language tag="en-GB">en-GB.plg_editors-xtd_pagebreak.sys.ini</language> </languages> </extension> pagebreak/pagebreak.php 0000705 00000003632 15242037052 0011121 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors-xtd.pagebreak * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Editor Pagebreak button * * @since 1.5 */ class PlgButtonPagebreak extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = true; /** * Display the button * * @param string $name The name of the button to add * * @return JObject The button options as JObject * * @since 1.5 */ public function onDisplay($name) { $input = JFactory::getApplication()->input; $user = JFactory::getUser(); // Can create in any category (component permission) or at least in one category $canCreateRecords = $user->authorise('core.create', 'com_content') || count($user->getAuthorisedCategories('com_content', 'core.create')) > 0; // Instead of checking edit on all records, we can use **same** check as the form editing view $values = (array) JFactory::getApplication()->getUserState('com_content.edit.article.id'); $isEditingRecords = count($values); // This ACL check is probably a double-check (form view already performed checks) $hasAccess = $canCreateRecords || $isEditingRecords; if (!$hasAccess) { return; } JFactory::getDocument()->addScriptOptions('xtd-pagebreak', array('editor' => $name)); $link = 'index.php?option=com_content&view=article&layout=pagebreak&tmpl=component&e_name=' . $name; $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_EDITORSXTD_PAGEBREAK_BUTTON_PAGEBREAK'); $button->name = 'copy'; $button->options = "{handler: 'iframe', size: {x: 500, y: 300}}"; return $button; } } pagebreak/index.html 0000705 00000000037 15242037052 0010460 0 ustar 00 <!DOCTYPE html><title></title> article/article.php 0000705 00000003517 15242037052 0010327 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors-xtd.article * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Editor Article button * * @since 1.5 */ class PlgButtonArticle extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = true; /** * Display the button * * @param string $name The name of the button to add * * @return JObject The button options as JObject * * @since 1.5 */ public function onDisplay($name) { $input = JFactory::getApplication()->input; $user = JFactory::getUser(); // Can create in any category (component permission) or at least in one category $canCreateRecords = $user->authorise('core.create', 'com_content') || count($user->getAuthorisedCategories('com_content', 'core.create')) > 0; // Instead of checking edit on all records, we can use **same** check as the form editing view $values = (array) JFactory::getApplication()->getUserState('com_content.edit.article.id'); $isEditingRecords = count($values); // This ACL check is probably a double-check (form view already performed checks) $hasAccess = $canCreateRecords || $isEditingRecords; if (!$hasAccess) { return; } $link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1&editor=' . $name; $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_ARTICLE_BUTTON_ARTICLE'); $button->name = 'file-add'; $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; return $button; } } article/article.xml 0000705 00000001430 15242037052 0010330 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.1" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_article</name> <author>Joomla! Project</author> <creationDate>October 2009</creationDate> <copyright>(C) 2009 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>PLG_ARTICLE_XML_DESCRIPTION</description> <files> <filename plugin="article">article.php</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors-xtd_article.ini</language> <language tag="en-GB">en-GB.plg_editors-xtd_article.sys.ini</language> </languages> </extension> article/index.html 0000705 00000000037 15242037052 0010162 0 ustar 00 <!DOCTYPE html><title></title> contact/contact.php 0000705 00000002622 15242037052 0010343 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors-xtd.contact * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Editor Contact button * * @since 3.7.0 */ class PlgButtonContact extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.7.0 */ protected $autoloadLanguage = true; /** * Display the button * * @param string $name The name of the button to add * * @return JObject The button options as JObject * * @since 3.7.0 */ public function onDisplay($name) { $user = JFactory::getUser(); if ($user->authorise('core.create', 'com_contact') || $user->authorise('core.edit', 'com_contact') || $user->authorise('core.edit.own', 'com_contact')) { // The URL for the contacts list $link = 'index.php?option=com_contact&view=contacts&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1&editor=' . $name; $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_EDITORS-XTD_CONTACT_BUTTON_CONTACT'); $button->name = 'address'; $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; return $button; } } } contact/contact.xml 0000705 00000001444 15242037052 0010355 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.7" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_contact</name> <author>Joomla! Project</author> <creationDate>October 2016</creationDate> <copyright>(C) 2016 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.7.0</version> <description>PLG_EDITORS-XTD_CONTACT_XML_DESCRIPTION</description> <files> <filename plugin="contact">contact.php</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors-xtd_contact.ini</language> <language tag="en-GB">en-GB.plg_editors-xtd_contact.sys.ini</language> </languages> </extension> index.html 0000705 00000000037 15242037052 0006537 0 ustar 00 <!DOCTYPE html><title></title> menu/menu.php 0000705 00000002530 15242037052 0007163 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors-xtd.menu * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Editor menu button * * @since 3.7.0 */ class PlgButtonMenu extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.7.0 */ protected $autoloadLanguage = true; /** * Display the button * * @param string $name The name of the button to add * * @since 3.7.0 * @return array */ public function onDisplay($name) { /* * Use the built-in element view to select the menu item. * Currently uses blank class. */ $user = JFactory::getUser(); if ($user->authorise('core.create', 'com_menus') || $user->authorise('core.edit', 'com_menus')) { $link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1&editor=' . $name; $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_EDITORS-XTD_MENU_BUTTON_MENU'); $button->name = 'share-alt'; $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; return $button; } } } menu/menu.xml 0000705 00000001421 15242037052 0007172 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.7" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_menu</name> <author>Joomla! Project</author> <creationDate>August 2016</creationDate> <copyright>(C) 2016 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.7.0</version> <description>PLG_EDITORS-XTD_MENU_XML_DESCRIPTION</description> <files> <filename plugin="menu">menu.php</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors-xtd_menu.ini</language> <language tag="en-GB">en-GB.plg_editors-xtd_menu.sys.ini</language> </languages> </extension> readmore/index.html 0000705 00000000037 15242037052 0010335 0 ustar 00 <!DOCTYPE html><title></title> readmore/readmore.xml 0000705 00000001434 15242037052 0010662 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.1" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_readmore</name> <author>Joomla! Project</author> <creationDate>March 2006</creationDate> <copyright>(C) 2006 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>PLG_READMORE_XML_DESCRIPTION</description> <files> <filename plugin="readmore">readmore.php</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors-xtd_readmore.ini</language> <language tag="en-GB">en-GB.plg_editors-xtd_readmore.sys.ini</language> </languages> </extension> readmore/readmore.php 0000705 00000002507 15242037052 0010653 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors-xtd.readmore * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Editor Readmore button * * @since 1.5 */ class PlgButtonReadmore extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = true; /** * Readmore button * * @param string $name The name of the button to add * * @return JObject The button options as JObject * * @since 1.5 */ public function onDisplay($name) { JHtml::_('script', 'com_content/admin-article-readmore.min.js', array('version' => 'auto', 'relative' => true)); // Pass some data to javascript JFactory::getDocument()->addScriptOptions( 'xtd-readmore', array( 'editor' => $this->_subject->getContent($name), 'exists' => JText::_('PLG_READMORE_ALREADY_EXISTS', true), ) ); $button = new JObject; $button->modal = false; $button->class = 'btn'; $button->onclick = 'insertReadmore(\'' . $name . '\');return false;'; $button->text = JText::_('PLG_READMORE_BUTTON_READMORE'); $button->name = 'arrow-down'; $button->link = '#'; return $button; } } tabs/popup.php 0000705 00000003240 15242037052 0007346 0 ustar 00 <?php /** * @package Tabs * @version 7.2.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2018 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\EditorButton\Tabs\Popup; defined('_JEXEC') or die; use JFactory; use JText; use RegularLabs\Library\Document as RL_Document; use RegularLabs\Library\RegEx as RL_RegEx; class Popup extends \RegularLabs\Library\EditorButtonPopup { var $require_core_auth = false; public function loadScripts() { // Tag character start and end list($tag_start, $tag_end) = explode('.', $this->params->tag_characters); $script = " var tabs_tag_open = '" . RL_RegEx::replace('[^a-z0-9-_]', '', $this->params->tag_open) . "'; var tabs_tag_close = '" . RL_RegEx::replace('[^a-z0-9-_]', '', $this->params->tag_close) . "'; var tabs_tag_delimiter = '" . (($this->params->tag_delimiter == '=') ? '=' : ' ') . "'; var tabs_tag_characters = ['" . $tag_start . "', '" . $tag_end . "']; var tabs_editorname = '" . JFactory::getApplication()->input->getString('name', 'text') . "'; var tabs_content_placeholder = '" . JText::_('TAB_TEXT', true) . "'; var tabs_error_empty_title = '" . JText::_('TAB_ERROR_EMPTY_TITLE', true) . "'; var tabs_max_count = " . (int) $this->params->button_max_count . "; "; RL_Document::scriptDeclaration($script); RL_Document::script('tabs/popup.min.js', '7.2.1'); } public function loadStyles() { RL_Document::style('tabs/popup.min.css', '7.2.1'); } } $class = new Popup('tabs'); $class->render(); tabs/helper.php 0000705 00000005714 15242037052 0007472 0 ustar 00 <?php /** * @package Tabs * @version 7.2.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2018 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; use RegularLabs\Library\Document as RL_Document; use RegularLabs\Library\RegEx as RL_RegEx; /** ** Plugin that places the button */ class PlgButtonTabsHelper extends \RegularLabs\Library\EditorButtonHelper { /** * Display the button * * @param string $editor_name * * @return JObject|null A button object */ public function render($editor_name) { if ($this->params->button_use_simple_button) { return $this->renderSimpleButton($editor_name); } return $this->renderPopupButton($editor_name); } private function renderSimpleButton($editor_name) { $this->params->tag_open = RL_RegEx::replace('[^a-z0-9-_]', '', $this->params->tag_open); $this->params->tag_close = RL_RegEx::replace('[^a-z0-9-_]', '', $this->params->tag_close); $this->params->tag_delimiter = ($this->params->tag_delimiter == '=') ? '=' : ' '; $text = $this->getExampleText(); $text = str_replace('\\\\n', '\\n', addslashes($text)); $text = str_replace('{', '{\'+\'', $text); $js = " function insertTabs(editor) { selection = RegularLabsScripts.getEditorSelection(editor); selection = selection ? selection : '" . JText::_('TAB_TEXT', true) . "'; text = '" . $text . "'; text = text.replace('[:SELECTION:]', selection); jInsertEditorText(text, editor); } "; RL_Document::scriptDeclaration($js); $button = new JObject; $button->modal = false; $button->class = 'btn'; $button->link = '#'; $button->onclick = 'insertTabs(\'' . $editor_name . '\');return false;'; $button->text = $this->getButtonText(); $button->name = $this->getIcon(); return $button; } private function getExampleText() { switch (true) { case ($this->params->button_use_custom_code && $this->params->button_custom_code): return $this->getCustomText(); default: return $this->getDefaultText(); } } private function getDefaultText() { return '{' . $this->params->tag_open . $this->params->tag_delimiter . JText::_('TAB_TITLE') . ' 1}\n' . '<p>[:SELECTION:]</p>\n' . '<p>{' . $this->params->tag_open . $this->params->tag_delimiter . JText::_('TAB_TITLE') . ' 2}</p>\n' . '<p>' . JText::_('TAB_TEXT') . '</p>\n' . '<p>{/' . $this->params->tag_close . '}</p>'; } private function getCustomText() { $text = trim($this->params->button_custom_code); $text = str_replace(["\r", "\n"], ['', '</p>\n<p>'], trim($text)) . '</p>'; $text = RL_RegEx::replace('^(.*?)</p>', '\1', $text); $text = str_replace( ['{tab ', '{/tabs}'], ['{' . $this->params->tag_open . $this->params->tag_delimiter, '{/' . $this->params->tag_close . '}'], trim($text) ); return $text; } } tabs/popup.tmpl.php 0000705 00000007606 15242037052 0010333 0 ustar 00 <?php /** * @package Tabs * @version 7.2.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2018 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; $xmlfile = __DIR__ . '/fields.xml'; ?> <div class="reglab-overlay"></div> <nav class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container-fluid"> <div class="btn-toolbar" id="toolbar"> <div class="btn-wrapper" id="toolbar-apply"> <button onclick="if(RegularLabsTabsPopup.insertText()){window.parent.SqueezeBox.close();}" class="btn btn-small btn-success"> <span class="icon-apply icon-white"></span> <?php echo JText::_('RL_INSERT') ?> </button> </div> <div class="btn-wrapper" id="toolbar-cancel"> <button onclick="if(confirm('<?php echo JText::_('RL_ARE_YOU_SURE'); ?>')){window.parent.SqueezeBox.close();}" class="btn btn-small"> <span class="icon-cancel "></span> <?php echo JText::_('JCANCEL') ?> </button> </div> <?php if (JFactory::getApplication()->isAdmin() && JFactory::getUser()->authorise('core.admin', 1)) : ?> <div class="btn-wrapper" id="toolbar-options"> <button onclick="window.open('index.php?option=com_plugins&filter_folder=system&filter_search=<?php echo JText::_('TABS') ?>');" class="btn btn-small"> <span class="icon-options"></span> <?php echo JText::_('JOPTIONS') ?> </button> </div> <?php endif; ?> </div> </div> </div> </nav> <div class="header has-navbar-fixed-top"> <h1 class="page-title"> <span class="icon-reglab icon-tabs"></span> <?php echo JText::_('INSERT_TABS'); ?> </h1> </div> <div class="container-fluid container-main"> <form action="index.php" id="tabsForm" method="post"> <div class="row-fluid"> <div class="span8"> <?php echo JHtml::_('bootstrap.startTabSet', 'myTab', ['active' => 'tab_1']); ?> <?php for ($i = 1; $i <= $this->params->button_max_count; $i++) : ?> <?php $form = new JForm('tab', ['control' => 'tab_' . $i]); $form->loadFile($xmlfile, 1, '//config'); $title = '<span class="tab_' . $i . '_open_icon icon-default hasTooltip"' . ' title="' . JText::_('TAB_DEFAULT') . '" style="display:none;"></span> ' . JText::sprintf('TAB_TAB_NUMBER', $i); ?> <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'tab_' . $i, $title); ?> <h1><?php echo $title; ?></h1> <div class="row-fluid"> <div class="span8"> <?php echo str_replace('xxx', $i, $form->renderFieldset('tab_notice')); ?> <div class="form-inline form-inline-header"> <div class="control-group"> <div class="control-label"> <label for="tab_<?php echo $i; ?>_title"><?php echo JText::_('JGLOBAL_TITLE'); ?></label> </div> <div class="controls"> <input type="text" name="tab_<?php echo $i; ?>[title]" id="tab_<?php echo $i; ?>_title" value="" class="input-xxlarge input-large-text" size="40"> </div> </div> </div> <div class="control-group"> <div class="controls"> <em><?php echo JText::_('TAB_CONTENT_DESC'); ?></em> <div id="tab_<?php echo $i; ?>_content" style="display:none;" class="well well-small"></div> </div> </div> </div> <div class="span4"> <?php echo $form->renderFieldset('tab_params'); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php endfor; ?> <?php echo JHtml::_('bootstrap.endTabSet'); ?> </div> <div class="span4"> <h3><?php echo JText::_('TAB_SET_SETTINGS'); ?></h3> <?php $form = new JForm('tab', ['control' => 'tab_1']); $form->loadFile($xmlfile, 1, '//config'); echo $form->renderFieldset('params'); ?> </div> </div> </form> </div> tabs/script.install.php 0000705 00000001331 15242037052 0011153 0 ustar 00 <?php /** * @package Tabs * @version 7.2.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2018 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; require_once __DIR__ . '/script.install.helper.php'; class PlgEditorsXtdTabsInstallerScript extends PlgEditorsXtdTabsInstallerScriptHelper { public $name = 'TABS'; public $alias = 'tabs'; public $extension_type = 'plugin'; public $plugin_folder = 'editors-xtd'; public function uninstall($adapter) { $this->uninstallPlugin($this->extname, 'system'); } } tabs/language/fr-FR/fr-FR.plg_editors-xtd_tabs.ini 0000705 00000002755 15242037052 0015740 0 ustar 00 ;; @package Tabs ;; @version 7.2.1 ;; ;; @author Peter van Westen <info@regularlabs.com> ;; @link http://www.regularlabs.com ;; @copyright Copyright © 2018 Regular Labs All Rights Reserved ;; @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL ;; ;; @translate Want to help with translations? See: https://www.regularlabs.com/translate ;; ;; @translation Pierre Cabrol <p.cabrol@midiconcept.fr> MidiConcept, Mihàly Marti <info@sarki.ch> Sarki (sarki.ch) PLG_EDITORS-XTD_TABS="Bouton - Panneaux à onglets Regular Labs" PLG_EDITORS-XTD_TABS_DESC="Le plug-in Bouton Panneaux à onglets Regular Labs permet d'afficher un bouton sous l'éditeur pour créer/insérer des panneaux à onglets (<i>tabs</i>) dans tous les contenus Joomla!" TABS="Panneaux à onglets" TABS_DESC="Le système Tabs de Regular Labs vous permet de créer/insérer des panneaux à onglets (<i>tabs</i>) dans tous les contenus Joomla tels les descriptions de catégorie, les articles, les modules personnalisés, et tout autre composant ayant une zone d'éditeur.<br>Pour en savoir plus, consultez le site officiel de l'extension par le lien ci-dessous." TAB_SETTINGS="Vous pouvez également consulter le plug-in [[%1:start link%]]Panneaux à onglets Regular Labs[[%2:end link%]] qui permet de configurer les éléments insérés par le bouton." TAB_TEXT="Votre texte..." TAB_THE_SYSTEM_PLUGIN="Plug-in système Panneaux à onglets Regular Labs" TAB_TITLE="Titre de l'onglet" tabs/language/fr-FR/fr-FR.plg_editors-xtd_tabs.sys.ini 0000705 00000001476 15242037052 0016554 0 ustar 00 ;; @package Tabs ;; @version 7.2.1 ;; ;; @author Peter van Westen <info@regularlabs.com> ;; @link http://www.regularlabs.com ;; @copyright Copyright © 2018 Regular Labs All Rights Reserved ;; @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL ;; ;; @translate Want to help with translations? See: https://www.regularlabs.com/translate ;; ;; @translation Pierre Cabrol <p.cabrol@midiconcept.fr> MidiConcept, Mihàly Marti <info@sarki.ch> Sarki (sarki.ch) PLG_EDITORS-XTD_TABS="Bouton - Panneaux à onglets Regular Labs" PLG_EDITORS-XTD_TABS_DESC="Le plug-in Bouton Panneaux à onglets Regular Labs permet d'afficher un bouton sous l'éditeur pour créer/insérer des panneaux à onglets (<i>tabs</i>) dans tous les contenus Joomla!" TABS="Panneaux à onglets" tabs/language/en-GB/en-GB.plg_editors-xtd_tabs.ini 0000705 00000001426 15242037052 0015662 0 ustar 00 ;; @package Tabs ;; @version 7.2.1 ;; ;; @author Peter van Westen <info@regularlabs.com> ;; @link http://www.regularlabs.com ;; @copyright Copyright © 2018 Regular Labs All Rights Reserved ;; @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL ;; ;; @translate Want to help with translations? See: https://www.regularlabs.com/translate PLG_EDITORS-XTD_TABS="Button - Regular Labs - Tabs" PLG_EDITORS-XTD_TABS_DESC="Tabs - make content tabs in Joomla!" TABS="Tabs" TABS_DESC="With Tabs you can make content tabs anywhere in Joomla!" TAB_SETTINGS="Please see the [[%1:start link%]]Tabs system plugin[[%2:end link%]] for settings." TAB_TEXT="Your text..." TAB_THE_SYSTEM_PLUGIN="the Tabs system plugin" TAB_TITLE="Tab Title" tabs/language/en-GB/en-GB.plg_editors-xtd_tabs.sys.ini 0000705 00000001022 15242037052 0016467 0 ustar 00 ;; @package Tabs ;; @version 7.2.1 ;; ;; @author Peter van Westen <info@regularlabs.com> ;; @link http://www.regularlabs.com ;; @copyright Copyright © 2018 Regular Labs All Rights Reserved ;; @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL ;; ;; @translate Want to help with translations? See: https://www.regularlabs.com/translate PLG_EDITORS-XTD_TABS="Button - Regular Labs - Tabs" PLG_EDITORS-XTD_TABS_DESC="Tabs - make content tabs in Joomla!" TABS="Tabs" tabs/tabs.xml 0000705 00000003562 15242037052 0007154 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.4" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_tabs</name> <description>PLG_EDITORS-XTD_TABS_DESC</description> <version>7.2.1</version> <creationDate>March 2018</creationDate> <author>Regular Labs (Peter van Westen)</author> <authorEmail>info@regularlabs.com</authorEmail> <authorUrl>https://www.regularlabs.com</authorUrl> <copyright>Copyright © 2018 Regular Labs - All Rights Reserved</copyright> <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license> <scriptfile>script.install.php</scriptfile> <files> <filename plugin="tabs">tabs.php</filename> <filename>fields.xml</filename> <filename>helper.php</filename> <filename>popup.php</filename> <filename>popup.tmpl.php</filename> <filename>script.install.helper.php</filename> <folder>language</folder> </files> <config> <fields name="params" addfieldpath="/libraries/regularlabs/fields"> <fieldset name="description"> <field name="@loadlanguage_regularlabs" type="rl_loadlanguage" extension="plg_system_regularlabs" /> <field name="@loadlanguage" type="rl_loadlanguage" extension="plg_editors-xtd_tabs" /> <field name="@license" type="rl_license" extension="TABS" /> <field name="@version" type="rl_version" extension="TABS" /> <field name="@dependency" type="rl_dependency" label="TAB_THE_SYSTEM_PLUGIN" file="/plugins/system/tabs/tabs.php" /> <field name="@header" type="rl_header" label="TABS" description="TABS_DESC" url="https://www.regularlabs.com/tabs" /> <field name="@notice_settings" type="rl_plaintext" description="TAB_SETTINGS,<a href="index.php?option=com_plugins&filter_folder=system&filter_search=tabs" target="_blank">,</a>" /> </fieldset> </fields> </config> </extension> tabs/tabs.php 0000705 00000001172 15242037052 0007136 0 ustar 00 <?php /** * @package Tabs * @version 7.2.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2018 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; if ( ! is_file(JPATH_LIBRARIES . '/regularlabs/autoload.php')) { return; } require_once JPATH_LIBRARIES . '/regularlabs/autoload.php'; /** * Button Plugin that places Editor Buttons */ class PlgButtonTabs extends \RegularLabs\Library\EditorButton { var $require_core_auth = false; } tabs/fields.xml 0000705 00000007450 15242037052 0007471 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <config addfieldpath="/libraries/regularlabs/fields"> <fieldset name="tab_notice"> <field name="@toggler_title_empty_a" type="rl_toggler" param="tab_xxx_title" value="" /> <field name="@notice_title_empty" type="note" description="TAB_TITLE_EMPTY" /> <field name="@toggler_title_empty_b" type="rl_toggler" /> </fieldset> <fieldset name="tab_params"> <field name="open" type="radio" class="btn-group" default="0" label="TAB_DEFAULT" description="TAB_DEFAULT_DESC"> <option value="1">JYES</option> </field> <field name="alias" type="text" label="JFIELD_ALIAS_LABEL" description="TAB_ALIAS_DESC" /> <field name="class" type="text" label="RL_CSS_CLASS" description="RL_CSS_CLASS_DESC" /> <field name="@notice_scroll" type="rl_plaintext" label="TAB_SCROLL" description="TAB_SCROLL_DESC" default="RL_ONLY_AVAILABLE_IN_PRO" /> <field name="@notice_access" type="rl_plaintext" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" default="RL_ONLY_AVAILABLE_IN_PRO" /> <field name="@notice_usergroup" type="rl_plaintext" label="RL_USER_GROUPS" description="RL_USER_GROUPS_DESC" default="RL_ONLY_AVAILABLE_IN_PRO" /> <field name="@notice_extra" type="rl_plaintext" label="RL_EXTRA_PARAMETERS" description="RL_EXTRA_PARAMETERS_DESC" default="RL_ONLY_AVAILABLE_IN_PRO" /> </fieldset> <fieldset name="params"> <field name="mainclass" type="text" default="" label="TAB_MAIN_CLASS" description="TAB_MAIN_CLASS_DESC" /> <field name="color_inactive_handles" type="radio" class="btn-group" default="" label="TAB_COLOR_INACTIVE_HANDLES" description="TAB_COLOR_INACTIVE_HANDLES_DESC"> <option value="">JDEFAULT</option> <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="outline_handles" type="radio" class="btn-group" default="" label="TAB_OUTLINE_HANDLES" description="TAB_OUTLINE_HANDLES_DESC"> <option value="">JDEFAULT</option> <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="outline_content" type="radio" class="btn-group" default="" label="TAB_OUTLINE_CONTENT" description="TAB_OUTLINE_CONTENT_DESC"> <option value="">JDEFAULT</option> <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="alignment" type="radio" class="btn-group" default="" label="TAB_ALIGNMENT_HANDLES" description="TAB_ALIGNMENT_HANDLES_DESC"> <option value="">JDEFAULT</option> <option value="left"><span class="icon-reglab-paragraph-left"></span></option> <option value="right"><span class="icon-reglab-paragraph-right"></span></option> <option value="center"><span class="icon-reglab-paragraph-center"></span></option> <option value="justify"><span class="icon-reglab-paragraph-justify"></span></option> </field> <field name="@notice_positioning" type="rl_plaintext" label="TAB_POSITIONING_HANDLES" description="TAB_POSITIONING_HANDLES_DESC" default="RL_ONLY_AVAILABLE_IN_PRO" /> <field name="@notice_slideshow" type="rl_plaintext" label="TAB_SLIDESHOW" description="SLIDESHOW_DESC" default="RL_ONLY_AVAILABLE_IN_PRO" /> <field name="nested" type="radio" class="btn-group" default="0" label="TAB_NESTED_SET" description="TAB_NESTED_SET_DESC"> <option value="">JNO</option> <option value="1">JYES</option> </field> <field name="@toggler_nested_a" type="rl_toggler" param="tab_1_nested" value="1" /> <field name="nested_id" type="text" class="btn-group" default="nested" label="TAB_NESTED_ID" description="TAB_NESTED_ID_DESC" /> <field name="@toggler_nested_b" type="rl_toggler" /> </fieldset> </config> tabs/script.install.helper.php 0000705 00000052146 15242037052 0012443 0 ustar 00 <?php /** * @package Tabs * @version 7.2.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2018 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; class PlgEditorsXtdTabsInstallerScriptHelper { public $name = ''; public $alias = ''; public $extname = ''; public $extension_type = ''; public $plugin_folder = 'system'; public $module_position = 'status'; public $client_id = 1; public $install_type = 'install'; public $show_message = true; public $db = null; public $softbreak = null; public function __construct(&$params) { $this->extname = $this->extname ?: $this->alias; $this->db = JFactory::getDbo(); } public function preflight($route, JAdapterInstance $adapter) { if ( ! in_array($route, ['install', 'update'])) { return true; } JFactory::getLanguage()->load('plg_system_regularlabsinstaller', JPATH_PLUGINS . '/system/regularlabsinstaller'); if ($this->show_message && $this->isInstalled()) { $this->install_type = 'update'; } if ($this->onBeforeInstall($route) === false) { return false; } return true; } public function postflight($route, JAdapterInstance $adapter) { $this->removeGlobalLanguageFiles(); $this->removeUnusedLanguageFiles(); JFactory::getLanguage()->load($this->getPrefix() . '_' . $this->extname, $this->getMainFolder()); if ( ! in_array($route, ['install', 'update'])) { return true; } $this->fixExtensionNames(); $this->updateUpdateSites(); $this->removeAdminCache(); if ($this->onAfterInstall($route) === false) { return false; } if ($route == 'install') { $this->publishExtension(); } if ($this->show_message) { $this->addInstalledMessage(); } JFactory::getCache()->clean('com_plugins'); JFactory::getCache()->clean('_system'); return true; } public function isInstalled() { if ( ! is_file($this->getInstalledXMLFile())) { return false; } $query = $this->db->getQuery(true) ->select($this->db->quoteName('extension_id')) ->from('#__extensions') ->where($this->db->quoteName('type') . ' = ' . $this->db->quote($this->extension_type)) ->where($this->db->quoteName('element') . ' = ' . $this->db->quote($this->getElementName())); $this->db->setQuery($query, 0, 1); $result = $this->db->loadResult(); return empty($result) ? false : true; } public function getMainFolder() { switch ($this->extension_type) { case 'plugin' : return JPATH_PLUGINS . '/' . $this->plugin_folder . '/' . $this->extname; case 'component' : return JPATH_ADMINISTRATOR . '/components/com_' . $this->extname; case 'module' : return JPATH_ADMINISTRATOR . '/modules/mod_' . $this->extname; case 'library' : return JPATH_SITE . '/libraries/' . $this->extname; } } public function getInstalledXMLFile() { return $this->getXMLFile($this->getMainFolder()); } public function getCurrentXMLFile() { return $this->getXMLFile(__DIR__); } public function getXMLFile($folder) { switch ($this->extension_type) { case 'module' : return $folder . '/mod_' . $this->extname . '.xml'; default : return $folder . '/' . $this->extname . '.xml'; } } public function uninstallExtension($extname, $type = 'plugin', $folder = 'system', $show_message = true) { if (empty($extname)) { return; } $folders = []; switch ($type) { case 'plugin'; $folders[] = JPATH_PLUGINS . '/' . $folder . '/' . $extname; break; case 'component': $folders[] = JPATH_ADMINISTRATOR . '/components/com_' . $extname; $folders[] = JPATH_SITE . '/components/com_' . $extname; break; case 'module': $folders[] = JPATH_ADMINISTRATOR . '/modules/mod_' . $extname; $folders[] = JPATH_SITE . '/modules/mod_' . $extname; break; } if ( ! $this->foldersExist($folders)) { return; } $query = $this->db->getQuery(true) ->select($this->db->quoteName('extension_id')) ->from('#__extensions') ->where($this->db->quoteName('element') . ' = ' . $this->db->quote($this->getElementName($type, $extname))) ->where($this->db->quoteName('type') . ' = ' . $this->db->quote($type)); if ($type == 'plugin') { $query->where($this->db->quoteName('folder') . ' = ' . $this->db->quote($folder)); } $this->db->setQuery($query); $ids = $this->db->loadColumn(); if (empty($ids)) { foreach ($folders as $folder) { JFolder::delete($folder); } return; } $ignore_ids = JFactory::getApplication()->getUserState('rl_ignore_uninstall_ids', []); if (JFactory::getApplication()->input->get('option') == 'com_installer' && JFactory::getApplication()->input->get('task') == 'remove') { // Don't attempt to uninstall extensions that are already selected to get uninstalled by them selves $ignore_ids = array_merge($ignore_ids, JFactory::getApplication()->input->get('cid', [], 'array')); JFactory::getApplication()->input->set('cid', array_merge($ignore_ids, $ids)); } $ids = array_diff($ids, $ignore_ids); if (empty($ids)) { return; } $ignore_ids = array_merge($ignore_ids, $ids); JFactory::getApplication()->setUserState('rl_ignore_uninstall_ids', $ignore_ids); foreach ($ids as $id) { $tmpInstaller = new JInstaller; $tmpInstaller->uninstall($type, $id); } if ($show_message) { JFactory::getApplication()->enqueueMessage( JText::sprintf( 'COM_INSTALLER_UNINSTALL_SUCCESS', JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($type)) ) ); } } public function foldersExist($folders = []) { foreach ($folders as $folder) { if (is_dir($folder)) { return true; } } return false; } public function uninstallPlugin($extname, $folder = 'system', $show_message = true) { $this->uninstallExtension($extname, 'plugin', $folder, $show_message); } public function uninstallComponent($extname, $show_message = true) { $this->uninstallExtension($extname, 'component', null, $show_message); } public function uninstallModule($extname, $show_message = true) { $this->uninstallExtension($extname, 'module', null, $show_message); } public function publishExtension() { switch ($this->extension_type) { case 'plugin' : $this->publishPlugin(); case 'module' : $this->publishModule(); } } public function publishPlugin() { $query = $this->db->getQuery(true) ->update('#__extensions') ->set($this->db->quoteName('enabled') . ' = 1') ->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin')) ->where($this->db->quoteName('element') . ' = ' . $this->db->quote($this->extname)) ->where($this->db->quoteName('folder') . ' = ' . $this->db->quote($this->plugin_folder)); $this->db->setQuery($query); $this->db->execute(); } public function publishModule() { // Get module id $query = $this->db->getQuery(true) ->select($this->db->quoteName('id')) ->from('#__modules') ->where($this->db->quoteName('module') . ' = ' . $this->db->quote('mod_' . $this->extname)) ->where($this->db->quoteName('client_id') . ' = ' . (int) $this->client_id); $this->db->setQuery($query, 0, 1); $id = $this->db->loadResult(); if ( ! $id) { return; } // check if module is already in the modules_menu table (meaning is is already saved) $query->clear() ->select($this->db->quoteName('moduleid')) ->from('#__modules_menu') ->where($this->db->quoteName('moduleid') . ' = ' . (int) $id); $this->db->setQuery($query, 0, 1); $exists = $this->db->loadResult(); if ($exists) { return; } // Get highest ordering number in position $query->clear() ->select($this->db->quoteName('ordering')) ->from('#__modules') ->where($this->db->quoteName('position') . ' = ' . $this->db->quote($this->module_position)) ->where($this->db->quoteName('client_id') . ' = ' . (int) $this->client_id) ->order('ordering DESC'); $this->db->setQuery($query, 0, 1); $ordering = $this->db->loadResult(); $ordering++; // publish module and set ordering number $query->clear() ->update('#__modules') ->set($this->db->quoteName('published') . ' = 1') ->set($this->db->quoteName('ordering') . ' = ' . (int) $ordering) ->set($this->db->quoteName('position') . ' = ' . $this->db->quote($this->module_position)) ->where($this->db->quoteName('id') . ' = ' . (int) $id); $this->db->setQuery($query); $this->db->execute(); // add module to the modules_menu table $query->clear() ->insert('#__modules_menu') ->columns([$this->db->quoteName('moduleid'), $this->db->quoteName('menuid')]) ->values((int) $id . ', 0'); $this->db->setQuery($query); $this->db->execute(); } public function addInstalledMessage() { JFactory::getApplication()->enqueueMessage( JText::sprintf( JText::_($this->install_type == 'update' ? 'RLI_THE_EXTENSION_HAS_BEEN_UPDATED_SUCCESSFULLY' : 'RLI_THE_EXTENSION_HAS_BEEN_INSTALLED_SUCCESSFULLY'), '<strong>' . JText::_($this->name) . '</strong>', '<strong>' . $this->getVersion() . '</strong>', $this->getFullType() ) ); } public function getPrefix() { switch ($this->extension_type) { case 'plugin'; return JText::_('plg_' . strtolower($this->plugin_folder)); case 'component': return JText::_('com'); case 'module': return JText::_('mod'); case 'library': return JText::_('lib'); default: return $this->extension_type; } } public function getElementName($type = null, $extname = null) { $type = is_null($type) ? $this->extension_type : $type; $extname = is_null($extname) ? $this->extname : $extname; switch ($type) { case 'component' : return 'com_' . $extname; case 'module' : return 'mod_' . $extname; case 'plugin' : default: return $extname; } } public function getFullType() { return JText::_('RLI_' . strtoupper($this->getPrefix())); } public function getVersion($file = '') { $file = $file ?: $this->getCurrentXMLFile(); if ( ! is_file($file)) { return ''; } $xml = JApplicationHelper::parseXMLInstallFile($file); if ( ! $xml || ! isset($xml['version'])) { return ''; } return $xml['version']; } public function isNewer() { if ( ! $installed_version = $this->getVersion($this->getInstalledXMLFile())) { return true; } $package_version = $this->getVersion(); return version_compare($installed_version, $package_version, '<='); } public function canInstall() { // The extension is not installed yet if ( ! $installed_version = $this->getVersion($this->getInstalledXMLFile())) { return true; } // The free version is installed. So any version is ok to install if (strpos($installed_version, 'PRO') === false) { return true; } // Current package is a pro version, so all good if (strpos($this->getVersion(), 'PRO') !== false) { return true; } JFactory::getLanguage()->load($this->getPrefix() . '_' . $this->extname, __DIR__); JFactory::getApplication()->enqueueMessage(JText::_('RLI_ERROR_PRO_TO_FREE'), 'error'); JFactory::getApplication()->enqueueMessage( html_entity_decode( JText::sprintf( 'RLI_ERROR_UNINSTALL_FIRST', '<a href="https://www.regularlabs.com/extensions/' . $this->alias . '" target="_blank">', '</a>', JText::_($this->name) ) ), 'error' ); return false; } /* * Fixes incorrectly formed versions because of issues in old packager */ public function fixFileVersions($file) { if (is_array($file)) { foreach ($file as $f) { self::fixFileVersions($f); } return; } if ( ! is_string($file) || ! is_file($file)) { return; } $contents = file_get_contents($file); if ( strpos($contents, 'FREEFREE') === false && strpos($contents, 'FREEPRO') === false && strpos($contents, 'PROFREE') === false && strpos($contents, 'PROPRO') === false ) { return; } $contents = str_replace( ['FREEFREE', 'FREEPRO', 'PROFREE', 'PROPRO'], ['FREE', 'PRO', 'FREE', 'PRO'], $contents ); JFile::write($file, $contents); } public function onBeforeInstall($route) { if ( ! $this->canInstall()) { return false; } return true; } public function onAfterInstall($route) { } public function delete($files = []) { foreach ($files as $file) { if (is_dir($file)) { JFolder::delete($file); } if (is_file($file)) { JFile::delete($file); } } } public function fixAssetsRules($rules = '{"core.admin":[],"core.manage":[]}') { // replace default rules value {} with the correct initial value $query = $this->db->getQuery(true) ->update($this->db->quoteName('#__assets')) ->set($this->db->quoteName('rules') . ' = ' . $this->db->quote($rules)) ->where($this->db->quoteName('title') . ' = ' . $this->db->quote('com_' . $this->extname)) ->where($this->db->quoteName('rules') . ' = ' . $this->db->quote('{}')); $this->db->setQuery($query); $this->db->execute(); } private function fixExtensionNames() { switch ($this->extension_type) { case 'module' : $this->fixModuleNames(); } } private function fixModuleNames() { // Get module id $query = $this->db->getQuery(true) ->select($this->db->quoteName('id')) ->from('#__modules') ->where($this->db->quoteName('module') . ' = ' . $this->db->quote('mod_' . $this->extname)) ->where($this->db->quoteName('client_id') . ' = ' . (int) $this->client_id); $this->db->setQuery($query, 0, 1); $module_id = $this->db->loadResult(); if (empty($module_id)) { return; } $title = 'Regular Labs - ' . JText::_($this->name); $query->clear() ->update('#__modules') ->set($this->db->quoteName('title') . ' = ' . $this->db->quote($title)) ->where($this->db->quoteName('id') . ' = ' . (int) $module_id) ->where($this->db->quoteName('title') . ' LIKE ' . $this->db->quote('NoNumber%')); $this->db->setQuery($query); $this->db->execute(); // Fix module assets // Get asset id $query = $this->db->getQuery(true) ->select($this->db->quoteName('id')) ->from('#__assets') ->where($this->db->quoteName('name') . ' = ' . $this->db->quote('com_modules.module.' . (int) $module_id)) ->where($this->db->quoteName('title') . ' LIKE ' . $this->db->quote('NoNumber%')); $this->db->setQuery($query, 0, 1); $asset_id = $this->db->loadResult(); if (empty($asset_id)) { return; } $query->clear() ->update('#__assets') ->set($this->db->quoteName('title') . ' = ' . $this->db->quote($title)) ->where($this->db->quoteName('id') . ' = ' . (int) $asset_id); $this->db->setQuery($query); $this->db->execute(); } private function updateUpdateSites() { $this->removeOldUpdateSites(); $this->updateNamesInUpdateSites(); $this->updateHttptoHttpsInUpdateSites(); $this->removeDuplicateUpdateSite(); $this->updateDownloadKey(); } private function removeOldUpdateSites() { $query = $this->db->getQuery(true) ->select($this->db->quoteName('update_site_id')) ->from('#__update_sites') ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('nonumber.nl%')) ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%e=' . $this->alias . '%')); $this->db->setQuery($query, 0, 1); $id = $this->db->loadResult(); if ( ! $id) { return; } $query->clear() ->delete('#__update_sites') ->where($this->db->quoteName('update_site_id') . ' = ' . (int) $id); $this->db->setQuery($query); $this->db->execute(); $query->clear() ->delete('#__update_sites_extensions') ->where($this->db->quoteName('update_site_id') . ' = ' . (int) $id); $this->db->setQuery($query); $this->db->execute(); } private function updateNamesInUpdateSites() { $name = JText::_($this->name); if ($this->alias != 'extensionmanager') { $name = 'Regular Labs - ' . $name; } $query = $this->db->getQuery(true) ->update('#__update_sites') ->set($this->db->quoteName('name') . ' = ' . $this->db->quote($name)) ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%download.regularlabs.com%')) ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%e=' . $this->alias . '%')); $this->db->setQuery($query); $this->db->execute(); } private function updateHttptoHttpsInUpdateSites() { $query = $this->db->getQuery(true) ->update('#__update_sites') ->set($this->db->quoteName('location') . ' = REPLACE(' . $this->db->quoteName('location') . ', ' . $this->db->quote('http://') . ', ' . $this->db->quote('https://') . ')') ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('http://download.regularlabs.com%')); $this->db->setQuery($query); $this->db->execute(); } private function removeDuplicateUpdateSite() { // First check to see if there is a pro entry $query = $this->db->getQuery(true) ->select($this->db->quoteName('update_site_id')) ->from('#__update_sites') ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%download.regularlabs.com%')) ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%e=' . $this->alias . '%')) ->where($this->db->quoteName('location') . ' NOT LIKE ' . $this->db->quote('%pro=1%')); $this->db->setQuery($query, 0, 1); $id = $this->db->loadResult(); // Otherwise just get the first match if ( ! $id) { $query->clear() ->select($this->db->quoteName('update_site_id')) ->from('#__update_sites') ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%download.regularlabs.com%')) ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%e=' . $this->alias . '%')); $this->db->setQuery($query, 0, 1); $id = $this->db->loadResult(); // Remove pro=1 from the found update site $query->clear() ->update('#__update_sites') ->set($this->db->quoteName('location') . ' = replace(' . $this->db->quoteName('location') . ', ' . $this->db->quote('&pro=1') . ', ' . $this->db->quote('') . ')') ->where($this->db->quoteName('update_site_id') . ' = ' . (int) $id); $this->db->setQuery($query); $this->db->execute(); } if ( ! $id) { return; } $query->clear() ->select($this->db->quoteName('update_site_id')) ->from('#__update_sites') ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%download.regularlabs.com%')) ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%e=' . $this->alias . '%')) ->where($this->db->quoteName('update_site_id') . ' != ' . $id); $this->db->setQuery($query); $ids = $this->db->loadColumn(); if (empty($ids)) { return; } $query->clear() ->delete('#__update_sites') ->where($this->db->quoteName('update_site_id') . ' IN (' . implode(',', $ids) . ')'); $this->db->setQuery($query); $this->db->execute(); $query->clear() ->delete('#__update_sites_extensions') ->where($this->db->quoteName('update_site_id') . ' IN (' . implode(',', $ids) . ')'); $this->db->setQuery($query); $this->db->execute(); } // Save the download key from the Regular Labs Extension Manager config to the update sites private function updateDownloadKey() { $query = $this->db->getQuery(true) ->select($this->db->quoteName('params')) ->from('#__extensions') ->where($this->db->quoteName('element') . ' = ' . $this->db->quote('com_regularlabsmanager')); $this->db->setQuery($query); $params = $this->db->loadResult(); if ( ! $params) { return; } $params = json_decode($params); if ( ! isset($params->key)) { return; } // Add the key on all regularlabs.com urls $query->clear() ->update('#__update_sites') ->set($this->db->quoteName('extra_query') . ' = ' . $this->db->quote('k=' . $params->key)) ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('%download.regularlabs.com%')); $this->db->setQuery($query); $this->db->execute(); } private function removeAdminCache() { $this->delete([JPATH_ADMINISTRATOR . '/cache/regularlabs']); $this->delete([JPATH_ADMINISTRATOR . '/cache/nonumber']); } private function removeGlobalLanguageFiles() { if ($this->extension_type == 'library') { return; } $language_files = JFolder::files(JPATH_ADMINISTRATOR . '/language', '\.' . $this->getPrefix() . '_' . $this->extname . '\.', true, true); // Remove override files foreach ($language_files as $i => $language_file) { if (strpos($language_file, '/overrides/') === false) { continue; } unset($language_files[$i]); } if (empty($language_files)) { return; } JFile::delete($language_files); } private function removeUnusedLanguageFiles() { if ($this->extension_type == 'library') { return; } $installed_languages = array_merge( JFolder::folders(JPATH_SITE . '/language'), JFolder::folders(JPATH_ADMINISTRATOR . '/language') ); $languages = array_diff( JFolder::folders(__DIR__ . '/language'), $installed_languages ); $delete_languages = []; foreach ($languages as $language) { $delete_languages[] = $this->getMainFolder() . '/language/' . $language; } if (empty($delete_languages)) { return; } // Remove folders $this->delete($delete_languages); } } module/module.php 0000705 00000002702 15242037052 0010026 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors-xtd.module * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Editor Module button * * @since 3.5 */ class PlgButtonModule extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.5 */ protected $autoloadLanguage = true; /** * Display the button * * @param string $name The name of the button to add * * @return JObject The button options as JObject * * @since 3.5 */ public function onDisplay($name) { /* * Use the built-in element view to select the module. * Currently uses blank class. */ $user = JFactory::getUser(); if ($user->authorise('core.create', 'com_modules') || $user->authorise('core.edit', 'com_modules') || $user->authorise('core.edit.own', 'com_modules')) { $link = 'index.php?option=com_modules&view=modules&layout=modal&tmpl=component&editor=' . $name . '&' . JSession::getFormToken() . '=1'; $button = new JObject; $button->modal = true; $button->class = 'btn'; $button->link = $link; $button->text = JText::_('PLG_MODULE_BUTTON_MODULE'); $button->name = 'file-add'; $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; return $button; } } } module/module.xml 0000705 00000001422 15242037052 0010035 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.6" type="plugin" group="editors-xtd" method="upgrade"> <name>plg_editors-xtd_module</name> <author>Joomla! Project</author> <creationDate>October 2015</creationDate> <copyright>(C) 2015 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.5.0</version> <description>PLG_MODULE_XML_DESCRIPTION</description> <files> <filename plugin="module">module.php</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors-xtd_module.ini</language> <language tag="en-GB">en-GB.plg_editors-xtd_module.sys.ini</language> </languages> </extension>
| ver. 1.6 |
Github
|
.
| PHP 7.4.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings