first commit
This commit is contained in:
1
components/com_pagebuilderck/views/browse/index.html
Normal file
1
components/com_pagebuilderck/views/browse/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
12
components/com_pagebuilderck/views/browse/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/browse/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/browse/tmpl/default.php';
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
13
components/com_pagebuilderck/views/browse/view.html.php
Normal file
13
components/com_pagebuilderck/views/browse/view.html.php
Normal 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
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/browse/view.html.php';
|
||||
10
components/com_pagebuilderck/views/content/tmpl/default.php
Normal file
10
components/com_pagebuilderck/views/content/tmpl/default.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?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;
|
||||
12
components/com_pagebuilderck/views/content/view.html.php
Normal file
12
components/com_pagebuilderck/views/content/view.html.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/content/view.html.php';
|
||||
12
components/com_pagebuilderck/views/contents/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/contents/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/contents/tmpl/default.php';
|
||||
12
components/com_pagebuilderck/views/contents/view.html.php
Normal file
12
components/com_pagebuilderck/views/contents/view.html.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/contents/view.html.php';
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/contenttype/tmpl/default.php';
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
13
components/com_pagebuilderck/views/contenttype/view.html.php
Normal file
13
components/com_pagebuilderck/views/contenttype/view.html.php
Normal 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
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/contenttype/view.html.php';
|
||||
12
components/com_pagebuilderck/views/fonts/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/fonts/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/fonts/tmpl/default.php';
|
||||
12
components/com_pagebuilderck/views/fonts/tmpl/default2.php
Normal file
12
components/com_pagebuilderck/views/fonts/tmpl/default2.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/fonts/tmpl/default2.php';
|
||||
12
components/com_pagebuilderck/views/fonts/view.html.php
Normal file
12
components/com_pagebuilderck/views/fonts/view.html.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/fonts/view.html.php';
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2019. 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;
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2019. 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\CKtext;
|
||||
|
||||
$iframeurl = str_replace('&tckedition=1', '', urldecode($this->input->get('url', '', 'string')));
|
||||
$doc = JFactory::getDocument();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="<?php echo $doc->language; ?>" lang="<?php echo $doc->language; ?>" dir="<?php echo $doc->direction; ?>">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<base href="<?php echo PAGEBUILDERCK_ADMIN_URL ?>" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Expires" content="Tue, 01 Jan 1995 12:12:12 GMT">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<title>Page Builder CK</title>
|
||||
|
||||
<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/frontedition.css" type="text/css" />
|
||||
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/ckframework.js" type="text/javascript"></script>
|
||||
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/frontedition.js" type="text/javascript"></script>
|
||||
<style>
|
||||
body {
|
||||
padding-left: 310px !important;
|
||||
padding-top: 66px !important;
|
||||
}
|
||||
|
||||
html {
|
||||
/*padding-top: 66px! important;*/
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ckpage {
|
||||
position: relative;
|
||||
top: 66px;
|
||||
}
|
||||
|
||||
iframe {
|
||||
height: calc(100vh - 66px);
|
||||
width: 100%;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#menuck {
|
||||
top: 65px;
|
||||
}
|
||||
|
||||
#ckheader .ckheadermenu .ckheadermenuitem {
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
html {
|
||||
padding-top: 66px! important;
|
||||
}
|
||||
|
||||
body.tck-edition-body #ckheader {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
div.menuck > .inner {
|
||||
height: calc(100vh - 115px);
|
||||
}
|
||||
|
||||
/* disable Joomla front edition buttons */
|
||||
a.jmodedit {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="ckheader">
|
||||
<div class="ckheaderlogo"><a href="https://www.joomlack.fr" target="_blank"><img width="35" height="35" title="JoomlaCK" src="<?php echo JUri::root(true) ?>/media/com_pagebuilderck/images/logo_ck.png" /></a></div>
|
||||
<div class="ckheadermenu">
|
||||
<a href="<?php echo JRoute::_('index.php?option=com_templateck'); ?>" class="ckheadermenuitem ckcancel" >
|
||||
<span class="fa fa-times"></span>
|
||||
<span class="ckheadermenuitemtext"><?php echo JText::_('CK_EXIT') ?></span>
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="ckheadermenuitem cksave" onclick="ckTemplateEditionSave()">
|
||||
<span class="fa fa-check"></span>
|
||||
<span class="ckheadermenuitemtext"><?php echo JText::_('CK_SAVE') ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
// loads the language files from the frontend
|
||||
$lang = JFactory::getLanguage();
|
||||
$lang->load('com_pagebuilderck', JPATH_SITE . '/components/com_pagebuilderck', $lang->getTag(), false);
|
||||
$editor = JFactory::getConfig()->get('editor') == 'jce' ? 'jce' : 'tinymce';
|
||||
$editor = JEditor::getInstance($editor);
|
||||
$editor->display('ckeditor', $html = '', $width = '', $height = '200px', $col='', $row='', $buttons = true, $id = 'ckeditor');
|
||||
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';
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/include.php');
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/menu.php');
|
||||
?>
|
||||
|
||||
- CHECK double authentif, si user logué en admin, sinon on jette la requête et on redirige sur doc
|
||||
- pb si user pas logué, CKText not found
|
||||
- charger ckstylescontainer
|
||||
- mettre structure du template dans le panneau gauche
|
||||
|
||||
<div id="ckleftpanel" class="ckleftpanel">
|
||||
</div>
|
||||
<div id="ckedition" class="ckleftpanel">
|
||||
|
||||
</div>
|
||||
<div id="ckhtmlcontainer" class="focusbar focus">
|
||||
<div class="cktemplatepreview">
|
||||
<iframe id="cktemplatepreview" src="<?php echo $iframeurl ?>"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
$ck('iframe#cktemplatepreview').load(function() {
|
||||
iframe = $ck('iframe#cktemplatepreview').contents();
|
||||
ckInitFrontendInterface();
|
||||
});
|
||||
|
||||
//document.getElementById('ckmodulesmanager_preview_iframe').contentWindow.location.reload();
|
||||
//document.getElementById('ckmodulesmanager_preview_iframe').contentWindow.location.reload(true);
|
||||
</script>
|
||||
<div id="ckpopup"></div>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
exit;
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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.application.component.view');
|
||||
|
||||
class PagebuilderckViewFrontedition extends JViewLegacy
|
||||
{
|
||||
protected $item;
|
||||
|
||||
protected $state;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
|
||||
// check that the user has the rights to edit
|
||||
$user = JFactory::getUser();
|
||||
$app = JFactory::getApplication();
|
||||
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
|
||||
if ($authorised !== true)
|
||||
{
|
||||
if ($user->guest === 1)
|
||||
{
|
||||
$return = base64_encode(JUri::getInstance());
|
||||
$login_url_with_return = JRoute::_('index.php?option=com_users&return=' . $return);
|
||||
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'notice');
|
||||
$app->redirect($login_url_with_return, 403);
|
||||
}
|
||||
else
|
||||
{
|
||||
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
|
||||
$app->setHeader('status', 403, true);
|
||||
return;
|
||||
}
|
||||
// JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
// return false;
|
||||
}
|
||||
|
||||
// check that the template is compatible
|
||||
$app = JFactory::getApplication();
|
||||
$template = $app->getTemplate();
|
||||
$this->input = $app->input;
|
||||
|
||||
// load xml file from the template
|
||||
$xml = simplexml_load_file(JPATH_SITE . '/templates/' . $template . '/templateDetails.xml');
|
||||
|
||||
// check that the template is made with a compatible version of Template Creator CK
|
||||
if ($xml->generator != 'Template Creator CK') {
|
||||
JError::raiseWarning(403, JText::_('The template you are trying to edit has not been created with Template Creator CK, or not the latest version of if. You can download Template Creator CK on <a href="https://www.template-creator.com">https://www.template-creator.com</a>'));
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::display($tpl);
|
||||
}
|
||||
}
|
||||
12
components/com_pagebuilderck/views/icons/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/icons/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/icons/tmpl/default.php';
|
||||
12
components/com_pagebuilderck/views/icons/view.html.php
Normal file
12
components/com_pagebuilderck/views/icons/view.html.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/icons/view.html.php';
|
||||
1
components/com_pagebuilderck/views/index.html
Normal file
1
components/com_pagebuilderck/views/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
1
components/com_pagebuilderck/views/library/index.html
Normal file
1
components/com_pagebuilderck/views/library/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
12
components/com_pagebuilderck/views/library/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/library/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
include_once(JPATH_ROOT . '/administrator/components/com_pagebuilderck/views/library/tmpl/default.php');
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
13
components/com_pagebuilderck/views/library/view.html.php
Normal file
13
components/com_pagebuilderck/views/library/view.html.php
Normal 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
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/library/view.html.php';
|
||||
12
components/com_pagebuilderck/views/links/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/links/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/links/tmpl/default.php';
|
||||
12
components/com_pagebuilderck/views/links/view.html.php
Normal file
12
components/com_pagebuilderck/views/links/view.html.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/links/view.html.php';
|
||||
12
components/com_pagebuilderck/views/modules/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/modules/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/modules/tmpl/default.php';
|
||||
12
components/com_pagebuilderck/views/modules/view.html.php
Normal file
12
components/com_pagebuilderck/views/modules/view.html.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/modules/view.html.php';
|
||||
1
components/com_pagebuilderck/views/options/index.html
Normal file
1
components/com_pagebuilderck/views/options/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
12
components/com_pagebuilderck/views/options/tmpl/edit.php
Normal file
12
components/com_pagebuilderck/views/options/tmpl/edit.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
include_once(JPATH_ROOT . '/administrator/components/com_pagebuilderck/views/options/tmpl/edit.php');
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
13
components/com_pagebuilderck/views/options/view.html.php
Normal file
13
components/com_pagebuilderck/views/options/view.html.php
Normal 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
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/options/view.html.php';
|
||||
1
components/com_pagebuilderck/views/page/index.html
Normal file
1
components/com_pagebuilderck/views/page/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
28
components/com_pagebuilderck/views/page/tmpl/_default.xml
Normal file
28
components/com_pagebuilderck/views/page/tmpl/_default.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_PAGEBUILDERCK_PAGE_VIEW_DEFAULT">
|
||||
<message>
|
||||
<![CDATA[COM_PAGEBUILDERCK_PAGE_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<!-- Add fields to the request variables for the layout. -->
|
||||
<fields name="request">
|
||||
<fieldset name="request" addfieldpath="administrator/components/com_pagebuilderck/models/fields">
|
||||
<field
|
||||
name="id"
|
||||
type="pagebuilderckpage"
|
||||
default="0"
|
||||
label="COM_PAGEBUILDERCK_FIELD_SELECT_PAGE_LABEL"
|
||||
description="COM_PAGEBUILDERCK_FIELD_SELECT_PAGE_DESC"
|
||||
extension="COM_PAGEBUILDERCK"
|
||||
required="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
|
||||
<!-- Add fields to the parameters object for the layout. -->
|
||||
<fields name="params">
|
||||
|
||||
</fields>
|
||||
</metadata>
|
||||
@@ -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
|
||||
*/
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/ajaxrendercss.php';
|
||||
@@ -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
|
||||
*/
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// loads the admin file
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/ajaxstylescss.php');
|
||||
56
components/com_pagebuilderck/views/page/tmpl/default.php
Normal file
56
components/com_pagebuilderck/views/page/tmpl/default.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?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();
|
||||
$canEdit = $user->authorise('core.edit.own', 'com_pagebuilderck');
|
||||
|
||||
// frontend medias
|
||||
PagebuilderckFrontHelper::loadFrontendAssets();
|
||||
|
||||
// load the component configuration
|
||||
$params = JComponentHelper::getParams('com_pagebuilderck');
|
||||
// load the page/link configuration
|
||||
$app = JFactory::getApplication();
|
||||
$pageParams = $app->getParams();
|
||||
$doc = JFactory::getDocument();
|
||||
|
||||
// add the meta in the page
|
||||
if ($pageParams->get('menu-meta_description'))
|
||||
{
|
||||
$doc->setDescription($pageParams->get('menu-meta_description'));
|
||||
}
|
||||
if ($pageParams->get('menu-meta_keywords'))
|
||||
{
|
||||
$doc->setMetadata('keywords', $pageParams->get('menu-meta_keywords'));
|
||||
}
|
||||
if ($pageParams->get('robots'))
|
||||
{
|
||||
$doc->setMetadata('robots', $pageParams->get('robots'));
|
||||
}
|
||||
// $this->item->params = new JRegistry($this->item->params);
|
||||
?>
|
||||
<div class="pagebuilderck <?php echo htmlspecialchars($pageParams->get('pageclass_sfx', '')); ?>">
|
||||
<?php if ($canEdit && $this->input->get('option', '', 'cmd') == 'com_pagebuilderck' ) { ?>
|
||||
<a class="btn btn-primary" href="<?php echo JUri::base(true) ?>/index.php?option=com_pagebuilderck&task=page.edit&id=<?php echo $this->item->id ?>"><i class="icon icon-edit"></i> <?php echo JText::_('CK_EDIT') ?></a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($pageParams->get('show_page_heading', '1') && $pageParams->get('page_heading')) { ?>
|
||||
<div class="page-header">
|
||||
<h1> <?php echo addslashes($pageParams->get('page_heading')); ?> </h1>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->item->params->get('showtitle')) { ?>
|
||||
<<?php echo $this->item->params->get('titletag', 'h1') ?> class="pagebuilderck_title"><?php echo $this->item->title ?></<?php echo $this->item->params->get('titletag', 'h1') ?>>
|
||||
<?php } ?>
|
||||
|
||||
<?php echo $this->item->htmlcode; ?>
|
||||
</div>
|
||||
25
components/com_pagebuilderck/views/page/tmpl/edit.php
Normal file
25
components/com_pagebuilderck/views/page/tmpl/edit.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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');
|
||||
|
||||
echo '<p style="color:red">You are not allowed to edit a page in Front. Please do it in the administration area. To edit in Front, please use the articles instead.</p>';
|
||||
return;
|
||||
|
||||
// loads the css and js files
|
||||
//include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/include.php');
|
||||
|
||||
// loads the css and js files
|
||||
//include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/main.php');
|
||||
1
components/com_pagebuilderck/views/page/tmpl/index.html
Normal file
1
components/com_pagebuilderck/views/page/tmpl/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
37
components/com_pagebuilderck/views/page/tmpl/modal.php
Normal file
37
components/com_pagebuilderck/views/page/tmpl/modal.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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');
|
||||
|
||||
|
||||
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
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/include.php');
|
||||
?>
|
||||
<style>
|
||||
body {background: #fff !important;}
|
||||
</style>
|
||||
<button id="applyBtn" type="button" class="hidden" style="display:none;" onclick="Joomla.submitbutton('page.apply');"></button>
|
||||
<button id="saveBtn" type="button" class="hidden" style="display:none;" onclick="Joomla.submitbutton('page.save');"></button>
|
||||
<button id="closeBtn" type="button" class="hidden" style="display:none;" onclick="Joomla.submitbutton('page.cancel');"></button>
|
||||
<?php
|
||||
// loads the main content
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/main.php');
|
||||
|
||||
99
components/com_pagebuilderck/views/page/view.html.php
Normal file
99
components/com_pagebuilderck/views/page/view.html.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?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\CKView;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
class PagebuilderckViewPage extends CKView
|
||||
{
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$user = CKFof::getUser();
|
||||
|
||||
$model = $this->getModel();
|
||||
|
||||
if (substr( $this->input->get('layout', '', 'cmd'), 0, 4 ) !== 'ajax') {
|
||||
// check if the page is available for modification
|
||||
$id = $this->input->get('id', 0, 'int');
|
||||
$this->item = $model->getItem($id);
|
||||
|
||||
// check that we got a page
|
||||
if (empty($this->item))
|
||||
{
|
||||
throw new Exception(JText::_('COM_PAGEBUILDERCK_ERROR_PAGE_NOT_FOUND'), 404);
|
||||
}
|
||||
}
|
||||
|
||||
// check if we are viewing the frontend layout
|
||||
if ( ($this->input->get('layout', null, 'cmd') === null || $this->input->get('layout', null, 'cmd') === 'default')
|
||||
&& $tpl === null) {
|
||||
|
||||
// check the rights to access the page
|
||||
$groups = $user->getAuthorisedViewLevels();
|
||||
// if ((!in_array($this->item->access, $groups)) || (!in_array($this->item->category_access, $groups)))
|
||||
if (!in_array($this->item->access, $groups))
|
||||
{
|
||||
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// check that the user has the rights to edit
|
||||
$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 (! $model->checkout($id)) {
|
||||
CKFof::redirect(
|
||||
JRoute::_(
|
||||
'index.php?option=com_pagebuilderck&view=page&id=' . $id, false
|
||||
)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
// Check if access is not public
|
||||
// $groups = $user->getAuthorisedViewLevels();
|
||||
|
||||
// if ($this->_layout == 'edit' || !$this->item->id) {
|
||||
// $authorised = $user->authorise('core.edit.own', 'com_pagebuilderck');
|
||||
|
||||
// if ($authorised !== true) {
|
||||
// Redirect to the edit screen.
|
||||
// $app->redirect(JURI::root() . 'index.php?option=com_templateck&view=login&template=templatecreatorck&tmpl=login&id=' . $this->item->id);
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// TODO : ajouter permissions et acl
|
||||
// if ((!in_array($item->access, $groups)) || (!in_array($item->category_access, $groups)))
|
||||
// {
|
||||
// JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
// return;
|
||||
// }
|
||||
|
||||
// $model = $this->getModel();
|
||||
// $model->hit();
|
||||
|
||||
return parent::display($tpl);
|
||||
}
|
||||
}
|
||||
12
components/com_pagebuilderck/views/pages/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/pages/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/pages/tmpl/default.php';
|
||||
13
components/com_pagebuilderck/views/pages/tmpl/modal.php
Normal file
13
components/com_pagebuilderck/views/pages/tmpl/modal.php
Normal 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
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/pages/tmpl/modal.php';
|
||||
12
components/com_pagebuilderck/views/pages/view.html.php
Normal file
12
components/com_pagebuilderck/views/pages/view.html.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/pages/view.html.php';
|
||||
12
components/com_pagebuilderck/views/styles/tmpl/default.php
Normal file
12
components/com_pagebuilderck/views/styles/tmpl/default.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/styles/tmpl/default.php';
|
||||
13
components/com_pagebuilderck/views/styles/tmpl/modal.php
Normal file
13
components/com_pagebuilderck/views/styles/tmpl/modal.php
Normal 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
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/styles/tmpl/modal.php';
|
||||
12
components/com_pagebuilderck/views/styles/view.html.php
Normal file
12
components/com_pagebuilderck/views/styles/view.html.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/styles/view.html.php';
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
158
components/com_pagebuilderck/views/templateedition/view.html.php
Normal file
158
components/com_pagebuilderck/views/templateedition/view.html.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<?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.application.component.view');
|
||||
|
||||
class PagebuilderckViewTemplateedition extends JViewLegacy
|
||||
{
|
||||
protected $item;
|
||||
|
||||
protected $state;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
|
||||
// check that the user has the rights to edit
|
||||
$user = JFactory::getUser();
|
||||
$app = JFactory::getApplication();
|
||||
$authorised = ($user->authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create'))));
|
||||
if ($authorised !== true)
|
||||
{
|
||||
if ($user->guest === 1)
|
||||
{
|
||||
$return = base64_encode(JUri::getInstance());
|
||||
$login_url_with_return = JRoute::_('index.php?option=com_users&return=' . $return);
|
||||
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'notice');
|
||||
$app->redirect($login_url_with_return, 403);
|
||||
}
|
||||
else
|
||||
{
|
||||
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
|
||||
$app->setHeader('status', 403, true);
|
||||
return;
|
||||
}
|
||||
// JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
// return false;
|
||||
}
|
||||
|
||||
// check that the template is compatible
|
||||
$app = JFactory::getApplication();
|
||||
$template = $app->getTemplate();
|
||||
|
||||
// load xml file from the template
|
||||
$xml = simplexml_load_file(JPATH_SITE . '/templates/' . $template . '/templateDetails.xml');
|
||||
|
||||
// check that the template is made with a compatible version of Template Creator CK
|
||||
if ($xml->generator != 'Template Creator CK') {
|
||||
JError::raiseWarning(403, JText::_('The template you are trying to edit has not been created with Template Creator CK, or not the latest version of if. You can download Template Creator CK on <a href="https://www.template-creator.com">https://www.template-creator.com</a>'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// die ('ok');
|
||||
// $app = JFactory::getApplication();
|
||||
// $user = JFactory::getUser();
|
||||
|
||||
/*if (substr( $app->input->get('layout', null, 'cmd'), 0, 4 ) !== 'ajax') {
|
||||
$this->item = $this->get('Item');
|
||||
$this->state = $this->get('State');
|
||||
// $this->form = $this->get('Form');
|
||||
|
||||
// check that we got a page
|
||||
if (empty($this->item))
|
||||
{
|
||||
return JError::raiseError(404, JText::_('COM_PAGEBUILDERCK_ERROR_PAGE_NOT_FOUND'));
|
||||
}
|
||||
}
|
||||
|
||||
// check if we are viewing the frontend layout
|
||||
if ( ($app->input->get('layout', null, 'cmd') === null || $app->input->get('layout', null, 'cmd') === 'default')
|
||||
&& $tpl === null) {
|
||||
|
||||
// check the rights to access the page
|
||||
$groups = $user->getAuthorisedViewLevels();
|
||||
// if ((!in_array($this->item->access, $groups)) || (!in_array($this->item->category_access, $groups)))
|
||||
if (!in_array($this->item->access, $groups))
|
||||
{
|
||||
JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// check that the user has the rights to edit
|
||||
$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;
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
// check if the page is available for modification
|
||||
$model = $this->getModel();
|
||||
$id = $app->input->get('id', 0, 'int');
|
||||
if (! $model->checkout($id)) {
|
||||
$app->redirect(
|
||||
JRoute::_(
|
||||
'index.php?option=com_pagebuilderck&view=page&id=' . $id, false
|
||||
)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
// Get the parameters
|
||||
// $params = JComponentHelper::getParams('com_pagebuilderck');
|
||||
// if ($app->input->get('layout', '', 'cmd') !== null || $tpl !== null) {
|
||||
|
||||
// Check for errors.
|
||||
// if (count($errors = $this->get('Errors')))
|
||||
// {
|
||||
// JError::raiseWarning(500, implode("\n", $errors));
|
||||
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// loads the neede library
|
||||
// include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/menustyles.php';
|
||||
// include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/stylescss.php';
|
||||
// Check if access is not public
|
||||
// $groups = $user->getAuthorisedViewLevels();
|
||||
|
||||
// if ($this->_layout == 'edit' || !$this->item->id) {
|
||||
// $authorised = $user->authorise('core.edit.own', 'com_pagebuilderck');
|
||||
|
||||
// if ($authorised !== true) {
|
||||
// Redirect to the edit screen.
|
||||
// $app->redirect(JURI::root() . 'index.php?option=com_templateck&view=login&template=templatecreatorck&tmpl=login&id=' . $this->item->id);
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// TODO : ajouter permissions et acl
|
||||
// if ((!in_array($item->access, $groups)) || (!in_array($item->category_access, $groups)))
|
||||
// {
|
||||
// JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
// return;
|
||||
// }
|
||||
|
||||
// $model = $this->getModel();
|
||||
// $model->hit();
|
||||
|
||||
return parent::display($tpl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user