File manager - Edit - /home/jardides/www/Jardi-design/old/administrator/components/com_pagebuilderck/pro/includes/favorites.php
Back
<?php /** * @name Page Builder CK * @package com_pagebuilderck * @copyright Copyright (C) 2015. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr */ // No direct access defined('_JEXEC') or die; jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); class PagebuilderckParamsFavorites { private $_doc; private $_app; private $_input; public function __construct() { $this->_doc = JFactory::getDocument(); $this->_app = JFactory::getApplication(); $this->_input = $this->_app->input; PagebuilderckHelper::loadCkbox(); PagebuilderckHelper::loadParamsAssets(); } public function loadStylesPanel() { $user = JFactory::getUser(); $canEdit = $user->authorise('core.edit', 'com_pagebuilderck'); ?> <div id="popup_favoriteck" class="menuck clearfix"> <div class="inner clearfix"> <div class="headerck"> <span class="headerckicon" onclick="ckCloseFavoritePopup(true)">×</span> <span class="headercktext"><?php echo JText::_('CK_FAVORITES'); ?></span> </div> <div class="menuckinfos"></div> <div> <div id="ckshowsuggestions" class="clearfix"> <div class="menulink current" tab="tab_favoriteblock"><?php echo JText::_('CK_BLOCK'); ?></div> <div class="menulink" tab="tab_favoriteshadows"><?php echo JText::_('CK_SHADOW'); ?></div> <div class="menulink" tab="tab_favoritecustom"><?php echo JText::_('CK_MYFAVORITES'); ?></div> <div class="clr"></div> <div id="ckelementscontentfavorites"> <div class="clearfix" style="margin: 0 5px;"> <div class="tab menustyles current" id="tab_favoriteblock"> <?php $index = 'bloc'; $path = PAGEBUILDERCK_PARAMS_PATH . '/suggestions'; $files = JFolder::files($path, '.fck3', false, false); natsort($files); $i = 1; $merge = 0; ?> <?php foreach ($files as $file) { $favorite = JFile::stripExt($file); $content = file_get_contents($path . '/' . $file); $content = json_decode($content); if ($index == 'bloc' && !stristr($file, "bloc")) : $index = 'shadow'; $merge = '1'; ?> </div> <div class="tab menustyles" id="tab_favoriteshadows"> <?php endif; if (stristr($file, "shadow")) { $content->style = '/*shadow start*/' . $content->style . '/*shadow end*/'; } echo '<div class="favoritethumb" data-merge="' . $merge . '" onmouseout="ckRestoreBeforeFavorite()" onmouseover="ckPreviewFavoriteDirect(this)" onclick="ckLoadFavorite(\'' . $favorite . '\', \'suggestions\', 1, this)"><img src="' . PAGEBUILDERCK_URI . '/pro/suggestions/' . $favorite . '.png" style="margin:0;padding:0;" />' . '<div class="themeindice">' . $i . '</div>' . '<div class="favoritethumbstyles"><style>' . $content->style . '</style></div>' . '</div>'; $i++; ?> <?php } ?> </div> <div class="tab menustyles" id="tab_favoritecustom"> <?php if ($canEdit) { ?> <div class="ckbutton ckaddtofavorite" id="ckaddtofavorite" onclick="ckSaveFavorite()"><span class="fa fa-plus-circle"></span> <?php echo JText::_('CK_ADD_TO_FAVORITES'); ?></div> <br /> <?php } ?> <div class="inner"> <?php $path = PAGEBUILDERCK_PARAMS_PATH . '/favorites'; $files = JFolder::files($path, '.fck3', false, false); natsort($files); $files = array_reverse($files, true); $i = 1; foreach ($files as $file) { $favorite = JFile::stripExt($file); $content = file_get_contents($path . '/' . $file); $content = json_decode($content); $styles = str_replace('|ID|', 'pbckmyfavorite' . $favorite, $content->style); $styles = str_replace('|di|', '#', $styles); $ckprops = ''; foreach ($content as $name => $prop) { if (substr($name, 0,7) == 'ckprops') { $ckprops .= '<div ' . str_replace('|di|', '#', $prop) . '></div>'; } } echo '<div class="pbckmyfavoriterow clearfix">' . '<div id="pbckmyfavorite' . $favorite . '" data-name="' . $favorite . '" style="margin:0px !important;" class="favoritethumb pbckmyfavorite" data-merge="0" onmouseout="ckRestoreBeforeFavorite()" onmouseover="ckPreviewFavoriteDirect(this)" onclick="ckLoadFavorite(\'' . $favorite . '\', \'favorites\', 1, this)">' . '<div class="themeindice">' . $i . '</div>' . $ckprops . '<div class="ckstyle"><style>' . $styles . '</style></div>' . '<div class="inner">' // . '<style>' . $styles . '</style>' . 'Lorem ipsum dolor sit amet' . '<div class="favoritethumbstyles"><style>' . $content->style . '</style></div>' . '</div>' . '</div>' . ($canEdit ? '<div class="ckbutton" onclick="ckEditFavorite(this);"><span class="fa fa-edit"></span> ' . JText::_('CK_EDIT') . '</div>' : '') . ($canEdit ? '<div class="ckbutton" onclick="ckRemoveFavorite(this);"><span class="fa fa-remove" style="color:red;"></span> ' . JText::_('CK_DELETE') . '</div>' : '') . '</div>'; $i++; } ?> </div> </div> </div> </div> </div> </div> </div> </div> <script language="javascript" type="text/javascript"> $ck('#ckshowsuggestions div.tab:not(.current)').hide(); $ck('#ckshowsuggestions .menulink', $ck('#popup_favoriteck')).each(function(i, tab) { $ck(tab).click(function() { $ck('#ckelementscontentfavorites div.tab').hide(); $ck('#ckshowsuggestions .menulink', $ck('#popup_favoriteck')).removeClass('current'); if ($ck('#ckshowsuggestions #' + $ck(tab).attr('tab')).length) $ck('#ckshowsuggestions #' + $ck(tab).attr('tab')).show(); $ck(tab).addClass('current'); }); }); </script> <?php } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings