first commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -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 - http://www.template-creator.com - http://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();
|
||||
@@ -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 - http://www.template-creator.com - http://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();
|
||||
@@ -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
|
||||
include_once PAGEBUILDERCK_PATH . '/views/page/tmpl/include.php';
|
||||
// loads the main content
|
||||
include_once PAGEBUILDERCK_PATH . '/views/style/tmpl/main.php';
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,188 @@
|
||||
<?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"> *</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>
|
||||
|
||||
<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' : '') ?> ckstyleedition">
|
||||
<?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;"> </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>
|
||||
<style>
|
||||
.menulink:not([tab$="styles"]) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab.menustyles:not([id$="styles"]) {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
require(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/submitform.php');
|
||||
@@ -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');
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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 PagebuilderckViewStyle extends CKView {
|
||||
|
||||
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('style.apply');
|
||||
JToolbarHelper::save('style.save');
|
||||
JToolbarHelper::cancel('style.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('style.apply');
|
||||
JToolbarHelper::save('style.save');
|
||||
}
|
||||
}
|
||||
|
||||
JToolbarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user