File manager - Edit - /home/jardides/www/Jardi-design/old/plugins/editors-xtd/mediaboxckbutton/mediaboxckbutton.php
Back
<?php /** * @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870 * http://www.joomlack.fr * http://www.template-creator.com * @license GNU/GPL * */ defined('_JEXEC') or die; jimport('joomla.filesystem.folder'); class PlgButtonMediaboxckbutton extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = true; /** * Mediaboxckbutton button * * @param string $name The name of the editor field * * @return button Object */ public function onDisplay($name) { $doc = JFactory::getDocument(); // get the settings from the system plugin $plugin = JPluginHelper::getPlugin('system', 'mediabox_ck'); $mediaboxParams = new JRegistry($plugin->params); // translations JText::script('PLG_MEDIABOXCKBUTTON_TEXT'); JText::script('PLG_MEDIABOXCKBUTTON_UPDATE_LINK'); JText::script('PLG_MEDIABOXCKBUTTON_INSERT_LINK'); JText::script('PLG_MEDIABOXCKBUTTON_UPDATE_TAG'); JText::script('PLG_MEDIABOXCKBUTTON_INSERT_TAG'); JText::script('PLG_MEDIABOXCKBUTTON_TITLE'); JText::script('PLG_MEDIABOXCKBUTTON_DESCRIPTION'); JText::script('PLG_MEDIABOXCKBUTTON_SOURCE'); JText::script('PLG_MEDIABOXCKBUTTON_SOURCE_MEDIA_SINGLE'); JText::script('PLG_MEDIABOXCKBUTTON_SOURCE_MEDIA_DIRECTORY'); JText::script('PLG_MEDIABOXCKBUTTON_SOURCE_NOTES'); JText::script('PLG_MEDIABOXCKBUTTON_SELECT_IMAGE'); JText::script('PLG_MEDIABOXCKBUTTON_SOURCE_DIRECTORY_NOTES'); JText::script('PLG_MEDIABOXCKBUTTON_SOURCE_DIRECTORY'); JText::script('PLG_MEDIABOXCKBUTTON_SELECT_DIRECTORY'); JText::script('PLG_MEDIABOXCKBUTTON_DIMENSIONS'); JText::script('PLG_MEDIABOXCKBUTTON_DIMENSIONS_NOTES'); JText::script('PLG_MEDIABOXCKBUTTON_WIDTH'); JText::script('PLG_MEDIABOXCKBUTTON_HEIGHT'); JText::script('PLG_MEDIABOXCKBUTTON_ALBUM_DESC'); JText::script('PLG_MEDIABOXCKBUTTON_ALBUM'); JText::script('PLG_MEDIABOXCKBUTTON_GALLERY_DESC'); JText::script('PLG_MEDIABOXCKBUTTON_GALLERY'); JText::script('PLG_MEDIABOXCKBUTTON_SOURCE_MISSING'); JText::script('PLG_MEDIABOXCKBUTTON_PREVIEW'); // $doc->addScriptDeclaration($js); $doc->addStylesheet(JUri::root(true) . '/plugins/editors-xtd/mediaboxckbutton/assets/mediaboxckbutton.css'); $doc->addScript(JUri::root(true) . '/plugins/editors-xtd/mediaboxckbutton/assets/mediaboxckbutton.js'); $button = new JObject; $button->modal = false; $button->class = 'btn'; $button->onclick = 'showMediaboxckButton(\'' . $name . '\', \'' . $mediaboxParams->get('attribtype', 'rel') . '\',\'' . $mediaboxParams->get('attribname', 'lightbox') . '\', \'' . JUri::root(true) . '\');return false;'; $button->text = JText::_('PLG_MEDIABOXCKBUTTON_BUTTON'); $button->name = 'mediaboxckbutton'; // nom de la classe <i> pour icone $button->link = '#'; return $button; } /* * Escape single quote in the strings to avoid JS errors * * param $t string : the text to escape * return string : the escaped string */ private function mediaboxckText($t) { return str_replace('\'', '\\\'', JText::_($t)); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings