first commit
This commit is contained in:
1
modules/mod_pagebuilderck/elements/index.html
Normal file
1
modules/mod_pagebuilderck/elements/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
139
modules/mod_pagebuilderck/elements/pagebuilderck.php
Normal file
139
modules/mod_pagebuilderck/elements/pagebuilderck.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870
|
||||
* http://www.joomlack.fr
|
||||
* @license GNU/GPL
|
||||
* */
|
||||
|
||||
defined('JPATH_PLATFORM') or die;
|
||||
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
if (!defined('PAGEBUILDERCK_MEDIA_URI'))
|
||||
{
|
||||
define('PAGEBUILDERCK_MEDIA_URI', JUri::root(true) . '/media/com_pagebuilderck');
|
||||
}
|
||||
|
||||
class JFormFieldPagebuilderck extends JFormField
|
||||
{
|
||||
protected $elements;
|
||||
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected $type = 'Pagebuilderck';
|
||||
|
||||
protected function getPathToElements() {
|
||||
$localpath = dirname(__FILE__);
|
||||
$rootpath = JPATH_ROOT;
|
||||
$httppath = trim(JURI::root(), "/");
|
||||
$pathtoelements = str_replace("\\", "/", str_replace($rootpath, $httppath, $localpath));
|
||||
return $pathtoelements;
|
||||
}
|
||||
|
||||
/*
|
||||
* Render the input only if we are in frontend editing because the renderField method does not work
|
||||
*/
|
||||
protected function getInput() {
|
||||
$app = JFactory::getApplication();
|
||||
$doc = JFactory::getDocument();
|
||||
if (CKFof::isSite()) {
|
||||
$doc->addStyleDeclaration('
|
||||
.pagebuilderckfrontend #workspaceparentck:not(.collapsedck) #workspaceck {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.pagebuilderckfrontend #workspaceck {
|
||||
margin-left: -120px;
|
||||
}
|
||||
|
||||
#options .accordion-body.collapse:not(.in) #menuck {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#options .accordion-body.collapse.in {
|
||||
height: auto !important;
|
||||
}
|
||||
');
|
||||
echo '<div class="pagebuilderckfrontend">';
|
||||
$this->renderField();
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
public function renderField($options = array()) {
|
||||
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/ckfof.php';
|
||||
$app = JFactory::getApplication();
|
||||
$this->input = CKFof::getInput();
|
||||
|
||||
// loads the language files from the frontend
|
||||
// loads the language files from the component frontend
|
||||
$lang = JFactory::getLanguage();
|
||||
$lang->load('com_pagebuilderck', JPATH_SITE . '/components/com_pagebuilderck', $lang->getTag(), false);
|
||||
$lang->load('com_pagebuilderck', JPATH_SITE, $lang->getTag(), false);
|
||||
?>
|
||||
<input type="hidden" name="<?php echo $this->name ?>" id="<?php echo $this->id ?>" />
|
||||
<style>
|
||||
iframe {border:none;}
|
||||
.pagebuilderck_container {resize:vertical;overflow:auto;}
|
||||
/* for joomla 4 */
|
||||
#fieldset-edition [class*="column-count-"] { column-count: initial; }
|
||||
#fieldset-edition [class*=" column-"] > div, #fieldset-edition [class^="column-"] > div { display: block; }
|
||||
#fieldset-edition [class*=" column-"] .modal { display: none; }
|
||||
</style>
|
||||
|
||||
<?php if (CKFof::isSite()) { ?>
|
||||
<div class="ckbutton ckbutton-primary" style="display: block;" onclick="ckModuleEditFullScreen()"><?php echo JText::_('CK_EDIT_FULLSCREEN') ?></div>
|
||||
<?php } ?>
|
||||
<div class="pagebuilderck_container"></div>
|
||||
<?php
|
||||
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';
|
||||
|
||||
$this->value = str_replace("|URIROOT|", JUri::root(true), $this->value);
|
||||
// get instance of the editor to load the css / js in the page
|
||||
// $this->ckeditor = PagebuilderckHelper::loadEditor();
|
||||
// need the tinymce instance for the items edition
|
||||
$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');
|
||||
// Get an instance of the model
|
||||
// JModelLegacy::addIncludePath(JPATH_SITE . '/administrator/components/com_pagebuilderck/models', 'PagebuilderckModel');
|
||||
$model = CKFof::getModel('Elements');
|
||||
|
||||
// $model = $this->getModel('Elements', '', array());
|
||||
$this->elements = $model->getItems();
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/include.php');
|
||||
include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/submitform.php');
|
||||
?>
|
||||
<script src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/assets/mod_pagebuilderck_edition.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
JoomlaCK.beforesubmitbutton = function() {
|
||||
var workspace = $ck('#workspaceck');
|
||||
$ck('#<?php echo $this->id ?>').attr('value', workspace.html());
|
||||
}
|
||||
</script>
|
||||
<div id="workspaceparentck">
|
||||
<?php include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/menu.php'); ?>
|
||||
<?php include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/toolbar.php'); ?>
|
||||
<div id="workspaceck" class="pagebuilderck workspaceck">
|
||||
<?php
|
||||
if ($this->value) {
|
||||
echo $this->value;
|
||||
} else { ?>
|
||||
<div class="googlefontscall"></div>
|
||||
<?php }
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include PAGEBUILDERCK_PATH . '/views/page/tmpl/contextmenu.php';
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; http://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
MOD_PAGEBUILDERCK="Page Builder CK"
|
||||
MOD_PAGEBUILDERCK_XML_DESCRIPTION="Use the interface of Page Builder CK into a module that you can use anywhere in your website."
|
||||
MOD_PAGEBUILDERCK_EDITION_FIELDSET_LABEL="Page Builder CK - Edition"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; http://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
MOD_PAGEBUILDERCK="Page Builder CK"
|
||||
MOD_PAGEBUILDERCK_XML_DESCRIPTION="Use the interface of Page Builder CK into a module that you can use anywhere in your page."
|
||||
1
modules/mod_pagebuilderck/language/en-GB/index.html
Normal file
1
modules/mod_pagebuilderck/language/en-GB/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,10 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; http://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
MOD_PAGEBUILDERCK="Page Builder CK"
|
||||
MOD_PAGEBUILDERCK_XML_DESCRIPTION="Utilisez l'interface de Page Builder CK directement dans un module que vous pouvez placer n'importe où dans votre site."
|
||||
MOD_PAGEBUILDERCK_EDITION_FIELDSET_LABEL="Page Builder CK - Edition"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; http://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
MOD_PAGEBUILDERCK="Page Builder CK"
|
||||
MOD_PAGEBUILDERCK_XML_DESCRIPTION="Use the interface of Page Builder CK into a module that you can use anywhere in your page."
|
||||
1
modules/mod_pagebuilderck/language/fr-FR/index.html
Normal file
1
modules/mod_pagebuilderck/language/fr-FR/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
1
modules/mod_pagebuilderck/language/index.html
Normal file
1
modules/mod_pagebuilderck/language/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
44
modules/mod_pagebuilderck/mod_pagebuilderck.php
Normal file
44
modules/mod_pagebuilderck/mod_pagebuilderck.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870
|
||||
* http://www.template-creator.com
|
||||
* http://www.joomlack.fr
|
||||
* @license GNU/GPL
|
||||
* */
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
if (! file_exists(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/pagebuilderckfront.php')) return;
|
||||
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/pagebuilderckfront.php';
|
||||
|
||||
// get the html code of the page
|
||||
$modulecontent = $params->get('pagedition');
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
// Detecting Active Variables
|
||||
$templateedition = $app->input->get('tckedition', 0, 'int');
|
||||
global $pagebuilderckEditionLoaded, $ckFrontEditionLoaded;
|
||||
if ($templateedition && $pagebuilderckEditionLoaded === true) {
|
||||
echo '<div class="workspaceck pagebuilderck pbck-module-edition" data-id="' . $module->id . '">' . $modulecontent . '</div>';
|
||||
} else {
|
||||
|
||||
// pass through the content plugins
|
||||
if ($params->get('preparecontent', '0')) {
|
||||
JPluginHelper::importPlugin('content');
|
||||
$modulecontent = JHtml::_('content.prepare', $modulecontent, '', 'mod_pagebuilderck.content');
|
||||
}
|
||||
|
||||
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''));
|
||||
|
||||
// frontend medias
|
||||
PagebuilderckFrontHelper::loadFrontendAssets();
|
||||
|
||||
// get the page model
|
||||
include_once JPATH_ROOT . '/components/com_pagebuilderck/models/page.php';
|
||||
$model = JModelLegacy::getInstance('Page', 'PagebuilderckModel');
|
||||
|
||||
// parse the html code through the model page
|
||||
$model->parseHtml($modulecontent);
|
||||
|
||||
require JModuleHelper::getLayoutPath('mod_pagebuilderck', $params->get('layout', 'default'));
|
||||
}
|
||||
52
modules/mod_pagebuilderck/mod_pagebuilderck.xml
Normal file
52
modules/mod_pagebuilderck/mod_pagebuilderck.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="module" version="3.1" client="site" method="upgrade">
|
||||
<name>mod_pagebuilderck</name>
|
||||
<creationDate>November 2015</creationDate>
|
||||
<copyright>Copyright (C) 2015. All rights reserved.</copyright>
|
||||
<license>GNU General Public License version 2 or later</license>
|
||||
<author>Cedric Keiflin</author>
|
||||
<authorEmail>ced1870@gmail.com</authorEmail>
|
||||
<authorUrl>http://www.joomlack.fr</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>MOD_PAGEBUILDERCK_XML_DESCRIPTION</description>
|
||||
|
||||
<files>
|
||||
<filename module="mod_pagebuilderck">mod_pagebuilderck.php</filename>
|
||||
<folder>elements</folder>
|
||||
<folder>language</folder>
|
||||
<folder>tmpl</folder>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.mod_pagebuilderck.sys.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.mod_pagebuilderck.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.mod_pagebuilderck.sys.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.mod_pagebuilderck.ini</language>
|
||||
</languages>
|
||||
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="edition" label="MOD_PAGEBUILDERCK_EDITION_FIELDSET_LABEL" addfieldpath="/modules/mod_pagebuilderck/elements">
|
||||
<field
|
||||
name="pagedition"
|
||||
type="pagebuilderck"
|
||||
label=""
|
||||
description=""
|
||||
filter="raw"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset name="advanced">
|
||||
<field
|
||||
name="preparecontent"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_CONTENT_PREPARE"
|
||||
description=""
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
14
modules/mod_pagebuilderck/tmpl/default.php
Normal file
14
modules/mod_pagebuilderck/tmpl/default.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870
|
||||
* http://www.template-creator.com
|
||||
* http://www.joomlack.fr
|
||||
* @license GNU/GPL
|
||||
* */
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
<div class="pagebuilderck <?php echo $moduleclass_sfx ?>">
|
||||
<?php echo $modulecontent; ?>
|
||||
</div>
|
||||
1
modules/mod_pagebuilderck/tmpl/index.html
Normal file
1
modules/mod_pagebuilderck/tmpl/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
Reference in New Issue
Block a user