first commit

This commit is contained in:
2026-02-08 21:16:11 +01:00
commit e17b7026fd
8881 changed files with 1160453 additions and 0 deletions

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,55 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
use Pagebuilderck\CKFof;
CKfof::addStyleSheet(PAGEBUILDERCK_MEDIA_URI . '/assets/pagebuilderck.css');
?>
<div class="ckadminsidebar"><?php echo JHtmlSidebar::render() ?></div>
<div class="ckadminarea">
<?php
// check for the update
$latest_version = PagebuilderckHelper::getLatestVersion();
$isOutdated = PagebuilderckHelper::isOutdated();
if ($latest_version !== false) {
if ($isOutdated) {
echo '<p class="alertck">' . JText::_('CK_IS_OUTDATED') . ' : <b>' . $latest_version . '</b></p>';
} else {
echo '<p class="infock">' . JText::_('CK_IS_UPTODATE') . '</p>';
}
}
?>
<style>
.ckaboutversion {
margin: 10px;
padding: 10px;
font-size: 20px;
font-color: #000;
text-align: center;
}
.ckcenter {
margin: 10px 0;
text-align: center;
}
</style>
<div class="ckaboutversion"><?php echo JText::_('CK_PAGEBUILDERCK_VERSION') . ' ' . $this->ckversion; ?> <?php echo (PagebuilderckHelper::getParams() ? 'PRO' : 'LIGHT') ?></div>
<div class="ckcenter"><img src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/images/logo_pagebuilderck_large_48.png" /></div>
<p class="ckcenter"><a href="https://www.joomlack.fr" target="_blank">https://www.joomlack.fr</a></p>
<p class="ckcenter"><?php echo JText::_('CK_PAGEBUILDERCK_DESC'); ?></p>
<p class="ckcenter">Tabler Icons - https://tablericons.com/</p>
<div class="alert"><?php echo JText::_('COM_PAGEBUILDERCK_VOTE_JED'); ?>&nbsp;<a href="https://extensions.joomla.org/extensions/extension/authoring-a-content/content-construction/page-builder-ck" target="_blank" class="btn btn-small btn-warning"><?php echo JText::_('COM_PAGEBUILDERCK_VOTE_JED_BUTTON'); ?></a></div>
<div><?php echo PagebuilderckHelper::showParamsMessage(true, JText::_('CK_PAGEBUILDERCK_GETMORE_PRO_ITEMS')); ?></div>
<hr />
<?php
PagebuilderckHelper::displayReleaseNotes();
?>
</div>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,53 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
/**
* About View
*/
class PagebuilderckViewAbout extends CKView {
protected $ckversion;
/**
* About view display method
* @return void
* */
function display($tpl = null) {
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/pagebuilderck.php';
$this->ckversion = PagebuilderckHelper::getCurrentVersion();
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/pagebuilderck.php';
// Load the left sidebar only for Joomla 3 and under.
if (! PAGEBUILDERCK_ISJ4) {
PagebuilderckHelper::addSubmenu('about');
}
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK') . ' - ' . JText::_('CK_ABOUT') , 'pagebuilderck');
}
}

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,121 @@
<?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;
use Pagebuilderck\CKFof;
// check the joomla! version
if (version_compare(JVERSION, '3.0.0') > 0) {
$jversion = '3';
} else {
$jversion = '2';
}
$user = CKFof::getUser();
// for ordering
$listOrder = $this->state->get('filter_order', 'a.id');
$listDirn = $this->state->get('filter_order_Dir', 'ASC');
$filter_search = $this->state->get('filter_search', '');
$limitstart = $this->state->get('limitstart', 0);
$limit = $this->state->get('limit', 20);
CKFof::addStyleSheet(PAGEBUILDERCK_MEDIA_URI . '/assets/adminlist.css');
?>
<div class="ckadminsidebar"><?php echo JHtmlSidebar::render() ?></div>
<div class="ckadminarea">
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=articles'); ?>" method="post" name="adminForm" id="adminForm">
<div id="filter-bar" class="btn-toolbar input-group">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo addslashes($this->state->get('filter_search')); ?>" class="cktip form-control" title="" />
</div>
<div class="input-group-append btn-group pull-left hidden-phone">
<button type="submit" class="btn btn-primary cktip" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_SUBMIT') : ''); ?></button>
<button type="button" class="btn btn-secondary cktip" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value = '';
this.form.submit();"><i class="icon-remove"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_CLEAR') : ''); ?></button>
</div>
<?php if ($jversion === '3') { ?>
<div class="btn-group pull-right hidden-phone ordering-select">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php } ?>
</div>
<div class="clearfix">&nbsp;</div>
<table class="table table-striped" id="templateckList">
<thead>
<tr>
<th width="1%">
<input type="checkbox" name="checkall-toggle" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" value="" onclick="Joomla.checkAll(this)" />
</th>
<th class='left'>
<?php //echo JText::_('COM_PAGEBUILDERCK_TEMPLATES_NAME'); ?>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_ARTICLES', 'a.title', $listDirn, $listOrder); ?>
</th>
<?php if (isset($this->items[0]->state)) { ?>
<?php } ?>
<?php if (isset($this->items[0]->id)) {
?>
<th width="1%" class="nowrap">
<?php //echo JText::_('JGRID_HEADING_ID'); ?>
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_pagebuilderck');
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$canCheckin = $user->authorise('core.manage', 'com_pagebuilderck');
$canChange = $user->authorise('core.edit.state', 'com_pagebuilderck');
$link = 'index.php?option=com_content&task=article.edit&id=' . $item->id;
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td>
<a href="<?php echo $link; ?>"><?php echo $item->title; ?></a>
</td>
<?php if (isset($this->items[0]->id)) {
?>
<td class="center">
<?php echo (int) $item->id; ?>
</td>
<?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="state_request" value="1" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
</div>

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,52 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewArticles extends CKView {
/**
* Display the view
*/
public function display($tpl = null) {
$this->items = $this->get('Items');
if (\Pagebuilderck\CKFof::isAdmin()) $this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar() {
PagebuilderckHelper::loadCkbox();
// Load the left sidebar only for Joomla 3 and under.
if (! PAGEBUILDERCK_ISJ4) {
PagebuilderckHelper::addSubmenu('articles');
}
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'));
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
// Create the New button
$newButton = '<a class="btn btn-small button-new btn-success" href="index.php?option=com_content&view=article&layout=edit&pbck=1">
<span class="icon-new icon-white"></span>
' . JText::_('CK_NEW') . '
</a>';
$bar->appendButton('Custom', $newButton, 'new');
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,166 @@
<?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
*/
defined('_JEXEC') or die;
use Pagebuilderck\CKFof;
use Pagebuilderck\CKFramework;
require_once(PAGEBUILDERCK_PATH . '/helpers/defines.js.php');
$imagespath = PAGEBUILDERCK_MEDIA_URI . '/images/';
JHtml::_('jquery.framework');
CKFof::addStylesheet(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.css?ver=' . PAGEBUILDERCK_VERSION);
CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.js?ver=' . PAGEBUILDERCK_VERSION);
$returnFunc = $this->input->get('func', 'ckSelectFile', 'cmd');
$returnField = $this->input->get('field', $this->input->get('fieldid', '', 'string'), 'string');
$type = $this->input->get('type', 'image', 'string');
if (JComponentHelper::getParams('com_pagebuilderck')->get('imagespathexclusive', '0') == '0') {
$folderPath = $this->input->get('folder', 'images', 'string');
} else {
$folderPath = $this->input->get('folder', '', 'string') ? trim($this->input->get('folder', '', 'string'), '/') : trim(JComponentHelper::getParams('com_pagebuilderck')->get('imagespath', 'images/pagebuilderck'), '/');
}
CKFramework::loadCss();
switch ($type) {
case 'video' :
$fileicon = 'file_video.png';
break;
case 'audio' :
$fileicon = 'file_audio.png';
break;
case 'folder' :
case 'image' :
default :
$fileicon = 'file_image.png';
break;
}
//$fileTypes = array(
// 'video' => array('.mp4', '.ogv', '.webm', '.MP4', '.OGV', '.WEBM')
// , 'audio' => array('.mp3', '.ogg', '.MP3', '.OGG')
// , 'pdf' => array('.pdf')
// , 'image' => array('.jpg', '.jpeg', '.png', '.gif', '.tiff', '.JPG', '.JPEG', '.PNG', '.GIF', '.TIFF', '.ico', '.svg', '.WEBP', '.webp')
//);
?>
<div id="ckbrowse" class="clearfix">
<div id="ckfolderupload">
<div class="inner">
<div class="upload">
<h2 class="uploadinstructions"><?php echo JText::_('CK_DROP_FILES_TO_UPLOAD'); ?></h2>
<p><?php echo JText::_('CK_OR_SELECT_FILES'); ?></p><input id="ckfileupload" type="file" name="Filedata[]" multiple class="" />
</div>
</div>
</div>
<div id="ckfoldertreelist">
<p><?php echo JText::_('CK_BROWSE_INFOS') ?></p>
<h3><?php echo JText::_('CK_FOLDERS') ?></h3>
<?php
$lastitem = 0;
foreach ($this->items as $i => $folder) {
$submenustyle = '';
$folderclass = '';
if ($folder->level == 1) {
$submenustyle = 'display: block;';
$folderclass = 'ckcurrent';
}
$pathway = str_replace('/', '</span><span class="ckfoldertreepath">', ($folder->basepath));
?>
<div class="ckfoldertree <?php echo $folderclass ?> <?php echo ($folder->deeper ? 'parent' : '') ?> <?php //echo (count($folder->files) ? 'hasfiles' : '') ?>" data-level="<?php echo $folder->level ?>" data-path="<?php echo PagebuilderckHelper::utf8_encode($folder->basepath) ?>">
<?php if ($folder->level > 1) { ?><div class="ckfoldertreetoggler" onclick="ckBrowseToggleTreeSub(this)"></div><?php } ?>
<div class="ckfoldertreename" onclick="ckLoadFiles(this, '<?php echo $type ?>', '<?php echo ($folder->basepath) ?>', '<?php echo $folder->name ?>')"><span class="icon-folder"></span><?php echo PagebuilderckHelper::utf8_encode($folder->name); ?>
<?php /*<div class="ckfoldertreecount"><?php echo count($folder->files); ?></div> */ ?>
</div>
<?php
if ($folder->deeper) {
echo '<div class="cksubfolder" style="' . $submenustyle . '">';
} elseif ($folder->shallower) {
// The next item is shallower.
echo '</div>'; // close ckfoldertree
echo str_repeat('</div></div>', $folder->level_diff); // close cksubfolder + ckfoldertree
} else {
// The next item is on the same level.
echo '</div>'; // close ckfoldertree
}
}
?>
</div>
<div id="ckfoldertreelistfiles" class="ckfoldertreelist">
<?php // place where the images will be loaded ?>
</div>
</div>
<script>
function ckBrowseToggleTreeSub(btn) {
var item = $ck(btn).parent();
if (item.hasClass('ckopened')) {
item.removeClass('ckopened');
} else {
item.addClass('ckopened')
// item.find('> .cksubfolder, > .ckfoldertreefiles').css('opacity','0').animate({'opacity': '1'}, 300);
}
}
function ckBrowseShowFiles(btn) {
// show the image in place of divs
var fakeImages = $ck(btn).find('~ .ckfoldertreefiles .ckfakeimage');
if (fakeImages.length) {
fakeImages.each(function () {
$fakeImage = $ck(this);
var source = $fakeImage.parent().attr('data-type') == 'image' ? $fakeImage.attr('data-src') : '<?php echo $imagespath . 'file_' ?>' + $fakeImage.parent().attr('data-type') + '.png';
$fakeImage.after('<img src="' + source + '" title="' + $fakeImage.attr('title') + '" />');
$fakeImage.parent().removeClass('ckwait');
$fakeImage.remove();
});
}
// set the current state on the folder
var item = $ck(btn).parent();
$ck('.ckcurrent').not(btn).removeClass('ckcurrent');
if (item.hasClass('ckcurrent')) {
item.removeClass('ckcurrent');
} else {
item.addClass('ckcurrent')
}
}
function ckBrowseSelectFile(btn) {
try {
if (typeof (window.parent.<?php echo $returnFunc ?>) != 'undefined') {
window.parent.<?php echo $returnFunc ?>($ck(btn).attr('data-path') + '/' + $ck(btn).attr('data-filename'), '<?php echo $returnField ?>');
if (typeof (window.parent.CKBox) != 'undefined')
window.parent.CKBox.close();
} else {
alert('ERROR : The function <?php echo $returnFunc ?> is missing in the parent window. Please contact the developer');
}
} catch (err) {
alert('ERROR : ' + err.message + '. Please contact the developper.');
}
}
function ckBrowseSelectFolder(path) {
try {
if (typeof(window.parent.<?php echo $returnFunc ?>) != 'undefined') {
window.parent.<?php echo $returnFunc ?>(path, '<?php echo $returnField ?>');
if (typeof(window.parent.CKBox) != 'undefined') window.parent.CKBox.close();
} else {
alert('ERROR : The function <?php echo $returnFunc ?> is missing in the parent window. Please contact the developer');
}
}
catch(err) {
alert('ERROR : ' + err.message + '. Please contact the developper.');
}
}
// display the images in the root folder
//ckBrowseShowFiles($ck('.ckfoldertreename').first()[0]);
let folderPath = (window.sessionStorage && sessionStorage.getItem('pagebuilderck_browse_folder.' + PAGEBUILDERCK.USERID)) ? sessionStorage.getItem('pagebuilderck_browse_folder.' + PAGEBUILDERCK.USERID) : '<?php echo $folderPath ?>';
ckLoadFiles($ck('.ckfoldertreename').first()[0], '<?php echo $type ?>', folderPath, folderPath)
</script>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,34 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewBrowse extends CKView {
function display($tpl = null) {
$user = JFactory::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
// load the items
require_once PAGEBUILDERCK_PATH . '/helpers/ckbrowse.php';
$this->items = CKBrowse::getItemsList();
parent::display($tpl);
}
}

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,198 @@
<?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;
use Pagebuilderck\CKFof;
require_once(PAGEBUILDERCK_PATH . '/helpers/defines.js.php');
// check the joomla! version
if (version_compare(JVERSION, '3.0.0') > 0) {
$jversion = '3';
} else {
$jversion = '2';
}
$user = CKFof::getUser();
$userId = $user->get('id');
// for ordering
$listOrder = $this->state->get('filter_order', 'a.id');
$listDirn = $this->state->get('filter_order_Dir', 'ASC');
$filter_search = $this->state->get('filter_search', '');
$limitstart = $this->state->get('limitstart', 0);
$limit = $this->state->get('limit', 20);
CKFof::addStyleSheet(PAGEBUILDERCK_MEDIA_URI . '/assets/adminlist.css');
?>
<div class="ckadminsidebar"><?php echo JHtmlSidebar::render() ?></div>
<div class="ckadminarea">
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&task=categories.save'); ?>" method="post" name="categoryNewForm" id="categoryNewForm">
<fieldset class="ckfieldset_category">
<legend><?php echo JText::_('CK_NEW_CATEGORY'); ?></legend>
<label for="name" class="element-invisible"><?php echo JText::_('CK_NAME'); ?></label>
<div class="btn-group">
<input type="text" name="name" id="name" value="" class="form-control" />
<button type="submit" class="btn btn-primary"><?php echo JText::_('CK_SAVE'); ?></button>
&nbsp;<button type="button" class="btn btn-primary" onclick="ckHideNewCategoryForm()"><?php echo JText::_('CK_CLOSE'); ?></button>
</div>
<?php echo JHtml::_('form.token'); ?>
</fieldset>
</form>
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=pages'); ?>" method="post" name="adminForm" id="adminForm">
<div id="filter-bar" class="btn-toolbar input-group">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo addslashes($this->state->get('filter_search')); ?>" class="cktip form-control" title="" />
</div>
<div class="input-group-append btn-group pull-left hidden-phone">
<button type="submit" class="btn btn-primary cktip" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_SUBMIT') : ''); ?></button>
<button type="button" class="btn btn-secondary cktip" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value = '';
this.form.submit();"><i class="icon-remove"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_CLEAR') : ''); ?></button>
</div>
&nbsp;
<?php if ($jversion === '3') { ?>
<div class="btn-group pull-right hidden-phone ordering-select">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php } ?>
</div>
<p>&nbsp;</p>
<div class="clearfix"> </div>
<table class="table table-striped" id="templateckList">
<thead>
<tr>
<th width="1%">
<input type="checkbox" name="checkall-toggle" class="form-check-input" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" value="" onclick="Joomla.checkAll(this)" />
</th>
<th class='left'>
<?php //echo JText::_('COM_PAGEBUILDERCK_TEMPLATES_NAME'); ?>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_CATEGORIES', 'a.title', $listDirn, $listOrder); ?>
</th>
<?php if (isset($this->items[0]->state)) { ?>
<?php } ?>
<?php if (isset($this->items[0]->id)) {
?>
<th width="1%" class="nowrap">
<?php //echo JText::_('JGRID_HEADING_ID'); ?>
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
<?php } ?>
<th width="1%" class="nowrap center">
<?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_pagebuilderck');
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$canCheckin = $user->authorise('core.manage', 'com_pagebuilderck');
$canChange = $user->authorise('core.edit.state', 'com_pagebuilderck');
$link = 'javascript:void(0)';
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td>
<?php if ($item->checked_out) { ?>
<a class="tbody-icon" href="<?php echo JRoute::_('index.php?option=com_pagebuilderck&task=pages.checkin&id=' . $item->id); ?>"><span class="icon-checkedout" aria-hidden="true"></span></a>
<?php /*<div role="tooltip" id="cbcheckin0-desc"><strong>Check-in</strong><br>test<br>Saturday, 05 February 2022<br>08:57</div> */ ?>
<?php } ?>
<a href="<?php echo $link; ?>" onclick="ckShowEditCategoryForm(this, '<?php echo $item->id; ?>', '<?php echo $item->name; ?>')" class="ckcategoryname"><?php echo $item->name; ?></a>
</td>
<?php if (isset($this->items[0]->id)) {
?>
<td class="center">
<?php echo (int) $item->id; ?>
</td>
<?php } ?>
<td class="center">
<?php
$buttonstate = $item->state == '1' ? '' : 'un';
?>
<span class="icon-<?php echo $buttonstate ?>publish"></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="state_request" value="1" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
</div>
<small style="display:block;text-align:center;"><?php echo JText::_('COM_PAGEBUILDERCK_VOTE_JED'); ?>&nbsp;<a href="https://extensions.joomla.org/extensions/extension/authoring-a-content/content-construction/page-builder-ck" target="_blank" ><small><?php echo JText::_('COM_PAGEBUILDERCK_VOTE_JED_BUTTON'); ?></small></a></small>
<script>
function ckShowNewCategoryForm() {
document.getElementById('categoryNewForm').style.display = 'block';
}
function ckHideNewCategoryForm() {
document.getElementById('categoryNewForm').style.display = 'none';
}
function ckShowEditCategoryForm(link, id, name) {
link.style.display = 'none';
let tmpl = '<div class="btn-group">'
+'<input type="text" name="name" id="name" value="' + name + '" class="form-control" />'
+'<input type="hidden" name="id" value="' + id + '" />'
+'<button type="submit" class="btn btn-primary"><?php echo JText::_('CK_SAVE'); ?></button>'
+'</div>'
+' <button type="button" class="btn btn-primary" onclick="ckRemoveEditCategoryForm()"><?php echo JText::_('CK_CLOSE'); ?></button>';
let container = document.createElement("div");
container.id = 'categoryEditForm';
container.innerHTML = tmpl;
link.after(container);
let form = document.getElementById('adminForm');
form.task.value = 'categories.save';
}
function ckRemoveEditCategoryForm() {
let items = document.getElementsByClassName('ckcategoryname');
for (i=0; i<items.length; i++) {
items[i].style.display = '';
}
document.getElementById('categoryEditForm').remove();
}
</script>
<style>
#categoryNewForm {
display: none;
}
.ckfieldset_category {
border: 1px solid #ccc;
padding: 20px;
margin: 10px 0;
}
</style>

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,137 @@
<?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;
use Pagebuilderck\CKFof;
// check the joomla! version
if (version_compare(JVERSION, '3.0.0') > 0) {
$jversion = '3';
} else {
$jversion = '2';
}
$user = CKFof::getUser();
$userId = $user->get('id');
// for ordering
$listOrder = $this->state->get('filter_order', 'a.id');
$listDirn = $this->state->get('filter_order_Dir', 'ASC');
$filter_search = $this->state->get('filter_search', '');
$limitstart = $this->state->get('limitstart', 0);
$limit = $this->state->get('limit', 20);
$function = $this->input->get('function', '', 'cmd');
$target = $this->input->get('target', '', 'cmd');
CKFof::addStyleSheet(PAGEBUILDERCK_MEDIA_URI . '/assets/adminlist.css');
if ($target == 'leftpanel') {
?>
<style>
body.contentpane {
background: #f5f5f5;
padding: 5px;
}
</style>
<?php
}
?>
<link rel="stylesheet" href="<?php echo JUri::root(true) ?>/components/com_pagebuilderck/assets/font-awesome.min.css" type="text/css" />
<div class="pagebuilderckchecking"></div>
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=pages&layout=modal&tmpl=component&function=' . $function . '&target=' . $target); ?>" method="post" name="adminForm" id="adminForm" class="ckinterface">
<?php if ($target == 'leftpanel') { ?>
<div class="ckleftpanelsearch">
<input type="text" name="filter_search" id="filter_search" class="cksearchleftpanel" placeholder="<?php echo JText::_('CK_SEARCH') ?>" value="<?php echo addslashes($this->state->get('filter_search')); ?>" />
<i class="fa fa-search cktip" title="<?php echo JText::_('CK_SEARCH') ?>" onclick="ckSearchAddon()"></i>
<i onclick="document.getElementById('filter_search').value = '';document.getElementById('adminForm').submit();" class="fa fa-times cktip" title="<?php echo JText::_('CK_CLEAN') ?>" ></i>
</div>
<?php
} else {
?>
<div id="filter-bar" class="btn-toolbar input-group">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo addslashes($this->state->get('filter_search')); ?>" class="cktip form-control" title="" />
</div>
<div class="input-group-append btn-group pull-left hidden-phone">
<button type="submit" class="btn btn-primary cktip" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_SUBMIT') : ''); ?></button>
<button type="button" class="btn btn-secondary cktip" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value = '';
this.form.submit();"><i class="icon-remove"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_CLEAR') : ''); ?></button>
</div>
<?php if ($jversion === '3') { ?>
<div class="btn-group pull-right hidden-phone ordering-select">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php } ?>
</div>
<?php
}
?>
<div class="clearfix"> </div>
<table class="table table-striped" id="templateckList">
<thead>
<tr>
<th class='left'>
<?php //echo JText::_('COM_PAGEBUILDERCK_TEMPLATES_NAME'); ?>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_PAGES_NAME', 'a.title', $listDirn, $listOrder); ?>
</th>
<?php if (isset($this->items[0]->state)) { ?>
<?php } ?>
<?php if (isset($this->items[0]->id)) {
?>
<th width="1%" class="nowrap">
<?php //echo JText::_('JGRID_HEADING_ID'); ?>
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_pagebuilderck');
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$canCheckin = $user->authorise('core.manage', 'com_pagebuilderck');
$canChange = $user->authorise('core.edit.state', 'com_pagebuilderck');
// $link = 'index.php?option=com_pagebuilderck&view=page&task=page.edit&id=' . $item->id;
$link = 'javascript:void(0)';
$onclick = 'window.parent.' . $function . '(' . $item->id . ', \'page\', \'' . addslashes($item->title) . '\');';
?>
<tr class="row<?php echo $i % 2; ?> ckrowpage">
<td>
<a href="<?php echo $link; ?>" onclick="<?php echo $onclick ?>"><?php echo $item->title; ?></a>
</td>
<?php if (isset($this->items[0]->id)) {
?>
<td class="center">
<?php echo (int) $item->id; ?>
</td>
<?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="state_request" value="1" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>

View File

@@ -0,0 +1,86 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKFof;
/**
* View class for a list of Templateck.
*/
class PagebuilderckViewCategories extends CKView {
/**
* Display the view
*/
public function display($tpl = null) {
// for the items published to be shown in the modal list
$this->state = $this->model->getState();
if ($this->input->get('layout') === 'modal') {
$this->model->setState('filter_state', '1');
} else {
$this->model->setState('filter_state', '');
}
$this->items = $this->get('Items');
if (CKFof::isAdmin()) $this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar() {
PagebuilderckHelper::loadCkbox();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
// Load the left sidebar only for Joomla 3 and under.
if (! PAGEBUILDERCK_ISJ4) {
PagebuilderckHelper::addSubmenu('categories');
}
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'));
if (CKFof::userCan('create')) {
// JToolBarHelper::addNew('page.add', 'JTOOLBAR_NEW');
$importButton = '<button class="btn btn-small button-new btn btn-success" onclick="ckShowNewCategoryForm()">
<span class="icon-new" aria-hidden="true"></span>
' . JText::_('JTOOLBAR_NEW') . '
</button>';
$bar->appendButton('Custom', $importButton, 'import');
}
if (CKFof::userCan('edit')) {
JToolBarHelper::custom('categories.copy', 'copy', 'copy', 'CK_COPY');
JToolBarHelper::custom('categories.publish', 'publish', 'publish', 'JTOOLBAR_PUBLISH');
JToolBarHelper::custom('categories.unpublish', 'unpublish', 'unpublish', 'JTOOLBAR_UNPUBLISH');
}
if (CKFof::userCan('core.delete')) {
//If this component does not use state then show a direct delete button as we can not trash
// JToolBarHelper::custom('page.trash', 'trash', 'trash', 'JTOOLBAR_DELETE', 'test');
$deleteButton = '<joomla-toolbar-button id="toolbar-cktrash" list-selection=""><button class="btn btn-small ' . (PAGEBUILDERCK_ISJ4 ? 'btn-danger' : '') . '" onclick="if (document.adminForm.boxchecked.value == 0) { alert(Joomla.JText._(\'JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST\')); } else { if (confirm(\'' . JText::_('CK_CONFIRM_DELETE') . '\')) Joomla.submitbutton(\'categories.trash\'); }">
<span class="icon-trash"></span>
' . JText::_('CK_DELETE') . '
</button></joomla-toolbar-button>';
$bar->appendButton('Custom', $deleteButton, 'export');
}
if (CKFof::userCan('core.admin')) {
JToolBarHelper::preferences('com_pagebuilderck');
}
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,14 @@
<?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
*/
defined('_JEXEC') or die;
$id = $this->input->get('ckid', '', 'string');
?>
<hr id="system-readmore" />

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,42 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewContent extends CKView {
/**
* About view display method
* @return void
* */
function display($tpl = null) {
$tpl = $this->input->get('cktype', null, 'cmd');
if ($tpl == null) {
echo JText::_('COM_PAGEBUILDERCK_ERROR_LAYOUT');
exit();
}
$standarditems = array('readmore');
$layout = JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/content/tmpl/default_' . $tpl . '.php';
if (file_exists($layout) && in_array($tpl, $standarditems)) {
include_once($layout);
} else {
// load the custom plugins
CKFof::importPlugin('pagebuilderck');
// loads all additional pagebuilderck items via plugins
CKFof::triggerEvent( 'onPagebuilderckLoadItemContent' . ucfirst($tpl) );
}
exit();
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,34 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/stylescss.php';
$app = JFactory::getApplication();
$input = $app->input;
$id = $input->get('ckobjid', '', 'string');
$class = $input->get('objclass', '', 'string');
//$fields = stripslashes( $input->get('fields', '', 'string'));
$fields = $input->get('fields', '', 'string');
$fields = json_decode($fields);
$customstyles = stripslashes( $input->get('customstyles', '', 'string'));
$customstyles = json_decode($customstyles);
$action = $input->get('action', '', 'string');
$cssstyles = new CssStyles();
$styles = $cssstyles->create($fields, $id, $action, $class, 'ltr', $customstyles);
if ($action == 'preview') {
echo '<style>' . $styles . '</style>';
} else {
return $styles;
}
exit();

View File

@@ -0,0 +1,81 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();
$objclass = $app->input->get('objclass', '');
$objid = $app->input->get('ckobjid', '');
$expertmode = $app->input->get('expertmode', false);
$saveFunc = $app->input->get('savefunc', 'ckSaveEditionPopup', 'cmd');
$showheight = (stristr($objclass, 'mainbanner') OR stristr($objclass, 'bannerlogo') OR stristr($objclass, 'horizmenu')) ? true : false;
$showwidth = ((stristr($objclass, 'wrapper') OR stristr($objclass, 'bannerlogo') OR stristr($objclass, 'banner') OR stristr($objclass, 'column')) AND !stristr($objclass, 'content')) ? true : false;
$isContent = (stristr($objclass, 'content') OR stristr($objclass, 'bannerlogodesc')) ? true : false;
$isBody = stristr($objclass, 'body') ? true : false;
//$isWrapper = stristr($objclass, 'wrapper') ? true : false;
$isWrapper = false;
$isContainer = (stristr($objclass, 'body') OR stristr($objclass, 'wrapper') OR stristr($objclass, 'mainbanner') OR stristr($objclass, 'bannerlogo') OR stristr($objclass, 'flexiblemodules') OR stristr($objclass, 'maincontent') OR stristr($objclass, 'content') OR ( stristr($objclass, 'center') && !stristr($objclass, 'centertop') && !stristr($objclass, 'centerbottom') )) ? true : false;
$isColumn = (stristr($objclass, 'column1') OR stristr($objclass, 'column2')) ? true : false;
$isLogo = (stristr($objclass, 'bannerlogo')) ? true : false;
$isModulesContainer = stristr($objclass, 'flexiblemodules') ? true : false;
$isMaincontentContainer = stristr($objclass, 'maincontent') ? true : false;
$isHoriznav = (stristr($objclass, 'horiznav') || stristr($objclass, 'bannermenu')) ? true : false;
$isFavorite = (stristr($objclass, 'pbckmyfavorite')) ? true : false;
$menustyles = new MenuStyles();
?>
<div class="menuck clearfix fixedck">
<div class="inner clearfix">
<div class="headerck">
<span class="headerckicon cktip" title="<?php echo JText::_('CK_SAVE_CLOSE'); ?>" onclick="<?php echo $saveFunc ?>();ckGetPreviewAreastylescss();ckCloseEditionPopup();">×</span>
<span class="headerckicon cksave cktip" title="<?php echo JText::_('CK_APPLY'); ?>" onclick="ckGetPreviewAreastylescss();"><span class="fa fa-check"></span></span>
<span class="headercktext"><?php echo JText::_('CK_CSS_EDIT'); ?></span>
</div>
<div id="elementscontainer">
<?php
$menulinktext = $isWrapper ? JText::_('CK_WRAPPER_STYLES') : JText::_('CK_STYLES');
$blocinfos = $isWrapper ? JText::_('CK_WRAPPER_INFOS') : JText::_('CK_BLOC_INFOS');
$blocdesc = $isWrapper ? JText::_('CK_WRAPPER_DESC') : JText::_('CK_BLOC_DESC');
?>
<div class="clr"></div>
<div id="elementscontent" class="ckinterface">
<div class="menulink" tab="tab_blocstyles"><?php echo $menulinktext; ?></div>
<div class="tab menustyles ckproperty" id="tab_blocstyles">
<?php echo $menustyles->createBlocStyles('bloc', $objclass, $expertmode) ?>
<div class="clr"></div>
</div>
<?php if (! $isFavorite) { ?>
<div class="menulink" tab="tab_animations"><?php echo JText::_('CK_ANIMATIONS'); ?></div>
<div class="tab menustyles ckproperty" id="tab_animations">
<?php echo $menustyles->createAnimations('bloc') ?>
<div class="clr"></div>
</div>
<div class="menulink" tab="tab_videobgstyles"><?php echo JText::_('CK_VIDEO_BACKGROUND_STYLES'); ?></div>
<div class="tab menustyles ckproperty" id="tab_videobgstyles">
<?php echo $menustyles->createVideobgStyles() ?>
<div class="clr"></div>
</div>
<div class="menulink" tab="tab_overlaystyles"><?php echo JText::_('CK_OVERLAY_STYLES'); ?></div>
<div class="tab menustyles ckproperty" id="tab_overlaystyles">
<?php echo $menustyles->createOverlayStyles() ?>
<div class="clr"></div>
</div>
<?php } ?>
</div>
</div>
<div class="clr"></div>
</div>
</div>
<script language="javascript" type="text/javascript">
ckInitColorPickers();
ckInitOptionsTabs();
ckInitAccordions();
</script>
<?php
exit();

View File

@@ -0,0 +1,32 @@
<?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
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$input = new JInput();
$user = JFactory::getUser();
$app = JFactory::getApplication();
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
?>
<?php
// loads the css and js files
require_once(PAGEBUILDERCK_PATH . '/views/contenttype/tmpl/include.php');
// echo $this->loadTemplate('include');
?>
<?php
// loads the main content
require_once('main.php');
// echo $this->loadTemplate('main');
?>

View File

@@ -0,0 +1,13 @@
<?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
*/
defined('_JEXEC') or die;
?>
</body>
</html>

View File

@@ -0,0 +1,214 @@
<?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
*/
defined('_JEXEC') or die;
if (!defined('PAGEBUILDERCK_MEDIA_URI'))
{
define('PAGEBUILDERCK_MEDIA_URI', JUri::root(true) . '/media/com_pagebuilderck');
}
$doc = JFactory::getDocument();
$editor = JFactory::getConfig()->get('pagebuilderck_replaced_editor', '') ? JFactory::getConfig()->get('pagebuilderck_replaced_editor') : JFactory::getConfig()->get('editor');
$editor = $editor == 'jce' ? 'jce' : 'tinymce';
require_once(PAGEBUILDERCK_PATH . '/helpers/defines.js.php');
?>
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/pagebuilderck.css?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/css" />
<?php // needs also to load the frontend styles to make the same visual as on frontend ?>
<link rel="stylesheet" href="<?php echo JUri::root(true) ?>/components/com_pagebuilderck/assets/pagebuilderck.css?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/css" />
<link rel="stylesheet" href="<?php echo JUri::root(true) ?>/components/com_pagebuilderck/assets/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/colpick.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckbox.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/codemirrorck.css" type="text/css" />
<?php //JHtmlBootstrap::loadCss($includeMaincss = false, $doc->direction); ?>
<?php JHtml::_('behavior.core'); ?>
<script type="text/javascript">
var URIROOT = PAGEBUILDERCK.URIROOT; // BC for old plugins
var URIBASE = PAGEBUILDERCK.URIBASE; // BC for old plugins
var CLIPBOARDCK = '';
var CLIPBOARDCOLORCK = '';
var BLOCCKSTYLESBACKUP = '';
var FAVORITELOCKED = '';
var JoomlaCK = {};
var PAGEBUILDERCK_MEDIA_URI = '<?php echo PAGEBUILDERCK_MEDIA_URI ?>';
var PAGEBUILDERCK_ADMIN_URL = '<?php echo PAGEBUILDERCK_ADMIN_URL ?>';
//var PAGEBUILDERCK_TOKEN = cktoken = '<?php echo JFactory::getSession()->getFormToken() ?>=1';
var PAGEBUILDERCK_EDITOR = '<?php echo $editor ?>';
var PAGEBUILDERCK_EDITOR = '<?php echo $editor ?>';
</script>
<?php //$doc->addScript(JUri::root(true) . '/media/jui/js/jquery.min.js'); ?>
<?php JHtml::_('jquery.framework'); ?>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jquery-uick-custom.min.js" type="text/javascript"></script>
<script src="<?php echo JUri::root(true) ?>/components/com_pagebuilderck/assets/jquery-uick.min.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/colpick.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckbox.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/codemirrorck.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/php.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/javascript.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/css.js" type="text/javascript"></script>
<?php
// load the CK Framework
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/ckframework.php';
\Pagebuilderck\CKFramework::loadInline();
switch ($editor) {
case 'jce':
?><script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/editors/jce.js" type="text/javascript"></script><?php
break;
case 'tinymce':
default:
if (version_compare(JVERSION, '4') >= 0) { // check if we are in Joomla 3.7
?><script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/editors/tinymce3.js" type="text/javascript"></script><?php
} else if (version_compare(JVERSION, '3.7') >= 0) { // check if we are in Joomla 3.7
?><script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/editors/tinymce2.js" type="text/javascript"></script><?php
} else { // we are still in an old version
?><script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/editors/tinymce1.js" type="text/javascript"></script><?php
}
break;
}
?>
<script type="text/javascript">
// JoomlaCK.submitbutton = Joomla.submitbutton;
Joomla.submitbutton = function(task) {
var form = document.getElementById("module-form")
|| document.getElementById("modules-form")
|| document.getElementById("item-form")
|| document.getElementById("adminForm");
if (task == 'page.restore') {
ckCallRestorePopup();
} else {
if (task != 'page.cancel' && form.title.value == '') {
form.title.className += ' invalid';
alert('<?php echo JText::_('CK_TITLE_EMPTY') ?>');
return;
}
if (task != 'page.cancel') {
var workspace = $ck('#workspaceck').length ? $ck('#workspaceck') : $ck('.workspaceck');
// delete all unwanted interface elements in the final code
ckCleanInterfaceBeforeSave(workspace);
ckCleanContenttypeInterfaceBeforeSave(workspace);
// replace the base path to keep images during website migration
if (URIROOT != '' && URIROOT != '/') {
var replaceUriroot = new RegExp('src="' + URIROOT, "g");
workspace.html(workspace.html().replace(replaceUriroot, 'src="|URIROOT|'));
}
if ($ck('#htmlcode').length) $ck('#htmlcode').val(workspace.html());
var stylecode = '';
$ck('#ckcontenttypeedition > .ckprops').each(function() {
stylecode += $ck(this)[0].outerHTML;
});
if ($ck('#ckcontenttypeedition > .ckstyle').length) stylecode += $ck('#ckcontenttypeedition > .ckstyle')[0].outerHTML;
if ($ck('#stylecode').length) $ck('#stylecode').val(stylecode);
}
// Joomla.submitform(task);
// check if the function exists, loads it
if (typeof JoomlaCK.beforesubmitbutton == 'function') { JoomlaCK.beforesubmitbutton(); }
// JoomlaCK.submitbutton(task);
Joomla.submitform(task, form);
}
}
function ckKeepAlive() {
jQuery.ajax({type: "POST", url: "index.php"});
}
<?php if (! PagebuilderckHelper::getParams()) { ?>
function ckShowFavoritePopup() {
CKBox.open({handler:'inline',content: 'pagebuilderckparamsmessage', fullscreen: false, size: {x: '600px', y: '150px'}});
}
function ckShowLibraryPopup() {
CKBox.open({handler:'inline',content: 'pagebuilderckparamsmessage', fullscreen: false, size: {x: '600px', y: '150px'}});
}
<?php } ?>
jQuery(document).ready(function()
{
CKApi.Tooltip('.cktip');
window.setInterval("ckKeepAlive()", 600000);
});
(function() {
var strings = {"CK_CONFIRM_DELETE": "<?php echo JText::_('CK_CONFIRM_DELETE') ?>",
"CK_FAILED_SET_TYPE": "<?php echo JText::_('CK_FAILED_SET_TYPE') ?>",
// "TEMPLATE_MUST_HAVE_WIDTH": "<?php echo JText::_('TEMPLATE_MUST_HAVE_WIDTH') ?>",
"CK_FAILED_SAVE_ITEM_ERRORMENUTYPE": "<?php echo JText::_('CK_FAILED_SAVE_ITEM_ERRORMENUTYPE') ?>",
"CK_ALIAS_EXISTS_CHOOSE_ANOTHER": "<?php echo JText::_('CK_ALIAS_EXISTS_CHOOSE_ANOTHER') ?>",
"CK_FAILED_SAVE_ITEM_ERROR500": "<?php echo JText::_('CK_FAILED_SAVE_ITEM_ERROR500') ?>",
"CK_FAILED_SAVE_ITEM": "<?php echo JText::_('CK_FAILED_SAVE_ITEM') ?>",
"CK_FAILED_TRASH_ITEM": "<?php echo JText::_('CK_FAILED_TRASH_ITEM') ?>",
"CK_FAILED_CREATE_ITEM": "<?php echo JText::_('CK_FAILED_CREATE_ITEM') ?>",
"CK_UNABLE_UNPUBLISH_HOME": "<?php echo JText::_('CK_UNABLE_UNPUBLISH_HOME') ?>",
"CK_TITLE_NOT_UPDATED": "<?php echo JText::_('CK_TITLE_NOT_UPDATED') ?>",
"CK_LEVEL_NOT_UPDATED": "<?php echo JText::_('CK_LEVEL_NOT_UPDATED') ?>",
"CK_SAVE_LEVEL_FAILED": "<?php echo JText::_('CK_SAVE_LEVEL_FAILED') ?>",
"CK_SAVE_ORDER_FAILED": "<?php echo JText::_('CK_SAVE_ORDER_FAILED') ?>",
"CK_CHECKIN_NOT_UPDATED": "<?php echo JText::_('CK_CHECKIN_NOT_UPDATED') ?>",
"CK_CHECKIN_FAILED": "<?php echo JText::_('CK_CHECKIN_FAILED') ?>",
"CK_PARAM_NOT_UPDATED": "<?php echo JText::_('CK_PARAM_NOT_UPDATED') ?>",
"CK_PARAM_UPDATE_FAILED": "<?php echo JText::_('CK_PARAM_UPDATE_FAILED') ?>",
"CK_FIRST_CREATE_ROW": "<?php echo JText::_('CK_FIRST_CREATE_ROW') ?>",
"CK_EDIT": "<?php echo JText::_('CK_EDIT') ?>",
"CK_ICON": "<?php echo JText::_('CK_ICON') ?>",
"CK_MODULE": "<?php echo JText::_('CK_MODULE') ?>",
"CK_GOOGLE_FONT": "<?php echo JText::_('CK_GOOGLE_FONT') ?>",
"CK_FULLSCREEN": "<?php echo JText::_('CK_FULLSCREEN') ?>",
"CK_RESTORE": "<?php echo JText::_('CK_RESTORE') ?>",
"CK_REMOVE_BLOCK": "<?php echo JText::_('CK_REMOVE_BLOCK') ?>",
"CK_MOVE_BLOCK": "<?php echo JText::_('CK_MOVE_BLOCK') ?>",
"CK_EDIT_STYLES": "<?php echo JText::_('CK_EDIT_STYLES') ?>",
"CK_DECREASE_WIDTH": "<?php echo JText::_('CK_DECREASE_WIDTH') ?>",
"CK_INCREASE_WIDTH": "<?php echo JText::_('CK_INCREASE_WIDTH') ?>",
"CK_ADD_BLOCK": "<?php echo JText::_('CK_ADD_BLOCK') ?>",
"CK_REMOVE_ROW": "<?php echo JText::_('CK_REMOVE_ROW') ?>",
"CK_EDIT_COLUMNS": "<?php echo JText::_('CK_EDIT_COLUMNS') ?>",
"CK_MOVE_ROW": "<?php echo JText::_('CK_MOVE_ROW') ?>",
"CK_ADD_NEW_ROW": "<?php echo JText::_('CK_ADD_NEW_ROW') ?>",
"CK_REMOVE_ITEM": "<?php echo JText::_('CK_REMOVE_ITEM') ?>",
"CK_MOVE_ITEM": "<?php echo JText::_('CK_MOVE_ITEM') ?>",
"CK_DUPLICATE_ITEM": "<?php echo JText::_('CK_DUPLICATE_ITEM') ?>",
"CK_DUPLICATE_ROW": "<?php echo JText::_('CK_DUPLICATE_ROW') ?>",
"CK_EDIT_ITEM": "<?php echo JText::_('CK_EDIT_ITEM') ?>",
"CK_ADD_COLUMN": "<?php echo JText::_('CK_ADD_COLUMN') ?>",
"CK_DELETE": "<?php echo JText::_('CK_DELETE') ?>",
"CK_SAVE_CLOSE": "<?php echo JText::_('CK_SAVE_CLOSE') ?>",
"CK_DESIGN_SUGGESTIONS": "<?php echo JText::_('CK_DESIGN_SUGGESTIONS') ?>",
"CK_MORE_MENU_ELEMENTS": "<?php echo JText::_('CK_MORE_MENU_ELEMENTS') ?>",
"CK_FULLWIDTH": "<?php echo JText::_('CK_FULLWIDTH') ?>",
"CK_DUPLICATE_COLUMN": "<?php echo JText::_('CK_DUPLICATE_COLUMN') ?>",
"CK_ENTER_CLASSNAMES": "<?php echo JText::_('CK_ENTER_CLASSNAMES') ?>",
"CHECK_IDS_ALERT_PROBLEM": "<?php echo JText::_('CHECK_IDS_ALERT_PROBLEM') ?>",
"CHECK_IDS_ALERT_OK": "<?php echo JText::_('CHECK_IDS_ALERT_OK') ?>",
"CK_ENTER_UNIQUE_ID": "<?php echo JText::_('CK_ENTER_UNIQUE_ID') ?>",
"CK_INVALID_ID": "<?php echo JText::_('CK_INVALID_ID') ?>",
"CK_ENTER_VALID_ID": "<?php echo JText::_('CK_ENTER_VALID_ID') ?>",
"CK_CONFIRM_BEFORE_CLOSE_EDITION_POPUP": "<?php echo JText::_('CK_CONFIRM_BEFORE_CLOSE_EDITION_POPUP') ?>",
"CK_SUGGESTIONS": "<?php echo JText::_('CK_SUGGESTIONS') ?>",
"CK_RESPONSIVE_SETTINGS_ALIGNED": "<?php echo JText::_('CK_RESPONSIVE_SETTINGS_ALIGNED') ?>",
"CK_RESPONSIVE_SETTINGS_STACKED": "<?php echo JText::_('CK_RESPONSIVE_SETTINGS_STACKED') ?>",
"CK_RESPONSIVE_SETTINGS_HIDDEN": "<?php echo JText::_('CK_RESPONSIVE_SETTINGS_HIDDEN') ?>",
"CK_SAVE": "<?php echo JText::_('CK_SAVE') ?>",
"CK_WRAPPER_IN_WRAPPER_NOT_ALLOWED": "<?php echo JText::_('CK_WRAPPER_IN_WRAPPER_NOT_ALLOWED') ?>",
"CK_DUPLICATE_WRAPPER": "<?php echo JText::_('CK_DUPLICATE_WRAPPER') ?>",
"CK_MOVE_WRAPPER": "<?php echo JText::_('CK_MOVE_WRAPPER') ?>",
"CK_REMOVE_WRAPPER": "<?php echo JText::_('CK_REMOVE_WRAPPER') ?>",
"CK_ADD_NEW_PAGEBUILDER_MODULE": "<?php echo JText::_('CK_ADD_NEW_PAGEBUILDER_MODULE') ?>",
"CK_FIRST_CLEAR_VALUE": "<?php echo JText::_('CK_FIRST_CLEAR_VALUE') ?>"};
if (typeof Joomla == 'undefined') {
Joomla = {};
Joomla.JText = strings;
}
else {
Joomla.JText.load(strings);
}
CKApi.Text.load(strings);
})();
</script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/pagebuilderck.js?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckbrowse.js" type="text/javascript"></script>

View File

@@ -0,0 +1,133 @@
<?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
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$user = JFactory::getUser();
$app = JFactory::getApplication();
$input = $app->input;
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$appendUrl = $input->get('layout', '', 'string') == 'modal' ? '&layout=modal&tmpl=component' : '&layout=edit';
// get global component params
// $params = JComponentHelper::getParams('com_pagebuilderck');
// get item params
// if (! is_object($this->item->params)) $this->item->params = new JRegistry($this->item->params);
// merge params
// $params->merge($this->item->params);
// $params->merge($this->item->params);
$conf = JFactory::getConfig();
?>
<div style="display:none;">
<form>
<?php
// Load the editor Tinymce or JCE
$editor = $conf->get('editor') == 'jce' ? 'jce' : 'tinymce';
$editor = JEditor::getInstance($editor);
echo $editor->display('ckeditor', $html = '', $width = '', $height = '200px', $col='', $row='', $buttons = true, $id = 'ckeditor');
?>
</form>
</div>
<div id="mainck" class="container-fluid">
<div id="maincktabcontent">
<?php if ($canEdit) { ?>
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=contenttype' . $appendUrl . '&type=' . $this->item->type);?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data" class="form-validate">
<?php if (\Pagebuilderck\CKFof::isSite() && $app->input->get('layout') != 'modal') { ?>
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('contenttype.apply')">
<span class="icon-apply"></span><?php echo JText::_('JSAVE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('contenttype.save')">
<span class="icon-ok"></span><?php echo JText::_('CK_SAVE_CLOSE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn" onclick="Joomla.submitbutton('contenttype.cancel')">
<span class="icon-cancel"></span><?php echo JText::_('JCANCEL') ?>
</button>
</div>
</div>
<?php } ?>
<div class="clearfix">
<div class="ckoption">
<span class="ckoption-label" style="width:auto;">
<?php echo JText::_('CK_CONTENT_TYPE'); ?> :
</span>
<span class="ckoption-value">
<b><?php echo ucfirst($this->item->type) ?></b>
</span>
<div class="clr"></div>
</div>
</div>
<div class="mainmenulink menulink current" tab="tab_interface"><?php echo JText::_('CK_EDITION'); ?></div>
<div class="clr"></div>
<input type="hidden" name="htmlcode" id="htmlcode" value="" />
<input type="hidden" name="stylecode" id="stylecode" value="" />
<input type="hidden" name="option" value="com_pagebuilderck" />
<input type="hidden" name="type" value="<?php echo $this->item->type; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="com_pagebuilderck" />
<input type="hidden" name="return" value="<?php echo $input->getCmd('return'); ?>" />
<?php echo JHtml::_('form.token'); ?>
</form>
<div class="maintab menustyles current ckproperty" id="tab_interface">
<div id="workspaceparentck">
<?php
// loads the menu
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/contenttype/tmpl/menu.php');
?>
<div id="ckcontenttypeedition" data-type="<?php echo $this->item->type ?>">
<?php
if ($this->item->stylecode) {
echo $this->item->stylecode;
} else { ?>
<div class="ckstyle"></div>
<?php } ?>
<div id="workspaceck" class="pagebuilderck inner workspaceck<?php echo (\Pagebuilderck\CKFof::isSite() ? ' pagebuilderckfrontend' : '') ?> ckcontenttypeedition" >
<?php
if ($this->item->htmlcode) {
echo $this->item->htmlcode;
} else { ?>
<?php }
?>
</div>
</div>
</div>
<?php } else {
if (!$canEdit) echo JText::_('COM_PAGEBUILDERCK_NORIGHTS_TO_EDIT');
} ?>
</div> <?php // fin tab_interface ?>
</div><?php // fin maincktabcontent ?>
</div>
<script>
$ck('#maincktabcontent div.maintab:not(.current)').hide();
$ck('.mainmenulink', $ck('#mainck')).each(function(i, tab) {
$ck(tab).click(function() {
if ($ck('#popup_favoriteck').length) {
ckCloseFavoritePopup(true);
}
$ck('#maincktabcontent div.maintab').hide();
$ck('.mainmenulink', $ck('#mainck')).removeClass('current');
if ($ck('#' + $ck(tab).attr('tab')).length)
$ck('#' + $ck(tab).attr('tab')).show();
$ck(this).addClass('current');
});
});
</script>

View File

@@ -0,0 +1,528 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$app = JFactory::getApplication();
$input = $app->input;
// load the custom plugins
JPluginHelper::importPlugin( 'pagebuilderck' );
//$dispatcher = JEventDispatcher::getInstance();
?>
<style type="text/css">
body {
margin-left: 310px;
/*position: relative;*/
}
body.tck-edition-body {
margin-left: 310px;
width: calc(100% - 310px);
}
.menuck {
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
display: block;
left: 0;
padding: 0 0 10px 0px;
width: 310px;
box-sizing: border-box;
z-index: 1040;
position: fixed;
top: 0;
bottom: 0;
overflow-y: scroll;
overflow-x: hidden;
margin: 0;
font-family: Segoe UI, arial;
}
.menuck .menuckinfos {
margin: 5px 0;
padding: 5px;
font-size: 12px;
line-height: 12px;
}
.menuck .menuitemck:hover {
border: 1px solid #000;
}
.menuck img {
margin: 1px;
}
.menuck .menuitemck, .workspaceck .menuitemck, .workspaceck .ckcontenttype {
background: #fff;
border: 1px solid #ddd;
float: left;
height: 40px;
min-height: 40px;
margin: 5px 0 0 5px;
padding: 5px;
width: 47%;
max-width: 125px;
cursor: grab;
cursor: -webkit-grab;
box-sizing: border-box;
}
.workspaceck .ckcontenttype {
margin: 5px;
background: rgba(255,255,255,0.7);
}
.workspaceck .ckcontenttype {
cursor: auto;
}
.menuck .menuitemck.grabbing, .workspaceck .menuitemck.grabbing, .workspaceck .ckcontenttype.grabbing {
cursor: grabbing;
cursor: -webkit-grabbing;
}
.menuck .menuitemck .menuitemck_title, .workspaceck .menuitemck .menuitemck_title, .workspaceck .ckcontenttype .menuitemck_title {
font-size: 12px;
line-height: 15px;
align-self: center;
}
.menuck .menuitemck .menuitemck_desc, .workspaceck .menuitemck .menuitemck_desc, .workspaceck .ckcontenttype .menuitemck_desc {
color: #1a1a1a;
font-size: 10px;
}
.menuck .menuitemck > div, .workspaceck .menuitemck > div, .workspaceck .ckcontenttype > div.ckcontenttype-infos {
float: right;
width: calc(100% - 28px);
min-height: 28px;
display: flex;
}
.workspaceck .ckcontenttype > div.recipesck-group {
clear: both;
}
.workspaceck .ckcontenttype {
height: auto;
}
.workspaceck .ckcontenttype > div[class*="-group"] {
float: none;
}
.menuck .menuitemck img, .workspaceck .menuitemck img, .workspaceck .ckcontenttype img {
float: left;
margin: 5px 0 0 2px;
width: 20px;
}
.menuitemck_group {
clear: both;
padding: 2px 5px;
text-transform: capitalize;
background: #2E5A84;
color: #fff;
margin: 5px 5px 0;
font-size: 12px;
cursor: pointer;
}
.menuck .headerck {
cursor: pointer;
padding: 0 0 0 5px;
background: #ececec;
border-bottom: 1px solid #ddd;
font-size: 18px;
min-height: 40px;
}
#workspaceparentck.collapsedck .menuck {
width: 75px;
}
#workspaceparentck.collapsedck .menuck .headercktext,
#workspaceparentck.collapsedck .menuck .menuckinfos,
#workspaceparentck.collapsedck .menuck .menuitemck > div,
#workspaceparentck.collapsedck .menuck .menuitemck_title,
#workspaceparentck.collapsedck .menuck .menuitemck_desc {
display: none;
}
#workspaceparentck.collapsedck .menuck .menuitemck {
width: 50px;
height: 50px;
margin: 5px 2px;
}
/*#workspaceparentck:not(.collapsedck) .workspaceck {
margin-left: 235px;
}
#module-form #workspaceparentck:not(.collapsedck) .workspaceck {
margin-left: 260px;
}*/
.menuck .headercktext {
display: inline-block;
width: 145px;
line-height: 32px;
vertical-align: top;
padding-left: 5px;
}
.menuck .menuckinner {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 100%;
}
.menuck > .inner {
/*position: relative;*/
max-height: 100%;
height: calc(100vh - 50px);
overflow-y: auto;
margin-left: 50px;
}
.menuck > .inner:not(.ckelementsedition) {
display: none;
}
.menuck .ckcolumnsedition {
display: none;
}
.menuck .headerckicon {
width: 40px;
height: 40px;
float: right;
display: inline-block;
box-sizing: border-box;
line-height: 32px;
padding: 0;
background: #cfcfcf;
color: #555;
font-size: 1.3em;
border: none;
border-left-width: medium;
border-left-style: none;
border-left-color: currentcolor;
border-left: 1px solid #aaa;
box-shadow: 0 0 15px #b5b5b5 inset;
text-align: center;
cursor: pointer;
font-weight: normal;
border-radius: 0;
}
.collapsedck .menuck .headerckicon {
transform: rotate(180deg);
}
.menuck .headerckicon.cksave {
font-size: 13px;
line-height: 35px;
}
.menuck input {
width: auto;
margin-left: 5px;
}
/* Fix for Safari */
.ckpopup, .menuck {
overflow: visible !important;
}
.menuckpanels {
width: 50px;
background: #1C3D5C;
height: calc(100vh - 40px);
float: left;
border-right: 1px solid #ddd;
}
.menuckpanelfake img,
.menuckpanel img {
margin: 8px;
}
.menuckpanelfake,
.menuckpanel {
color: #ddd;
text-align: center;
padding: 12px 0;
}
.menuckpanelfake .fa,
.menuckpanel .fa {
font-size: 24px;
}
.menuckpanelfake.active, .menuckpanelfake:hover,
.menuckpanel.active, .menuckpanel:hover {
background: #2E5A84;
color: #fff;
cursor: pointer;
}
.menuckbootomtoolbar {
height: 40px;
background: #2E5A84;
position: absolute;
bottom: 0;
width: 100%;
left: 0;
text-align: center;
}
.menuckbootomtoolbar span.menuckbootomtoolbar-button {
height: 40px;
width: 30px;
border-radius: 0;
margin: 0;
padding: 0;
line-height: 40px;
color: #fff;
padding: 0 10px;
opacity: 0.7;
display: inline-block;
cursor: pointer;
font-size: 16px;
}
.menuckbootomtoolbar span.menuckbootomtoolbar-button:hover, .menuckbootomtoolbar span.menuckbootomtoolbar-button.active {
opacity: 1;
}
.ckresponsivebutton {
width: 170px;
}
.ckleftpanelsearch {
position: relative;
}
.ckleftpanelsearch input, .cksearchleftpanel {
margin: 0 5px;
width: 96%;
height: 32px;
padding: 0 5px;
box-sizing: border-box;
border-radius: 0;
}
.ckleftpanelsearch .fa, .cksearchleftpanel {
font-size: 11px;
position: absolute;
top: 12px;
right: 20px;
color: #6d6d6d;
cursor: pointer;
}
.ckleftpanelsearch .fa-times {
right: 40px;
font-size: 12px;
line-height: 10px;
}
.ckleftpanelsearch .fa-times:hover {
color: #000;
}
.ckmyelements.headerck {
margin-top: 10px;
}
.ckaddonsdisplaytype {
display: none;
}
<?php
$displaytype = $app->getUserState('pagebuilderck.addons.displaytype', 'grid');
echo '#ckaddonsdisplaytype' . $displaytype . ' { display: block; }';
?>
</style>
<?php
// get global component params
$componentParams = JComponentHelper::getParams('com_pagebuilderck');
$view = $input->get('view', 'page');
$type = $input->get('type', '', 'string');
?>
<div id="menuck" class="menuck clearfix ckinterface">
<div class="menuckpanels">
<div class="menuckpanel cktip active" data-target="addons" title="<?php echo JText::_('CK_ADDONS') ?>" data-placement="right"><span class="fa fa-puzzle-piece"></span></div>
<div id="ckeditionbutton" data-target="edition" class="menuckpanel cktip" title="<?php echo JText::_('CK_EDITION') ?>" data-placement="right" onclick="ckShowEditionPopup('ckcontenttypeedition')"><span class="fa fa-edit"></span></div>
<div id="ckresponsivesettingsbutton" data-target="responsive" class="menuckpanel cktip" title="<?php echo JText::_('CK_RESPONSIVE_SETTINGS') ?>" data-placement="right"><span class="fa fa-mobile" style="font-size:2.8em;"></span></div>
<div id="ckcustomcsssettingsbutton" data-target="customcss" class="menuckpanelfake cktip" title="<?php echo JText::_('CK_CUSTOMCSS') ?>" data-placement="right"><span class="fa fa-file-code-o"></span></div>
</div>
<div class="inner clearfix ckelementsedition menuckpaneltarget" data-target="addons">
<div class="headerck">
<span class="headercktext" style="width: 130px;"><?php echo JText::_('CK_ELEMENTS'); ?></span>
<span class="ckbutton-group" style="margin: 5px;">
<span class="headerckdisplaytype ckbutton <?php echo ($displaytype == 'list' ? 'active' : '') ?>" data-type="list" onclick="ckSetAddonsDisplaytypeState('list')"><i class="fa fa-list cktip" data-placement="bottom" title="<?php echo JText::_('CK_DISPLAY_TYPE_LIST') ?>" onclick="ckSearchAddon()"></i></span>
<span class="headerckdisplaytype ckbutton <?php echo ($displaytype == 'grid' ? 'active' : '') ?>" data-type="grid" onclick="ckSetAddonsDisplaytypeState('grid')"><i class="fa fa-th cktip" data-placement="bottom" title="<?php echo JText::_('CK_DISPLAY_TYPE_GRID') ?>" onclick="ckSearchAddon()"></i></span>
</span>
</div>
<div class="menuckinfos"><?php echo JText::_('COM_PAGEBUILDERCK_INSERT_CONTENT'); ?></div>
<div id="ckaddonsearch" class="ckleftpanelsearch">
<input type="text" class="cksearchleftpanel" placeholder="<?php echo JText::_('CK_SEARCH') ?>" onchange="ckSearchAddon()" />
<i class="fa fa-search cktip" title="<?php echo JText::_('CK_SEARCH') ?>" onclick="ckSearchAddon()"></i>
<i class="fa fa-times cktip" title="<?php echo JText::_('CK_CLEAN') ?>" onclick="ckSearchAddonClear()"></i>
</div>
<?php
// $items = Pagebuilderck\CKFof::triggerEvent( 'onPagebuilderckAddItemToMenu' );
$items = PagebuilderckHelper::getPluginsMenuItemType('contenttype', $type);
// $groups = PagebuilderckHelper::getPluginsMenuItemTypeByGroup();
?>
<div id="ckaddonsdisplaytypegrid" class="ckaddonsdisplaytype">
<?php
$pagebuilderckTypesImagesArray = array();
if (count($items)) {
foreach ($items as $item) {
// if ($item->type != 'row' && $item->type != 'rowinrow') continue;
$pagebuilderckTypesImagesArray[$item->type] = $item->image;
$className = $item->type == 'row' ? '' : 'ckcontenttype';
?>
<div data-type="<?php echo $item->type ?>" data-group="<?php echo $item->group ?>" class="menuitemck <?php echo $className ?>" title="<b><?php echo $item->title ?></b><br /><?php echo $item->description ?>">
<div>
<div class="menuitemck_title"><?php echo $item->title ?></div>
</div>
<img src="<?php echo $item->image ?>" />
<?php /*<div class="menuitemck_remove" onclick="ckRemoveItem($ck(this).parent())">×</div> */ ?>
</div>
<?php
}
}
?>
</div>
<div style="clear:both;"></div>
</div>
<div class="inner clearfix ckresponsiveedition menuckpaneltarget" data-target="responsive">
<div class="menuckcollapse headerck">
<span class="headercktext" style="width:auto;"><?php echo JText::_('CK_RESPONSIVE_SETTINGS'); ?></span>
<?php /*<span class="headerckicon cktip" title="<?php echo JText::_('CK_SAVE_CLOSE'); ?>" onclick="ckShowResponsiveSettings(true);">×</span> */ ?>
</div>
<div id="cktoolbarResponsive" class="clearfix ckinterface" style="overflow:visible;background:none;padding:5px;">
<span class="ckbutton-group">
<span id="ckresponsive1button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(1)" data-range="1"><span class="fa fa-mobile" ></span> <?php echo JText::_('CK_PHONE') ?> / <small><?php echo JText::_('CK_PORTRAIT') ?></small></span>
<input id="ckresponsive1value" type="text" value="<?php echo $componentParams->get('responsive1value', '320') ?>" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span class="ckbutton-group">
<span id="ckresponsive2button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(2)" data-range="2"><span class="fa fa-mobile" style="font-size: 1.4em;vertical-align: bottom;transform:rotate(90deg);"></span> <?php echo JText::_('CK_PHONE') ?> / <small><?php echo JText::_('CK_LANDSCAPE') ?></small></span>
<input id="ckresponsive2value" type="text" value="<?php echo $componentParams->get('responsive2value', '480') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span class="ckbutton-group">
<span id="ckresponsive3button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(3)" data-range="3"><span class="fa fa-tablet" ></span> <?php echo JText::_('CK_TABLET') ?> / <small><?php echo JText::_('CK_PORTRAIT') ?></small></span>
<input id="ckresponsive3value" type="text" value="<?php echo $componentParams->get('responsive3value', '640') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span class="ckbutton-group">
<span id="ckresponsive4button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(4)" data-range="4"><span class="fa fa-tablet" style="font-size: 1.4em;vertical-align: bottom;transform:rotate(90deg);"></span> <?php echo JText::_('CK_TABLET') ?> / <small><?php echo JText::_('CK_LANDSCAPE') ?></small></span>
<input id="ckresponsive4value" type="text" value="<?php echo $componentParams->get('responsive4value', '800') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span>
<span id="ckresponsive5button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(5)" data-range="5"><span class="fa fa-desktop" ></span> <?php echo JText::_('CK_COMPUTER') ?></span>
</span>
</div>
</div>
<div class="inner clearfix ckcolumnsedition" >
<div class="headerck">
<span class="headerckicon" onclick="ckHideColumnsEdition()">×</span>
<span class="headercktext"><?php echo JText::_('CK_COLUMNS'); ?></span>
</div>
<div class="ckcolumnsoptions">
<div class="ckbutton-group" style="margin-top: 5px;">
<input id="autowidth" name="autowidth" value="1" type="radio" onchange="ckUpdateAutowidth($ck('.rowck.ckfocus'), this.value);" />
<label class="ckbutton btn" for="autowidth" style="width:auto;margin-left:5px;" ><?php echo JText::_('CK_AUTO_WIDTH') ?></label>
<input id="advlayout" name="autowidth" value="0" type="radio" onchange="ckUpdateAutowidth($ck('.rowck.ckfocus'), this.value);" />
<label class="ckbutton btn" for="advlayout" style="width:auto;"><?php echo JText::_('CK_ADVANCED_LAYOUT') ?></label>
</div>
<div id="ckgutteroptions">
<div class="menuckinfos"><?php echo JText::_('CK_GUTTER') ?></div>
<input class="ckguttervalue" type="text" onchange="ckUpdateGutter($ck('.rowck.ckfocus'), this.value);" style="margin-left:5px;" />
</div>
<div>
<div class="ckbutton ckbutton-success" onclick="ckAddBlock($ck('.rowck.ckfocus'));" style="display: block;">+ <?php echo JText::_('CK_ADD_COLUMN') ?></div>
</div>
<div id="ckcolumnsuggestions">
</div>
</div>
</div>
<div class="menuckbootomtoolbar">
<?php if ($input->get('id', 0, 'int')
&& $input->get('option', '', 'cmd') == 'com_pagebuilderck'
&& $input->get('view', '', 'cmd') == 'page'
&& \Pagebuilderck\CKFof::isAdmin()){ ?>
<a class="" target="_blank" href="<?php echo JUri::root(true) ?>/index.php?option=com_pagebuilderck&view=page&id=<?php echo $input->get('id', '', 'int') ?>"><span class="menuckbootomtoolbar-button cktip" title="<?php echo JText::_('CK_PREVIEW_FRONT') ?>"><span class="fa fa-eye"></span><span></a>
<?php } else if ($input->get('id', 0, 'int') && $input->get('option', '', 'cmd') == 'com_content' && $input->get('view', '', 'cmd') == 'article' && \Pagebuilderck\CKFof::isAdmin()) { ?>
<a class="" target="_blank" href="<?php echo JUri::root(true) ?>/index.php?option=com_content&view=article&id=<?php echo $input->get('id', '', 'int') ?>"><span class="menuckbootomtoolbar-button cktip" title="<?php echo JText::_('CK_PREVIEW_FRONT') ?>"><span class="fa fa-eye"></span><span></a>
<?php }?>
<?php if (
($input->get('option', '', 'cmd') == 'com_content' && $input->get('view', '', 'cmd') == 'article' && \Pagebuilderck\CKFof::isAdmin())
|| ($input->get('option', '', 'cmd') == 'com_flexicontent' && $input->get('view', '', 'cmd') == 'article' && \Pagebuilderck\CKFof::isAdmin())
|| ($input->get('option', '', 'cmd') == 'com_modules' && $input->get('view', '', 'cmd') == 'module' && \Pagebuilderck\CKFof::isAdmin())
|| ($input->get('option', '', 'cmd') == 'com_advmodulesmanager' && $input->get('view', '', 'cmd') == 'module' && \Pagebuilderck\CKFof::isAdmin())
) { ?>
<span class="menuckbootomtoolbar-button cktip" onclick="ckSaveAsPage()" title="<?php echo JText::_('CK_SAVE_AS_PAGE') ?>"><span class="fa fa-floppy-o"></span></span>
<?php } ?>
<span id="ckhtmlchecksettingsbutton" class="menuckbootomtoolbar-button cktip" onclick="ckCheckHtml()" title="<?php echo JText::_('CK_HTML_CSS') ?>"><span class="fa fa-dot-circle-o"></span></span>
<span id="ckundo" class="menuckbootomtoolbar-button cktip" onclick="ckUndo()" title="<?php echo JText::_('CK_UNDO') ?>"><span class="fa fa-mail-reply"></span></span>
<span id="ckundo" class="menuckbootomtoolbar-button cktip" onclick="ckRedo()" title="<?php echo JText::_('CK_REDO') ?>"><span class="fa fa-mail-forward"></span></span>
</div>
<div id="ckcustomcssedition" style="display: none;"></div>
</div>
<script type="text/javascript">
// create tooltip for the items
ckMakeTooltip($ck('#menuck .menuitemck'));
// check if we are in frontend
var isSiteCK = '<?php echo \Pagebuilderck\CKFof::isSite() ?>';
$ck('#menuck').hide();
var ckcustomcsseditor;
jQuery(document).ready(function (){
$ck('#menuck').fadeIn();
ckMakeContentTypeSortable();
});
if (isSiteCK) {
$ck(window).on("load resize scroll", function() {
if (! $ck('.workspaceck').length || ! $ck('#workspaceparentck').length) return;
var menuToWorkspaceOffset = $ck('#workspaceparentck').offset().left -50 - $ck('#menuck').width()
if (menuToWorkspaceOffset < 0) {
$ck('.workspaceck').css({'margin-left': -menuToWorkspaceOffset + 'px'});
} else {
$ck('.workspaceck').css({'margin-left': '0'});
}
});
}
$ck('.menuckpanel').click(function() {
ckActivatePanel($ck(this).attr('data-target'));
});
$ck('#ckcustomcsssettingsbutton').click(function() {
ckOpenCustomCssEditor();
});
$ck('.menuitemck_group').click(function() {
$ck(this).find('+ div').toggle('fast');
});
</script>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,31 @@
<?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
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$input = new JInput();
$user = JFactory::getUser();
$app = JFactory::getApplication();
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
?>
<?php
// loads the css and js files
echo $this->loadTemplate('include');
?>
<button id="applyBtn" type="button" class="hidden" onclick="Joomla.submitbutton('page.apply');"></button>
<button id="saveBtn" type="button" class="hidden" onclick="Joomla.submitbutton('page.save');"></button>
<button id="closeBtn" type="button" class="hidden" onclick="Joomla.submitbutton('page.cancel');"></button>
<?php
// loads the main content
echo $this->loadTemplate('main');

View File

@@ -0,0 +1,102 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewContenttype extends CKView {
function display($tpl = null) {
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/menustyles.php';
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/stylescss.php';
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/ckeditor.php';
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/pagebuilderck.php';
// get instance of the editor to load the css / js in the page
$this->ckeditor = PagebuilderckHelper::loadEditor();
$input = JFactory::getApplication()->input;
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'), 'home_pagebuilderck');
$this->item = $this->get('Data');
$user = JFactory::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
return false;
}
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/pagebuilderck.php';
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$userId = $user->get('id');
// $isNew = ($this->item->id == 0);
// $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
$state = $this->get('State');
$canDo = PagebuilderckHelper::getActions();
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'));
// For new records, check the create permission.
// if ($isNew && $user->authorise('core.create', 'com_pagebuilderck'))
// {
// JToolbarHelper::apply('contenttype.apply');
// JToolbarHelper::save('contenttype.save');
// // JToolbarHelper::save2new('contenttype.save2new');
// JToolbarHelper::cancel('contenttype.cancel');
// } else
// {
// Can't save the record if it's checked out.
// if (!$checkedOut)
// {
// Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
if ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId))
{
JToolbarHelper::apply('contenttype.apply');
JToolbarHelper::save('contenttype.save');
// JToolbarHelper::custom('contenttype.restore', 'archive', 'archive', 'CK_RESTORE', false);
// We can save this record, but check the create permission to see if we can return to make a new one.
if ($canDo->get('core.create'))
{
// JToolbarHelper::save2new('contenttype.save2new');
}
}
// }
// If checked out, we can still save
if ($canDo->get('core.create'))
{
// JToolbarHelper::save2copy('contenttype.save2copy');
}
JToolbarHelper::cancel('contenttype.cancel', 'JTOOLBAR_CLOSE');
// }
// JToolbarHelper::divider();
// JToolbarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER_EDIT');
}
}

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,68 @@
<?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;
// check the joomla! version
if (version_compare(JVERSION, '3.0.0') > 0) {
$jversion = '3';
} else {
$jversion = '2';
}
$user = JFactory::getUser();
$userId = $user->get('id');
// for ordering
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'a.ordering';
?>
<div class="ckadminsidebar"><?php echo JHtmlSidebar::render() ?></div>
<div class="ckadminarea">
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=contenttypes'); ?>" method="post" name="adminForm" id="adminForm">
<table class="table table-striped" id="ckcontenttypeslist">
<thead>
<tr>
<th class='left'>
<?php echo JText::_('COM_PAGEBUILDERCK_CONTENTTYPES'); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_pagebuilderck');
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$canCheckin = $user->authorise('core.manage', 'com_pagebuilderck');
$canChange = $user->authorise('core.edit.state', 'com_pagebuilderck');
$link = 'index.php?option=com_pagebuilderck&view=contenttype&layout=edit&type=' . $item;
?>
<tr class="row<?php echo $i % 2; ?>" data-type="<?php echo $item; ?>">
<td>
<a href="<?php echo $link; ?>"><?php echo $item; ?></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
</div>

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,114 @@
<?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;
// check the joomla! version
if (version_compare(JVERSION, '3.0.0') > 0) {
$jversion = '3';
} else {
$jversion = '2';
}
// Import CSS
// $document = JFactory::getDocument();
// $document->addStyleSheet('components/com_pagebuilderck/assets/css/templateck.css');
$user = JFactory::getUser();
$userId = $user->get('id');
$input = JFactory::getApplication()->input;
// for ordering
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$function = $input->get('function', '', 'cmd');
// $editor = $input->get('editor', '', 'string');
?>
<div class="pagebuilderckchecking"></div>
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=elements&layout=modal&tmpl=component'); ?>" method="post" name="adminForm" id="adminForm">
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter_search')); ?>" class="cktip" title="" />
</div>
<div class="btn-group pull-left hidden-phone">
<button type="submit" class="btn cktip" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_SUBMIT') : ''); ?></button>
<button type="button" class="btn cktip" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value = '';
this.form.submit();"><i class="icon-remove"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_CLEAR') : ''); ?></button>
</div>
<?php if ($jversion === '3') { ?>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php } ?>
</div>
<div class="clearfix"> </div>
<table class="table table-striped" id="templateckList">
<thead>
<tr>
<th class='left'>
<?php //echo JText::_('COM_PAGEBUILDERCK_TEMPLATES_NAME'); ?>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_PAGES_NAME', 'a.name', $listDirn, $listOrder); ?>
</th>
<?php if (isset($this->items[0]->state)) { ?>
<?php } ?>
<?php if (isset($this->items[0]->id)) {
?>
<th width="1%" class="nowrap">
<?php //echo JText::_('JGRID_HEADING_ID'); ?>
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_pagebuilderck');
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$canCheckin = $user->authorise('core.manage', 'com_pagebuilderck');
$canChange = $user->authorise('core.edit.state', 'com_pagebuilderck');
// $link = 'index.php?option=com_pagebuilderck&view=page&task=page.edit&id=' . $item->id;
$link = 'javascript:void(0)';
$onclick = 'window.parent.' . $function . '(' . $item->id .');';
?>
<tr class="row<?php echo $i % 2; ?>">
<td>
<a href="<?php echo $link; ?>" onclick="<?php echo $onclick ?>"><?php echo $item->title; ?></a>
</td>
<?php if (isset($this->items[0]->id)) {
?>
<td class="center">
<?php echo (int) $item->id; ?>
</td>
<?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>

View File

@@ -0,0 +1,109 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
/**
* View class for a list of Templateck.
*/
class PagebuilderckViewContenttypes extends CKView {
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*/
public function display($tpl = null) {
// require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/pagebuilderck.php';
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
// Check for errors.
// if (! empty($errors = $this->get('Errors'))) {
// JError::raiseError(500, implode("\n", $errors));
// return false;
// }
if (Pagebuilderck\CKFof::isAdmin()) $this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar() {
PagebuilderckHelper::loadCkbox();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$state = $this->get('State');
$canDo = PagebuilderckHelper::getActions($state->get('filter.category_id'));
// Load the left sidebar.
PagebuilderckHelper::addSubmenu('contenttypes');
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'));
//Check if the form exists before showing the add/edit buttons
$formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/contenttype';
if (file_exists($formPath)) {
if ($canDo->get('core.create')) {
// JToolBarHelper::addNew('contenttype.add', 'JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('contenttype.edit', 'JTOOLBAR_EDIT');
JToolBarHelper::custom('contenttype.copy', 'copy', 'copy', 'CK_COPY');
}
}
if ($canDo->get('core.edit.state')) {
if (isset($this->items[0]->state)) {
JToolBarHelper::divider();
} else {
//If this component does not use state then show a direct delete button as we can not trash
JToolBarHelper::trash('contenttypes.delete');
}
if (isset($this->items[0]->state)) {
JToolBarHelper::divider();
}
}
//Show trash and delete for components that uses the state field
if (isset($this->items[0]->state)) {
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::divider();
JToolBarHelper::trash('contenttypes.delete', 'CK_DELETE');
} else if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('contenttypes.trash', 'CK_DELETE');
JToolBarHelper::divider();
}
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_pagebuilderck');
}
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,34 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/stylescss.php';
$app = JFactory::getApplication();
$input = $app->input;
$id = $input->get('ckobjid', '', 'string');
$class = $input->get('objclass', '', 'string');
//$fields = stripslashes( $input->get('fields', '', 'string'));
$fields = $input->get('fields', '', 'string');
$fields = json_decode($fields);
$customstyles = stripslashes( $input->get('customstyles', '', 'string'));
$customstyles = json_decode($customstyles);
$action = $input->get('action', '', 'string');
$cssstyles = new CssStyles();
$styles = $cssstyles->create($fields, $id, $action, $class, 'ltr', $customstyles);
if ($action == 'preview') {
echo '<style>' . $styles . '</style>';
} else {
return $styles;
}
exit();

View File

@@ -0,0 +1,81 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();
$objclass = $app->input->get('objclass', '');
$objid = $app->input->get('ckobjid', '');
$expertmode = $app->input->get('expertmode', false);
$saveFunc = $app->input->get('savefunc', 'ckSaveEditionPopup', 'cmd');
$showheight = (stristr($objclass, 'mainbanner') OR stristr($objclass, 'bannerlogo') OR stristr($objclass, 'horizmenu')) ? true : false;
$showwidth = ((stristr($objclass, 'wrapper') OR stristr($objclass, 'bannerlogo') OR stristr($objclass, 'banner') OR stristr($objclass, 'column')) AND !stristr($objclass, 'content')) ? true : false;
$isContent = (stristr($objclass, 'content') OR stristr($objclass, 'bannerlogodesc')) ? true : false;
$isBody = stristr($objclass, 'body') ? true : false;
//$isWrapper = stristr($objclass, 'wrapper') ? true : false;
$isWrapper = false;
$isContainer = (stristr($objclass, 'body') OR stristr($objclass, 'wrapper') OR stristr($objclass, 'mainbanner') OR stristr($objclass, 'bannerlogo') OR stristr($objclass, 'flexiblemodules') OR stristr($objclass, 'maincontent') OR stristr($objclass, 'content') OR ( stristr($objclass, 'center') && !stristr($objclass, 'centertop') && !stristr($objclass, 'centerbottom') )) ? true : false;
$isColumn = (stristr($objclass, 'column1') OR stristr($objclass, 'column2')) ? true : false;
$isLogo = (stristr($objclass, 'bannerlogo')) ? true : false;
$isModulesContainer = stristr($objclass, 'flexiblemodules') ? true : false;
$isMaincontentContainer = stristr($objclass, 'maincontent') ? true : false;
$isHoriznav = (stristr($objclass, 'horiznav') || stristr($objclass, 'bannermenu')) ? true : false;
$isFavorite = (stristr($objclass, 'pbckmyfavorite')) ? true : false;
$menustyles = new MenuStyles();
?>
<div class="menuck clearfix fixedck">
<div class="inner clearfix">
<div class="headerck">
<span class="headerckicon cktip" title="<?php echo JText::_('CK_SAVE_CLOSE'); ?>" onclick="<?php echo $saveFunc ?>();ckGetPreviewAreastylescss();ckCloseEditionPopup();">×</span>
<span class="headerckicon cksave cktip" title="<?php echo JText::_('CK_APPLY'); ?>" onclick="ckGetPreviewAreastylescss();"><span class="fa fa-check"></span></span>
<span class="headercktext"><?php echo JText::_('CK_CSS_EDIT'); ?></span>
</div>
<div id="elementscontainer">
<?php
$menulinktext = $isWrapper ? JText::_('CK_WRAPPER_STYLES') : JText::_('CK_STYLES');
$blocinfos = $isWrapper ? JText::_('CK_WRAPPER_INFOS') : JText::_('CK_BLOC_INFOS');
$blocdesc = $isWrapper ? JText::_('CK_WRAPPER_DESC') : JText::_('CK_BLOC_DESC');
?>
<div class="clr"></div>
<div id="elementscontent" class="ckinterface">
<div class="menulink" tab="tab_blocstyles"><?php echo $menulinktext; ?></div>
<div class="tab menustyles ckproperty" id="tab_blocstyles">
<?php echo $menustyles->createBlocStyles('bloc', $objclass, $expertmode) ?>
<div class="clr"></div>
</div>
<?php if (! $isFavorite) { ?>
<div class="menulink" tab="tab_animations"><?php echo JText::_('CK_ANIMATIONS'); ?></div>
<div class="tab menustyles ckproperty" id="tab_animations">
<?php echo $menustyles->createAnimations('bloc') ?>
<div class="clr"></div>
</div>
<div class="menulink" tab="tab_videobgstyles"><?php echo JText::_('CK_VIDEO_BACKGROUND_STYLES'); ?></div>
<div class="tab menustyles ckproperty" id="tab_videobgstyles">
<?php echo $menustyles->createVideobgStyles() ?>
<div class="clr"></div>
</div>
<div class="menulink" tab="tab_overlaystyles"><?php echo JText::_('CK_OVERLAY_STYLES'); ?></div>
<div class="tab menustyles ckproperty" id="tab_overlaystyles">
<?php echo $menustyles->createOverlayStyles() ?>
<div class="clr"></div>
</div>
<?php } ?>
</div>
</div>
<div class="clr"></div>
</div>
</div>
<script language="javascript" type="text/javascript">
ckInitColorPickers();
ckInitOptionsTabs();
ckInitAccordions();
</script>
<?php
exit();

View File

@@ -0,0 +1,23 @@
<?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
*/
defined('_JEXEC') or die;
$user = JFactory::getUser();
$app = JFactory::getApplication();
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
?>
<?php
// loads the css and js files
require PAGEBUILDERCK_PATH . '/views/page/tmpl/include.php';
// loads the main content
require PAGEBUILDERCK_PATH . '/views/element/tmpl/main.php';

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,185 @@
<?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
*/
defined('_JEXEC') or die;
$user = JFactory::getUser();
$app = JFactory::getApplication();
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$appendUrl = $this->input->get('layout', '', 'string') == 'modal' ? '&layout=modal&tmpl=component' : '&layout=edit';
// get global component params
// $params = JComponentHelper::getParams('com_pagebuilderck');
// get item params
// if (! is_object($this->item->params)) $this->item->params = new JRegistry($this->item->params);
// merge params
// $params->merge($this->item->params);
$conf = JFactory::getConfig();
?>
<div style="display:none;">
<form>
<?php
// Load the editor Tinymce or JCE
$editor = $conf->get('editor') == 'jce' ? 'jce' : 'tinymce';
$editor = JEditor::getInstance($editor);
echo $editor->display('ckeditor', $html = '', $width = '', $height = '200px', $col = '', $row = '', $buttons = true, $id = 'ckeditor');
?>
</form>
</div>
<div id="mainck" class="container-fluid">
<div id="maincktabcontent">
<?php if ($canEdit) { ?>
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=page' . $appendUrl . '&id=' . $this->item->id); ?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data" class="form-validate ckinterface">
<?php if (\Pagebuilderck\CKFof::isSite() && $app->input->get('layout') != 'modal') { ?>
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('element.apply')">
<span class="icon-apply"></span><?php echo JText::_('JSAVE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('element.save')">
<span class="icon-ok"></span><?php echo JText::_('CK_SAVE_CLOSE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn" onclick="Joomla.submitbutton('element.cancel')">
<span class="icon-cancel"></span><?php echo JText::_('JCANCEL') ?>
</button>
</div>
</div>
<?php } ?>
<div class="mainmenulink menulink current" tab="tab_interface"><?php echo JText::_('CK_EDITION'); ?></div>
<div class="clr"></div>
<div class="clearfix">
<div>
<label class="required" for="title" id="title-lbl">
<?php echo JText::_('COM_PAGEBUILDERCK_TITLE'); ?>
<span class="star">&nbsp;*</span>
</label>
<input type="text" aria-required="true" required="required" size="40" class="input-xlarge input-large-text required" value="<?php echo $this->item->title ?>" id="title" name="title">
</div>
<div>
<label class="required" for="description" id="description-lbl">
<?php echo JText::_('COM_PAGEBUILDERCK_DESCRIPTION'); ?>
</label>
<input type="text" size="40" class="input-xlarge input-large-text" value="<?php echo $this->item->description ?>" id="description" name="description">
</div>
</div>
<input type="hidden" name="htmlcode" id="htmlcode" value="" />
<input type="hidden" name="option" value="com_pagebuilderck" />
<input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="com_pagebuilderck" />
<input type="hidden" name="return" value="<?php echo $this->input->getCmd('return'); ?>" />
<?php echo JHtml::_('form.token'); ?>
</form>
<div class="maintab menustyles current ckproperty" id="tab_interface">
<div id="workspaceparentck">
<?php
// loads the menu
include_once(PAGEBUILDERCK_PATH . '/views/page/tmpl/contextmenu.php');
include_once(PAGEBUILDERCK_PATH . '/views/page/tmpl/menu.php');
include_once(PAGEBUILDERCK_PATH . '/views/page/tmpl/toolbar.php');
?>
<div id="workspaceck" class="workspaceck<?php echo (\Pagebuilderck\CKFof::isSite() ? ' pagebuilderckfrontend' : '') ?> ckelementedition">
<?php
if ($this->item->htmlcode) {
echo $this->item->htmlcode;
} else {
?>
<?php }
?>
</div>
</div>
<?php // load the modal for the restoration ?>
<div id="pagebuilderckRestoreModalck" class="pagebuilderckRestoreModalck pagebuilderckModalck" style="display:none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3><?php echo JText::_('CK_RESTORE') ?></h3>
</div>
<div class="modal-body">
<?php
if ($this->item->id) {
$path = JPATH_ROOT . '/administrator/components/com_pagebuilderck/backup/' . $this->item->id . '_bak';
if (JFolder::exists($path)) {
$files = JFolder::files($path, '.pbck', false, false);
if (count($files)) {
natsort($files);
$i = 0;
foreach ($files as $file) {
if (stristr($file, 'locked_')) {
$backupdate = str_replace('locked_' . $this->item->id . '_', '', JFile::stripExt($file));
$isLocked = true;
} else {
$backupdate = str_replace('backup_' . $this->item->id . '_', '', JFile::stripExt($file));
$isLocked = false;
}
$date = DateTime::createFromFormat('d-m-Y-G-i-s', $backupdate);
$lockedIcon = $isLocked ? '<span class="ck-icon-lock"></span>' : '<span class="ck-icon-lock-open"></span>';
echo '<div class="restoreline restoreline' . $i . ' clearfix">
<span class="span6">
<span class="label label-info">' . $date->format('d-M-Y H:i:s') . '</span>
</span>
<span class="span6">
<span onclick="ckToggleLockedBackup(' . $this->item->id . ',\'' . $backupdate . '\', ' . $i . ')" data-locked="' . ($isLocked ? ' 1' : '0') . '" class="btn locked' . ($isLocked ? ' active' : '') . '" style="width:16px;margin:0 3px;display:inline-block;">' . $lockedIcon . '</span>
<a class="btn" href="javascript:void(0)" onclick="ckDoRestoration(' . $this->item->id . ', \'' . $backupdate . '\', ' . $i . ')">
' . JText::_('CK_DO_RESTORATION') . '
</a>
<span class="processing" style="width:16px;margin:0 3px;display:inline-block;">&nbsp;</span>
</span>
</div>';
$i++;
}
} else {
echo '<div class="alert">' . JText::_('CK_NO_RESTORE_FILE_FOUND') . '</div>';
}
} else {
echo '<div class="alert">' . JText::_('CK_NO_RESTORE_FILE_FOUND') . '</div>';
}
}
?>
</div>
</div>
<?php
} else {
if (!$canEdit)
echo JText::_('COM_PAGEBUILDERCK_NORIGHTS_TO_EDIT');
}
?>
</div> <?php // fin tab_interface ?>
</div><?php // fin maincktabcontent ?>
</div>
<script>
$ck('#maincktabcontent div.maintab:not(.current)').hide();
$ck('.mainmenulink', $ck('#mainck')).each(function (i, tab) {
$ck(tab).click(function () {
if ($ck('#popup_favoriteck').length) {
ckCloseFavoritePopup(true);
}
$ck('#maincktabcontent div.maintab').hide();
$ck('.mainmenulink', $ck('#mainck')).removeClass('current');
if ($ck('#' + $ck(tab).attr('tab')).length)
$ck('#' + $ck(tab).attr('tab')).show();
$ck(this).addClass('current');
});
});
</script>
<?php
require(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/submitform.php');

View File

@@ -0,0 +1,31 @@
<?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
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$input = new JInput();
$user = JFactory::getUser();
$app = JFactory::getApplication();
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
?>
<?php
// loads the css and js files
echo $this->loadTemplate('include');
?>
<button id="applyBtn" type="button" class="hidden" onclick="Joomla.submitbutton('page.apply');"></button>
<button id="saveBtn" type="button" class="hidden" onclick="Joomla.submitbutton('page.save');"></button>
<button id="closeBtn" type="button" class="hidden" onclick="Joomla.submitbutton('page.cancel');"></button>
<?php
// loads the main content
echo $this->loadTemplate('main');

View File

@@ -0,0 +1,89 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewElement extends CKView {
protected $elements;
protected $ckeditor;
function display($tpl = null) {
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/menustyles.php';
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/stylescss.php';
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/ckeditor.php';
// get instance of the editor to load the css / js in the page
$this->ckeditor = PagebuilderckHelper::loadEditor();
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'), 'home_pagebuilderck');
$this->item = $this->get('Item');
$this->elements = $this->get('Elements');
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
$this->addToolbar();
parent::display($tpl);
// exit to make a full edition standalone page
if ($this->input->get('display') === 'raw') {
exit();
}
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar() {
$this->input->set('hidemainmenu', true);
$user = CKfof::getUser();
$userId = $user->get('id');
$isNew = ($this->item->id == 0 || $this->item->id == "");
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'));
// For new records, check the create permission.
if ($isNew && $user->authorise('core.create', 'com_pagebuilderck'))
{
JToolbarHelper::apply('element.apply');
JToolbarHelper::save('element.save');
JToolbarHelper::cancel('element.cancel');
} else
{
// Can't save the record if it's checked out.
if (!$checkedOut)
{
// Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
if (CKfof::userCan('core.edit') || (CKfof::userCan('core.edit.own') && $this->item->created_by == $userId))
{
JToolbarHelper::apply('element.apply');
JToolbarHelper::save('element.save');
}
}
JToolbarHelper::cancel('element.cancel', 'JTOOLBAR_CLOSE');
}
}
}

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,199 @@
<?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;
use Pagebuilderck\CKFof;
require_once PAGEBUILDERCK_PATH . '/helpers/defines.js.php';
// check the joomla! version
if (version_compare(JVERSION, '3.0.0') > 0) {
$jversion = '3';
} else {
$jversion = '2';
}
$user = JFactory::getUser();
// for ordering
$listOrder = $this->state->get('filter_order', 'a.id');
$listDirn = $this->state->get('filter_order_Dir', 'ASC');
$filter_search = $this->state->get('filter_search', '');
$limitstart = $this->state->get('limitstart', 0);
$limit = $this->state->get('limit', 20);
CKFof::addStyleSheet(PAGEBUILDERCK_MEDIA_URI . '/assets/adminlist.css');
$saveOrder = $listOrder == 'a.ordering';
?>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jqueryck.min.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jquery-uick-custom.min.js" type="text/javascript"></script>
<div class="ckadminsidebar"><?php echo JHtmlSidebar::render() ?></div>
<div class="ckadminarea">
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=elements'); ?>" method="post" name="adminForm" id="adminForm">
<div id="filter-bar" class="btn-toolbar input-group">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo addslashes($this->state->get('filter_search')); ?>" class="cktip form-control" title="" />
</div>
<div class="input-group-append btn-group pull-left hidden-phone">
<button type="submit" class="btn btn-primary cktip" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_SUBMIT') : ''); ?></button>
<button type="button" class="btn btn-secondary cktip" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value = '';
this.form.submit();"><i class="icon-remove"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_CLEAR') : ''); ?></button>
</div>
<?php if ($jversion === '3') { ?>
<div class="btn-group pull-right hidden-phone ordering-select">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php } ?>
</div>
<div class="clearfix">&nbsp;</div>
<table class="table table-striped" id="ckelementslist">
<thead>
<tr>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', 'CK_ORDERING', 'a.ordering', $listDirn, $listOrder); ?>
</th>
<th width="1%">
<input type="checkbox" name="checkall-toggle" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" value="" onclick="Joomla.checkAll(this)" />
</th>
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_PAGES_NAME', 'a.title', $listDirn, $listOrder); ?>
</th>
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_DESCRIPTION', 'a.description', $listDirn, $listOrder); ?>
</th>
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_TYPE', 'a.type', $listDirn, $listOrder); ?>
</th>
<?php if (isset($this->items[0]->state)) { ?>
<?php } ?>
<?php if (isset($this->items[0]->id)) {
?>
<th width="1%" class="nowrap">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
// load all the pagebuilderck plugins
$pluginsType = PagebuilderckHelper::getPluginsMenuItemType();
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_pagebuilderck');
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$canCheckin = $user->authorise('core.manage', 'com_pagebuilderck');
$canChange = $user->authorise('core.edit.state', 'com_pagebuilderck');
$link = 'index.php?option=com_pagebuilderck&view=element&task=element.edit&id=' . $item->id;
?>
<tr class="row<?php echo $i % 2; ?>" data-id="<?php echo (int) $item->id; ?>">
<td class="order nowrap center hidden-phone">
<?php
$iconClass = '';
if (!$canChange) {
$iconClass = ' inactive';
} elseif (!$saveOrder) {
$iconClass = ' inactive tip-top cktip" title="' . JHtml::_('tooltipText', 'JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
<span class="icon-menu" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order" />
<?php endif; ?>
</td>
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td>
<a href="<?php echo $link; ?>"><?php echo $item->title; ?></a>
</td>
<td>
<?php echo $item->description; ?>
</td>
<td>
<?php
if ($item->type == 'row') {
echo JText::_('COM_PAGEBUILDERCK_CONTENT_ROW');
} else {
$typeName = $pluginsType[$item->type]->title;
echo $typeName;
}
?>
</td>
<?php if (isset($this->items[0]->id)) {
?>
<td class="center">
<?php echo (int) $item->id; ?>
</td>
<?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="state_request" value="1" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
<script>
$ck('#ckelementslist tbody').sortable({
items: "> tr",
// helper: "clone",
handle: ".sortable-handler:not(.inactive)",
forcePlaceholderSize: true,
tolerance: "pointer",
placeholder: "placeholderck",
stop: function (e, ui) {
ckSaveElementsListSorting();
}
});
function ckSaveElementsListSorting() {
var ordering = new Object();
var i = 0;
$ck('#ckelementslist tbody tr').each(function () {
ordering[$ck(this).attr('data-id')] = i;
i++;
});
var myurl = PAGEBUILDERCK.URIPBCK + "&task=elements.order&" + PAGEBUILDERCK.TOKEN;
$ck.ajax({
type: "POST",
url: myurl,
data: {
ordering: ordering
}
}).done(function (code) {
}).fail(function () {
alert(Joomla.JText._('CK_FAILED', 'Failed'));
});
}
</script>
</div>

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,114 @@
<?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;
// check the joomla! version
if (version_compare(JVERSION, '3.0.0') > 0) {
$jversion = '3';
} else {
$jversion = '2';
}
// Import CSS
// $document = JFactory::getDocument();
// $document->addStyleSheet('components/com_pagebuilderck/assets/css/templateck.css');
$user = JFactory::getUser();
$userId = $user->get('id');
$input = JFactory::getApplication()->input;
// for ordering
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$function = $input->get('function', '', 'cmd');
// $editor = $input->get('editor', '', 'string');
?>
<div class="pagebuilderckchecking"></div>
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=elements&layout=modal&tmpl=component'); ?>" method="post" name="adminForm" id="adminForm">
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter_search')); ?>" class="cktip" title="" />
</div>
<div class="btn-group pull-left hidden-phone">
<button type="submit" class="btn cktip" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_SUBMIT') : ''); ?></button>
<button type="button" class="btn cktip" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value = '';
this.form.submit();"><i class="icon-remove"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_CLEAR') : ''); ?></button>
</div>
<?php if ($jversion === '3') { ?>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php } ?>
</div>
<div class="clearfix"> </div>
<table class="table table-striped" id="templateckList">
<thead>
<tr>
<th class='left'>
<?php //echo JText::_('COM_PAGEBUILDERCK_TEMPLATES_NAME'); ?>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_PAGES_NAME', 'a.name', $listDirn, $listOrder); ?>
</th>
<?php if (isset($this->items[0]->state)) { ?>
<?php } ?>
<?php if (isset($this->items[0]->id)) {
?>
<th width="1%" class="nowrap">
<?php //echo JText::_('JGRID_HEADING_ID'); ?>
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_pagebuilderck');
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$canCheckin = $user->authorise('core.manage', 'com_pagebuilderck');
$canChange = $user->authorise('core.edit.state', 'com_pagebuilderck');
// $link = 'index.php?option=com_pagebuilderck&view=page&task=page.edit&id=' . $item->id;
$link = 'javascript:void(0)';
$onclick = 'window.parent.' . $function . '(' . $item->id .');';
?>
<tr class="row<?php echo $i % 2; ?>">
<td>
<a href="<?php echo $link; ?>" onclick="<?php echo $onclick ?>"><?php echo $item->title; ?></a>
</td>
<?php if (isset($this->items[0]->id)) {
?>
<td class="center">
<?php echo (int) $item->id; ?>
</td>
<?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>

View File

@@ -0,0 +1,108 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
/**
* View class for a list of Templateck.
*/
class PagebuilderckViewElements extends CKView {
/**
* Display the view
*/
public function display($tpl = null) {
$this->items = $this->get('Items');
if (\Pagebuilderck\CKFof::isAdmin()) $this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar() {
PagebuilderckHelper::loadCkbox();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
// Load the left sidebar only for Joomla 3 and under.
if (! PAGEBUILDERCK_ISJ4) {
PagebuilderckHelper::addSubmenu('elements');
}
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'));
if (CKFof::userCan('core.create')) {
// JToolBarHelper::addNew('element.add', 'JTOOLBAR_NEW');
}
if (CKFof::userCan('core.edit')) {
JToolBarHelper::editList('element.edit', 'JTOOLBAR_EDIT');
JToolBarHelper::custom('element.copy', 'copy', 'copy', 'CK_COPY');
}
// if Params is installed
if (PagebuilderckHelper::getParams()) {
$importButton = '<button class="btn btn-small" onclick="CKBox.open({handler: \'inline\', content: \'ckImportModal\', fullscreen: false, size: {x: \'600px\', y: \'200px\'}});">
<span class="icon-forward-2"></span>
' . JText::_('CK_IMPORT') . '
</button>';
$bar->appendButton('Custom', $importButton, 'import');
$exportButton = '<button class="btn btn-small" onclick="ckExportPage(document.adminForm);">
<span class="icon-share"></span>
' . JText::_('CK_EXPORT') . '
</button>';
$bar->appendButton('Custom', $exportButton, 'export');
// if (document.adminForm.boxchecked.value==0){alert('Veuillez d\'abord effectuer une s<>lection dans la liste.');}else{ Joomla.submitbutton('pages.export')}
// JToolBarHelper::custom('pages.export', 'share', 'share', 'CK_EXPORT', true);
if ($importClass = PagebuilderckHelper::getParams('importelement')) {
$importClass->loadImportForm();
}
if ($exportClass = PagebuilderckHelper::getParams('exportelement')) {
$exportClass->loadExportForm();
}
} else {
$importButton = '<button class="btn btn-small" onclick="CKBox.open({handler:\'inline\',content: \'pagebuilderckparamsmessage\', fullscreen: false, size: {x: \'600px\', y: \'150px\'}});">
<span class="icon-forward-2"></span>
' . JText::_('CK_IMPORT') . '
</button>';
$bar->appendButton('Custom', $importButton, 'import');
$exportButton = '<button class="btn btn-small" onclick="CKBox.open({handler:\'inline\',content: \'pagebuilderckparamsmessage\', fullscreen: false, size: {x: \'600px\', y: \'150px\'}});">
<span class="icon-share"></span>
' . JText::_('CK_EXPORT') . '
</button>';
$bar->appendButton('Custom', $exportButton, 'export');
echo PagebuilderckHelper::showParamsMessage(false);
}
if (CKFof::userCan('core.delete')) {
//If this component does not use state then show a direct delete button as we can not trash
// JToolBarHelper::custom('page.trash', 'trash', 'trash', 'JTOOLBAR_DELETE', 'test');
$deleteButton = '<joomla-toolbar-button id="toolbar-cktrash" list-selection=""><button class="btn btn-small ' . (PAGEBUILDERCK_ISJ4 ? 'btn-danger' : '') . '" onclick="if (document.adminForm.boxchecked.value == 0) { alert(Joomla.JText._(\'JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST\')); } else { if (confirm(\'' . JText::_('CK_CONFIRM_DELETE') . '\')) Joomla.submitbutton(\'element.trash\'); }">
<span class="icon-trash"></span>
' . JText::_('CK_DELETE') . '
</button></joomla-toolbar-button>';
$bar->appendButton('Custom', $deleteButton, 'export');
}
if (CKFof::userCan('core.admin')) {
JToolBarHelper::preferences('com_pagebuilderck');
}
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,263 @@
<?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
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$input = $app->input;
$prefix = $input->get('prefix', '', 'string');
?>
<style>
#fontpreview {
font-size: 28px;
display: block;
line-height: 1.5em;
padding: 20px 0;
}
label {
display: inline-block !important;
min-width: 200px;
}
@font-face {
font-family: 'icomoon';
src:url('https://s3.amazonaws.com/icomoon.io/4/Loading/icomoon.eot?-9haulc');
src:url('https://s3.amazonaws.com/icomoon.io/4/Loading/icomoon.eot?#iefix-9haulc') format('embedded-opentype'),
url('https://s3.amazonaws.com/icomoon.io/4/Loading/icomoon.woff?-9haulc') format('woff'),
url('https://s3.amazonaws.com/icomoon.io/4/Loading/icomoon.ttf?-9haulc') format('truetype'),
url('https://s3.amazonaws.com/icomoon.io/4/Loading/icomoon.svg?-9haulc#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-spinner:before {
content: "\e000";
}
.icon-spinner-2:before {
content: "\e001";
}
.icon-spinner-3:before {
content: "\e002";
}
.icon-spinner-4:before {
content: "\e003";
}
.icon-spinner-5:before {
content: "\e004";
}
.icon-spinner-6:before {
content: "\e005";
}
.icon-spinner-7:before {
content: "\e006";
}
@keyframes anim-rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
.spinner {
display: inline-block;
opacity: 0;
height: 1em;
line-height: 1;
margin: .5em;
animation: anim-rotate 2s infinite linear;
color: #000;
text-shadow: 0 0 .25em rgba(255,255,255, .3);
}
.spinner--steps {
animation: anim-rotate 1s infinite steps(8);
}
.spinner--steps2 {
animation: anim-rotate 1s infinite steps(12);
}
</style>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jqueryck.min.js" type="text/javascript"></script>
<?php PagebuilderckHelper::loadInlineCKFramework(); ?>
<div id="googlefontstyle"></div>
<div class="ckinterface" style="padding: 20px;">
<p>
<input id ="googlefonturl" name="googlefonturl" type="text" style="height:auto;margin:0;width: 500px;max-width:100%;" placeholder="<?php echo JText::_('CK_GOOGLEFONT_URL') ?>" onchange="searchgooglefont()" />
<button class="ckbutton" onclick="searchgooglefont()"><?php echo JText::_('CK_SEARCH') ?></button><i class="spinner spinner--steps icon-spinner"></i>
<button class="ckbutton ckbutton-primary" onclick="returngooglefont()"><?php echo JText::_('CK_SUBMIT') ?></button>
</p>
<hr />
<input type="hidden" id="fonturl" name="fonturl" value="" />
<p id="fontapplied"><label><?php echo JText::_('CK_FONT_APPLIED') ?></label> : <span id="fontappliedname" class="badge badge-success"><?php echo JText::_('CK_NONE') ?><span></p>
<p id="fontweight"><label><?php echo JText::_('CK_FONTWEIGHT') ?></label> : <span class=""><input id="googlefontweight" name="googlefontweight" type="text" onchange="updatefontweight()" style="height:auto;margin:0;" placeholder="300" /><span></p>
<p id="fontpreview">Grumpy wizards make toxic brew for the evil Queen and Jack.</p>
</div>
<script>
//<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
// <link href='https://fonts.googleapis.com/css?family=Open+Sans&subset=latin,greek-ext' rel='stylesheet' type='text/css'>
//https://fonts.googleapis.com/css?family=Open+Sans
// Open+Sans
// Opens Sans
/*
* Test the given value and search for a google font
*
* return void
*/
function searchgooglefont() {
var url = window.parent.ckCapitalize(jQuery('#googlefonturl').val()).trim("'");
if (! url) {
alert ('<?php echo JText::_('CK_EMPTY_URL', true) ?>');
jQuery('#googlefonturl').addClass('invalid').focus();
return;
}
jQuery('.spinner').css('opacity', '1');
var valuetest = /\+/;
if ( url.indexOf("http") == 0 ) {
getGooglefontFromUrl(url); // https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600
} else if ( url.indexOf("<link") == 0 ) {
getGooglefontFromStylesheet(url); // <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600' rel='stylesheet' type='text/css'>
} else if ( valuetest.test(url) ) {
getGooglefontFromFontvalue(url); // Open+Sans
} else {
getGooglefontFromFontname(url); // Open Sans
}
}
/*
* Load the font stylesheet from its url
* @param : url - the http path to the stylesheet (https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600)
*
* return : void
*/
function getGooglefontFromUrl(url) {
jQuery.ajax({
url: url,
})
.done(function( data ) {
if (data) {
jQuery('#googlefontstyle').html('<style>' + data + '</style>');
var fontName = getNameFromContent(data).replace(/'/g, "");
if (fontName) {
jQuery('#fontappliedname').html(fontName);
jQuery('#fonturl').val(url);
updateFontPreview(fontName);
}
} else {
alert( '<?php echo JText::_('CK_FONT_NOT_FOUND', true) ?>' );
}
jQuery('.spinner').css('opacity', '0');
})
.fail(function() {
alert( '<?php echo JText::_('CK_FONT_NOT_FOUND', true) ?>' );
jQuery('.spinner').css('opacity', '0');
});
}
/*
* Load the font stylesheet from its stylesheet code
* @param : url - the stylesheet code (<link href='https://fonts.googleapis.com/css?family=Open+Sans&subset=latin,greek-ext' rel='stylesheet' type='text/css'>)
*
* return : String - the stylesheet content
*/
function getGooglefontFromStylesheet(stylesheet) {
var re = /href='(.*?)'/;
var url = stylesheet.match(re);
if (typeof(url[1]) == 'undefined') {
alert('<?php echo JText::_('CK_FONTURL_NOT_FOUND', true) ?>');
return;
}
getGooglefontFromUrl(url[1].trim("'"));
}
/*
* Load the font stylesheet from its url
* @param : url - the http path to the stylesheet (Open+Sans)
*
* return : String - the stylesheet content
*/
function getGooglefontFromFontvalue(name) {
var url = 'https://fonts.googleapis.com/css?family=' + name;
getGooglefontFromUrl(url);
}
/*
* Load the font stylesheet from its url
* @param : url - the http path to the stylesheet (Open Sans)
*
* return : String - the stylesheet content
*/
function getGooglefontFromFontname(name) {
name = name.replace(' ', '+');
getGooglefontFromFontvalue(name);
}
/*
* Extract the name of the font from the google font styles
* @param content : string - the font styles from google
*
* return string - the name
*/
function getNameFromContent(content) {
// font-family:(.*?);
var re = /font-family:(.*?);/;
var fontName = content.match(re);
if (typeof(fontName[1]) == 'undefined') {
alert('<?php echo JText::_('CK_FONTNAME_NOT_FOUND', true) ?>');
return '';
}
return fontName[1].trim().trim("'");
}
/*
* Apply the font to the preview text
* @param fontName : string - the font name
*
* return void
*/
function updateFontPreview(fontName) {
jQuery('#fontpreview').css('font-family', fontName);
updatefontweight();
}
/*
* Apply the font weight to the preview text
*
* return void
*/
function updatefontweight() {
jQuery('#fontpreview').css('font-weight', jQuery('#googlefontweight').val());
}
/*
* Get the name and font weight and return them into the parent window
*
* return void
*/
function returngooglefont() {
// if (! jQuery('#fonturl').val()) return;
window.parent.ckSetGoogleFont('<?php echo $prefix ?>', jQuery('#fonturl').val(), jQuery('#fontappliedname').text(), jQuery('#googlefontweight').val());
window.parent.CKBox.close();
}
</script>

View File

@@ -0,0 +1,768 @@
<?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
*/
defined('_JEXEC') or die;
use Pagebuilderck\CKFof;
require_once(PAGEBUILDERCK_PATH . '/helpers/defines.js.php');
$input = CKFof::getInput();
$prefix = $input->get('prefix', '', 'string');
?>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/pagebuilderck.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckframework.css" type="text/css" />
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jquery.min.js" type="text/javascript"></script>
<?php
foreach ($this->items as $item) {
?>
<div class="ckexistingfont" data-name="<?php echo $item->name ?>" data-variants="<?php echo $item->variants ?>" data-filesize="<?php echo $item->filesize ?>"></div>
<?php
}
?>
<div class="ckinterface" style="padding: 20px;">
<div id="fontslistcontainer">
<div class="ckbutton-group">
<input id ="cksearchfontcategory" name="cksearchfontcategory" type="text" style="height:auto;margin:0;width: 500px;max-width:100%;" onchange="ckSearchFontCategory()" />
<button class="ckbutton" onclick="ckSearchFontCategory()"><span class="fa fa-search"></span> <?php echo JText::_('CK_SEARCH') ?></button>
<button class="ckbutton" onclick="jQuery('#cksearchfontcategory').val('');ckSearchFontCategory();"><span class="fa fa-times"></span> <?php echo JText::_('CK_CLEAR') ?></button>
</div>
<p>
<label for=""><?php echo JText::_('CK_USE_LOCAL_GFONTS') ?></label>
<select id="ckuselocalgfonts" name="ckuselocalgfonts">
<option value="1"><?php echo JText::_('JYES') ?></option>
<option value="0"><?php echo JText::_('JNO') ?></option>
</select>
<p><?php echo JText::_('CK_USE_LOCAL_GFONTS_DESC') ?></p>
</p>
<div id="ckgooglefontslist" class="ckfontslist"></div>
</div>
<div id="ckgooglefontdetails"></div>
<div id="ckgooglefontpanel">
<div id="ckgooglefontpanel-list"></div>
<div id="ckgooglefontpanel-toolbar">
<div class="ckbutton ckbutton-primary" onclick="ckSaveFonts()"><i class="fa fa-save"></i> <?php echo JText::_('CK_SAVE') ?></div>
</div>
</div>
</div>
<script>
var PAGEBUILDERCK_ADMIN_URL = '<?php echo PAGEBUILDERCK_ADMIN_URL ?>';
function ckgetFontsLibrary(targetId) {
var setVar = 'google';
jQuery('#' + targetId).addClass('ckwait');
var debug = false;
// sessionStorage.setItem('fonts_library_' + setVar,'');
if (!debug && window.sessionStorage && sessionStorage.getItem('fonts_library_' + setVar)) {
var html = sessionStorage.getItem('fonts_library_' + setVar);
jQuery('#' + targetId).empty().append(html);
jQuery('#' + targetId).removeClass('ckwait');
ckScrollFonts();
// load the data
ckLoadFontsDataFromInterface();
} else {
// var url = 'https://media.joomlack.fr/api/fonts/list/google';
var url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyA1U444P79sRH3hB2nOTHmiDjL_URoLsWU';
jQuery.ajax({
url: url,
dataType: 'jsonp',
cache: true,
jsonpCallback: "joomlack_jsonpcallback",
timeout: 20000,
success: function (response) {
jQuery('#' + targetId).removeClass('ckwait');
var html = '';
var items = response.items;
for (var i=0;i<items.length;i++) {
html += ckFontItemDisplay(items[i]);
}
html = '<p class="ckfontslistnumber">' + i + ' fonts found</p>' + html;
jQuery('#' + targetId).empty().append(html);
sessionStorage.setItem('fonts_library_' + setVar, html);
ckScrollFonts();
// load the data
ckLoadFontsDataFromInterface();
},
fail: function() {
alert('Error : Unable to connect to the library. Please contact an administrator');
},
complete: function() {
},
error: function(request, status, error) {
}
});
}
}
// immediately load the library in the page
ckgetFontsLibrary('ckgooglefontslist');
function ckFontItemDisplay(item) {
var name = item.family;
var styles = item.variants;
// var subsets = item.subsets;
var category = item.category;
var html = '';
html += '<div class="ckfontitem" onclick="ckShowFontDetails(this)" loading="lazy" data-font="' + name + '" data-name="' + name.toLowerCase() + '" data-category="' + category + '">'
+ '<div class="ckfontitem-json">' + JSON.stringify(item) + '</div>'
+ '<div class="ckfontitem-name">' + name + '</div>'
+ '<div class="ckfontitem-styles"><span class="ckfontitem-styles-count">' + styles.length + '</span> <?php echo JText::_('CK_STYLES') ?></div>'
+ '<div class="ckfontitem-state"></div>'
+ '<div class="ckfontitem-demo">Almost before we knew it, we had left the ground.</div>'
+ '</div>';
return html;
}
function ckScrollFonts() {
var limit = jQuery(window).scrollTop() + jQuery(window).height();
var items = jQuery('.ckfontitem:not([data-loaded="1"])');
items.each(function(i) {
var $item = jQuery(this);
if ($item.offset().top < limit && document.getElementById('ckgooglefontslist').style.display !== 'none') {
ckLoadGoogleFontForPreview($item);
} else {
return false;
}
});
}
function ckLoadGoogleFontForPreview($item) {
var name = $item.attr('data-font');
var fontfamily = name.replace(/\+/g, ' ');
jQuery(document.head).append('<link href="https://fonts.googleapis.com/css2?family=' + name + '" rel="stylesheet">')
$item.attr('data-loaded', '1');
$item.find('.ckfontitem-demo').css('font-family', fontfamily).css('color', '#333');
$item.find('.ckfontitem-state').attr('data-state', '1');
}
function ckFilterFontCategory() {
var cat = jQuery('#ckselectfontcategory').val();
if (! cat) {
jQuery('.ckfontitem').show();
return;
} else {
jQuery('.ckfontitem').hide();
jQuery('.ckfontitem[data-category="' + cat + '"]').show();
}
}
function ckSearchFontCategory() {
var search = jQuery('#cksearchfontcategory').val().trim().toLowerCase();
if (! search) {
jQuery('.ckfontitem').show();
return;
} else {
jQuery('.ckfontitem').hide();
var items = jQuery('.ckfontitem[data-name*="' + search + '"]');
items.show();
items.each(function(i) {
var $item = jQuery(this);
ckLoadGoogleFontForPreview($item);
});
}
}
function ckShowFontDetails(item) {
var $item = jQuery(item);
var settings = $item.find('.ckfontitem-json').html();
var settingsObj = JSON.parse(settings);
jQuery('#ckgooglefontslist').hide();
jQuery('#fontslistcontainer').hide();
var details = ckFontDetailsDisplay(settingsObj);
jQuery('#ckgooglefontdetails').empty().show().append(details).append('<div class="ckfontitem-json">' + settings + '</div>');
ckAddEventOnButtons();
ckCheckSelectedFonts();
}
function ckFontDetailsDisplay(item) {
var name = item.family;
var category = item.category;
var subsets = item.subsets;
var variants = item.variants;
var text = 'Almost before we knew it, we had left the ground.';
var html = '';
html += '<div class="ckfontitem-details" data-font="' + name + '" data-name="' + name.toLowerCase() + '" data-category="' + category + '">'
+ '<div class="ckfontitem-details-close ckbutton" onclick="ckBackTofontsList()"><span class="fa fa-chevron-left"></span> <?php echo JText::_('CK_BACK') ?></div>'
+ '<div class="ckfontitem-name">' + name + '</div>'
+ '<div class="ckfontitem-details-styles"><?php echo JText::_('CK_STYLES') ?></div>'
for (var i = 0; i < variants.length; i++) {
var variant = variants[i]; // can be 'regular', '500italic'
var fontweight = variant.replace('italic', '');
var fontstyle = '';
if (variant.indexOf('italic') > -1) fontstyle = 'italic';
if (fontweight == 'regular') fontweight = '400';
if (fontweight == '') fontweight = '400';
var variantdetail = (fontweight == variant) ? variant : variant + ' ' + fontweight;
var style = 'style="font-family:' + name + ';' + (fontstyle ? 'font-style:' + fontstyle : '') + ';font-weight:' + fontweight + ';"'
html += '<div class="ckfontitem-variant-line" data-variant="'+ variant + '" data-weight="'+ fontweight + '" data-style="'+ fontstyle + '" data-file="' + item.files[variant] + '">'
+ '<div class="ckfontitem-variant-detail"> ' + variantdetail + '</div>'
+ '<div class="ckfontitem-variant-checkbox-button">'
+ '<input type="checkbox" name="ckfontitem-variant-checkbox" id="ckfontitem-variant-checkbox-' + i + '" />&nbsp;'
+ '<label class="ckfontitem-variant-checkbox-label" for="ckfontitem-variant-checkbox-' + i + '"><?php echo JText::_('CK_USE_THIS_STYLE') ?></label>'
+ '</div>'
+ '<div class="ckfontitem-variant" ' + style + '>' + text + '</div>'
+ '</div>'
}
html += '</div>';
return html;
}
function ckBackTofontsList() {
jQuery('#ckgooglefontdetails').hide();
jQuery('#ckgooglefontslist').show();
jQuery('#fontslistcontainer').show();
}
function ckDownloadGFontFiles() {
var fontitems = jQuery('#ckgooglefontpanel .ckfontlistitem');
var f = 0;
fontitems.each(function() {
f++;
var fontitem = jQuery(this);
var v = 0;
var variants = fontitem.find('.ckfontlistitem-variant');
var fontvarsregular = new Array();
var fontvarsitalic = new Array();
variants.each(function() {
v++;
var listitem = jQuery(this);
var url = jQuery(this).attr('data-file');
var variantWeight = jQuery(this).attr('data-weight') ? jQuery(this).attr('data-weight') : '400';
var variantStyle = jQuery(this).attr('data-style');
if (variantStyle === 'italic') {
fontvarsitalic.push('1' + ',' + variantWeight);
} else {
fontvarsregular.push('0' + ',' + variantWeight);
}
});
fontvarsregular.sort();
fontvarsitalic.sort();
fontvarsregular = fontvarsregular.join(';');
fontvarsitalic = fontvarsitalic.join(';');
var fontvars = fontvarsregular + (fontvarsitalic ? ';' + fontvarsitalic : '');
// create the font css url
var fontname = fontitem.attr('data-font');
// console.log(fontname);
fontname = fontname.replace(/ /g, '+');
var fonturl = 'https://fonts.googleapis.com/css2?family=' + fontname + ':ital,wght@' + fontvars + '&display=swap';
//https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@1,600&display=swap
// 0 = regular
// 1 = italic
// 600 = font weight
// load the stylesheet in the page
// TODO : ne pas utiliser, il faut ajouter la font dans la page si elle est sélectionnée dans la liste déroulantes des options de styles
// window.parent.ckAddGooglefontStylesheet(fontname, fonturl);
// if (document.getElementById('ckuselocalgfonts').value == '1') {
var myurl = PAGEBUILDERCK.URIPBCK + "&task=fonts.save&" + PAGEBUILDERCK.TOKEN;
// var url = 'https://media.joomlack.fr/api/fonts/list/google';
jQuery.ajax({
type: "POST",
async: "false",
url: myurl,
data: {
'url' : fonturl,
'fontname' : fontname,
'fontvars' : fontvars,
'local' : document.getElementById('ckuselocalgfonts').value
}
}).done(function(code) {
var result = JSON.parse(code);
if (result.status === '0') {
alert(result.msg);
}
fontitem.find('.ckfontlistitem-title').append('<span class="ckbadge ckbadge-success ckfontlistitem-filesize">' + parseInt(parseInt(result.filesize) / 1000) + ' kb</span>');
fontitem.attr('data-cssurl', result.file);
f--;
if (f === 0) {
ckAfterFontsDownloaded();
}
}).fail(function(code) {
alert(Joomla.Text._('CK_FAILED', 'Failed'));
});
// } else {
// ckAfterFontsDownloaded();
// }
});
}
function ckAddEventOnButtons() {
jQuery('[name="ckfontitem-variant-checkbox"]').on('change', function() {
var variant = jQuery(jQuery(this).parents('.ckfontitem-variant-line')[0]);
var font = jQuery('#ckgooglefontdetails');
var fontName = font.find('.ckfontitem-name')[0].innerHTML;
var variantName = variant.attr('data-variant');
var fontWeight = variant.attr('data-weight');
var fontStyle = variant.attr('data-style');
var fontFile = variant.attr('data-file');
if (this.checked) {
ckAddStyleInPanel(fontName, variantName, fontWeight, fontStyle, fontFile);
} else {
ckRemoveStyleInPanel(fontName, variantName, fontWeight, fontStyle);
}
});
}
function ckAddStyleInPanel(fontName, variantName, fontWeight, fontStyle, fontFile) {
if (! jQuery('#ckgooglefontpanel-list .ckfontlistitem[data-font="' + fontName + '"]').length) {
jQuery('#ckgooglefontpanel-list').append(
'<div class="ckfontlistitem" data-font="' + fontName + '">'
+ '<h3 class="ckfontlistitem-title"><a href="javascript:void(0)" onclick="ckShowFontDetailsFromPanel(\'' + fontName + '\')">' + fontName + '</a></h3>'
+ '<div class="ckfontlistitem-variants"></div>'
+ '</div>');
}
var listitem = jQuery('#ckgooglefontpanel-list .ckfontlistitem[data-font="' + fontName + '"]');
// var fontitem = jQuery('#ckgooglefontdetails .ckfontitem-details[data-font="' + fontName + '"] .ckfontitem-variant-line[data-variant="' + variantName + '"]');
// console.log(fontitem.attr('data-file'));
if (! listitem.find('.ckfontlistitem-variant[data-variant="' + variantName + '"]').length) {
let html = '<div class="ckfontlistitem-variant" data-font="' + fontName + '" data-variant="' + variantName + '" data-weight="' + fontWeight + '" data-style="' + fontStyle + '" data-file="' + fontFile + '">'
+ '<span>' + fontWeight + ' ' + fontStyle + '</span>';
if ('<?php echo CKFof::userCan('core.delete') ?>') html += '<div class="ckfontlistitem-variant-button-remove" onclick="ckRemoveStyleFromPanel(this)"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM168 232C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H168z"/></svg></div>';
html += '</div>'
listitem.find('.ckfontlistitem-variants').append(html);
}
}
function ckRemoveStyleInPanel(fontName, variantName, fontWeight, fontStyle) {
// var confirmed = window.parent.ckRemoveGoogleFont(fontName);
// if (! confirmed) return;
if (!confirm(Joomla.Text._('CK_CONFIRM_DELETE','Are you sure that you want to delete ?'))) return false;
var listitem = jQuery('#ckgooglefontpanel .ckfontlistitem[data-font="' + fontName + '"]');
if (listitem.find('.ckfontlistitem-variant').length > 1) {
listitem.find('.ckfontlistitem-variant[data-variant="' + variantName + '"]').remove();
} else {
ckDeleteFont(fontName);
}
jQuery('#ckgooglefontdetails .ckfontitem-details[data-font="' + fontName + '"] .ckfontitem-variant-line[data-variant="' + variantName + '"] input[type="checkbox"]').prop('checked', '');
// ckSaveFonts();
}
function ckDeleteFont(fontName) {
var myurl = PAGEBUILDERCK_ADMIN_URL + "&task=fonts.delete&" + PAGEBUILDERCK.TOKEN;
jQuery.ajax({
type: "POST",
async: "false",
url: myurl,
data: {
'fontname' : fontName
}
}).done(function(code) {
var result = JSON.parse(code);
if (result.status === '0') {
alert(result.msg);
return;
}
var listitem = jQuery('#ckgooglefontpanel .ckfontlistitem[data-font="' + fontName + '"]');
listitem.remove();
}).fail(function(code) {
alert(Joomla.Text._('CK_FAILED', 'Failed'));
});
}
function ckRemoveStyleFromPanel(btn) {
var variant = jQuery(jQuery(btn).parents('.ckfontlistitem-variant')[0]);
var fontName = variant.attr('data-font');
var variantName = variant.attr('data-variant');
ckRemoveStyleInPanel(fontName, variantName);
}
function ckShowFontDetailsFromPanel(fontName) {
var $item = jQuery('#ckgooglefontslist .ckfontitem[data-name="' + fontName.toLowerCase() + '"]');
$item.trigger('click');
ckLoadGoogleFontForPreview($item);
}
function ckCheckSelectedFonts() {
var fontName = jQuery('#ckgooglefontdetails .ckfontitem-details').attr('data-font');
var listitem = jQuery('#ckgooglefontpanel .ckfontlistitem[data-font="' + fontName + '"]');
var variants = listitem.find('.ckfontlistitem-variant');
variants.each(function() {
var variant = jQuery(this).attr('data-variant');
jQuery('#ckgooglefontdetails .ckfontitem-details .ckfontitem-variant-line[data-variant="' + variant + '"]').find('input[name="ckfontitem-variant-checkbox"]').prop('checked', 'checked');
});
}
function ckSaveFonts() {
ckAddSpinnerIcon(jQuery('#ckgooglefontpanel-toolbar .ckbutton-primary'));
jQuery('.ckfontlistitem-filesize').remove();
jQuery('#ckgooglefontpanel-info').remove();
ckDownloadGFontFiles();
}
function ckAddSpinnerIcon(btn) {
if (! btn.attr('data-class')) var icon = btn.find('.fa').attr('class');
btn.attr('data-class', icon).find('.fa').attr('class', 'fa fa-spinner fa-pulse').css('opacity', '1');
}
function ckRemoveSpinnerIcon(btn) {
btn.find('.fa').attr('class', btn.attr('data-class'));
}
function ckExitFonts() {
window.parent.CKBox.close();
}
function ckAfterFontsDownloaded() {
var filesizes = jQuery('.ckfontlistitem-filesize');
var totalfilesize = 0;
filesizes.each(function() {
totalfilesize += parseInt(jQuery(this).text())
});
jQuery('#ckgooglefontpanel-info').remove();
jQuery('#ckgooglefontpanel').append('<div id="ckgooglefontpanel-info"><?php echo JText::_('CK_TOTAL_FILE_SIZE', true) ?> : ' + totalfilesize + ' kb' + '</div>');
var listitems = jQuery('#ckgooglefontpanel .ckfontlistitem');
var fontslist = new Array();
listitems.each(function() {
fontslist.push(jQuery(this).attr('data-font').replace(/ /g, '+'));
});
fontslistjoined = fontslist.join(',');
// automatically add the font to the list in the styling interface
if (typeof(window.parent['ckAddGoogleFontsToList']) == 'function') {
window.parent.ckAddGoogleFontsToList(fontslistjoined);
// fontslist.forEach(function(name) {
// if ($ck('#ckuselocalgfonts').val() === '1') {
// window.parent.ckAddFontToHead(PAGEBUILDERCK.MEDIA_URI + '/gfonts/' + name + '.css');
// } else {
// window.parent.ckAddFontToHead('https://fonts.googleapis.com/css2?family=' + name);
// }
// });
}
ckRemoveSpinnerIcon(jQuery('#ckgooglefontpanel-toolbar .ckbutton-primary'));
}
jQuery(window).scroll(function() {
ckScrollFonts();
});
jQuery(document.body).scroll(function() {
ckScrollFonts();
});
function ckLoadFontsDataFromInterface() {
var fonts = document.querySelectorAll('.ckexistingfont');
fonts.forEach(function(font) {
let fontName = font.getAttribute('data-name').replace(/\+/g, ' ');
var variants = font.getAttribute('data-variants').split(';'); // regular;italic
for (var j=0; j < variants.length; j++) {
let variantArray = variants[j].split(',');
let variant = variantArray[0];
let fontStyle = variant === '1' ? 'italic' : '';
let fontWeight = variantArray[1];
let variantName = variant === '1' ? fontWeight + 'italic' : fontWeight + 'regular'; // regular
if (variant) {
if (fontWeight === 'regular') fontWeight = '400';
if (variantName === '400') variantName = 'regular';
if (variantName === '400italic') variantName = 'italic';
var $item = jQuery('.ckfontitem[data-font="' + fontName + '"]');
var settings = $item.find('.ckfontitem-json').html();
var settingsObj = JSON.parse(settings);
var fontFile = settingsObj.files[variantName];
ckAddStyleInPanel(fontName, variantName, fontWeight, fontStyle, fontFile);
var fontitem = jQuery('#ckgooglefontpanel .ckfontlistitem[data-font="' + fontName + '"]');
if (! fontitem.find('.ckfontlistitem-filesize').length) fontitem.find('.ckfontlistitem-title').append('<span class="ckbadge ckbadge-success ckfontlistitem-filesize">' + parseInt(parseInt(font.getAttribute('data-filesize')) / 1000) + ' kb</span>');
}
}
});
}
</script>
<style>
html {
overflow-y: hidden;
}
body {
background: #fff;
overflow-y: scroll;
max-height: 100%;
}
* {
box-sizing: border-box;
}
#fontpreview {
font-size: 28px;
display: block;
line-height: 1.5em;
padding: 20px 0;
}
label {
display: inline-block !important;
min-width: 200px;
}
.fa-spinner {
opacity: 0;
}
.ckfontslist * {
box-sizing: border-box;
}
.ckfontslistnumber {
flex: 1 1 100%;
}
.ckfontitem {
flex: 1 1 auto;
min-width: 250px;
width: 350px;
cursor: pointer;
border: 1px solid #ddd;
border-radius: 5px;
padding: 15px;
color: #333;
font-size: 13px;
margin: 15px;
position: relative;
background: #fff;
}
.ckfontitem:hover {
box-shadow: #ccc 0 0 15px;
}
.ckfontslist {
display: flex;
flex-wrap: wrap;
}
body {
width: calc(100% - 300px);
}
.ckfontitem-name {
font-size: 14px;
color: #444;
}
.ckfontitem-demo {
font-size: 40px;
text-align: left;
line-height: 1;
margin: 10px 0;
color: #fff;
}
.ckfontitem-json {
display: none;
}
.ckfontitem-styles {
position: absolute;
right: 50px;
top: 15px;
color: #999;
}
.ckfontitem-state {
position: absolute;
right: 15px;
top: 15px;
width: 10px;
height: 10px;
/*background: #ddd;*/
border-radius: 50%;
}
.ckfontitem-state[data-state="1"] {
/*background: green;*/
}
.ckfontitem-variant {
font-size: 40px;
line-height: 1;
white-space: nowrap;
overflow: hidden;
padding: 15px;
margin: 10px 0;
border: 1px solid #ddd;
overflow: auto;
border-radius: 5px;
background: #fff;
}
.ckfontitem-variant-detail {
display: inline-block;
}
input[name="ckfontitem-variant-checkbox"]:checked ~ .ckfontitem-variant {
border-color: rgba(82,168,236,0.8);
}
input[name="ckfontitem-variant-checkbox"]:checked + label {
color: rgba(82,168,236,1);
border-color: rgba(82,168,236,1);
}
.ckfontitem-details .ckfontitem-name {
font-size: 36px;
line-height: 1;
margin: 20px;
}
.ckfontitem-details-styles {
color: #aaa;
font-size: 20px;
line-height: 1;
margin: 5px 0 20px;;
}
#ckgooglefontpanel {
position: fixed;
top: 0;
bottom: 0;
right: 0;
width: 300px;
background: #fff;
box-shadow: rgba(0,0,0,0.5) 0 0 10px;
z-index: 1111;
padding-bottom: 80px;
}
label.ckfontitem-variant-checkbox-label {
margin: 0;
color: #666;
font-size: 16px;
background: #fff;
border: #ddd 1px solid;
padding: 5px 20px 5px 30px;
display: inline-block;
min-width: 0;
width: auto;
border-radius: 3px;
}
label.ckfontitem-variant-checkbox-label:hover {
background: #fff;
border: #000 1px solid;
}
.ckfontitem-variant-checkbox-button {
display: inline-block;
margin: 0 20px;
position: relative;
}
input[name="ckfontitem-variant-checkbox"] {
position: absolute;
margin: 10px;
}
.ckfontlistitem-variant-button-remove svg {
width: 16px;
height: 16px;
line-height: 0;
fill: #fff;
background: #333;
border-radius: 50%;
border: 1px solid #333;
box-sizing: border-box;
vertical-align: baseline;
}
.ckfontlistitem-variant-button-remove {
display: inline-block;
margin-left: auto;
border-radius: 50%;
height: 16px;
width: 16px;
box-sizing: content-box;
border: 5px solid transparent;
cursor: pointer;
}
.ckfontlistitem-variant-button-remove:hover {
border: 5px solid rgba(236, 82, 82, 0.2);
}
.ckfontlistitem {
margin: 10px;
border: 1px solid #ddd;
border-radius: 4px;
padding: 10px;
}
.ckfontlistitem-title {
color: #1a73e8;
}
.ckfontlistitem-variant {
font-size: 14px;
display: flex;
}
div#ckgooglefontpanel-toolbar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: #eee;
padding: 20px;
height: 80px;
box-sizing: border-box;
}
#ckgooglefontpanel-toolbar {
text-align: center;
}
#ckgooglefontpanel-toolbar .ckbutton {
padding: 7px 20px;
border-radius: 4px;
}
#ckgooglefontpanel .ckfontlistitem-filesize {
height: 18px;
margin-top: 3px;
float: right;
}
#ckgooglefontpanel-info {
margin: 10px;
padding: 10px;
background: #eee;
color: #666;
border-radius: 4px;
}
#ckgooglefontpanel-list {
height: calc(100% - 80px);
overflow: auto;
}
</style>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,34 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewFonts extends CKView {
function display($tpl = null) {
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
PagebuilderckHelper::checkTableExists('fonts');
$this->items = $this->get('Items');
parent::display($tpl);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,220 @@
<?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
*/
defined('TCK_LOADED') or die;
$input = new TCK_Input();
$prefix = $input->get('prefix', '', 'string');
?>
<style>
body {
background: #fff;
}
#fontpreview {
font-size: 28px;
display: block;
line-height: 1.5em;
padding: 20px 0;
}
label {
display: inline-block !important;
min-width: 200px;
}
.fa-spinner {
opacity: 0;
}
</style>
<link rel="stylesheet" href="<?php echo TEMPLATECREATORCK_MEDIA_URI ?>/assets/ckframework.css" type="text/css" />
<link rel="stylesheet" href="<?php echo TEMPLATECREATORCK_MEDIA_URI ?>/assets/font-awesome.min.css" type="text/css" />
<script src="<?php echo TEMPLATECREATORCK_MEDIA_URI ?>/assets/jquery.min.js" type="text/javascript"></script>
<div id="googlefontstyle"></div>
<div class="ckinterface" style="padding: 20px;">
<p>
<input id ="googlefonturl" name="googlefonturl" type="text" style="height:auto;margin:0;width: 500px;max-width:100%;" placeholder="<?php echo TCK_Text::_('CK_GOOGLEFONT_URL') ?>" onchange="searchgooglefont()" />
<button class="ckbutton" onclick="searchgooglefont()"><span class="fa fa-search"></span> <?php echo TCK_Text::_('CK_SEARCH') ?></button><i class="fa fa-pulse fa-spinner"></i>
<button class="ckbutton ckbutton-primary" onclick="returngooglefont()"><span class="fa fa-check"></span> <?php echo TCK_Text::_('CK_SELECT') ?></button>
</p>
<p><a class="ckalert ckalert-success" href="https://www.template-creator.com/en/documentation-category/12-interface/63-manage-google-fonts" target="_blank"><?php echo TCK_Text::_('CK_GOOGLE_FONT_DOCUMENTATION') ?></a></p>
<hr />
<input type="hidden" id="fonturl" name="fonturl" value="" />
<p id="fontapplied"><label><?php echo TCK_Text::_('CK_FONT_APPLIED') ?></label> : <span id="fontappliedname" class="badge badge-success"><?php echo TCK_Text::_('CK_NONE') ?><span></p>
<p id="fontweight"><label><?php echo TCK_Text::_('CK_FONTWEIGHT') ?></label> : <span class=""><input id="googlefontweight" name="googlefontweight" type="text" onchange="updatefontweight()" style="height:auto;margin:0;" placeholder="300" /><span></p>
<p id="fontpreview">Grumpy wizards make toxic brew for the evil Queen and Jack.</p>
</div>
<script>
//<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
// <link href='https://fonts.googleapis.com/css?family=Open+Sans&subset=latin,greek-ext' rel='stylesheet' type='text/css'>
//https://fonts.googleapis.com/css?family=Open+Sans
// Open+Sans
// Opens Sans
/*
* Test the given value and search for a google font
*
* return void
*/
function searchgooglefont() {
var url = jQuery('#googlefonturl').val();
var name = ckCapitalize(jQuery('#googlefonturl').val()).trim("'");
if (! url) {
alert ('<?php echo TCK_Text::_('CK_EMPTY_URL', true) ?>');
jQuery('#googlefonturl').addClass('invalid').focus();
return;
}
jQuery('.fa-spinner').css('opacity', '1');
var valuetest = /\+/;
if ( url.indexOf("specimen") != -1 ) {
name = url.split('=');
name = name[1];
getGooglefontFromFontvalue(name); // https://fonts.google.com/specimen/Dancing+Script?selection.family=Dancing+Script
} else if ( url.indexOf("http") == 0 ) {
getGooglefontFromUrl(url); // https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600
} else if ( url.indexOf("<link") == 0 ) {
getGooglefontFromStylesheet(url); // <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600' rel='stylesheet' type='text/css'>
} else if ( valuetest.test(url) ) {
getGooglefontFromFontvalue(name); // Open+Sans
} else {
getGooglefontFromFontname(name); // Open Sans
}
}
/*
* Load the font stylesheet from its url
* @param : url - the http path to the stylesheet (https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600)
*
* return : void
*/
function getGooglefontFromUrl(url) {
jQuery.ajax({
url: url,
})
.done(function( data ) {
if (data) {
jQuery('#googlefontstyle').html('<style>' + data + '</style>');
var fontName = getNameFromContent(data).replace(/'/g, "");
if (fontName) {
jQuery('#fontappliedname').html(fontName);
var re = /([0-9])*$/;
var fontWeight = url.match(re);
console.log(fontWeight);
if (typeof(fontWeight[0]) != 'undefined') {
jQuery('#googlefontweight').val(fontWeight[0]);
}
jQuery('#fonturl').val(url);
updateFontPreview(fontName);
}
} else {
alert( '<?php echo TCK_Text::_('CK_FONT_NOT_FOUND', true) ?>' );
}
jQuery('.fa-spinner').css('opacity', '0');
})
.fail(function() {
alert( '<?php echo TCK_Text::_('CK_FONT_NOT_FOUND', true) ?>' );
jQuery('.fa-spinner').css('opacity', '0');
});
}
/*
* Load the font stylesheet from its stylesheet code
* @param : url - the stylesheet code (<link href='https://fonts.googleapis.com/css?family=Open+Sans&subset=latin,greek-ext' rel='stylesheet' type='text/css'>)
*
* return : String - the stylesheet content
*/
function getGooglefontFromStylesheet(stylesheet) {
var re = /href='(.*?)'/;
var url = stylesheet.match(re);
if (typeof(url[1]) == 'undefined') {
alert('<?php echo TCK_Text::_('CK_FONTURL_NOT_FOUND', true) ?>');
return;
}
getGooglefontFromUrl(url[1].trim("'"));
}
/*
* Load the font stylesheet from its url
* @param : url - the http path to the stylesheet (Open+Sans)
*
* return : String - the stylesheet content
*/
function getGooglefontFromFontvalue(name) {
var url = 'https://fonts.googleapis.com/css?family=' + name;
getGooglefontFromUrl(url);
}
/*
* Load the font stylesheet from its url
* @param : url - the http path to the stylesheet (Open Sans)
*
* return : String - the stylesheet content
*/
function getGooglefontFromFontname(name) {
names = name.split(' ');
for (var i=0; i<names.length ; i++) {
names[i] = ckCapitalize(names[i]);
}
name = names.join('+');
getGooglefontFromFontvalue(name);
}
/*
* Extract the name of the font from the google font styles
* @param content : string - the font styles from google
*
* return string - the name
*/
function getNameFromContent(content) {
// font-family:(.*?);
var re = /font-family:(.*?);/;
var fontName = content.match(re);
if (typeof(fontName[1]) == 'undefined') {
alert('<?php echo TCK_Text::_('CK_FONTNAME_NOT_FOUND', true) ?>');
return '';
}
return fontName[1].trim().trim("'");
}
/*
* Apply the font to the preview text
* @param fontName : string - the font name
*
* return void
*/
function updateFontPreview(fontName) {
jQuery('#fontpreview').css('font-family', fontName);
updatefontweight();
}
/*
* Apply the font weight to the preview text
*
* return void
*/
function updatefontweight() {
jQuery('#fontpreview').css('font-weight', jQuery('#googlefontweight').val());
}
/*
* Get the name and font weight and return them into the parent window
*
* return void
*/
function returngooglefont() {
// if (! jQuery('#fonturl').val()) return;
window.parent.ckSetGoogleFont('<?php echo $prefix ?>', jQuery('#fonturl').val(), jQuery('#fontappliedname').text(), jQuery('#googlefontweight').val());
window.parent.CKBox.close();
}
function ckCapitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
</script>

View File

@@ -0,0 +1,766 @@
<?php
/**
* @copyright Copyright (C) 2022. 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
*/
defined('TCK_LOADED') or die;
$input = new TCK_Input();
$prefix = $input->get('prefix', '', 'string');
?>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="stylesheet" href="<?php echo TEMPLATECREATORCK_MEDIA_URI ?>/assets/ckframework.css" type="text/css" />
<link rel="stylesheet" href="<?php echo TEMPLATECREATORCK_MEDIA_URI ?>/assets/font-awesome.min.css" type="text/css" />
<script src="<?php echo TEMPLATECREATORCK_MEDIA_URI ?>/assets/jquery.min.js" type="text/javascript"></script>
<div class="ckinterface" style="padding: 20px;">
<div id="fontslistcontainer">
<p>
<input id ="cksearchfontcategory" name="cksearchfontcategory" type="text" style="height:auto;margin:0;width: 500px;max-width:100%;" onchange="ckSearchFontCategory()" />
<div class="ckbutton-group">
<button class="ckbutton" onclick="ckSearchFontCategory()"><span class="fa fa-search"></span> <?php echo TCK_Text::_('CK_SEARCH') ?></button><i class="fa fa-pulse fa-spinner"></i>
<button class="ckbutton" onclick="jQuery('#cksearchfontcategory').val('');ckSearchFontCategory();"><span class="fa fa-times"></span> <?php echo TCK_Text::_('CK_CLEAR') ?></button><i class="fa fa-pulse fa-spinner"></i>
</div>
</p>
<?php /*<p>
<label for=""><?php echo TCK_Text::_('CK_CATEGORY') ?></label>
<select id="ckselectfontcategory" onchange="ckFilterFontCategory()">
<option value=""><?php echo TCK_Text::_('CK_ALL') ?></option>
<option value="sans-serif">sans-serif</option>
<option value="serif">serif</option>
<option value="handwriting">handwriting</option>
<option value="display">display</option>
<option value="monospace">monospace</option>
</select></p>
*/ ?>
<p>
<label for=""><?php echo TCK_Text::_('CK_USE_LOCAL_GFONTS') ?></label>
<select id="ckuselocalgfonts" name="ckuselocalgfonts">
<option value="1"><?php echo TCK_Text::_('CK_YES') ?></option>
<option value="0"><?php echo TCK_Text::_('CK_NO') ?></option>
</select>
<p><?php echo TCK_Text::_('CK_USE_LOCAL_GFONTS_DESC') ?></p>
</p>
<div id="ckgooglefontslist" class="ckfontslist"></div>
</div>
<div id="ckgooglefontdetails"></div>
<div id="ckgooglefontpanel">
<div id="ckgooglefontpanel-list"></div>
<div id="ckgooglefontpanel-toolbar">
<div class="ckbutton ckbutton-primary" onclick="ckSaveFonts()"><i class="fa fa-save"></i> <?php echo TCK_Text::_('CK_SAVE') ?></div>
<div class="ckbutton" onclick="ckExitFonts()"><?php echo TCK_Text::_('CK_EXIT') ?></div>
</div>
</div>
</div>
<script>
var TEMPLATECREATORCK_ADMIN_URL = '<?php echo TEMPLATECREATORCK_ADMIN_URL ?>';
var CKTOKEN = '<?php echo TemplateckHelper::getToken() ?>=1';
function ckgetFontsLibrary(targetId) {
var setVar = 'google';
jQuery('#' + targetId).addClass('ckwait');
var debug = false;
// sessionStorage.setItem('fonts_library_' + setVar,'');
if (!debug && window.sessionStorage && sessionStorage.getItem('fonts_library_' + setVar)) {
var html = sessionStorage.getItem('fonts_library_' + setVar);
jQuery('#' + targetId).empty().append(html);
jQuery('#' + targetId).removeClass('ckwait');
ckScrollFonts();
// load the data
ckLoadFontsDataFromInterface();
} else {
// var url = 'https://media.joomlack.fr/api/fonts/list/google';
var url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyA1U444P79sRH3hB2nOTHmiDjL_URoLsWU';
jQuery.ajax({
url: url,
dataType: 'jsonp',
cache: true,
jsonpCallback: "joomlack_jsonpcallback",
timeout: 20000,
success: function (response) {
jQuery('#' + targetId).removeClass('ckwait');
var html = '';
var items = response.items;
for (var i=0;i<items.length;i++) {
html += ckFontItemDisplay(items[i]);
}
html = '<p class="ckfontslistnumber">' + i + ' fonts found</p>' + html;
jQuery('#' + targetId).empty().append(html);
sessionStorage.setItem('fonts_library_' + setVar, html);
ckScrollFonts();
// load the data
ckLoadFontsDataFromInterface();
},
fail: function() {
alert('Error : Unable to connect to the library. Please contact an administrator');
},
complete: function() {
},
error: function(request, status, error) {
}
});
}
}
// immediately load the library in the page
ckgetFontsLibrary('ckgooglefontslist');
function ckFontItemDisplay(item) {
var name = item.family;
var styles = item.variants;
// var subsets = item.subsets;
var category = item.category;
var html = '';
html += '<div class="ckfontitem" onclick="ckShowFontDetails(this)" loading="lazy" data-font="' + name + '" data-name="' + name.toLowerCase() + '" data-category="' + category + '">'
+ '<div class="ckfontitem-json">' + JSON.stringify(item) + '</div>'
+ '<div class="ckfontitem-name">' + name + '</div>'
+ '<div class="ckfontitem-styles"><span class="ckfontitem-styles-count">' + styles.length + '</span> <?php echo TCK_Text::_('CK_STYLES') ?></div>'
+ '<div class="ckfontitem-state"></div>'
+ '<div class="ckfontitem-demo">Almost before we knew it, we had left the ground.</div>'
+ '</div>';
return html;
}
function ckScrollFonts() {
var limit = jQuery(window).scrollTop() + jQuery(window).height();
var items = jQuery('.ckfontitem:not([data-loaded="1"])');
items.each(function(i) {
var $item = jQuery(this);
if ($item.offset().top < limit && document.getElementById('ckgooglefontslist').style.display !== 'none') {
ckLoadGoogleFontForPreview($item);
} else {
return false;
}
});
}
function ckLoadGoogleFontForPreview($item) {
var name = $item.attr('data-font');
var fontfamily = name.replace(/\+/g, ' ');
jQuery(document.head).append('<link href="https://fonts.googleapis.com/css2?family=' + name + '" rel="stylesheet">')
$item.attr('data-loaded', '1');
$item.find('.ckfontitem-demo').css('font-family', fontfamily).css('color', '#333');
$item.find('.ckfontitem-state').attr('data-state', '1');
}
function ckFilterFontCategory() {
var cat = jQuery('#ckselectfontcategory').val();
if (! cat) {
jQuery('.ckfontitem').show();
return;
} else {
jQuery('.ckfontitem').hide();
jQuery('.ckfontitem[data-category="' + cat + '"]').show();
}
}
function ckSearchFontCategory() {
var search = jQuery('#cksearchfontcategory').val().trim().toLowerCase();
if (! search) {
jQuery('.ckfontitem').show();
return;
} else {
jQuery('.ckfontitem').hide();
var items = jQuery('.ckfontitem[data-name*="' + search + '"]');
items.show();
items.each(function(i) {
var $item = jQuery(this);
ckLoadGoogleFontForPreview($item);
});
}
}
function ckShowFontDetails(item) {
var $item = jQuery(item);
var settings = $item.find('.ckfontitem-json').html();
var settingsObj = JSON.parse(settings);
jQuery('#ckgooglefontslist').hide();
jQuery('#fontslistcontainer').hide();
var details = ckFontDetailsDisplay(settingsObj);
jQuery('#ckgooglefontdetails').empty().show().append(details).append('<div class="ckfontitem-json">' + settings + '</div>');
ckAddEventOnButtons();
ckCheckSelectedFonts();
}
function ckFontDetailsDisplay(item) {
var name = item.family;
var category = item.category;
var subsets = item.subsets;
var variants = item.variants;
var text = 'Almost before we knew it, we had left the ground.';
var html = '';
html += '<div class="ckfontitem-details" data-font="' + name + '" data-name="' + name.toLowerCase() + '" data-category="' + category + '">'
+ '<div class="ckfontitem-details-close ckbutton" onclick="ckBackTofontsList()"><span class="fa fa-chevron-left"></span> <?php echo TCK_Text::_('CK_BACK') ?></div>'
+ '<div class="ckfontitem-name">' + name + '</div>'
+ '<div class="ckfontitem-details-styles"><?php echo TCK_Text::_('CK_STYLES') ?></div>'
for (var i = 0; i < variants.length; i++) {
var variant = variants[i]; // can be 'regular', '500italic'
var fontweight = variant.replace('italic', '');
var fontstyle = '';
if (variant.indexOf('italic') > -1) fontstyle = 'italic';
if (fontweight == 'regular') fontweight = '400';
if (fontweight == '') fontweight = '400';
var variantdetail = (fontweight == variant) ? variant : variant + ' ' + fontweight;
var style = 'style="font-family:' + name + ';' + (fontstyle ? 'font-style:' + fontstyle : '') + ';font-weight:' + fontweight + ';"'
html += '<div class="ckfontitem-variant-line" data-variant="'+ variant + '" data-weight="'+ fontweight + '" data-style="'+ fontstyle + '" data-file="' + item.files[variant] + '">'
+ '<div class="ckfontitem-variant-detail"> ' + variantdetail + '</div>'
+ '<div class="ckfontitem-variant-checkbox-button">'
+ '<input type="checkbox" name="ckfontitem-variant-checkbox" id="ckfontitem-variant-checkbox-' + i + '" />&nbsp;'
+ '<label class="ckfontitem-variant-checkbox-label" for="ckfontitem-variant-checkbox-' + i + '"><?php echo TCK_Text::_('CK_USE_THIS_STYLE') ?></label>'
+ '</div>'
+ '<div class="ckfontitem-variant" ' + style + '>' + text + '</div>'
+ '</div>'
}
html += '</div>';
return html;
}
function ckBackTofontsList() {
jQuery('#ckgooglefontdetails').hide();
jQuery('#ckgooglefontslist').show();
jQuery('#fontslistcontainer').show();
}
function ckDownloadGFontFiles() {
var fontitems = jQuery('#ckgooglefontpanel .ckfontlistitem');
var f = 0;
fontitems.each(function() {
f++;
var fontitem = jQuery(this);
var v = 0;
var variants = fontitem.find('.ckfontlistitem-variant');
var fontvarsregular = new Array();
var fontvarsitalic = new Array();
variants.each(function() {
v++;
var listitem = jQuery(this);
var url = jQuery(this).attr('data-file');
var variantWeight = jQuery(this).attr('data-weight') ? jQuery(this).attr('data-weight') : '400';
var variantStyle = jQuery(this).attr('data-style');
if (variantStyle === 'italic') {
fontvarsitalic.push('1' + ',' + variantWeight);
} else {
fontvarsregular.push('0' + ',' + variantWeight);
}
});
fontvarsregular.sort();
fontvarsitalic.sort();
fontvarsregular = fontvarsregular.join(';');
fontvarsitalic = fontvarsitalic.join(';');
var fontvars = fontvarsregular + (fontvarsitalic ? ';' + fontvarsitalic : '');
// create the font css url
var fontname = fontitem.attr('data-font');
// console.log(fontname);
fontname = fontname.replace(/ /g, '+');
var fonturl = 'https://fonts.googleapis.com/css2?family=' + fontname + ':ital,wght@' + fontvars + '&display=swap';
//https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@1,600&display=swap
// 0 = regular
// 1 = italic
// 600 = font weight
// load the stylesheet in the page
window.parent.ckAddGooglefontStylesheet(fontname, fonturl);
if (document.getElementById('ckuselocalgfonts').value == '1') {
var myurl = TEMPLATECREATORCK_ADMIN_URL + "&task=interface.load&layout=loadgfontcss&" + CKTOKEN;
// var url = 'https://media.joomlack.fr/api/fonts/list/google';
jQuery.ajax({
type: "POST",
async: "false",
url: myurl,
data: {
'url' : fonturl,
'fontname' : fontname
}
}).done(function(code) {
var result = JSON.parse(code);
if (result.status === '0') {
alert(result.msg);
}
fontitem.find('.ckfontlistitem-title').append('<span class="ckbadge ckbadge-success ckfontlistitem-filesize">' + parseInt(parseInt(result.filesize) / 1000) + ' kb</span>');
fontitem.attr('data-cssurl', result.file);
f--;
if (f === 0) {
ckAfterFontsDownloaded();
}
}).fail(function(code) {
alert(TCK.Text._('CK_FAILED', 'Failed'));
});
} else {
ckAfterFontsDownloaded();
}
});
}
function ckAddEventOnButtons() {
jQuery('[name="ckfontitem-variant-checkbox"]').on('change', function() {
var variant = jQuery(jQuery(this).parents('.ckfontitem-variant-line')[0]);
var font = jQuery('#ckgooglefontdetails');
var fontName = font.find('.ckfontitem-name')[0].innerHTML;
var variantName = variant.attr('data-variant');
var fontWeight = variant.attr('data-weight');
var fontStyle = variant.attr('data-style');
var fontFile = variant.attr('data-file');
if (this.checked) {
ckAddStyleInPanel(fontName, variantName, fontWeight, fontStyle, fontFile);
} else {
ckRemoveStyleInPanel(fontName, variantName, fontWeight, fontStyle);
}
});
}
function ckAddStyleInPanel(fontName, variantName, fontWeight, fontStyle, fontFile) {
if (! jQuery('#ckgooglefontpanel-list .ckfontlistitem[data-font="' + fontName + '"]').length) {
jQuery('#ckgooglefontpanel-list').append(
'<div class="ckfontlistitem" data-font="' + fontName + '">'
+ '<h3 class="ckfontlistitem-title"><a href="javascript:void(0)" onclick="ckShowFontDetailsFromPanel(\'' + fontName + '\')">' + fontName + '</a></h3>'
+ '<div class="ckfontlistitem-variants"></div>'
+ '</div>');
}
var listitem = jQuery('#ckgooglefontpanel-list .ckfontlistitem[data-font="' + fontName + '"]');
// var fontitem = jQuery('#ckgooglefontdetails .ckfontitem-details[data-font="' + fontName + '"] .ckfontitem-variant-line[data-variant="' + variantName + '"]');
// console.log(fontitem.attr('data-file'));
if (! listitem.find('.ckfontlistitem-variant[data-variant="' + variantName + '"]').length) {
listitem.find('.ckfontlistitem-variants').append('<div class="ckfontlistitem-variant" data-font="' + fontName + '" data-variant="' + variantName + '" data-weight="' + fontWeight + '" data-style="' + fontStyle + '" data-file="' + fontFile + '">'
+ '<span>' + fontWeight + ' ' + fontStyle + '</span>'
+ '<div class="ckfontlistitem-variant-button-remove" onclick="ckRemoveStyleFromPanel(this)"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM168 232C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H168z"/></svg></div>'
+ '</div>');
}
}
function ckRemoveStyleInPanel(fontName, variantName, fontWeight, fontStyle) {
var confirmed = window.parent.ckRemoveGoogleFont(fontName);
if (! confirmed) return;
var listitem = jQuery('#ckgooglefontpanel .ckfontlistitem[data-font="' + fontName + '"]');
if (listitem.find('.ckfontlistitem-variant').length > 1) {
listitem.find('.ckfontlistitem-variant[data-variant="' + variantName + '"]').remove();
} else {
listitem.remove();
}
jQuery('#ckgooglefontdetails .ckfontitem-details[data-font="' + fontName + '"] .ckfontitem-variant-line[data-variant="' + variantName + '"] input[type="checkbox"]').prop('checked', '');
ckSaveFonts();
}
function ckRemoveStyleFromPanel(btn) {
var variant = jQuery(jQuery(btn).parents('.ckfontlistitem-variant')[0]);
var fontName = variant.attr('data-font');
var variantName = variant.attr('data-variant');
ckRemoveStyleInPanel(fontName, variantName);
}
function ckShowFontDetailsFromPanel(fontName) {
var $item = jQuery('#ckgooglefontslist .ckfontitem[data-name="' + fontName.toLowerCase() + '"]');
$item.trigger('click');
ckLoadGoogleFontForPreview($item);
}
function ckCheckSelectedFonts() {
var fontName = jQuery('#ckgooglefontdetails .ckfontitem-details').attr('data-font');
var listitem = jQuery('#ckgooglefontpanel .ckfontlistitem[data-font="' + fontName + '"]');
var variants = listitem.find('.ckfontlistitem-variant');
variants.each(function() {
var variant = jQuery(this).attr('data-variant');
jQuery('#ckgooglefontdetails .ckfontitem-details .ckfontitem-variant-line[data-variant="' + variant + '"]').find('input[name="ckfontitem-variant-checkbox"]').prop('checked', 'checked');
});
}
function ckSaveFonts() {
ckAddSpinnerIcon(jQuery('#ckgooglefontpanel-toolbar .ckbutton-primary'));
jQuery('.ckfontlistitem-filesize').remove();
jQuery('#ckgooglefontpanel-info').remove();
ckDownloadGFontFiles();
}
function ckAddSpinnerIcon(btn) {
if (! btn.attr('data-class')) var icon = btn.find('.fa').attr('class');
btn.attr('data-class', icon).find('.fa').attr('class', 'fa fa-spinner fa-pulse').css('opacity', '1');
}
function ckRemoveSpinnerIcon(btn) {
btn.find('.fa').attr('class', btn.attr('data-class'));
}
function ckExitFonts() {
window.parent.CKBox.close();
}
function ckAfterFontsDownloaded() {
var filesizes = jQuery('.ckfontlistitem-filesize');
var totalfilesize = 0;
filesizes.each(function() {
totalfilesize += parseInt(jQuery(this).text())
});
jQuery('#ckgooglefontpanel-info').remove();
jQuery('#ckgooglefontpanel').append('<div id="ckgooglefontpanel-info"><?php echo TCK_Text::_('CK_TOTAL_FILE_SIZE', true) ?> : ' + totalfilesize + ' kb' + '</div>');
var bodyfontsprops = window.parent.ckGetPropsForBloc('body', 'googlefonts');
var listitems = jQuery('#ckgooglefontpanel .ckfontlistitem');
var fontslist = new Array();
var cssurllist = new Array();
var variantslist = new Array();
listitems.each(function() {
fontslist.push(jQuery(this).attr('data-font').replace(/ /g, '+'));
cssurllist.push(jQuery(this).attr('data-cssurl'));
var variants = new Array();
jQuery(this).find('.ckfontlistitem-variant').each(function() {
variants.push(jQuery(this).attr('data-weight') + '||' + jQuery(this).attr('data-style'));
});
variantslist.push(jQuery(this).attr('data-font') + '@' + variants.join(';'));
});
fontslist = fontslist.join(',');
cssurllist = cssurllist.join(',');
variantslist = variantslist.join(',');
bodyfontsprops.attr('fontslist', fontslist);
bodyfontsprops.attr('cssurllist', cssurllist);
bodyfontsprops.attr('variantslist', variantslist);
bodyfontsprops.attr('uselocal', document.getElementById('ckuselocalgfonts').value);
window.parent.ckAddGoogleFontsToList();
ckRemoveSpinnerIcon(jQuery('#ckgooglefontpanel-toolbar .ckbutton-primary'));
}
jQuery(window).scroll(function() {
ckScrollFonts();
});
jQuery(document.body).scroll(function() {
ckScrollFonts();
});
function ckLoadFontsDataFromInterface() {
var bodyfontsprops = window.parent.ckGetPropsForBloc('body', 'googlefonts');
if (! bodyfontsprops.length) return;
var fontslist = bodyfontsprops.attr('fontslist');
var variantslist = bodyfontsprops.attr('variantslist');
var uselocal = bodyfontsprops.attr('uselocal');
if (uselocal == '1') {
document.getElementById('ckuselocalgfonts').value = '1';
} else {
document.getElementById('ckuselocalgfonts').value = '0';
}
if (fontslist) {
if (variantslist) {
var list = variantslist.split(',');
} else { // for old method, B/C
var list = fontslist.split(','); //Alegreya+Sans:ital,wght@1,100
// var list = fontName + ':ital,wght@0,400'; //Alegreya+Sans:ital,wght@1,100
for (var i=0; i < list.length; i++) {
// console.log('list');
// console.log(list[i]);
list[i] = list[i] + '@400';
// list[i] = list[i] + '@0,400';
}
}
for (var i=0; i < list.length; i++) {
var row = list[i]; // ABeeZee@regular;italic
var splitted = row.split('@');
var fontName = splitted[0]; // ABeeZee
var $item = jQuery('.ckfontitem[data-font="' + fontName + '"]');
var settings = $item.find('.ckfontitem-json').html();
var settingsObj = JSON.parse(settings);
var variants = splitted[1].split(';'); // regular;italic
for (var j=0; j < variants.length; j++) {
var variantName = variants[j].replace('||', ''); // regular
var fontWeight = variantName.replace('italic', '');
var fontStyle = '';
if (variantName.indexOf('italic') > -1) fontStyle = 'italic';
if (fontWeight == 'regular') fontWeight = '400';
if (variantName == '400') variantName = 'regular';
if (variantName == '400italic') variantName = 'italic';
var fontFile = settingsObj.files[variantName];
ckAddStyleInPanel(fontName, variantName, fontWeight, fontStyle, fontFile);
}
}
}
}
</script>
<style>
html {
overflow-y: hidden;
}
body {
background: #fff;
overflow-y: scroll;
max-height: 100%;
}
* {
box-sizing: border-box;
}
#fontpreview {
font-size: 28px;
display: block;
line-height: 1.5em;
padding: 20px 0;
}
label {
display: inline-block !important;
min-width: 200px;
}
.fa-spinner {
opacity: 0;
}
.ckfontslist * {
box-sizing: border-box;
}
.ckfontslistnumber {
flex: 1 1 100%;
}
.ckfontitem {
flex: 1 1 auto;
min-width: 250px;
width: 350px;
cursor: pointer;
border: 1px solid #ddd;
border-radius: 5px;
padding: 15px;
color: #333;
font-size: 13px;
margin: 15px;
position: relative;
}
.ckfontitem:hover {
box-shadow: #ccc 0 0 15px;
}
.ckfontslist {
display: flex;
flex-wrap: wrap;
}
body {
width: calc(100% - 300px);
}
.ckfontitem-name {
font-size: 14px;
color: #444;
}
.ckfontitem-demo {
font-size: 40px;
text-align: left;
line-height: 1;
margin: 10px 0;
color: #fff;
}
.ckfontitem-json {
display: none;
}
.ckfontitem-styles {
position: absolute;
right: 50px;
top: 15px;
color: #999;
}
.ckfontitem-state {
position: absolute;
right: 15px;
top: 15px;
width: 10px;
height: 10px;
/*background: #ddd;*/
border-radius: 50%;
}
.ckfontitem-state[data-state="1"] {
/*background: green;*/
}
.ckfontitem-variant {
font-size: 60px;
line-height: 1;
white-space: nowrap;
overflow: hidden;
padding: 15px;
margin: 10px 0;
border: 1px solid #ddd;
overflow: auto;
border-radius: 5px;
}
.ckfontitem-variant-detail {
display: inline-block;
}
input[name="ckfontitem-variant-checkbox"]:checked ~ .ckfontitem-variant {
border-color: rgba(82,168,236,0.8);
}
input[name="ckfontitem-variant-checkbox"]:checked + label {
color: rgba(82,168,236,1);
border-color: rgba(82,168,236,1);
}
.ckfontitem-details .ckfontitem-name {
font-size: 36px;
line-height: 1;
margin: 20px;
}
.ckfontitem-details-styles {
color: #aaa;
font-size: 20px;
line-height: 1;
margin: 5px 0 20px;;
}
#ckgooglefontpanel {
position: fixed;
top: 0;
bottom: 0;
right: 0;
width: 300px;
background: #fff;
box-shadow: rgba(0,0,0,0.5) 0 0 10px;
z-index: 1111;
padding-bottom: 80px;
}
label.ckfontitem-variant-checkbox-label {
margin: 0;
color: #666;
font-size: 16px;
background: #fff;
border: #ddd 1px solid;
padding: 5px 20px 5px 30px;
display: inline-block;
min-width: 0;
width: auto;
border-radius: 3px;
}
label.ckfontitem-variant-checkbox-label:hover {
background: #eee;
border: #eee 1px solid;
}
.ckfontitem-variant-checkbox-button {
display: inline-block;
margin: 0 20px;
position: relative;
}
input[name="ckfontitem-variant-checkbox"] {
position: absolute;
margin: 10px;
}
.ckfontlistitem-variant-button-remove svg {
width: 16px;
height: 16px;
line-height: 0;
fill: #fff;
background: #333;
border-radius: 50%;
border: 1px solid #333;
box-sizing: border-box;
}
.ckfontlistitem-variant-button-remove {
display: inline-block;
margin-left: auto;
border-radius: 50%;
height: 16px;
width: 16px;
box-sizing: content-box;
border: 5px solid transparent;
cursor: pointer;
}
.ckfontlistitem-variant-button-remove:hover {
border: 5px solid rgba(82,168,236,0.2);
}
.ckfontlistitem {
margin: 10px;
border: 1px solid #ddd;
border-radius: 4px;
padding: 10px;
}
.ckfontlistitem-title {
color: #1a73e8;
}
.ckfontlistitem-variant {
font-size: 14px;
display: flex;
}
div#ckgooglefontpanel-toolbar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: #eee;
padding: 20px;
height: 80px;
box-sizing: border-box;
}
#ckgooglefontpanel-toolbar {
text-align: center;
}
#ckgooglefontpanel-toolbar .ckbutton {
padding: 7px 20px;
border-radius: 4px;
}
#ckgooglefontpanel .ckfontlistitem-filesize {
height: 18px;
margin-top: 3px;
float: right;
}
#ckgooglefontpanel-info {
margin: 10px;
padding: 10px;
background: #eee;
color: #666;
border-radius: 4px;
}
#ckgooglefontpanel-list {
height: calc(100% - 80px);
overflow: auto;
}
</style>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,24 @@
<?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;
use Pagebuilderck\CKView;
class PagebuilderckFontselect extends CKView {
/**
* view display method
* @return void
* */
function display($tpl = null) {
parent::display($tpl);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,94 @@
<?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
*/
defined('_JEXEC') or die;
use Pagebuilderck\CKFof;
?>
<style>
.container {
color: #333;
}
.fontawesome-icon-list {
display: flex;
flex-wrap: wrap;
}
.fontawesome-icon-list a {
color: #000;
}
div.fa-hover {
float: left;
height: 30px;
margin: 10px;
padding: 10px;
width: 14%;
text-align: center;
}
div.fa-hover:hover a {
transform: scale(2);
background: #fff;
z-index: 1;
display: block;
}
div.fa-hover a {
text-decoration: none;
}
</style>
<?php
PagebuilderckHelper::loadInlineCKFramework();
// get global component params
$pagebuilderckParams = JComponentHelper::getParams('com_pagebuilderck');
?>
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckframework.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/pagebuilderck.css?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/css" />
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jqueryck.min.js" type="text/javascript"></script>
<div id="maincktabcontent" class="ckinterface">
<div class="mainmenulink menulink current" tab="tab_svgicons"><h3><?php echo JText::_('CK_SVG_ICONS'); ?></h3></div>
<div class="mainmenulink menulink" tab="tab_customsvg"><h3><?php echo JText::_('CK_CUSTOM_SVG'); ?></h3></div>
<?php if ($pagebuilderckParams->get('fontawesome4legacy', '0', 'int') === 1) { ?>
<div class="mainmenulink menulink " tab="tab_fontawesome"><h3><?php echo JText::_('CK_FONTAWESOME'); ?></h3></div>
<?php } ?>
<div class="clr"></div>
<div class="maintab current" id="tab_svgicons">
<?php include PAGEBUILDERCK_PATH . '/views/icons/tmpl/svg.php'; ?>
</div>
<div class="maintab" id="tab_customsvg">
<textarea id="ckcustomsvgcode" style="width:100%;min-height:200px;"></textarea>
<a class="ckbuttonstyle" href="javascript:void(0);" onclick="window.parent.ckApplyCustomSvg($ck('#ckcustomsvgcode').val())"><?php echo JText::_('CK_APPLY'); ?></a>
</div>
<?php if ($pagebuilderckParams->get('fontawesome4legacy', '0', 'int') === 1) { ?>
<div class="maintab " id="tab_fontawesome">
<?php include PAGEBUILDERCK_PATH . '/views/icons/tmpl/fontawesome4.php'; ?>
</div>
<?php } ?>
</div>
<script>
var $ck = window.$ck || jQuery.noConflict();
$ck('#maincktabcontent div.maintab:not(.current)').hide();
$ck('.mainmenulink', $ck('#maincktabcontent')).each(function(i, tab) {
$ck(tab).click(function() {
$ck('#maincktabcontent div.maintab').hide();
$ck('.mainmenulink', $ck('#maincktabcontent')).removeClass('current');
if ($ck('#' + $ck(tab).attr('tab')).length)
$ck('#' + $ck(tab).attr('tab')).show();
$ck(this).addClass('current');
});
});
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,220 @@
<?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
*/
defined('_JEXEC') or die;
?>
<div id="svgicon-search">
<label for="svgicon-filter-by"></label>
<div style="position: relative; height: 46px; display: block;">
<input type="text" tabindex="1" class="" id="svgicon-filter-by" placeholder="<?php echo JText::_('CK_SEARCH') ?>" style="margin:3px;">
<span class="ckbutton-group">
<button class="ckbutton" id="svgicon-filter-submit" onclick="ckSearchSvgIcon()"><i class="ck-icon-search"></i></button>
<button class="ckbutton" id="svgicon-filter-clear" onclick="ckClearSearchSvgIcon()"><i class="ck-icon-cancel"></i></button>
</span>
</div>
</div>
<button class="ckbutton ckbuttonlink" data-target="ckheroiconsoutline" data-set="heroicons/outline"><?php echo JText::_('Heroicons - Outline'); ?></button>
<button class="ckbutton ckbuttonlink" data-target="ckherosolidiconslist" data-set="heroicons/solid"><?php echo JText::_('Heroicons - Solid'); ?></button>
<button class="ckbutton ckbuttonlink" data-target="cktablericonslist" data-set="tabler"><?php echo JText::_('Tabler icons'); ?></button>
<button class="ckbutton ckbuttonlink" data-target="ckioniconsnormaliconslist" data-set="ionicons/normal"><?php echo JText::_('Ionicons icons - Normal'); ?></button>
<button class="ckbutton ckbuttonlink" data-target="ckioniconsoutlineiconslist" data-set="ionicons/outline"><?php echo JText::_('Ionicons icons - Outline'); ?></button>
<button class="ckbutton ckbuttonlink" data-target="ckioniconssharpiconslist" data-set="ionicons/sharp"><?php echo JText::_('Ionicons icons - Sharp'); ?></button>
<button class="ckbutton ckbuttonlink" data-target="ckfontawesomebrandsiconslist" data-set="fontawesome/brands"><?php echo JText::_('Fontawesome icons - Brands'); ?></button>
<button class="ckbutton ckbuttonlink" data-target="ckfontawesomeregulariconslist" data-set="fontawesome/regular"><?php echo JText::_('Fontawesome icons - Regular'); ?></button>
<button class="ckbutton ckbuttonlink" data-target="ckfontawesomesolidiconslist" data-set="fontawesome/solid"><?php echo JText::_('Fontawesome icons - Solid'); ?></button>
<div class="ckuttontab" data-tab="ckheroiconsoutline">
<a href="https://heroicons.com" target="_blank">Heroicons website</a>
</div>
<div class="ckuttontab" data-tab="ckherosolidiconslist">
<a href="https://heroicons.com" target="_blank">Heroicons website</a>
</div>
<div class="ckuttontab" data-tab="cktablericonslist">
<a href="https://tablericons.com" target="_blank">Tabler icons website</a>
</div>
<div class="ckuttontab" data-tab="ckioniconsnormaliconslist">
<a href="https://ionicons.com/" target="_blank">Ionicons website</a>
</div>
<div class="ckuttontab" data-tab="ckioniconsoutlineiconslist">
<a href="https://ionicons.com/" target="_blank">Ionicons website</a>
</div>
<div class="ckuttontab" data-tab="ckioniconssharpiconslist">
<a href="https://ionicons.com/" target="_blank">Ionicons website</a>
</div>
<div class="ckuttontab" data-tab="ckfontawesomebrandsiconslist">
<a href="https://fontawesome.com/" target="_blank">Fontawesome website</a>
</div>
<div class="ckuttontab" data-tab="ckfontawesomeregulariconslist">
<a href="https://fontawesome.com/" target="_blank">Fontawesome website</a>
</div>
<div class="ckuttontab" data-tab="ckfontawesomesolidiconslist">
<a href="https://fontawesome.com/" target="_blank">Fontawesome website</a>
</div>
<div id="ckicons-welcome">
<?php echo JText::_('CK_PLEASE_SELECT_ICON_PACK'); ?>
</div>
<script>
$ck('.ckbuttonlink').on('click', function() {
var target = $ck(this).attr('data-target');
$ck('.ckuttontab').hide();
$ck('.ckbuttonlink').removeClass('active');
$ck('#ckicons-welcome').hide();
var $tab = $ck('.ckuttontab[data-tab="' + target + '"]');
$tab.show();
$ck(this).addClass('active');
if (! $ck('#' + target).length) {
$tab.append('<div id="' + target + '" class="ckiconslist"></div>')
ckgetIconsLibrary(target, $ck(this).attr('data-set'));
}
});
function ckgetIconsLibrary(targetId, set) {
var setVar = set.replace('/', '_');
$ck('#' + targetId).addClass('ckwait');
var debug = false;
sessionStorage.setItem('icons_library_' + setVar,'');
if (!debug && window.sessionStorage && sessionStorage.getItem('icons_library_' + setVar)) {
var html = sessionStorage.getItem('icons_library_' + setVar);
$ck('#' + targetId).empty().append(html);
$ck('#' + targetId).removeClass('ckwait');
ckAddEventOnIcons();
} else {
var url = 'https://media.joomlack.fr/api/icons/set/' + set;
jQuery.ajax({
url: url,
dataType: 'jsonp',
cache: true,
jsonpCallback: "joomlack_jsonpcallback",
timeout: 20000,
success: function (response) {
$ck('#' + targetId).removeClass('ckwait');
var html = '';
for (var i=0;i<response.length;i++) {
var name = response[i];
html += '<img class="ckiconfile" loading="lazy" title="' + name + '" data-set="' + set + '" data-name="' + name + '" src="https://media.joomlack.fr/icons/' + set + '/' + name + '" />';
}
html = '<p class="ckiconslistnumber">' + i + ' icons found</p>' + html;
$ck('#' + targetId).empty().append(html);
ckAddEventOnIcons();
sessionStorage.setItem('icons_library_' + setVar, html);
},
fail: function() {
alert('Error : Unable to connect to the library. Please contact an administrator');
},
complete: function() {
},
error: function(request, status, error) {
}
});
}
}
$ck('#svgicon-filter-by').keydown(function (e) {
if (e.which == 13) {
$ck("#svgicon-filter-submit").click();
}
});
function ckSearchSvgIcon() {
$ck('.ckiconfile').hide();
$ck('.ckiconfile[data-name*=' + $ck('#svgicon-filter-by').val() + ']').show();
}
function ckClearSearchSvgIcon() {
jQuery('.ckiconfile').show();
jQuery('#svgicon-filter-by').val('');
}
function ckAddEventOnIcons() {
$ck('.ckiconfile').on('click', function() {
ckGetIconSvgCode($ck(this).attr('data-set') + '/' + $ck(this).attr('data-name'));
});
}
function ckGetIconSvgCode(path) {
var regEx = new RegExp('/', "ig");
var setVar = path.replace(regEx, '_');
var debug = true;
if (debug === true) sessionStorage.setItem('icons_library_' + setVar,'');
if (!debug && window.sessionStorage && sessionStorage.getItem('icons_library_' + setVar)) {
var code = sessionStorage.getItem('icons_library_' + setVar);
window.parent.ckSelectSvgIcon(response, setVar);
} else {
var url = 'https://media.joomlack.fr/api/icons/get/' + path;
jQuery.ajax({
url: url,
dataType: 'jsonp',
cache: true,
jsonpCallback: "joomlack_jsonpcallback",
timeout: 20000,
success: function (response) {
window.parent.ckSelectSvgIcon(response, setVar);
sessionStorage.setItem('icons_library_' + setVar, response);
},
fail: function() {
alert('Error : Unable to connect to the library. Please contact an administrator');
},
complete: function() {
},
error: function(request, status, error) {
}
});
}
}
</script>
<style>
.ckiconslistnumber {
flex: 1 1 100%;
}
.ckuttontab {
display: none;
}
.ckiconslist {
display: flex;
flex-wrap: wrap;
}
.ckiconslist img {
width: 30px;
height: 30px;
margin: 10px;
padding: 10px;
cursor: pointer;
}
.ckiconslist img:hover {
transform: scale(1.5);
background: #eee;
}
#ckicons-welcome {
min-height: 50vh;
display: flex;
align-items: center;
justify-content: center;
color: #666;
font-size: 40px;
margin: 10px;
background: #f5f5f5;
border-radius: 5px;
}
.ckbutton.ckbuttonlink {
border-radius: 4px;
font-size: 13px;
}
</style>

View File

@@ -0,0 +1,32 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewIcons extends CKView {
function display($tpl = null) {
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
parent::display($tpl);
exit();
}
}

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,17 @@
<?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
*/
defined('_JEXEC') or die;
$filePath = JPATH_ROOT . '/plugins/system/pagebuilderckparams/includes/library.php';
if (PagebuilderckHelper::getParams() && file_exists($filePath)) {
include_once($filePath);
} else {
echo 'ERROR : you can not access this page. Page Builder CK Params is not installed / enabled.';
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,50 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewLibrary extends CKView {
function display($tpl = null) {
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
$url = 'https://media.joomlack.fr/api/pagebuilderck/pages';
// for local test purpose only
// if ($input->getInt('sandbox' == '1')) {
// $url = 'https://localhost/media.joomlack.fr';
// }
// store the library in the session to avoid to much request to the external server
// $session = JFactory::getSession();
// if (! $this->itemsCats = $session->get('pagebuilderck_library_categories')) {
// try {
// $itemsCats = file_get_contents($url);
// } catch (Exception $e) {
// echo 'ERROR : Unable To connect to the library server. Check your internet connection and retry later. ', $e->getMessage(), "\n";
// exit();
// }
// $this->itemsCats = json_decode($itemsCats);
// $session->set('pagebuilderck_library_categories', $this->itemsCats);
// }
parent::display($tpl);
exit();
}
}

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,116 @@
<?php
/**
* @name Slider CK
* @package com_pagebuilderck
* @copyright Copyright (C) 2016. 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;
if (!defined('PAGEBUILDERCK_MEDIA_URI'))
{
define('PAGEBUILDERCK_MEDIA_URI', JUri::root(true) . '/media/com_pagebuilderck');
}
$imagespath = PAGEBUILDERCK_MEDIA_URI .'/images/';
$input = JFactory::getApplication()->input;
$fieldid = $input->get('fieldid', '', 'string');
JHtml::_('jquery.framework');
$doc = JFactory::getDocument();
$doc->addStylesheet(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.css');
$doc->addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.js');
?>
<h3><?php echo JText::_('CK_MENU_ITEMS') ?></h3>
<p><?php echo JText::_('CK_MENU_ITEMS_DESC') ?></p>
<div class="ckfoldertreelist" style="width:90%">
<?php
// Access filter
$com_path = JPATH_SITE . '/components/com_content/';
JLoader::register('ContentHelperRoute', $com_path . 'helpers/route.php');
$access = !JComponentHelper::getParams('com_content')->get('show_noauth');
$authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id'));
foreach ($this->articles as $item) {
// check if category or article
if ($item->type == 'article') {
$item->slug = $item->id . ':' . $item->alias;
if ($access || in_array($item->access, $authorised))
{
// We know that user has the privilege to view the article
$item->link = ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language);
} else {
continue;
}
} else {
if ($access || in_array($item->access, $authorised))
{
$item->link = ContentHelperRoute::getCategoryRoute($item->id);
} else {
continue;
}
}
?>
<div class="ckfoldertree parent">
<div class="ckfoldertreetoggler" onclick="ckLinksArticlesToggleTreeSub(this, <?php echo $item->id; ?>)" data-id="<?php echo $item->id; ?>"></div>
<div class="ckfoldertreename hasTip" title="<?php echo $item->link ?>" onclick="ckSetLinksArticlesUrl('<?php echo $item->link ?>')"><span class="icon-folder"></span><?php echo PagebuilderckHelper::utf8_encode($item->title); ?></div>
</div>
<?php
}
?>
</div>
<script>
var $ck = window.$ck || jQuery.noConflict();
var URIROOT = window.URIROOT || '<?php echo JUri::root(true) ?>';
var URIBASE = window.URIBASE || '<?php echo JUri::base(true) ?>';
var cktoken = '<?php echo JSession::getFormToken() ?>';
//ckMakeTooltip();
function ckLinksArticlesToggleTreeSub(btn, parentid) {
var item = $ck(btn).parent();
if (item.hasClass('ckopened')) {
item.removeClass('ckopened');
} else {
item.addClass('ckopened');
// load only the items if not already there
if (! item.find('.cksubfolder').length) {
// var parentid = $ck(btn).attr('data-id');
ckLinksArticlesShowItems(btn, parentid);
}
}
}
function ckLinksArticlesShowItems(btn, parentid) {
if ($ck(btn).hasClass('empty')) return;
ckAddWaitIcon(btn);
var item = $ck(btn).parent();
// ajax call to code and return items layout
var myurl = PAGEBUILDERCK.URIPBCK + "&task=links.ajaxShowArticles&" + PAGEBUILDERCK.TOKEN;
$ck.ajax({
type: "POST",
url: myurl,
data: {
// menutype: menutype,
parentid: parentid
}
}).done(function(code) {
if (code.trim().length == 0) {
$ck(btn).css('opacity', 0).addClass('empty');
} else {
item.append(code);
ckInitTooltips();
}
ckRemoveWaitIcon(btn);
}).fail(function() {
alert(Joomla.JText._('CK_FAILED', 'Failed'));
});
}
function ckSetLinksArticlesUrl(url) {
window.parent.document.getElementById('<?php echo $fieldid ?>').value = url;
$ck(window.parent.document.getElementById('<?php echo $fieldid ?>')).trigger('change');
window.parent.CKBox.close('#ckfilesmodal .ckboxmodal-button');
}
</script>

View File

@@ -0,0 +1,86 @@
<?php
// no direct access
defined('_JEXEC') or die;
use Pagebuilderck\CKFof;
if (!defined('PAGEBUILDERCK_MEDIA_URI'))
{
define('PAGEBUILDERCK_MEDIA_URI', JUri::root(true) . '/media/com_pagebuilderck');
}
$imagespath = PAGEBUILDERCK_MEDIA_URI .'/images/';
$input = JFactory::getApplication()->input;
$fieldid = $input->get('fieldid', '', 'string');
$type = $input->get('type', 'all', 'string');
$folder = $this->input->get('folder', '', 'string');
JHtml::_('jquery.framework');
$doc = JFactory::getDocument();
$doc->addStylesheet(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.css');
$doc->addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.js');
?>
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/pagebuilderck.css?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/css" />
<div id="maincktabcontent">
<?php if ($type !== 'image') { ?>
<div class="mainmenulink menulink <?php echo ($type !== 'image' ? 'current' : '') ?>" tab="tab_menus"><h3><?php echo JText::_('CK_MENUS'); ?></h3></div>
<div class="mainmenulink menulink" tab="tab_articles"><h3><?php echo JText::_('CK_ARTICLES'); ?></h3></div>
<?php } ?>
<div class="mainmenulink menulink <?php echo ($type === 'image' ? 'current' : '') ?>" tab="tab_files"><h3><?php echo JText::_('CK_FILES'); ?></h3></div>
<?php if (CKFof::userCan('core.pixabay')) { ?>
<div class="mainmenulink menulink" tab="tab_pixabay"><h3><?php echo JText::_('Pixabay'); ?></h3></div>
<?php } ?>
<div class="clr"></div>
<?php if ($type !== 'image') { ?>
<div class="maintab <?php echo ($type !== 'image' ? 'current' : '') ?>" id="tab_menus">
<?php
require_once PAGEBUILDERCK_PATH . '/views/menus/tmpl/default.php';
?>
</div>
<div class="maintab" id="tab_articles">
<?php
if (PagebuilderckHelper::getParams()) {
include PAGEBUILDERCK_PATH . '/views/links/tmpl/articles.php';
} else {
echo PagebuilderckHelper::showParamsMessage();
}
?>
</div>
<?php } ?>
<div class="maintab <?php echo ($type === 'image' ? 'current' : '') ?>" id="tab_files">
<?php
include PAGEBUILDERCK_PATH . '/views/browse/tmpl/default.php';
?>
<?php /*<iframe style="width:100%;height:100vh;" src="<?php echo JUri::root(true) . '/administrator/index.php?option=com_media&view=media&e_name=' . $fieldid . '&tmpl=component'; ?>"></iframe>*/ ?>
</div>
<?php if (CKFof::userCan('core.pixabay')) { ?>
<div class="maintab" id="tab_pixabay">
<?php
if (PagebuilderckHelper::getParams()) {
include PAGEBUILDERCK_PATH . '/views/pixabay/tmpl/default.php';
} else {
echo PagebuilderckHelper::showParamsMessage();
}
?>
</div>
<?php } ?>
</div>
<script>
var $ck = window.$ck || jQuery.noConflict();
$ck('#maincktabcontent div.maintab:not(.current)').hide();
$ck('.mainmenulink', $ck('#maincktabcontent')).each(function(i, tab) {
$ck(tab).click(function() {
if ($ck('#popup_favoriteck').length) {
ckCloseFavoritePopup(true);
}
$ck('#maincktabcontent div.maintab').hide();
$ck('.mainmenulink', $ck('#maincktabcontent')).removeClass('current');
if ($ck('#' + $ck(tab).attr('tab')).length)
$ck('#' + $ck(tab).attr('tab')).show();
$ck(this).addClass('current');
});
});
</script>

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,46 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
/**
* View class for a list of Maximenuck.
*/
class PagebuilderckViewLinks extends CKView {
protected $items;
protected $articles;
protected $menus;
/**
* Display the view
*/
public function display($tpl = null) {
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
$this->menus = $this->get('Menus');
$this->articles = $this->get('ArticleCategoriesRoot');
$this->items = $this->get('Files');
parent::display($tpl);
}
}

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,93 @@
<?php
/**
* @name Slider CK
* @package com_pagebuilderck
* @copyright Copyright (C) 2016. 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;
if (!defined('PAGEBUILDERCK_MEDIA_URI'))
{
define('PAGEBUILDERCK_MEDIA_URI', JUri::root(true) . '/media/com_pagebuilderck');
}
$imagespath = PAGEBUILDERCK_MEDIA_URI .'/images/';
$input = JFactory::getApplication()->input;
$fieldid = $input->get('fieldid', '', 'string');
JHtml::_('jquery.framework');
$doc = JFactory::getDocument();
$doc->addStylesheet(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.css');
$doc->addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.js');
?>
<h3><?php echo JText::_('CK_MENU_ITEMS') ?></h3>
<p><?php echo JText::_('CK_MENU_ITEMS_DESC') ?></p>
<div id="ckfoldertreelist">
<?php
foreach ($this->menus as $menu) {
?>
<div class="ckfoldertree parent">
<div class="ckfoldertreetoggler" onclick="ckMenusToggleTreeSub(this, 0)" data-menutype="<?php echo $menu->menutype; ?>"></div>
<div class="ckfoldertreename"><span class="icon-folder"></span><?php echo PagebuilderckHelper::utf8_encode($menu->title); ?></div>
</div>
<?php
}
?>
</div>
<script>
var $ck = window.$ck || jQuery.noConflict();
var URIROOT = window.URIROOT || '<?php echo JUri::root(true) ?>';
var URIBASE = window.URIBASE || '<?php echo JUri::base(true) ?>';
var cktoken = '<?php echo JSession::getFormToken() ?>';
//ckMakeTooltip();
function ckMenusToggleTreeSub(btn, parentid) {
var item = $ck(btn).parent();
if (item.hasClass('ckopened')) {
item.removeClass('ckopened');
} else {
item.addClass('ckopened');
// load only the items if not already there
if (! item.find('.cksubfolder').length) {
var menutype = $ck(btn).attr('data-menutype');
ckMenusShowItems(btn, menutype, parentid);
}
}
}
function ckMenusShowItems(btn, menutype, parentid) {
if ($ck(btn).hasClass('empty')) return;
ckAddWaitIcon(btn);
var item = $ck(btn).parent();
// ajax call to code and return items layout
var myurl = URIBASE + "/index.php?option=com_pagebuilderck&task=ajaxShowMenuItems&" + cktoken + "=1";
$ck.ajax({
type: "POST",
url: myurl,
data: {
menutype: menutype,
parentid: parentid
}
}).done(function(code) {
if (code.trim().length == 0) {
$ck(btn).css('opacity', 0).addClass('empty');
} else {
item.append(code);
ckInitTooltips();
}
ckRemoveWaitIcon(btn);
}).fail(function() {
alert(Joomla.JText._('CK_FAILED', 'Failed'));
});
}
function ckSetMenuItemUrl(url) {
window.parent.document.getElementById('<?php echo $fieldid ?>').value = url;
$ck(window.parent.document.getElementById('<?php echo $fieldid ?>')).trigger('change');
window.parent.CKBox.close('#ckfilesmodal .ckboxmodal-button');
}
</script>

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,44 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
/**
* View class for a list of Maximenuck.
*/
class PagebuilderckViewMenus extends CKView {
/**
* Display the view
*/
public function display($tpl = null) {
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
// Check for errors.
if (! empty($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->menus = $this->get('Menus');
$this->items = $this->get('Items');
parent::display($tpl);
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,94 @@
<?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
*/
defined('_JEXEC') or die;
PagebuilderckHelper::loadInlinejQueryck();
PagebuilderckHelper::loadInlineCKFramework();
?>
<style>
.container {
color: #333;
}
</style>
<div class="ckinterface">
<h3><?php echo JText::_('CK_MODULE') ?></h3>
<div id="search-title" class="filter-parent" style="margin: 10px;">
<div style="position: relative; height: 46px; display: inline-block;" class="">
<span class="ckbutton-group"><input type="text" tabindex="1" class="" id="filter-by-title" placeholder="Search by title" onchange="searchby('title')" style="height:auto;margin:0;background-color: transparent; position: relative;">
<button class="ckbutton fa fa-search" id="filter-by-title-submit" onclick="searchby('title')"></button>
<button class="ckbutton fa fa-times" id="filter-by-title-clear" onclick="clearsearch('title')"></button>
</span>
</div>
<div style="position: relative; height: 46px; display: inline-block;" class="">
<input type="text" tabindex="1" class="" id="filter-by-module" placeholder="Search by type" onchange="searchby('module')" style="height:auto;margin:0;background-color: transparent; position: relative;">
<span class="ckbutton-group">
<button class="ckbutton fa fa-search" id="filter-by-module-submit" onclick="searchby('module')"></button>
<button class="ckbutton fa fa-times" id="filter-by-module-clear" onclick="clearsearch('module')"></button>
</span>
</div>
<div style="position: relative; height: 46px; display: inline-block;" class="">
<input type="text" tabindex="1" class="" id="filter-by-position" placeholder="Search by position" onchange="searchby('position')" style="height:auto;margin:0;background-color: transparent; position: relative;">
<span class="ckbutton-group">
<button class="ckbutton fa fa-search" id="filter-by-position-submit" onclick="searchby('position')"></button>
<button class="ckbutton fa fa-times" id="filter-by-position-clear" onclick="clearsearch('position')"></button>
</span>
</div>
</div>
<script>
function searchby(type) {
var val = jQuery('#filter-by-'+type).val().toLowerCase();
if (val == '') return;
jQuery('.modulerow:not([data-'+type+'*="' + val + '"])').addClass('filteredck').hide();
if (jQuery('.filteredck').length) {
jQuery('.modulerow[data-'+type+'*="' + val + '"]:not(.filteredck)').show();
} else {
jQuery('.modulerow[data-'+type+'*="' + val + '"]').addClass('filteredck').show();
}
}
function clearsearch(type) {
jQuery('.modulerow').removeClass('filteredck').show();
jQuery('#filter-by-' + type).val('');
if (jQuery('#filter-by-title').val()) searchby('title');
if (jQuery('#filter-by-module').val()) searchby('module');
if (jQuery('#filter-by-position').val()) searchby('position');
}
jQuery(document).ready(function() {
jQuery('.modulerow').click(function(e) {
e.preventDefault();
window.parent.ckSelectModule(jQuery(this).attr('data-id'), jQuery(this).attr('data-title'), jQuery(this).attr('data-module'));
window.parent.CKBox.close();
});
});
</script>
<table class="cktable cktable-striped cktable-hover">
<thead>
<tr>
<th class="" style="width:20px;"><?php echo JText::_('CK_ID') ?></th>
<th class="" style="min-width:200px;text-align:left;"><?php echo JText::_('CK_TITLE') ?></th>
<th class="" style="min-width:200px;"><?php echo JText::_('CK_TYPE') ?></th>
<th class="" style="min-width:200px;"><?php echo JText::_('CK_POSITION') ?></th>
</tr>
</thead>
<?php foreach($this->items as $module) { ?>
<tr class="modulerow" style="cursor:pointer;" data-id="<?php echo strtolower($module->id) ?>" data-title="<?php echo strtolower($module->title) ?>" data-module="<?php echo strtolower($module->module) ?>" data-position="<?php echo strtolower($module->position) ?>">
<td class="" style="width:20px;"><?php echo $module->id ?></td>
<td class="" style="min-width:200px;text-align:left;color:#3071a9;"><?php echo $module->title ?></td>
<td class="" style="min-width:200px;"><?php echo $module->module ?></td>
<td class="" style="min-width:200px;"><?php echo $module->position ?></td>
</tr>
<?php } ?>
<table>
</div>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,34 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewModules extends CKView {
function display($tpl = null) {
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
$this->items = $this->get('Items');
parent::display($tpl);
exit();
}
}

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,117 @@
<?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;
// check the joomla! version
if (version_compare(JVERSION, '3.0.0') > 0) {
$jversion = '3';
} else {
$jversion = '2';
}
$user = JFactory::getUser();
$userId = $user->get('id');
// for ordering
$listOrder = $this->state->get('filter_order', 'a.id');
$listDirn = $this->state->get('filter_order_Dir', 'ASC');
$filter_search = $this->state->get('filter_search', '');
$limitstart = $this->state->get('limitstart', 0);
$limit = $this->state->get('limit', 20);
?>
<div class="ckadminsidebar"><?php echo JHtmlSidebar::render() ?></div>
<div class="ckadminarea">
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=modules'); ?>" method="post" name="adminForm" id="adminForm">
<div id="filter-bar" class="btn-toolbar input-group">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo addslashes($this->state->get('filter_search')); ?>" class="cktip form-control" title="" />
</div>
<div class="input-group-append btn-group pull-left hidden-phone">
<button type="submit" class="btn btn-primary cktip" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_SUBMIT') : ''); ?></button>
<button type="button" class="btn btn-secondary cktip" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value = '';
this.form.submit();"><i class="icon-remove"></i><?php echo ($jversion === '2' ? JText::_('JSEARCH_FILTER_CLEAR') : ''); ?></button>
</div>
<?php if ($jversion === '3') { ?>
<div class="btn-group pull-right hidden-phone ordering-select">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php } ?>
</div>
<div class="clearfix">&nbsp;</div>
<table class="table table-striped" id="templateckList">
<thead>
<tr>
<th width="1%">
<input type="checkbox" name="checkall-toggle" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" value="" onclick="Joomla.checkAll(this)" />
</th>
<th class='left'>
<?php //echo JText::_('COM_PAGEBUILDERCK_TEMPLATES_NAME'); ?>
<?php echo JHtml::_('grid.sort', 'COM_PAGEBUILDERCK_ARTICLES', 'a.name', $listDirn, $listOrder); ?>
</th>
<?php if (isset($this->items[0]->state)) { ?>
<?php } ?>
<?php if (isset($this->items[0]->id)) {
?>
<th width="1%" class="nowrap">
<?php //echo JText::_('JGRID_HEADING_ID'); ?>
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
$canCreate = $user->authorise('core.create', 'com_pagebuilderck');
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$canCheckin = $user->authorise('core.manage', 'com_pagebuilderck');
$canChange = $user->authorise('core.edit.state', 'com_pagebuilderck');
$link = 'index.php?option=com_modules&task=module.edit&id=' . $item->id;
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td>
<a href="<?php echo $link; ?>"><?php echo $item->title; ?></a>
</td>
<?php if (isset($this->items[0]->id)) {
?>
<td class="center">
<?php echo (int) $item->id; ?>
</td>
<?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="state_request" value="1" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
</div>

View File

@@ -0,0 +1 @@
<html><body></body></html>

View File

@@ -0,0 +1,54 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewModules2 extends CKView {
/**
* Display the view
*/
public function display($tpl = null) {
$this->items = $this->get('Items');
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
if (CKFof::isAdmin()) $this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar() {
PagebuilderckHelper::loadCkbox();
// Load the left sidebar only for Joomla 3 and under.
if (! PAGEBUILDERCK_ISJ4) {
PagebuilderckHelper::addSubmenu('modules2');
}
JToolBarHelper::title(JText::_('COM_PAGEBUILDERCK'));
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,82 @@
<?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
*/
defined('_JEXEC') or die;
$input = new JInput();
$id = $input->get('ckid', '', 'string');
$componentParams = JComponentHelper::getParams('com_pagebuilderck');
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/menustyles.php';
$menustyles = new MenuStyles();
?>
<div class="menuck clearfix fixedck">
<div class="inner clearfix">
<div class="headerck">
<span class="headerckicon cktip" title="<?php echo JText::_('CK_SAVE_CLOSE'); ?>" onclick="ckSaveEditionPanel(1);">×</span>
<span class="headerckicon cksave cktip" title="<?php echo JText::_('CK_APPLY'); ?>" onclick="ckSaveEditionPanel();"><span class="fa fa-check"></span></span>
<span class="headerckicon ckclean cktip" data-placement="bottom" title="<?php echo JText::_('CK_CLEAR_STYLES'); ?>" onclick="ckClearStylesFromPanel();"><span class="fa fa-paint-brush"></span></span>
<span class="headercktext"><?php echo JText::_('CK_CSS_EDIT'); ?></span>
</div>
<div class="ckinterface">
<div class="cktoolbarResponsive clearfix ckinterface" style="overflow:visible;background:none;padding:5px;text-align:center;">
<span class="ckbutton-group">
<span id="ckresponsive1button" class="ckbutton ckresponsivebutton cktip" style="width: auto;" onclick="ckSwitchResponsiveSmart(1)" data-range="1" title="<?php echo JText::_('CK_PHONE') ?> / <?php echo JText::_('CK_PORTRAIT') ?>">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M976 1408q0-33-23.5-56.5t-56.5-23.5-56.5 23.5-23.5 56.5 23.5 56.5 56.5 23.5 56.5-23.5 23.5-56.5zm208-160v-704q0-13-9.5-22.5t-22.5-9.5h-512q-13 0-22.5 9.5t-9.5 22.5v704q0 13 9.5 22.5t22.5 9.5h512q13 0 22.5-9.5t9.5-22.5zm-192-848q0-16-16-16h-160q-16 0-16 16t16 16h160q16 0 16-16zm288-16v1024q0 52-38 90t-90 38h-512q-52 0-90-38t-38-90v-1024q0-52 38-90t90-38h512q52 0 90 38t38 90z"/></svg>
</span>
<input id="ckresponsive1value" type="hidden" value="<?php echo $componentParams->get('responsive1value', '320') ?>" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
<span id="ckresponsive2button" class="ckbutton ckresponsivebutton cktip" style="width: auto;" onclick="ckSwitchResponsiveSmart(2)" data-range="2" title="<?php echo JText::_('CK_PHONE') ?> / <?php echo JText::_('CK_LANDSCAPE') ?>">
<svg style="font-size: 1.4em;vertical-align: bottom;transform:rotate(90deg);" width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M976 1408q0-33-23.5-56.5t-56.5-23.5-56.5 23.5-23.5 56.5 23.5 56.5 56.5 23.5 56.5-23.5 23.5-56.5zm208-160v-704q0-13-9.5-22.5t-22.5-9.5h-512q-13 0-22.5 9.5t-9.5 22.5v704q0 13 9.5 22.5t22.5 9.5h512q13 0 22.5-9.5t9.5-22.5zm-192-848q0-16-16-16h-160q-16 0-16 16t16 16h160q16 0 16-16zm288-16v1024q0 52-38 90t-90 38h-512q-52 0-90-38t-38-90v-1024q0-52 38-90t90-38h512q52 0 90 38t38 90z"/></svg>
</span>
<input id="ckresponsive2value" type="hidden" value="<?php echo $componentParams->get('responsive2value', '480') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span class="ckbutton-group">
<span id="ckresponsive3button" class="ckbutton ckresponsivebutton cktip" style="width: auto;" onclick="ckSwitchResponsiveSmart(3)" data-range="3" title="<?php echo JText::_('CK_TABLET') ?> / <?php echo JText::_('CK_PORTRAIT') ?>">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M960 1408q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm384-160v-960q0-13-9.5-22.5t-22.5-9.5h-832q-13 0-22.5 9.5t-9.5 22.5v960q0 13 9.5 22.5t22.5 9.5h832q13 0 22.5-9.5t9.5-22.5zm128-960v1088q0 66-47 113t-113 47h-832q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h832q66 0 113 47t47 113z"/></svg>
</span>
<input id="ckresponsive3value" type="hidden" value="<?php echo $componentParams->get('responsive3value', '640') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
<span id="ckresponsive4button" class="ckbutton ckresponsivebutton cktip" style="width: auto;" onclick="ckSwitchResponsiveSmart(4)" data-range="4" title="<?php echo JText::_('CK_TABLET') ?> / <?php echo JText::_('CK_LANDSCAPE') ?>">
<svg style="vertical-align: bottom;transform:rotate(90deg);" width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M960 1408q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm384-160v-960q0-13-9.5-22.5t-22.5-9.5h-832q-13 0-22.5 9.5t-9.5 22.5v960q0 13 9.5 22.5t22.5 9.5h832q13 0 22.5-9.5t9.5-22.5zm128-960v1088q0 66-47 113t-113 47h-832q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h832q66 0 113 47t47 113z"/></svg>
</span>
<input id="ckresponsive4value" type="hidden" value="<?php echo $componentParams->get('responsive4value', '800') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span>
<span id="ckresponsive5button" class="ckbutton ckresponsivebutton ckbutton-warning active cktip" style="width: auto;" onclick="ckSwitchResponsiveSmart(5)" data-range="5" title="<?php echo JText::_('CK_COMPUTER') ?>">
<svg width="2048" height="1792" viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1856 992v-832q0-13-9.5-22.5t-22.5-9.5h-1600q-13 0-22.5 9.5t-9.5 22.5v832q0 13 9.5 22.5t22.5 9.5h1600q13 0 22.5-9.5t9.5-22.5zm128-832v1088q0 66-47 113t-113 47h-544q0 37 16 77.5t32 71 16 43.5q0 26-19 45t-45 19h-512q-26 0-45-19t-19-45q0-14 16-44t32-70 16-78h-544q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1600q66 0 113 47t47 113z"/></svg>
</span>
</span>
</div>
<?php
$this->input = $input;
// load the custom plugins
JPluginHelper::importPlugin( 'pagebuilderck' );
// $dispatcher = JEventDispatcher::getInstance();
$otheritems = Pagebuilderck\CKFof::triggerEvent( 'onPagebuilderckLoadItemOptions' . ucfirst(str_replace('.', '_', $this->cktype)) );
if (count($otheritems) == 1) {
// load only the first instance found, because each plugin type must be unique
$layout = $otheritems[0];
include_once($layout);
} else {
echo '<p style="text-align:center;color:red;font-size:14px;">' . JText::_('CK_EDITION_NOT_FOUND') . ' : ' . $this->cktype . '. Number of instances found : ' . count($otheritems) . '</p>';
}
?>
<div class="menulink" tab="tab_effects"><?php echo JText::_('CK_EFFECTS'); ?></div>
<div class="tab menustyles ckproperty" id="tab_effects">
<?php echo $menustyles->createEffects('bloc') ?>
<div class="clr"></div>
</div>
</div>
</div>
</div>
<script>
ckInitRangeInputs();
</script>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,53 @@
<?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;
use Pagebuilderck\CKView;
use Pagebuilderck\CKfof;
class PagebuilderckViewOptions extends CKView {
protected $menustyles;
protected $imagespath;
protected $imagespath_plugin;
protected $cktype;
function display($tpl = null) {
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/menustyles.php';
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/stylescss.php';
// load the helper class to construct the styles areas
$this->menustyles = new MenuStyles();
$this->imagespath = PAGEBUILDERCK_MEDIA_URI .'/images/menustyles/';
$this->cktype = $this->input->get('cktype', null);
if (! $this->cktype && $this->input->get('layout', null, 'cmd') !== 'editor') {
echo JText::_('COM_PAGEBUILDERCK_ERROR_LAYOUT');
exit();
}
$user = CKFof::getUser();
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
if ($authorised !== true)
{
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
return false;
}
parent::display($tpl);
exit();
}
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,88 @@
<?php
/**
* @name Page Builder CK
* @package com_pagebuilderck
* @copyright Copyright (C) 2020. 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
*/
defined('_JEXEC') or die;
?>
<nav id="context-menu-ck" class="context-menu-ck">
<ul class="context-menu-ck__items">
<li class="context-menu-ck__item context-menu-ck_row parent" data-target="row">
<a href="#" class="context-menu-ck__link" data-action="parentItem"><i class="fa fa-ellipsis-h"></i> <?php echo JText::_('CK_ROW') ?></a>
<ul class="context-menu-ck__items">
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="row.edit"><i class="fa fa-pencil-square-o"></i> <?php echo JText::_('CK_EDIT_STYLES') ?></a>
<a href="#" class="context-menu-ck__link context-menu-ck__item-styles-copy" data-action="row.stylecopy"><i class="fa fa-copy"></i> </a>
<a href="#" class="context-menu-ck__link context-menu-ck__item-styles-paste" data-action="row.stylepaste"><i class="fa fa-paste"></i> </a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="row.columns"><i class="fa fa-align-justify"></i> <?php echo JText::_('CK_EDIT_COLUMNS') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="row.fullwidth"><i class="fa fa-expand"></i> <?php echo JText::_('CK_FULLWIDTH') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="row.duplicate"><i class="fa fa-clone"></i> <?php echo JText::_('CK_DUPLICATE_ROW') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="row.favorite"><i class="fa fa-magic"></i> <?php echo JText::_('CK_DESIGN_SUGGESTIONS') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="row.save"><i class="fa fa-floppy-o"></i> <?php echo JText::_('CK_SAVE') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="row.remove"><i class="fa fa-times"></i> <?php echo JText::_('CK_REMOVE_ROW') ?></a>
</li>
</ul>
</li>
<li class="context-menu-ck__item context-menu-ck_column parent" data-target="column">
<a href="#" class="context-menu-ck__link" data-action="parentItem"><i class="fa fa-columns"></i> <?php echo JText::_('CK_COLUMN') ?></a>
<ul class="context-menu-ck__items">
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="column.edit"><i class="fa fa-pencil-square-o"></i> <?php echo JText::_('CK_EDIT_STYLES') ?></a>
<a href="#" class="context-menu-ck__link context-menu-ck__item-styles-copy" data-action="column.stylecopy"><i class="fa fa-copy"></i> </a>
<a href="#" class="context-menu-ck__link context-menu-ck__item-styles-paste" data-action="column.stylepaste"><i class="fa fa-paste"></i> </a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="column.duplicate"><i class="fa fa-clone"></i> <?php echo JText::_('CK_DUPLICATE_COLUMN') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="column.favorite"><i class="fa fa-magic"></i> <?php echo JText::_('CK_DESIGN_SUGGESTIONS') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="column.remove"><i class="fa fa-times"></i> <?php echo JText::_('CK_REMOVE_BLOCK') ?></a>
</li>
</ul>
</li>
<li class="context-menu-ck__item context-menu-ck_item parent" data-target="item">
<a href="#" class="context-menu-ck__link" data-action="parentItem"><i class="fa fa-window-maximize"></i> <?php echo JText::_('CK_ITEM') ?></a>
<ul class="context-menu-ck__items">
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="item.edit"><i class="fa fa-pencil-square-o"></i> <?php echo JText::_('CK_EDIT_ITEM') ?></a>
<a href="#" class="context-menu-ck__link context-menu-ck__item-styles-copy" data-action="item.stylecopy"><i class="fa fa-copy"></i> </a>
<a href="#" class="context-menu-ck__link context-menu-ck__item-styles-paste" data-action="item.stylepaste"><i class="fa fa-paste"></i> </a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="item.duplicate"><i class="fa fa-clone"></i> <?php echo JText::_('CK_DUPLICATE_ITEM') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="item.favorite"><i class="fa fa-magic"></i> <?php echo JText::_('CK_DESIGN_SUGGESTIONS') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="item.save"><i class="fa fa-floppy-o"></i> <?php echo JText::_('CK_SAVE') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="item.clearstyles"><i class="fa fa-paint-brush"></i> <?php echo JText::_('CK_CLEAR_STYLES') ?></a>
</li>
<li class="context-menu-ck__item">
<a href="#" class="context-menu-ck__link" data-action="item.remove"><i class="fa fa-times"></i> <?php echo JText::_('CK_REMOVE_ITEM') ?></a>
</li>
</ul>
</li>
</ul>
</nav>
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckcontextmenu.css?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/css" />
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckcontextmenu.js?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/javascript"></script>

View File

@@ -0,0 +1,23 @@
<?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
*/
defined('_JEXEC') or die;
$user = JFactory::getUser();
$app = JFactory::getApplication();
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
// loads the css and js files
require PAGEBUILDERCK_PATH . '/views/page/tmpl/include.php';
// loads the main content
require PAGEBUILDERCK_PATH . '/views/page/tmpl/main.php';
// loads the context menu
//require PAGEBUILDERCK_PATH . '/views/page/tmpl/contextmenu.php';

View File

@@ -0,0 +1,13 @@
<?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
*/
defined('_JEXEC') or die;
?>
</body>
</html>

View File

@@ -0,0 +1,250 @@
<?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
*/
defined('_JEXEC') or die;
use Pagebuilderck\CKFof;
if (!defined('PAGEBUILDERCK_MEDIA_URI'))
{
define('PAGEBUILDERCK_MEDIA_URI', JUri::root(true) . '/media/com_pagebuilderck');
}
require_once(PAGEBUILDERCK_PATH . '/helpers/defines.js.php');
$doc = JFactory::getDocument();
$editor = JFactory::getConfig()->get('pagebuilderck_replaced_editor', '') ? JFactory::getConfig()->get('pagebuilderck_replaced_editor') : JFactory::getConfig()->get('editor');
$editor = $editor == 'jce' ? 'jce' : 'tinymce';
$input = CKFof::getInput();
?>
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/pagebuilderck.css?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckframework.css" type="text/css" />
<?php // needs also to load the frontend styles to make the same visual as on frontend ?>
<link rel="stylesheet" href="<?php echo JUri::root(true) ?>/components/com_pagebuilderck/assets/pagebuilderck.css?ver=<?php echo PAGEBUILDERCK_VERSION ?>" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/colpick.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckbox.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/codemirrorck.css" type="text/css" />
<?php
if (PAGEBUILDERCK_LOADEDITORCSS === '1') {
$defaultTemplate = PagebuilderckHelper::getDefaultTemplate();
if (file_exists(JPATH_ROOT . '/templates/<?php echo $defaultTemplate ?>/css/editor.css')) {
?>
<link rel="stylesheet" href="<?php echo JUri::root(true) ?>/templates/<?php echo $defaultTemplate ?>/css/editor.css" type="text/css" />
<?php
}
}
// call google fonts
$googlefontsFromTemplate = PagebuilderckHelper::loadTemplateGooglefonts();
$fonts = PagebuilderckHelper::getFonts();
if (! empty($googlefontsFromTemplate) && ! empty($googlefontsFromTemplate)) {
?><link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><?php
}
if (! empty($googlefontsFromTemplate)) {
foreach ($googlefontsFromTemplate as $i => $gfont) {
PagebuilderckHelper::loadTemplateGooglefontFile($gfont);
/*
?><link href="https://fonts.googleapis.com/css2?family=<?php echo $gfont ?>&display=swap" rel="stylesheet"><?php
*/
}
}
if (! empty($fonts)) {
foreach ($fonts as $i => $font) {
if ($font->local === 1) {
$url = PagebuilderckHelper::getFontPath($font->name);
?> <link href="<?php echo $url ?>" rel="stylesheet"><?php
} else { ?>
<link href="<?php echo $font->url ?>" rel="stylesheet"><?php
}
}
}
?>
<script type="text/javascript">
var URIROOT = PAGEBUILDERCK.URIROOT; // BC for old plugins
var URIBASE = PAGEBUILDERCK.URIBASE; // BC for old plugins
var CLIPBOARDCK = '';
var CLIPBOARDCOLORCK = '';
var BLOCCKSTYLESBACKUP = '';
var FAVORITELOCKED = '';
var JoomlaCK = {};
var PAGEBUILDERCK_MEDIA_URI = '<?php echo PAGEBUILDERCK_MEDIA_URI ?>';
var PAGEBUILDERCK_ADMIN_URL = '<?php echo PAGEBUILDERCK_ADMIN_URL ?>';
//var PAGEBUILDERCK_TOKEN = cktoken = '<?php echo JFactory::getSession()->getFormToken() ?>=1';
var PAGEBUILDERCK_EDITOR = '<?php echo $editor ?>';
PAGEBUILDERCK.ISCONTENTTYPE = '<?php echo $input->get('iscontenttype', 0, 'int') ?>';
</script>
<?php
// modal view : strange that Joomla 4 do not want to load the script at the end in modal view
if ((version_compare(JVERSION,'4') <= 1) || $input->get('layout', '') === 'modal' || (CKFof::isSite() && $input->get('layout', '') === 'edit')) { ?>
<?php if (version_compare(JVERSION,'4') < 1) JHtml::_('behavior.core'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/jqueryck.min.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/jquery-uick-custom.min.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbox.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/codemirrorck.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/php.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/javascript.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/ckframework.js'); ?>
<?php CKFof::addScript(JUri::root(true) . '/components/com_pagebuilderck/assets/jquery-uick.min.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.js?ver=' . PAGEBUILDERCK_VERSION); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/colpick.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/pagebuilderck.js?ver=' . PAGEBUILDERCK_VERSION); ?>
<style>
body > .container-fluid {
padding-left: 35px;
}
</style>
<?php
// normal view
} else { ?>
<?php CKFof::addScript(JUri::root(true) . '/components/com_pagebuilderck/assets/jquery-uick.min.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/ckbrowse.js?ver=' . PAGEBUILDERCK_VERSION); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/colpick.js'); ?>
<?php CKFof::addScript(PAGEBUILDERCK_MEDIA_URI . '/assets/pagebuilderck.js?ver=' . PAGEBUILDERCK_VERSION); ?>
<?php JHtml::_('jquery.framework'); ?>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jqueryck.min.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jquery-uick-custom.min.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckbox.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/codemirrorck.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/php.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/javascript.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/css.js" type="text/javascript"></script>
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckframework.js" type="text/javascript"></script>
<?php } ?>
<?php
// load the CK Framework
//require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/ckframework.php';
//\Pagebuilderck\CKFramework::loadInline();
switch ($editor) {
case 'jce':
?><script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/editors/jce.js" type="text/javascript"></script><?php
break;
case 'tinymce':
default:
if (version_compare(JVERSION, '4') >= 0) { // check if we are in Joomla 3.7
?><script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/editors/tinymce3.js" type="text/javascript"></script><?php
} else if (version_compare(JVERSION, '3.7') >= 0) { // check if we are in Joomla 3.7
?><script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/editors/tinymce2.js" type="text/javascript"></script><?php
} else { // we are still in an old version
?><script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/editors/tinymce1.js" type="text/javascript"></script><?php
}
break;
}
JText::script('CK_CONFIRM_DELETE');
JText::script('CK_FAILED_SET_TYPE');
JText::script('CK_FAILED_SAVE_ITEM_ERRORMENUTYPE');
JText::script('CK_ALIAS_EXISTS_CHOOSE_ANOTHER');
JText::script('CK_FAILED_SAVE_ITEM_ERROR500');
JText::script('CK_FAILED_SAVE_ITEM');
JText::script('CK_FAILED_TRASH_ITEM');
JText::script('CK_FAILED_CREATE_ITEM');
JText::script('CK_UNABLE_UNPUBLISH_HOME');
JText::script('CK_TITLE_NOT_UPDATED');
JText::script('CK_LEVEL_NOT_UPDATED');
JText::script('CK_SAVE_LEVEL_FAILED');
JText::script('CK_SAVE_ORDER_FAILED');
JText::script('CK_CHECKIN_NOT_UPDATED');
JText::script('CK_CHECKIN_FAILED');
JText::script('CK_PARAM_NOT_UPDATED');
JText::script('CK_PARAM_UPDATE_FAILED');
JText::script('CK_FIRST_CREATE_ROW');
JText::script('CK_EDIT');
JText::script('CK_ICON');
JText::script('CK_MODULE');
JText::script('CK_GOOGLE_FONT');
JText::script('CK_FULLSCREEN');
JText::script('CK_RESTORE');
JText::script('CK_REMOVE_BLOCK');
JText::script('CK_MOVE_BLOCK');
JText::script('CK_EDIT_STYLES');
JText::script('CK_DECREASE_WIDTH');
JText::script('CK_INCREASE_WIDTH');
JText::script('CK_ADD_BLOCK');
JText::script('CK_REMOVE_ROW');
JText::script('CK_EDIT_COLUMNS');
JText::script('CK_MOVE_ROW');
JText::script('CK_ADD_NEW_ROW');
JText::script('CK_REMOVE_ITEM');
JText::script('CK_REMOVE_ITEM');
JText::script('CK_MOVE_ITEM');
JText::script('CK_DUPLICATE_ITEM');
JText::script('CK_DUPLICATE_ROW');
JText::script('CK_EDIT_ITEM');
JText::script('CK_ADD_COLUMN');
JText::script('CK_DELETE');
JText::script('CK_SAVE_CLOSE');
JText::script('CK_DESIGN_SUGGESTIONS');
JText::script('CK_MORE_MENU_ELEMENTS');
JText::script('CK_FULLWIDTH');
JText::script('CK_DUPLICATE_COLUMN');
JText::script('CK_ENTER_CLASSNAMES');
JText::script('CHECK_IDS_ALERT_PROBLEM');
JText::script('CHECK_IDS_ALERT_OK');
JText::script('CK_ENTER_UNIQUE_ID');
JText::script('CK_INVALID_ID');
JText::script('CK_ENTER_VALID_ID');
JText::script('CK_CONFIRM_BEFORE_CLOSE_EDITION_POPUP');
JText::script('CK_SUGGESTIONS');
JText::script('CK_RESPONSIVE_SETTINGS_ALIGNED');
JText::script('CK_RESPONSIVE_SETTINGS_STACKED');
JText::script('CK_RESPONSIVE_SETTINGS_HIDDEN');
JText::script('CK_SAVE');
JText::script('CK_WRAPPER_IN_WRAPPER_NOT_ALLOWED');
JText::script('CK_DUPLICATE_WRAPPER');
JText::script('CK_MOVE_WRAPPER');
JText::script('CK_REMOVE_WRAPPER');
JText::script('CK_ADD_NEW_PAGEBUILDER_MODULE');
JText::script('CK_ADD');
JText::script('CK_DRAG_DROP_PAGE');
JText::script('CK_PAGE');
JText::script('CK_ACCESS_RIGHTS');
JText::script('CK_CLIPBOARDEMPTY');
JText::script('CK_COPYFROMCLIPBOARD');
JText::script('CK_FIRST_CLEAR_VALUE');
JText::script('CK_CLICK_TO_EDIT_CONTENT');
JText::script('CK_CLEAN');
JText::script('CK_SELECT');
JText::script('CK_CONFIRM_CLEAR_STYLES');
JText::script('CK_VALIGN_DEFAULT');
JText::script('CK_VALIGN_TOP');
JText::script('CK_VALIGN_CENTER');
JText::script('CK_VALIGN_BOTTOM');
JText::script('CK_FONT_ICON');
JText::script('CK_SVG_ICON');
?>
<script type="text/javascript">
function ckKeepAlive() {
$ck.ajax({type: "POST", url: "index.php"});
}
<?php if (! PagebuilderckHelper::getParams()) { ?>
function ckShowFavoritePopup() {
CKBox.open({handler:'inline',content: 'pagebuilderckparamsmessage', fullscreen: false, size: {x: '600px', y: '150px'}});
}
function ckShowLibraryPopup() {
CKBox.open({handler:'inline',content: 'pagebuilderckparamsmessage', fullscreen: false, size: {x: '600px', y: '150px'}});
}
<?php } ?>
$ck(document).ready(function()
{
CKApi.Tooltip('.cktip');
window.setInterval("ckKeepAlive()", 600000);
});
</script>
<style>
.tox.tox-silver-sink.tox-tinymce-aux {z-index: 99999}
#ckeditor_ArticleModal {z-index: 99999};
</style>

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,184 @@
<?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
*/
defined('_JEXEC') or die;
$user = JFactory::getUser();
$app = JFactory::getApplication();
$input = $app->input;
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
$appendUrl = $this->input->get('layout', '', 'string') == 'modal' ? '&layout=modal&tmpl=component' : '&layout=edit';
// get global component params
$params = JComponentHelper::getParams('com_pagebuilderck');
// get item params
if (! is_object($this->item->params)) $this->item->params = new JRegistry($this->item->params);
// merge params
$params->merge($this->item->params);
$params->merge($this->item->params);
$conf = JFactory::getConfig();
?>
<div style="display:none;">
<form>
<?php
// Load the editor Tinymce or JCE
$editor = $conf->get('editor') == 'jce' ? 'jce' : 'tinymce';
$editor = JEditor::getInstance($editor);
echo $editor->display('ckeditor', $html = '', $width = '', $height = '200px', $col='', $row='', $buttons = true, $id = 'ckeditor');
?>
</form>
</div>
<div id="mainck">
<div id="maincktabcontent">
<?php if ($canEdit) { ?>
<form action="<?php echo JRoute::_('index.php?option=com_pagebuilderck&view=page' . $appendUrl . '&id=' . $this->item->id);?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data" class="form-validate">
<?php if (\Pagebuilderck\CKFof::isSite() && $app->input->get('layout') != 'modal') { ?>
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('page.apply')">
<span class="icon-apply"></span> <?php echo JText::_('JSAVE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('page.save')">
<span class="icon-ok"></span> <?php echo JText::_('CK_SAVE_CLOSE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn" onclick="Joomla.submitbutton('page.cancel')">
<span class="icon-cancel"></span> <?php echo JText::_('JCANCEL') ?>
</button>
</div>
</div>
<?php } ?>
<div class="mainmenulink menulink current" tab="tab_interface"><?php echo JText::_('CK_EDITION'); ?></div>
<div class="mainmenulink menulink" tab="tab_options"><?php echo JText::_('CK_OPTIONS'); ?></div>
<div class="clr"></div>
<div class="form-inline form-inline-header clearfix ckinterface">
<div>
<label class="required" for="title" id="title-lbl">
<?php echo JText::_('COM_PAGEBUILDERCK_TITLE'); ?>
<span class="star">&nbsp;*</span>
</label>
<input type="text" aria-required="true" required="required" size="40" class="form-control input-xlarge input-large-text required" value="<?php echo $this->item->title ?>" id="title" name="title">
</div>
</div>
<div class="maintab menustyles ckproperty" id="tab_options">
<?php
// loads the options layout
include_once(PAGEBUILDERCK_PATH . '/views/page/tmpl/options.php');
?>
</div>
<input type="hidden" name="htmlcode" id="htmlcode" value="" />
<input type="hidden" name="params" id="params" value="" />
<input type="hidden" name="option" value="com_pagebuilderck" />
<input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="com_pagebuilderck" />
<input type="hidden" name="return" value="<?php echo $this->input->getCmd('return'); ?>" />
<?php echo JHtml::_('form.token'); ?>
</form>
<div>&nbsp;</div>
<div class="maintab menustyles current ckproperty" id="tab_interface">
<div id="workspaceparentck">
<?php
// loads the menu
include_once(PAGEBUILDERCK_PATH . '/views/page/tmpl/contextmenu.php');
include_once(PAGEBUILDERCK_PATH . '/views/page/tmpl/menu.php');
include_once(PAGEBUILDERCK_PATH . '/views/page/tmpl/toolbar.php');
?>
<div id="workspaceck" class="pagebuilderck workspaceck<?php echo (\Pagebuilderck\CKFof::isSite() ? ' pagebuilderckfrontend' : '') ?><?php echo ($this->input->get('iscontenttype', 0, 'int') === 1 ? ' ckiscontenttype' : '') ?>" >
<?php
if ($this->item->htmlcode) {
echo $this->item->htmlcode;
} else { ?>
<div class="googlefontscall"></div>
<?php }
?>
</div>
</div>
<?php // load the modal for the restoration ?>
<div id="pagebuilderckRestoreModalck" class="pagebuilderckRestoreModalck pagebuilderckModalck" style="display:none;">
<h3><?php echo JText::_('CK_RESTORE') ?></h3>
<div class="ckinterface">
<?php
if ($this->item->id) {
$path = JPATH_ROOT . '/administrator/components/com_pagebuilderck/backup/' . $this->item->id . '_bak';
if (JFolder::exists($path)) {
$files = JFolder::files($path, '.pbck', false, false);
if (count($files)) {
natsort($files);
$i = 0;
foreach ($files as $file) {
if (stristr($file, 'locked_')) {
$backupdate = str_replace('locked_' . $this->item->id . '_', '', JFile::stripExt($file));
$isLocked = true;
} else {
$backupdate = str_replace('backup_' . $this->item->id . '_', '', JFile::stripExt($file));
$isLocked = false;
}
$date = DateTime::createFromFormat('d-m-Y-G-i-s', $backupdate);
$lockedIcon = $isLocked ? '<span class="ck-icon-lock"></span>' : '<span class="ck-icon-lock-open"></span>';
echo '<div class="restoreline restoreline' . $i . ' clearfix">
<span class="span6">
<span class="cklabel cklabel-info">' . $date->format('d-M-Y H:i:s') . '</span>
</span>
<span class="span6">
<span onclick="ckToggleLockedBackup(' . $this->item->id . ',\'' . $backupdate . '\', ' . $i . ')" data-locked="' . ($isLocked ? ' 1' : '0') . '" class="ckbutton locked' . ($isLocked ? ' active' : '') . '" style="margin:0 3px;display:inline-block;">' . $lockedIcon . '</span>
<a class="ckbutton" href="javascript:void(0)" onclick="ckDoRestoration(' . $this->item->id . ', \'' . $backupdate . '\', ' . $i . ')">
' . JText::_('CK_DO_RESTORATION') . '
</a>
<span class="processing" style="width:16px;margin:0 3px;display:inline-block;">&nbsp;</span>
</span>
</div>';
$i++;
}
} else {
echo '<div class="ckalert">' . JText::_('CK_NO_RESTORE_FILE_FOUND') . '</div>';
}
} else {
echo '<div class="ckalert">' . JText::_('CK_NO_RESTORE_FILE_FOUND') . '</div>';
}
}
?>
</div>
</div>
<?php } else {
if (!$canEdit) echo JText::_('COM_PAGEBUILDERCK_NORIGHTS_TO_EDIT');
} ?>
</div> <?php // fin tab_interface ?>
</div><?php // fin maincktabcontent ?>
</div>
<script>
$ck('#maincktabcontent div.maintab:not(.current)').hide();
$ck('.mainmenulink', $ck('#mainck')).each(function(i, tab) {
$ck(tab).click(function() {
if ($ck('#popup_favoriteck').length) {
ckCloseFavoritePopup(true);
}
$ck('#maincktabcontent div.maintab').hide();
$ck('.mainmenulink', $ck('#mainck')).removeClass('current');
if ($ck('#' + $ck(tab).attr('tab')).length)
$ck('#' + $ck(tab).attr('tab')).show();
$ck(this).addClass('current');
});
});
</script>
<?php
require(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/submitform.php');

View File

@@ -0,0 +1,752 @@
<?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 to this file
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$app = JFactory::getApplication();
$input = $app->input;
// load the custom plugins
JPluginHelper::importPlugin( 'pagebuilderck' );
//$dispatcher = JEventDispatcher::getInstance();
?>
<style type="text/css">
<?php if ($input->get('view', '', 'string') === 'style') { ?>
.menuckpanel[data-target="pages"],
.menuckpanel[data-target="library"] {
display: none !important;
}
<?php } ?>
<?php if ($input->get('iscontenttype', 0, 'int') !== 1) { ?>
body {
margin-left: 310px;
}
<?php } ?>
body.hidepanel {
margin-left: 50px;
}
body.hidepanel .menuck {
width: 50px;
overflow: hidden;
}
body.hidepanel #togglepanel ~ *,
body.hidepanel .menuckpanel,
body.hidepanel .menuckpanelfake {
display: none;
}
body.hidepanel #togglepanel {
width: 50px;
transform: rotate(180deg);
}
body.tck-edition-body {
margin-left: 310px;
width: calc(100% - 310px);
}
.menuck {
background-color: #f5f5f5;
border: none;
display: block;
left: 0;
padding: 0 0 10px 0px;
width: 310px;
box-sizing: border-box;
z-index: 1039;
position: fixed;
top: 0;
bottom: 0;
overflow-y: scroll;
overflow-x: hidden;
margin: 0;
font-family: Segoe UI, arial;
}
.menuck .menuckinfos {
margin: 5px 0;
padding: 5px;
font-size: 12px;
line-height: 12px;
}
.menuck .menuitemck:hover {
border: 1px solid #ddd;
}
.menuck img {
margin: 1px;
}
.menuck .menuitemck, .workspaceck .menuitemck {
background: #fff none repeat scroll 0 0;
border: 1px solid #f2f2f2;
float: left;
height: 40px;
margin: 5px 0 0 5px;
padding: 5px;
width: 47%;
max-width: 125px;
cursor: grab;
cursor: -webkit-grab;
box-sizing: border-box;
border-radius: 4px;
}
.menuck .menuitemck.grabbing, .workspaceck .menuitemck.grabbing {
cursor: grabbing;
cursor: -webkit-grabbing;
}
.menuck .menuitemck .menuitemck_title, .workspaceck .menuitemck .menuitemck_title {
font-size: 12px;
line-height: 15px;
align-self: center;
}
.menuck .menuitemck .menuitemck_desc, .workspaceck .menuitemck .menuitemck_desc {
color: #1a1a1a;
font-size: 10px;
}
.menuck .menuitemck > div, .workspaceck .menuitemck > div {
float: right;
width: calc(100% - 28px);
height: 28px;
display: flex;
}
.menuck .menuitemck img, .workspaceck .menuitemck img {
float: left;
margin: 5px 0 0 2px;
width: 20px;
opacity: 0.6;
}
.menuitemck_group {
clear: both;
padding: 2px 5px;
text-transform: capitalize;
border-bottom: 2px solid #2E5A84;
color: #2E5A84;
margin: 5px 5px 0;
font-size: 12px;
font-weight: bold;
cursor: pointer;
}
.menuck .headerck {
cursor: pointer;
padding: 0 0 0 5px;
background: none;
font-size: 18px;
min-height: 40px;
}
.menuck .ckinterface {
background: none;
}
#workspaceparentck.collapsedck .menuck {
width: 75px;
}
#workspaceparentck.collapsedck .menuck .headercktext,
#workspaceparentck.collapsedck .menuck .menuckinfos,
#workspaceparentck.collapsedck .menuck .menuitemck > div,
#workspaceparentck.collapsedck .menuck .menuitemck_title,
#workspaceparentck.collapsedck .menuck .menuitemck_desc {
display: none;
}
#workspaceparentck.collapsedck .menuck .menuitemck {
width: 50px;
height: 50px;
margin: 5px 2px;
}
/*#workspaceparentck:not(.collapsedck) #workspaceck {
margin-left: 235px;
}
#module-form #workspaceparentck:not(.collapsedck) #workspaceck {
margin-left: 260px;
}*/
.menuck .headercktext {
display: inline-block;
width: 145px;
line-height: 32px;
vertical-align: top;
padding-left: 5px;
margin-top: 5px;
font-weight: 600;
color: #2E5A84;
}
.menuck .menuckinner {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 100%;
}
.menuck > .inner {
/*position: relative;*/
max-height: 100%;
height: calc(100vh - 50px);
overflow-y: auto;
margin-left: 50px;
}
.menuck > .inner:not(.ckelementsedition) {
display: none;
}
.menuck .ckcolumnsedition {
display: none;
}
.menuck .headerckicon {
width: 40px;
height: 40px;
float: right;
display: inline-block;
box-sizing: border-box;
line-height: 32px;
padding: 0;
background: none;
color: #000;
font-size: 1.3em;
border: none;
text-align: center;
cursor: pointer;
font-weight: normal;
border-radius: 0;
opacity: 0.7;
}
.menuck .headerckicon:hover {
color: #000;
opacity: 1;
}
.collapsedck .menuck .headerckicon {
transform: rotate(180deg);
}
.menuck .headerckicon.cksave,
.menuck .headerckicon.ckclean {
font-size: 13px;
line-height: 35px;
}
.menuck input {
width: auto;
margin-left: 5px;
}
.menuck .ckresponsivebutton {
border: 1px solid #ddd;
border-radius: 4px;
box-shadow: none;
width: 205px;
margin-left: 0;
}
.menuck .ckresponsivebutton.active {
border-color: #faa732;
}
.menuck .ckbutton-group .ckresponsivebutton:not(#ckresponsive5button) {
border-radius: 4px 0 0 4px;
height: 30px;
}
.menuck .ckbutton-group .ckresponsivebutton ~ .ckresponsivebutton:not(#ckresponsive5button) {
border-radius: 0 4px 4px 0;
}
#popup_editionck .menulink {
background: #fff;
border: none;
border-bottom: 1px solid #ddd;
padding: 10px 10px 10px 14px;
border-radius: 0px;
border-left: 4px solid #fff;
font-weight: 600;
font-size: 16px;
color: #555;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
}
#popup_editionck .menulink:hover,
#popup_editionck .menulink.open{
color: #0073aa;
background: #f8f8f8;
border-bottom: 1px solid #0073aa;
}
/* Fix for Safari */
.ckpopup, .menuck {
overflow: visible !important;
}
.menuckpanels {
width: 50px;
background: #1C3D5C;
height: calc(100vh - 40px);
float: left;
}
.menuckpanelfake img,
.menuckpanel img {
margin: 8px;
}
.menuckpanel svg {
width: 24px;
height: 24px;
fill: #fff;
opacity: 0.5;
}
.menuckpanel.active svg {
opacity: 1;
}
.menuckpanelfake,
.menuckpanel {
color: #ddd;
text-align: center;
padding: 12px 0;
}
.menuckpanelfake .fa,
.menuckpanel .fa {
font-size: 24px;
}
.menuckpanelfake.active, .menuckpanelfake:hover,
.menuckpanel.active, .menuckpanel:hover {
background: #2E5A84;
color: #fff;
cursor: pointer;
}
.menuckbootomtoolbar {
height: 40px;
background: #2E5A84;
position: absolute;
bottom: 0;
width: 100%;
left: 0;
text-align: center;
display: flex;
justify-content: center;
padding-left: 40px;
}
.menuckbootomtoolbar span.menuckbootomtoolbar-button {
height: 40px;
width: 40px;
border-radius: 0;
margin: 0;
padding: 0;
line-height: 40px;
color: #fff;
padding: 0 10px;
opacity: 0.7;
display: inline-block;
cursor: pointer;
font-size: 16px;
}
.menuckbootomtoolbar span.menuckbootomtoolbar-button:hover, .menuckbootomtoolbar span.menuckbootomtoolbar-button.active {
opacity: 1;
}
.menuckbootomtoolbar a:before {
display: none;
}
.ckresponsivebutton {
width: 170px;
}
.ckmyelements.headerck {
margin-top: 10px;
}
.ckaddonsdisplaytype {
display: none;
}
#cklibraryiframe {
padding: 10px;
}
<?php
$displaytype = $app->getUserState('pagebuilderck.addons.displaytype', 'list');
echo '#ckaddonsdisplaytype' . $displaytype . ' { display: block; }';
?>
</style>
<?php
// get global component params
$componentParams = JComponentHelper::getParams('com_pagebuilderck');
$view = $input->get('view', 'page');
?>
<?php
if ($input->get('iscontenttype', 0, 'int') !== 1) { ?>
<div id="menuck" class="menuck clearfix ckinterface">
<div class="menuckpanels">
<div class="menuckpanel cktip active" data-target="addons" title="<?php echo JText::_('CK_ADDONS') ?>" data-placement="right">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1728 1098q0 81-44.5 135t-123.5 54q-41 0-77.5-17.5t-59-38-56.5-38-71-17.5q-110 0-110 124 0 39 16 115t15 115v5q-22 0-33 1-34 3-97.5 11.5t-115.5 13.5-98 5q-61 0-103-26.5t-42-83.5q0-37 17.5-71t38-56.5 38-59 17.5-77.5q0-79-54-123.5t-135-44.5q-84 0-143 45.5t-59 127.5q0 43 15 83t33.5 64.5 33.5 53 15 50.5q0 45-46 89-37 35-117 35-95 0-245-24-9-2-27.5-4t-27.5-4l-13-2q-1 0-3-1-2 0-2-1v-1024q2 1 17.5 3.5t34 5 21.5 3.5q150 24 245 24 80 0 117-35 46-44 46-89 0-22-15-50.5t-33.5-53-33.5-64.5-15-83q0-82 59-127.5t144-45.5q80 0 134 44.5t54 123.5q0 41-17.5 77.5t-38 59-38 56.5-17.5 71q0 57 42 83.5t103 26.5q64 0 180-15t163-17v2q-1 2-3.5 17.5t-5 34-3.5 21.5q-24 150-24 245 0 80 35 117 44 46 89 46 22 0 50.5-15t53-33.5 64.5-33.5 83-15q82 0 127.5 59t45.5 143z"/></svg>
</div>
<?php if ($pagebuilderckParams->get('enablepanel_pages', '1', 'int') !== '0') { ?>
<div class="menuckpanel cktip" data-target="pages" title="<?php echo JText::_('CK_LOAD_PAGE') ?>" data-placement="right">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1596 380q28 28 48 76t20 88v1152q0 40-28 68t-68 28h-1344q-40 0-68-28t-28-68v-1600q0-40 28-68t68-28h896q40 0 88 20t76 48zm-444-244v376h376q-10-29-22-41l-313-313q-12-12-41-22zm384 1528v-1024h-416q-40 0-68-28t-28-68v-416h-768v1536h1280zm-1024-864q0-14 9-23t23-9h704q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64zm736 224q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704zm0 256q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704z"/></svg>
</div>
<?php } ?>
<?php if ($pagebuilderckParams->get('enablepanel_styles', '1', 'int') !== '0') { ?>
<?php if ($view !== 'element') { ?>
<div class="menuckpanel cktip" data-target="styles" title="<?php echo JText::_('CK_LOAD_STYLE') ?>" data-placement="right">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1615 0q70 0 122.5 46.5t52.5 116.5q0 63-45 151-332 629-465 752-97 91-218 91-126 0-216.5-92.5t-90.5-219.5q0-128 92-212l638-579q59-54 130-54zm-909 1034q39 76 106.5 130t150.5 76l1 71q4 213-129.5 347t-348.5 134q-123 0-218-46.5t-152.5-127.5-86.5-183-29-220q7 5 41 30t62 44.5 59 36.5 46 17q41 0 55-37 25-66 57.5-112.5t69.5-76 88-47.5 103-25.5 125-10.5z"/></svg>
</div><?php } ?>
<div class="menuckpanel cktip" data-target="library" title="<?php echo JText::_('CK_LOAD_MODEL') ?>" data-placement="right">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M512 1248v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm0-512v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm640 512v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm-640-1024v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm640 512v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm640 512v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm-640-1024v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm640 512v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm0-512v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68z"/></svg>
</div>
<?php } ?>
<?php if ($input->get('tckedition', 0, 'int') == 0) { ?>
<?php if ($pagebuilderckParams->get('enablepanel_responsive', '1', 'int') !== '0') { ?>
<div id="ckresponsivesettingsbutton" data-target="responsive" class="menuckpanel cktip" title="<?php echo JText::_('CK_RESPONSIVE_SETTINGS') ?>" data-placement="right">
<svg style="width:36px;height:36px;" width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M976 1408q0-33-23.5-56.5t-56.5-23.5-56.5 23.5-23.5 56.5 23.5 56.5 56.5 23.5 56.5-23.5 23.5-56.5zm208-160v-704q0-13-9.5-22.5t-22.5-9.5h-512q-13 0-22.5 9.5t-9.5 22.5v704q0 13 9.5 22.5t22.5 9.5h512q13 0 22.5-9.5t9.5-22.5zm-192-848q0-16-16-16h-160q-16 0-16 16t16 16h160q16 0 16-16zm288-16v1024q0 52-38 90t-90 38h-512q-52 0-90-38t-38-90v-1024q0-52 38-90t90-38h512q52 0 90 38t38 90z"/></svg> </div>
<?php } ?>
<?php if ($pagebuilderckParams->get('enablepanel_customcss', '1', 'int') !== '0') { ?>
<div id="ckcustomcsssettingsbutton" data-target="customcss" class="menuckpanelfake cktip" title="<?php echo JText::_('CK_CUSTOMCSS') ?>" data-placement="right">
</div>
<?php } ?>
<?php } ?>
</div>
<div class="inner clearfix ckelementsedition menuckpaneltarget" data-target="addons">
<div class="headerck">
<span class="headercktext" style="width: 130px;"><?php echo JText::_('CK_ELEMENTS'); ?></span>
<span class="ckbutton-group" style="margin: 5px;">
<span class="headerckdisplaytype ckbutton <?php echo ($displaytype == 'list' ? 'active' : '') ?>" data-type="list" onclick="ckSetAddonsDisplaytypeState('list')"><i class="fa fa-list cktip" data-placement="bottom" title="<?php echo JText::_('CK_DISPLAY_TYPE_LIST') ?>" onclick="ckSearchAddon(this)"></i></span>
<span class="headerckdisplaytype ckbutton <?php echo ($displaytype == 'grid' ? 'active' : '') ?>" data-type="grid" onclick="ckSetAddonsDisplaytypeState('grid')"><i class="fa fa-th cktip" data-placement="bottom" title="<?php echo JText::_('CK_DISPLAY_TYPE_GRID') ?>" onclick="ckSearchAddon(this)"></i></span>
</span>
</div>
<div id="ckaddonsearch" class="ckleftpanelsearch">
<input type="text" class="cksearchleftpanel" placeholder="<?php echo JText::_('CK_SEARCH') ?>" onchange="ckSearchAddon(this)" />
<i class="fa fa-search cktip" title="<?php echo JText::_('CK_SEARCH') ?>" onclick="ckSearchAddon(this)"></i>
<i class="fa fa-times cktip" title="<?php echo JText::_('CK_CLEAN') ?>" onclick="ckSearchAddonClear()"></i>
</div>
<div class="menuckinfos"><?php echo JText::_('COM_PAGEBUILDERCK_INSERT_CONTENT'); ?></div>
<?php
// $items = Pagebuilderck\CKFof::triggerEvent( 'onPagebuilderckAddItemToMenu' );
$items = PagebuilderckHelper::getPluginsMenuItemType();
$groups = PagebuilderckHelper::getPluginsMenuItemTypeByGroup();
?>
<div id="ckaddonsdisplaytypegrid" class="ckaddonsdisplaytype">
<?php
$pagebuilderckTypesImagesArray = array();
if (count($items)) {
foreach ($items as $item) {
$pagebuilderckTypesImagesArray[$item->type] = $item->image;
?>
<div data-type="<?php echo $item->type ?>" data-group="<?php echo $item->group ?>" class="menuitemck" title="<b><?php echo $item->title ?></b><br /><?php echo $item->description ?>">
<div>
<div class="menuitemck_title"><?php echo $item->title ?></div>
</div>
<img src="<?php echo $item->image ?>" />
</div>
<?php
}
}
?>
</div>
<div id="ckaddonsdisplaytypelist" class="ckaddonsdisplaytype">
<?php
foreach ($groups as $groupname => $group) {
if (empty($group['items'])) continue;
?>
<div class="menuitemck_group"><?php echo $group['name'] ?></div>
<div>
<?php
foreach ($group['items'] as $item) {
$pagebuilderckTypesImagesArray[$item->type] = $item->image;
?>
<div data-type="<?php echo $item->type ?>" data-group="<?php echo $item->group ?>" class="menuitemck" title="<b><?php echo $item->title ?></b><br /><?php echo $item->description ?>">
<div>
<div class="menuitemck_title"><?php echo $item->title ?></div>
</div>
<img src="<?php echo $item->image ?>" />
</div>
<?php
}
?>
<div style="clear:both;"></div>
</div>
<?php
}
?>
</div>
<div style="clear:both;"></div>
<div><?php echo PagebuilderckHelper::showParamsMessage(true, JText::_('CK_PAGEBUILDERCK_GETMORE_PRO_ITEMS')); ?></div>
<div class="headerck ckmyelements" style="clear:both;">
<span class="headercktext"><?php echo JText::_('CK_MY_ELEMENTS'); ?></span>
</div>
<div class="" id="ckmyelements">
<?php
$elements = PagebuilderckHelper::getElements();
if (count($elements)) {
foreach ($elements as $element) {
if (($view == 'element' || $view == 'style') && $element->type == 'row') continue;
$description = $element->description ? $element->description : $element->title;
?>
<div data-type="<?php echo $element->type ?>" data-id="<?php echo $element->id ?>" class="menuitemck ckmyelement" title="<b><?php echo $description ?></b>">
<div>
<div class="menuitemck_title"><?php echo $element->title ?></div>
</div>
<img src="<?php echo isset($pagebuilderckTypesImagesArray[$element->type]) ? $pagebuilderckTypesImagesArray[$element->type] : PAGEBUILDERCK_MEDIA_URI . '/images/contents/' . $element->type . '.svg' ?>" />
</div>
<?php
}
}
?>
</div>
</div>
<div class="inner clearfix ckelementsedition menuckpaneltarget" data-target="pages">
<div class="headerck">
<span class="headercktext"><?php echo JText::_('CK_PAGES'); ?></span>
</div>
<iframe class="ckwait" src="index.php?option=com_pagebuilderck&view=pages&layout=modal&tmpl=component&function=returnLoadPage&target=leftpanel" width="100%" height="auto" >
</iframe>
</div>
<div class="inner clearfix ckelementsedition menuckpaneltarget" data-target="styles">
<div class="headerck">
<span class="headercktext"><?php echo JText::_('CK_STYLES'); ?></span>
</div>
<?php if (PagebuilderckHelper::getParams()) { ?>
<iframe id="pbckiframestyles" class="ckwait" src="index.php?option=com_pagebuilderck&view=styles&layout=modal&tmpl=component&function=ckReturnLoadStyle&target=leftpanel" width="100%" height="auto" >
</iframe>
<?php } else {
echo PagebuilderckHelper::showParamsMessage();
}
?>
</div>
<div class="inner clearfix ckelementsedition menuckpaneltarget" data-target="library">
<div class="headerck">
<span class="headercktext"><?php echo JText::_('CK_MODELS'); ?></span>
</div>
<?php if (PagebuilderckHelper::getParams()) { ?>
<div id="cklibraryiframe"><?php PagebuilderckHelper::loadCustomLibrary() ?></div>
<?php } else {
echo PagebuilderckHelper::showParamsMessage();
}
?>
</div>
<div class="inner clearfix ckresponsiveedition menuckpaneltarget" data-target="responsive">
<div class="menuckcollapse headerck">
<span class="headercktext" style="width:auto;"><?php echo JText::_('CK_RESPONSIVE_SETTINGS'); ?></span>
<?php /*<span class="headerckicon cktip" title="<?php echo JText::_('CK_SAVE_CLOSE'); ?>" onclick="ckShowResponsiveSettings(true);">×</span> */ ?>
</div>
<div id="cktoolbarResponsive" class="clearfix ckinterface cktoolbarResponsive" style="overflow:visible;background:none;padding:5px;">
<span class="ckbutton-group">
<span id="ckresponsive1button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(1)" data-range="1">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M976 1408q0-33-23.5-56.5t-56.5-23.5-56.5 23.5-23.5 56.5 23.5 56.5 56.5 23.5 56.5-23.5 23.5-56.5zm208-160v-704q0-13-9.5-22.5t-22.5-9.5h-512q-13 0-22.5 9.5t-9.5 22.5v704q0 13 9.5 22.5t22.5 9.5h512q13 0 22.5-9.5t9.5-22.5zm-192-848q0-16-16-16h-160q-16 0-16 16t16 16h160q16 0 16-16zm288-16v1024q0 52-38 90t-90 38h-512q-52 0-90-38t-38-90v-1024q0-52 38-90t90-38h512q52 0 90 38t38 90z"/></svg>
<?php echo JText::_('CK_PHONE') ?> / <small><?php echo JText::_('CK_PORTRAIT') ?></small></span>
<input id="ckresponsive1value" type="text" value="<?php echo $componentParams->get('responsive1value', '320') ?>" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span class="ckbutton-group">
<span id="ckresponsive2button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(2)" data-range="2">
<svg style="vertical-align: bottom;transform:rotate(90deg);" width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M976 1408q0-33-23.5-56.5t-56.5-23.5-56.5 23.5-23.5 56.5 23.5 56.5 56.5 23.5 56.5-23.5 23.5-56.5zm208-160v-704q0-13-9.5-22.5t-22.5-9.5h-512q-13 0-22.5 9.5t-9.5 22.5v704q0 13 9.5 22.5t22.5 9.5h512q13 0 22.5-9.5t9.5-22.5zm-192-848q0-16-16-16h-160q-16 0-16 16t16 16h160q16 0 16-16zm288-16v1024q0 52-38 90t-90 38h-512q-52 0-90-38t-38-90v-1024q0-52 38-90t90-38h512q52 0 90 38t38 90z"/></svg>
<?php echo JText::_('CK_PHONE') ?> / <small><?php echo JText::_('CK_LANDSCAPE') ?></small></span>
<input id="ckresponsive2value" type="text" value="<?php echo $componentParams->get('responsive2value', '480') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span class="ckbutton-group">
<span id="ckresponsive3button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(3)" data-range="3">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M960 1408q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm384-160v-960q0-13-9.5-22.5t-22.5-9.5h-832q-13 0-22.5 9.5t-9.5 22.5v960q0 13 9.5 22.5t22.5 9.5h832q13 0 22.5-9.5t9.5-22.5zm128-960v1088q0 66-47 113t-113 47h-832q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h832q66 0 113 47t47 113z"/></svg>
<?php echo JText::_('CK_TABLET') ?> / <small><?php echo JText::_('CK_PORTRAIT') ?></small></span>
<input id="ckresponsive3value" type="text" value="<?php echo $componentParams->get('responsive3value', '640') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span class="ckbutton-group">
<span id="ckresponsive4button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(4)" data-range="4">
<svg style="vertical-align: bottom;transform:rotate(90deg);" width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M960 1408q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm384-160v-960q0-13-9.5-22.5t-22.5-9.5h-832q-13 0-22.5 9.5t-9.5 22.5v960q0 13 9.5 22.5t22.5 9.5h832q13 0 22.5-9.5t9.5-22.5zm128-960v1088q0 66-47 113t-113 47h-832q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h832q66 0 113 47t47 113z"/></svg>
<?php echo JText::_('CK_TABLET') ?> / <small><?php echo JText::_('CK_LANDSCAPE') ?></small></span>
<input id="ckresponsive4value" type="text" value="<?php echo $componentParams->get('responsive4value', '800') ?>" class="cktip" data-default="" disabled="disabled" title="<?php echo JText::_('CK_SET_RESPONSIVE_VALUE_IN_OPTIONS') ?>" style="width:40px;"/>
</span>
<span>
<span id="ckresponsive5button" class="ckbutton ckresponsivebutton" onclick="ckSwitchResponsive(5)" data-range="5">
<svg width="2048" height="1792" viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1856 992v-832q0-13-9.5-22.5t-22.5-9.5h-1600q-13 0-22.5 9.5t-9.5 22.5v832q0 13 9.5 22.5t22.5 9.5h1600q13 0 22.5-9.5t9.5-22.5zm128-832v1088q0 66-47 113t-113 47h-544q0 37 16 77.5t32 71 16 43.5q0 26-19 45t-45 19h-512q-26 0-45-19t-19-45q0-14 16-44t32-70 16-78h-544q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1600q66 0 113 47t47 113z"/></svg>
<?php echo JText::_('CK_COMPUTER') ?>
</span>
</span>
<p><?php echo JText::_('CK_EDIT_RESPONSIVE_COLUMNS_DESC') ?></p>
<div class="ckinterface">
<span class="ckbuttonstyle" onclick="ckSwitchResponsiveEditColumns(this)" data-state="0">
<svg style="width:20px;height:24px;stroke:#fff;vertical-align: bottom;" xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-columns-2" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M3 3m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1zm9 -1v18" />
</svg>
<?php echo JText::_('CK_EDIT_RESPONSIVE_COLUMNS') ?>
</span>
</div>
</div>
</div>
<div class="inner clearfix ckcolumnsedition" >
<div class="headerck">
<span class="headerckicon" onclick="ckHideColumnsEdition()">×</span>
<span class="headercktext"><?php echo JText::_('CK_COLUMNS'); ?></span>
</div>
<div class="ckcolumnsoptions">
<div class="ckbutton-group" style="margin-top: 5px;">
<input id="autowidth" name="autowidth" value="1" type="radio" onchange="ckUpdateAutowidth($ck('.rowck.ckfocus'), this.value);" />
<label class="ckbutton btn" for="autowidth" style="width:auto;margin-left:5px;" ><?php echo JText::_('CK_AUTO_WIDTH') ?></label>
<input id="advlayout" name="autowidth" value="0" type="radio" onchange="ckUpdateAutowidth($ck('.rowck.ckfocus'), this.value);" />
<label class="ckbutton btn" for="advlayout" style="width:auto;"><?php echo JText::_('CK_ADVANCED_LAYOUT') ?></label>
</div>
<div id="ckgutteroptions">
<div class="menuckinfos"><?php echo JText::_('CK_GUTTER') ?></div>
<input class="ckguttervalue" type="text" onchange="ckUpdateGutter($ck('.rowck.ckfocus'), this.value);" style="margin-left:5px;" />
</div>
<div>
<div class="ckbuttonstyle" onclick="ckAddBlock($ck('.rowck.ckfocus'));" style="display: block;">+ <?php echo JText::_('CK_ADD_COLUMN') ?></div>
</div>
<div class="menuckinfos"><?php echo JText::_('CK_COLUMNS_SPACE_BETWEEN') ?></div>
<div class="ckbutton-group" style="margin-top: 5px;">
<input id="columns-space-between0" name="columns-space-between" value="0" type="radio" onchange="ckUpdateSpacebetween($ck('.rowck.ckfocus'), this.value);" />
<label class="ckbutton btn" for="columns-space-between0" style="width:auto;margin-left:5px;" ><?php echo JText::_('JNO') ?></label>
<input id="columns-space-between1" name="columns-space-between" value="1" type="radio" onchange="ckUpdateSpacebetween($ck('.rowck.ckfocus'), this.value);" />
<label class="ckbutton btn" for="columns-space-between1" style="width:auto;"><?php echo JText::_('JYES') ?></label>
</div>
<div id="ckcolumnsuggestions">
</div>
</div>
</div>
<div class="menuckbootomtoolbar">
<span id="togglepanel" class="menuckbootomtoolbar-button cktip" onclick="ckTogglePanel()" title="<?php echo JText::_('CK_TOGGLE_PANEL') ?>">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-chevron-left" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M15 6l-6 6l6 6" />
</svg>
</span>
<?php if ($input->get('id', 0, 'int')
&& $input->get('option', '', 'cmd') == 'com_pagebuilderck'
&& $input->get('view', '', 'cmd') == 'page'
&& \Pagebuilderck\CKFof::isAdmin()){ ?>
<a class="" target="_blank" href="<?php echo JUri::root(true) ?>/index.php?option=com_pagebuilderck&view=page&id=<?php echo $input->get('id', '', 'int') ?>"><span class="menuckbootomtoolbar-button cktip" title="<?php echo JText::_('CK_PREVIEW_FRONT') ?>">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-eye-check" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M11.143 17.961c-3.221 -.295 -5.936 -2.281 -8.143 -5.961c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.222 .37 -.449 .722 -.68 1.057" />
<path d="M15 19l2 2l4 -4" />
</svg>
</a>
<?php } else if ($input->get('id', 0, 'int') && $input->get('option', '', 'cmd') == 'com_content' && $input->get('view', '', 'cmd') == 'article' && \Pagebuilderck\CKFof::isAdmin()) { ?>
<a class="" target="_blank" href="<?php echo JUri::root(true) ?>/index.php?option=com_content&view=article&id=<?php echo $input->get('id', '', 'int') ?>"><span class="menuckbootomtoolbar-button cktip" title="<?php echo JText::_('CK_PREVIEW_FRONT') ?>">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-eye-check" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M11.143 17.961c-3.221 -.295 -5.936 -2.281 -8.143 -5.961c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.222 .37 -.449 .722 -.68 1.057" />
<path d="M15 19l2 2l4 -4" />
</svg>
</a>
<?php }?>
<?php if (
($input->get('option', '', 'cmd') == 'com_content' && $input->get('view', '', 'cmd') == 'article' && \Pagebuilderck\CKFof::isAdmin())
|| ($input->get('option', '', 'cmd') == 'com_flexicontent' && $input->get('view', '', 'cmd') == 'article' && \Pagebuilderck\CKFof::isAdmin())
|| ($input->get('option', '', 'cmd') == 'com_modules' && $input->get('view', '', 'cmd') == 'module' && \Pagebuilderck\CKFof::isAdmin())
|| ($input->get('option', '', 'cmd') == 'com_advmodulesmanager' && $input->get('view', '', 'cmd') == 'module' && \Pagebuilderck\CKFof::isAdmin())
) { ?>
<span class="menuckbootomtoolbar-button cktip" onclick="ckSaveAsPage()" title="<?php echo JText::_('CK_SAVE_AS_PAGE') ?>">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-device-floppy" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2" />
<path d="M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
<path d="M14 4l0 4l-6 0l0 -4" />
</svg>
</span>
<?php } ?>
<span id="ckhtmlchecksettingsbutton" class="menuckbootomtoolbar-button cktip" onclick="ckCheckHtml()" title="<?php echo JText::_('CK_HTML_CSS') ?>">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-focus" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r=".5" fill="currentColor" />
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
</svg>
</span>
<span id="ckundo" class="menuckbootomtoolbar-button cktip" onclick="ckUndo()" title="<?php echo JText::_('CK_UNDO') ?>">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-back-up" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M9 14l-4 -4l4 -4" />
<path d="M5 10h11a4 4 0 1 1 0 8h-1" />
</svg>
</span>
<span id="ckundo" class="menuckbootomtoolbar-button cktip" onclick="ckRedo()" title="<?php echo JText::_('CK_REDO') ?>">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-forward-up" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M15 14l4 -4l-4 -4" />
<path d="M19 10h-11a4 4 0 1 0 0 8h1" />
</svg>
</span>
</div>
<div id="ckcustomcssedition" style="display: none;"></div>
</div>
<?php
// if contenttype, only load the plugins with scripts
} else {
// load the custom plugins
JPluginHelper::importPlugin( 'pagebuilderck' );
$otheritems = Pagebuilderck\CKFof::triggerEvent( 'onPagebuilderckAddItemToMenu' );
}
?>
<script type="text/javascript">
// check if we are in frontend
var isSiteCK = '<?php echo \Pagebuilderck\CKFof::isSite() ?>';
$ck('#menuck').hide();
var ckcustomcsseditor;
$ck(document).ready(function (){
// create tooltip for the items
ckMakeTooltip($ck('#menuck .menuitemck'));
$ck('#menuck').fadeIn();
});
if (isSiteCK) {
$ck(window).on("load resize scroll", function() {
if (! $ck('#workspaceck').length || ! $ck('#workspaceparentck').length) return;
var menuToWorkspaceOffset = $ck('#workspaceparentck').offset().left -50 - $ck('#menuck').width()
if (menuToWorkspaceOffset < 0) {
$ck('#workspaceck').css({'margin-left': -menuToWorkspaceOffset + 'px'});
} else {
$ck('#workspaceck').css({'margin-left': '0'});
}
});
}
$ck('.menuckpanel').click(function() {
ckActivatePanel($ck(this).attr('data-target'));
});
$ck('#ckcustomcsssettingsbutton').click(function() {
ckOpenCustomCssEditor();
});
$ck('.menuitemck_group').click(function() {
$ck(this).find('+ div').toggle('fast');
});
</script>

Some files were not shown because too many files have changed in this diff Show More