first commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -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>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user