File manager - Edit - /home/jardides/www/Jardi-design/old/plugins/pagebuilderck/table/table.php
Back
<?php /** * @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870 * https://www.template-creator.com * https://www.joomlack.fr * @license GNU/GPL * */ defined('_JEXEC') or die('Restricted access'); jimport('joomla.event.plugin'); class plgPagebuilderckTable extends JPlugin { private $context = 'PLG_PAGEBUILDERCK_TABLE'; private $type = 'table'; function __construct(&$subject, $params) { parent::__construct($subject, $params); } private function callAssets() { $doc = JFactory::getDocument(); PagebuilderckFrontHelper::addStylesheet(JUri::root(true) . '/plugins/pagebuilderck/table/assets/table.css'); } /* * Construct the Menu Item to drag into the interface * * Return Object with item data */ public function onPagebuilderckAddItemToMenu() { $this->callAssets(); // load the language files of the plugin $this->loadLanguage(); // create the menu item $menuitem = new stdClass(); $menuitem->type = $this->type; $menuitem->group = 'text'; $menuitem->title = JText::_($this->context . '_MENUITEM_TITLE'); $menuitem->description = JText::_($this->context . '_MENUITEM_DESC'); $menuitem->image = JUri::root(true) . '/plugins/pagebuilderck/table/assets/images/table.png'; return $menuitem; } /* * Display the html code for the item to be used into the interface * * Return String the html code */ public function onPagebuilderckLoadItemContentTable() { $input = JFactory::getApplication()->input; $id = $input->get('ckid', '', 'string'); // ckstyle and inner classes are needed to get the styles from the interface ?> <div id="<?php echo $id; ?>" class="cktype" data-type="<?php echo $this->type ?>"> <div class="tab_cellstyles ckprops" tableckcellsbackgroundcolorstart="#e3e3e3" tableckcellsmargins="5" tableckcellspaddings="10" fieldslist="tableckcellsbackgroundcolorstart,tableckcellsmargins,tableckcellspaddings"></div> <div class="tab_buttonstyles ckprops" tableckbuttonsbackgroundcolorstart="#f9f9f9" tableckbuttonsmargins="5" tableckbuttonspaddings="6" fieldslist="tableckbuttonsbackgroundcolorstart,tableckbuttonsmargins,tableckbuttonspaddings"></div> <div class="ckstyle"> <style> #<?php echo $id; ?> .tableck .tableck-cell { background: #e3e3e3; margin: 5px; padding: 10px; } #<?php echo $id; ?> .tableck .tableck-button { background: #f9f9f9; margin: 5px; padding: 6px; } </style> </div> <section class="inner tableck"> <div class="tableck-body"> <div class="tableck-col"> <div class="tableck-cell"><p>Lorem</p></div> <div class="tableck-cell"><p>Consectetur</p></div> <div class="tableck-cell"><p>Praesent</p></div> </div> <div class="tableck-col"> <div class="tableck-cell"><p>Donec</p></div> <div class="tableck-cell"><p>Placerat</p></div> <div class="tableck-cell"><p>Quisque</p></div> </div> <div class="tableck-col"> <div class="tableck-cell"><p>Curabitur</p></div> <div class="tableck-cell"><p>Condimentum</p></div> <div class="tableck-cell"><p>Faucibus</p></div> </div> </div> </section> </div> <?php } /* * Display the html code for the item to be used into the interface * * Return String the html code */ public function onPagebuilderckLoadItemOptionsTable() { // load the language files of the plugin $this->loadLanguage(); // load the interface for the options $tpl = JPATH_SITE . '/plugins/pagebuilderck/table/layouts/edit_table.php'; return $tpl; } /* * Display the html code for the item to be used into the frontend page * @param string the item object from simple_html_dom * * Return String the html code */ public function onPagebuilderckRenderItemTable($item) { $this->callAssets(); $attrs = $item->find('.tab_tablestyles'); // this is the tab id in the interface which contains the options $this->table_params = PagebuilderckFrontHelper::createParamsFromElement($attrs); $styles = '@media only screen and (max-width:' . (int)$this->table_params->get('tableckresponsivevalue', '640') . 'px){ #'.$item->attr['id'].' div.tableck-col { display: block; width: auto !important; } }'; PagebuilderckFrontHelper::addStyleDeclaration($styles); $html = $item->innertext; return $html; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings