File manager - Edit - /home/jardides/www/Jardi-design/old/plugins/pagebuilderck/tablerow/tablerow.php
Back
<?php /** * @copyright Copyright (C) 2020 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 plgPagebuilderckTablerow extends JPlugin { private $context = 'PLG_PAGEBUILDERCK_TABLEROW'; private $type = 'tablerow'; function __construct(&$subject, $params) { parent::__construct($subject, $params); } private function callAssets() { $doc = JFactory::getDocument(); PagebuilderckFrontHelper::addStylesheet(JUri::root(true) . '/plugins/pagebuilderck/tablerow/assets/tablerow.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/tablerow/assets/images/tablerow.png'; return $menuitem; } /* * Display the html code for the item to be used into the interface * * Return String the html code */ public function onPagebuilderckLoadItemContentTablerow() { $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" tablerowckcellsbackgroundcolorstart="#e3e3e3" tablerowckcellsmargins="" tablerowckcellspaddings="10" fieldslist="tablerowckcellsbackgroundcolorstart,tablerowckcellsmargins,tablerowckcellspaddings"></div> <div class="tab_buttonstyles ckprops" tablerowckbuttonsbackgroundcolorstart="#f9f9f9" tablerowckbuttonsmargins="5" tablerowckbuttonspaddings="6" fieldslist="tablerowckbuttonsbackgroundcolorstart,tablerowckbuttonsmargins,tablerowckbuttonspaddings"></div> <div class="ckstyle"> <style> #<?php echo $id; ?> .tablerowck .tablerowck-cell { background: #e3e3e3; padding: 10px; } #<?php echo $id; ?> .tablerowck .tablerowck-button { background: #f9f9f9; margin: 5px; padding: 6px; } </style> </div> <table class="inner tablerowck"> <tbody class="tablerowck-body"> <tr class="tablerowck-row"> <td class="tablerowck-cell"><p>Lorem</p></td> <td class="tablerowck-cell"><p>Consectetur</p></td> <td class="tablerowck-cell"><p>Praesent</p></td> </tr> <tr class="tablerowck-row"> <td class="tablerowck-cell"><p>Donec</p></td> <td class="tablerowck-cell"><p>Placerat</p></td> <td class="tablerowck-cell"><p>Quisque</p></td> </tr> <tr class="tablerowck-row"> <td class="tablerowck-cell"><p>Curabitur</p></td> <td class="tablerowck-cell"><p>Condimentum</p></td> <td class="tablerowck-cell"><p>Faucibus</p></td> </tr> </tbody> </table> </div> <?php } /* * Display the html code for the item to be used into the interface * * Return String the html code */ public function onPagebuilderckLoadItemOptionsTablerow() { // load the language files of the plugin $this->loadLanguage(); // load the interface for the options $tpl = JPATH_SITE . '/plugins/pagebuilderck/tablerow/layouts/edit_tablerow.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 onPagebuilderckRenderItemTablerow($item) { $this->callAssets(); $attrs = $item->find('.tab_tablerowstyles'); // this is the tab id in the interface which contains the options $this->tablerow_params = PagebuilderckFrontHelper::createParamsFromElement($attrs); $styles = '@media only screen and (max-width:' . (int)$this->tablerow_params->get('tablerowckresponsivevalue', '640') . 'px){ #'.$item->attr['id'].' .tablerowck .tablerowck-row, #'.$item->attr['id'].' .tablerowck .tablerowck-body { display: flex; flex-direction: column; } }'; PagebuilderckFrontHelper::addStyleDeclaration($styles); $html = $item->innertext; return $html; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings