first commit
This commit is contained in:
14
components/com_pagebuilderck/controllers/browse.php
Normal file
14
components/com_pagebuilderck/controllers/browse.php
Normal 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
|
||||
*/
|
||||
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
// load the main controller
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/controllers/browse.php');
|
||||
14
components/com_pagebuilderck/controllers/contenttype.php
Normal file
14
components/com_pagebuilderck/controllers/contenttype.php
Normal 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
|
||||
*/
|
||||
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
// load the main controller
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/controllers/contenttype.php');
|
||||
14
components/com_pagebuilderck/controllers/fonts.php
Normal file
14
components/com_pagebuilderck/controllers/fonts.php
Normal 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
|
||||
*/
|
||||
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
// load the main controller
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/controllers/fonts.php');
|
||||
79
components/com_pagebuilderck/controllers/frontedition.php
Normal file
79
components/com_pagebuilderck/controllers/frontedition.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?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/helpers/ckcontroller.php';
|
||||
|
||||
Use Pagebuilderck\CKFof;
|
||||
Use Pagebuilderck\CKController;
|
||||
|
||||
class PagebuilderckControllerFrontedition extends CKController
|
||||
{
|
||||
|
||||
public function createModule() {
|
||||
// security check
|
||||
PagebuilderckHelper::checkAjaxToken();
|
||||
|
||||
$position = $this->input->get('position', 'position-8');
|
||||
$pagedition = $this->input->get('pagedition', '', 'raw');
|
||||
|
||||
// create the module
|
||||
$data = array();
|
||||
$data['id'] = 0;
|
||||
$data['title'] = 'Page Builder CK';
|
||||
$data['ordering'] = 0;
|
||||
$data['checked_out'] = 0;
|
||||
$data['published'] = 1;
|
||||
$data['position'] = $position;
|
||||
$data['module'] = 'mod_pagebuilderck';
|
||||
$data['access'] = 1;
|
||||
$data['showtitle'] = 0;
|
||||
$data['clint_id'] = 0;
|
||||
$data['language'] = '*';
|
||||
$data['params'] = '{"pagedition":"' . addslashes($pagedition) . '"}';
|
||||
|
||||
$id = CKFof::dbStore('#__modules', $data);
|
||||
// if error, return
|
||||
if (! $id) {
|
||||
echo '{"id" : "0"}';
|
||||
exit;
|
||||
}
|
||||
|
||||
// assign to all pages
|
||||
$data = array();
|
||||
$data['id'] = 0; // to force inserting new value
|
||||
$data['moduleid'] = (int)$id;
|
||||
$data['menuid'] = 0;
|
||||
|
||||
$assign = CKFof::dbStore('#__modules_menu', $data);
|
||||
|
||||
echo '{"id" : "' . $id . '"}';
|
||||
exit;
|
||||
}
|
||||
|
||||
public function savemodules() {
|
||||
$modules = $this->input->get('modules', array(), 'array');
|
||||
|
||||
foreach($modules as $module) {
|
||||
$query = "SELECT * FROM #__modules WHERE id = " . (int)$module['id'];
|
||||
$data = CKFof::dbLoadObject($query);
|
||||
$params = json_decode($data->params);
|
||||
$params->pagedition = $module['code'];
|
||||
$data->params = json_encode($params);
|
||||
|
||||
$id = CKFof::dbStore('#__modules', $data);
|
||||
// if error, return
|
||||
if (! $id) {
|
||||
echo '{"id" : "0"}';
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
1
components/com_pagebuilderck/controllers/index.html
Normal file
1
components/com_pagebuilderck/controllers/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
14
components/com_pagebuilderck/controllers/interface.php
Normal file
14
components/com_pagebuilderck/controllers/interface.php
Normal 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
|
||||
*/
|
||||
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
// load the main controller
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/controllers/interface.php');
|
||||
95
components/com_pagebuilderck/controllers/page.php
Normal file
95
components/com_pagebuilderck/controllers/page.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
/**
|
||||
* Controller for single page view
|
||||
*
|
||||
* @since 1.5.19
|
||||
*/
|
||||
class PagebuilderckControllerPage extends CKController
|
||||
{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function apply() {
|
||||
return $this->save(0, 'apply');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save data.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save($task = null) {
|
||||
// Check for request forgeries.
|
||||
CKFof::checkToken();
|
||||
|
||||
// Initialise variables.
|
||||
$model = $this->getModel();
|
||||
|
||||
// Initialise variables.
|
||||
$appendToUrl = $this->input->get('tmpl') ? '&tmpl=' . $this->input->get('tmpl') : '';
|
||||
$layout = $this->input->get('layout') == 'modal' ? '&layout=modal' : '&layout=edit';
|
||||
|
||||
// Get the user data.
|
||||
$data = $this->input->getArray($_POST);
|
||||
|
||||
// Check for errors.
|
||||
if ($data === false) {
|
||||
CKFof::enqueueMessage('ERROR : NO DATA SAVED', 'warning');
|
||||
// Redirect back to the edit screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_BASE_URL . '&view=page'.$layout.'&id=' . $id . $appendToUrl);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Attempt to save the data.
|
||||
$return = $model->save($data);
|
||||
|
||||
// Check for errors.
|
||||
if ($return === false) {
|
||||
// Redirect back to the edit screen.
|
||||
CKFof::enqueueMessage(JText::_('CK_ITEM_SAVED_FAILED'), 'warning');
|
||||
CKFof::redirect(PAGEBUILDERCK_BASE_URL . '&view=page' . $layout . '&id=' . $id . $appendToUrl);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Redirect to the list screen.
|
||||
CKFof::enqueueMessage(JText::_('CK_ITEM_SAVED_SUCCESS'));
|
||||
|
||||
$model->checkin($return);
|
||||
|
||||
switch ($task)
|
||||
{
|
||||
case 'apply':
|
||||
// Redirect back to the edit screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_BASE_URL . '&view=page' . $layout . '&id=' . $return . $appendToUrl);
|
||||
break;
|
||||
default:
|
||||
// Redirect to the list screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_BASE_URL . '&view=page&id=' . $return, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
$id = $this->input->get('id', 0, 'int');
|
||||
if (! $this->getModel()->checkin($id)) {
|
||||
CKFof::redirect('index.php?option=com_pagebuilderck&view=page&id=' . $id, JLIB_APPLICATION_ERROR_CHECKIN_FAILED, 'warning');
|
||||
}
|
||||
|
||||
//Redirect back to list
|
||||
CKFof::redirect('index.php?option=com_pagebuilderck&view=page&id=' . $id);
|
||||
}
|
||||
}
|
||||
14
components/com_pagebuilderck/controllers/pixabay.php
Normal file
14
components/com_pagebuilderck/controllers/pixabay.php
Normal 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
|
||||
*/
|
||||
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
// load the main controller
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/controllers/pixabay.php');
|
||||
14
components/com_pagebuilderck/controllers/styles.php
Normal file
14
components/com_pagebuilderck/controllers/styles.php
Normal 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
|
||||
*/
|
||||
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
// load the main controller
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/controllers/styles.php');
|
||||
Reference in New Issue
Block a user