first commit
15
administrator/components/com_pagebuilderck/access.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<access component="com_pagebuilderck">
|
||||
<section name="component">
|
||||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
|
||||
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
|
||||
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
|
||||
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
|
||||
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
|
||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
|
||||
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
|
||||
<action name="core.frontedition" title="PAGEBUILDERCK_ACCESS_FRONTEDITION" description="PAGEBUILDERCK_ACCESS_FRONTEDITION_DESC" />
|
||||
<action name="core.pixabay" title="PAGEBUILDERCK_ACCESS_PIXABAY" description="PAGEBUILDERCK_ACCESS_PIXABAY_DESC" />
|
||||
<action name="core.itemacl" title="PAGEBUILDERCK_ITEM_ACL" description="PAGEBUILDERCK_ITEM_ACL_DESC" />
|
||||
</section>
|
||||
</access>
|
||||
@@ -0,0 +1 @@
|
||||
{"id":"","title":"","alias":"","ordering":"","state":"","created":"","modified":"","catid":"","created_by":"","params":{},"access":"","hits":"","featured":"","htmlcode":"","checked_out":"","categories":[""]}
|
||||
@@ -0,0 +1 @@
|
||||
{"id":"","title":"","alias":"","ordering":"","state":"","created":"","modified":"","catid":"","created_by":"","params":{},"access":"","hits":"","featured":"","htmlcode":"","checked_out":"","categories":[""]}
|
||||
@@ -0,0 +1 @@
|
||||
{"id":"","title":"","alias":"","ordering":"","state":"","created":"","modified":"","catid":"","created_by":"","params":{},"access":"","hits":"","featured":"","htmlcode":"","checked_out":"","categories":[""]}
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
270
administrator/components/com_pagebuilderck/config.xml
Normal file
@@ -0,0 +1,270 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<fieldset name="general"
|
||||
label="COM_PAGEBUILDERCK_GENERAL_LABEL"
|
||||
description="COM_PAGEBUILDERCK_GENERAL_DESC"
|
||||
addfieldpath="/administrator/components/com_pagebuilderck/elements"
|
||||
>
|
||||
<field
|
||||
name="imagespath"
|
||||
type="text"
|
||||
label="COM_PAGEBUILDERCK_IMAGES_PATH_LABEL"
|
||||
description="COM_PAGEBUILDERCK_IMAGES_PATH_DESC"
|
||||
default="images/pagebuilderck"
|
||||
/>
|
||||
<field
|
||||
name="imagespathexclusive"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_IMAGES_PATH_EXCLUSIVE_LABEL"
|
||||
description="COM_PAGEBUILDERCK_IMAGES_PATH_EXCLUSIVE_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="loadfontawesome"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_LOADFONTAWESOME4_LABEL"
|
||||
description="COM_PAGEBUILDERCK_LOADFONTAWESOME4_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="fixedwidthresolution"
|
||||
type="text"
|
||||
label="COM_PAGEBUILDERCK_FIXED_WIDTH_RESOLUTION_LABEL"
|
||||
description="COM_PAGEBUILDERCK_FIXED_WIDTH_RESOLUTION_DESC"
|
||||
default="1000"
|
||||
/>
|
||||
<field
|
||||
name="nestedrows"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_NESTEDROWS_LABEL"
|
||||
description="COM_PAGEBUILDERCK_NESTEDROWS_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="tooltips"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_TOOLTIPS_LABEL"
|
||||
description="COM_PAGEBUILDERCK_TOOLTIPS_DESC"
|
||||
default="1"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="image_path_fix"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_IMAGE_PATH_FIX_LABEL"
|
||||
description="COM_PAGEBUILDERCK_IMAGE_PATH_FIX_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="spacer1"
|
||||
type="spacer"
|
||||
hr="true"
|
||||
/>
|
||||
<field
|
||||
name="colorpalette1"
|
||||
type="color"
|
||||
label="COM_PAGEBUILDERCK_COLOR_PALETTE"
|
||||
description="COM_PAGEBUILDERCK_COLOR_PALETTE_DESC"
|
||||
default=""
|
||||
/>
|
||||
<field
|
||||
name="colorpalette2"
|
||||
type="color"
|
||||
label="COM_PAGEBUILDERCK_COLOR_PALETTE"
|
||||
description="COM_PAGEBUILDERCK_COLOR_PALETTE_DESC"
|
||||
default=""
|
||||
/>
|
||||
<field
|
||||
name="colorpalette3"
|
||||
type="color"
|
||||
label="COM_PAGEBUILDERCK_COLOR_PALETTE"
|
||||
description="COM_PAGEBUILDERCK_COLOR_PALETTE_DESC"
|
||||
default=""
|
||||
/>
|
||||
<field
|
||||
name="colorpalette4"
|
||||
type="color"
|
||||
label="COM_PAGEBUILDERCK_COLOR_PALETTE"
|
||||
description="COM_PAGEBUILDERCK_COLOR_PALETTE_DESC"
|
||||
default=""
|
||||
/>
|
||||
<field
|
||||
name="colorpalette5"
|
||||
type="color"
|
||||
label="COM_PAGEBUILDERCK_COLOR_PALETTE"
|
||||
description="COM_PAGEBUILDERCK_COLOR_PALETTE_DESC"
|
||||
default=""
|
||||
/>
|
||||
<field
|
||||
name="frontedition"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_FRONTEDITION_LABEL"
|
||||
description="COM_PAGEBUILDERCK_FRONTEDITION_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="loadeditorcss"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_LOAD_EDITORCSS_LABEL"
|
||||
description="COM_PAGEBUILDERCK_LOAD_EDITORCSS_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="stylestoload"
|
||||
type="ckstylestoload"
|
||||
multiple="true"
|
||||
label="COM_PAGEBUILDERCK_STYLES_TO_LOAD_LABEL"
|
||||
description="COM_PAGEBUILDERCK_STYLES_TO_LOAD_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="responsive"
|
||||
label="COM_PAGEBUILDERCK_RESPONSIVE_LABEL"
|
||||
>
|
||||
<field
|
||||
name="responsive4value"
|
||||
type="text"
|
||||
label="COM_PAGEBUILDERCK_RESPONSIVE4_LABEL"
|
||||
default="800"
|
||||
/>
|
||||
<field
|
||||
name="responsive3value"
|
||||
type="text"
|
||||
label="COM_PAGEBUILDERCK_RESPONSIVE3_LABEL"
|
||||
default="640"
|
||||
/>
|
||||
<field
|
||||
name="responsive2value"
|
||||
type="text"
|
||||
label="COM_PAGEBUILDERCK_RESPONSIVE2_LABEL"
|
||||
default="480"
|
||||
/>
|
||||
<field
|
||||
name="responsive1value"
|
||||
type="text"
|
||||
label="COM_PAGEBUILDERCK_RESPONSIVE1_LABEL"
|
||||
default="320"
|
||||
/>
|
||||
<field
|
||||
name="responsiverange"
|
||||
type="list"
|
||||
label="CK_RESPONSIVE_RANGE_LABEL"
|
||||
description="CK_RESPONSIVE_RANGE_DESC"
|
||||
default="reducing"
|
||||
>
|
||||
<option value="between">CK_RESPONSIVE_BETWEEN</option>
|
||||
<option value="reducing">CK_RESPONSIVE_REDUCING</option>
|
||||
</field>
|
||||
<field
|
||||
name="disableanimations"
|
||||
type="text"
|
||||
label="COM_PAGEBUILDERCK_DISABLE_ANIMATIONS_LABEL"
|
||||
default=""
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset name="optimization"
|
||||
label="COM_PAGEBUILDERCK_OPTIMIZATION_LABEL"
|
||||
>
|
||||
<field
|
||||
name="compile"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_COMPILE_LABEL"
|
||||
description="COM_PAGEBUILDERCK_COMPILE_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="lazy_loading"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_IMAGE_LAZY_LOADING_LABEL"
|
||||
description="COM_PAGEBUILDERCK_IMAGE_LAZY_LOADING_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="thirdpartyintegration"
|
||||
label="COM_PAGEBUILDERCK_INTEGRATION_LABEL"
|
||||
>
|
||||
<field
|
||||
name="integrationarticlespacer"
|
||||
type="spacer"
|
||||
label="COM_PAGEBUILDERCK_ARTICLE_INTEGRATION_LABEL"
|
||||
class="nav-header"
|
||||
/>
|
||||
<field
|
||||
name="forcearticleeditor"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_FORCE_ARTICLE_EDITOR_LABEL"
|
||||
description="COM_PAGEBUILDERCK_FORCE_ARTICLE_EDITOR_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="integrationthirdpartyspacer"
|
||||
type="spacer"
|
||||
label="COM_PAGEBUILDERCK_THIRDPARTY_INTEGRATION_LABEL"
|
||||
class="nav-header"
|
||||
/>
|
||||
<field
|
||||
name="integration_com_djcatalog2_item"
|
||||
type="radio"
|
||||
label="COM_PAGEBUILDERCK_DJCATALOG2"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
<option value="2">COM_PAGEBUILDERCK_FORCE</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset name="permissions"
|
||||
description="JCONFIG_PERMISSIONS_DESC"
|
||||
label="JCONFIG_PERMISSIONS_LABEL"
|
||||
>
|
||||
|
||||
<field name="rules" type="rules"
|
||||
component="com_pagebuilderck"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
label="JCONFIG_PERMISSIONS_LABEL"
|
||||
section="component" />
|
||||
</fieldset>
|
||||
|
||||
</config>
|
||||
474
administrator/components/com_pagebuilderck/controller.php
Normal file
@@ -0,0 +1,474 @@
|
||||
<?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\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
class PagebuilderckController extends CKController
|
||||
{
|
||||
static $releaseNotes;
|
||||
|
||||
static $currentVersion;
|
||||
|
||||
public function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
// load the views only in backend
|
||||
if (CKFof::isAdmin()) {
|
||||
$view = $this->input->get('view', 'pages');
|
||||
$this->input->set('view', $view);
|
||||
}
|
||||
parent::display();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the backup file
|
||||
*
|
||||
* @return string, the html content
|
||||
*/
|
||||
public function ajaxDoRestoration() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$id = $this->input->get('id', 0, 'int');
|
||||
$name = $this->input->get('name','', 'string');
|
||||
$isLocked = $this->input->get('isLocked', 0, 'int');
|
||||
$filename = ($isLocked ? 'locked' : 'backup') . '_' . $id . '_' . $name . '.pbck';
|
||||
$path = JPATH_ROOT . '/administrator/components/com_pagebuilderck/backup/' . $id . '_bak';
|
||||
$content = file_get_contents($path . '/' . $filename);
|
||||
$backup = json_decode($content);
|
||||
|
||||
echo str_replace('|URIROOT|', JUri::root(true), $backup->htmlcode);
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a method from the Page Builder CK Params
|
||||
*
|
||||
* @return mixed, the method return
|
||||
*/
|
||||
public function ajaxParamsCall() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$class = $this->input->get('class', '', 'cmd');
|
||||
$method = $this->input->get('method', '', 'cmd');
|
||||
$params = $this->input->get('params', '', 'array');
|
||||
if ($paramsClass = PagebuilderckHelper::getParams($class)) {
|
||||
echo $paramsClass->$method($params);
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch between lock / unlock state for the backup file
|
||||
*
|
||||
* @return string, the html content
|
||||
*/
|
||||
public function ajaxToggleLockBackup() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$id = $this->input->get('id', 0, 'int');
|
||||
$isLocked = $this->input->get('isLocked', 0, 'int');
|
||||
$filename = $this->input->get('filename', '', 'string');
|
||||
// locked_38_09-02-2016-11-30-13
|
||||
$filename = ($isLocked ? 'locked' : 'backup') . '_' . $id . '_' . $filename . '.pbck';
|
||||
$file = JPATH_ROOT . '/administrator/components/com_pagebuilderck/backup/' . $id . '_bak/' . $filename;
|
||||
// $isLocked = stristr($file, 'locked_');
|
||||
if ($isLocked) {
|
||||
$newFilename = str_replace('locked_', 'backup_', $filename);
|
||||
} else {
|
||||
$newFilename = str_replace('backup_', 'locked_', $filename);
|
||||
}
|
||||
$toFile = JPATH_ROOT . '/administrator/components/com_pagebuilderck/backup/' . $id . '_bak/' . $newFilename;
|
||||
|
||||
if (@JFile::move($file, $toFile)) {
|
||||
echo '1';
|
||||
} else {
|
||||
echo '0';
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the page html code from it id
|
||||
*
|
||||
* @return string, the html code
|
||||
*/
|
||||
public function ajaxLoadPageHtml() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
PagebuilderckHelper::ajaxLoadPageHtml();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the page html code from its id
|
||||
*
|
||||
* @return string, the html code
|
||||
*/
|
||||
public static function ajaxLoadLibraryHtml() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$id = $this->input->get('id', 0, 'string');
|
||||
// $page = PagebuilderckHelper::getPage($id);
|
||||
$url = 'https://media.joomlack.fr/api/pagebuilderck/page/' . $id;
|
||||
|
||||
try {
|
||||
$file = file_get_contents($url);
|
||||
} catch (Exception $e) {
|
||||
echo 'ERROR : ', $e->getMessage(), "\n";
|
||||
exit();
|
||||
}
|
||||
$file = json_decode($file);
|
||||
if (isset($file->htmlcode)) {
|
||||
echo trim($file->htmlcode);
|
||||
} else {
|
||||
echo 'error';
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that the user can do
|
||||
*/
|
||||
public function checkAjaxUserEditRight() {
|
||||
$user = JFactory::getUser();
|
||||
$canEdit = $user->authorise('core.edit', 'com_pagebuilderck');
|
||||
if (! $canEdit) {
|
||||
echo '{"status": "0", "msg": "' . JText::_('CK_ERROR_USER_NO_AUTH') . '"}';
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Save the current styles into a favorite file
|
||||
*/
|
||||
public function ajaxSaveFavorite() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$this->checkAjaxUserEditRight();
|
||||
|
||||
$favorite = $this->input->get('favorite', '', 'raw');
|
||||
$id = $this->input->get('id', -1, 'int');
|
||||
$path = PAGEBUILDERCK_PARAMS_PATH . '/favorites';
|
||||
|
||||
$error = 0;
|
||||
if (is_numeric($id) && (int) $id > -1) {
|
||||
$i = (int) $id;
|
||||
} else {
|
||||
$i = count(JFolder::files($path, '.fck3'));
|
||||
$j = 0;
|
||||
while (file_exists(PAGEBUILDERCK_PARAMS_PATH . '/favorites/favorite'.$i.'.fck3') && $j < 1000) {
|
||||
$i++;
|
||||
$j++;
|
||||
}
|
||||
if ($j >= 1000) {
|
||||
echo 'ERROR reach loop of 1000 files';
|
||||
$error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$exportfiledest = PAGEBUILDERCK_PARAMS_PATH . '/favorites/favorite'.$i.'.fck3';
|
||||
$exportfiletext = $favorite;
|
||||
|
||||
if (!file_put_contents($exportfiledest, $exportfiletext) || $error == 1) {
|
||||
$msg = JText::_('CK_ERROR_CREATING_FAVORITEFILE');
|
||||
$status = 0;
|
||||
} else {
|
||||
$msg = $i;
|
||||
$status = 1;
|
||||
}
|
||||
|
||||
echo '{"status": "' . $status . '", "msg": "' . $msg . '"}';
|
||||
// echo $msg;
|
||||
exit();
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the favorite file
|
||||
*/
|
||||
public function ajaxLoadFavorite() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$name = $this->input->get('name', '', 'string');
|
||||
$folder = $this->input->get('folder', '', 'string');
|
||||
|
||||
$path = PAGEBUILDERCK_PARAMS_PATH . '/'.$folder.'/';
|
||||
|
||||
$content = file_get_contents($path . $name . '.fck3');
|
||||
echo $content;
|
||||
exit();
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the favorite file from the folder
|
||||
*/
|
||||
public function ajaxRemoveFavorite() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$this->checkAjaxUserEditRight();
|
||||
|
||||
$name = $this->input->get('name', '', 'string');
|
||||
|
||||
$msg = '';
|
||||
if (!JFile::delete(PAGEBUILDERCK_PARAMS_PATH . '/favorites/' . $name . '.fck3')) {
|
||||
$msg = JText::_('CK_ERROR_DELETING_FAVORITEFILE');
|
||||
$status = 0;
|
||||
} else {
|
||||
$status = 1;
|
||||
}
|
||||
|
||||
echo '{"status": "' . $status . '", "msg": "' . $msg . '"}';
|
||||
exit();
|
||||
}
|
||||
|
||||
function ajaxShowMenuItems() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$parentId = $this->input->get('parentid', 0, 'int');
|
||||
$menutype = $this->input->get('menutype', '', 'string');
|
||||
|
||||
$model = $this->getModel('Menus', '', array());
|
||||
$items = $model->getChildrenItems($menutype, $parentId);
|
||||
|
||||
$links = array();
|
||||
$imagespath = PAGEBUILDERCK_MEDIA_URI .'/images/';
|
||||
?>
|
||||
<div class="cksubfolder">
|
||||
<?php
|
||||
foreach ($items as $item) {
|
||||
$aliasId = $item->id;
|
||||
if ($item->type == 'alias') {
|
||||
$itemParams = new JRegistry($item->params);
|
||||
$aliasId = $itemParams->get('aliasoptions', 0);
|
||||
}
|
||||
$Itemid = substr($item->link,-7,7) == 'Itemid=' ? $aliasId : '&Itemid=' . $aliasId;
|
||||
$hasChild = (int)$item->rgt - (int)$item->lft > 1 ? true : false;
|
||||
?>
|
||||
<div class="ckfoldertree parent">
|
||||
<div class="ckfoldertreetoggler <?php if (! $hasChild) { echo 'empty'; } ?>" onclick="ckMenusToggleTreeSub(this, <?php echo $item->id ?>)" data-menutype="<?php echo $item->menutype; ?>"></div>
|
||||
<div class="ckfoldertreename hasTip" title="<?php echo $item->link . $Itemid ?>" onclick="ckSetMenuItemUrl('<?php echo $item->link . $Itemid ?>')"><span class="icon-link"></span><?php echo $item->title; ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
|
||||
public function ajaxSaveElement() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$name = $this->input->get('name', '', 'string');
|
||||
$type = $this->input->get('type', '', 'string');
|
||||
$html = $this->input->get('html', '', 'raw');
|
||||
// $html = json_encode($this->input->get('html', '', 'raw'));
|
||||
|
||||
$model = $this->getModel('Elements', '', array());
|
||||
$id = $model->ajaxSave($name, $type, $html);
|
||||
$pluginsType = PagebuilderckHelper::getPluginsMenuItemType();
|
||||
$image = $pluginsType[$type]->image;
|
||||
$returncode = '<div data-type=\"' . $type . '\" data-id=\"' . $id . '\" class=\"menuitemck ckmyelement\" >'
|
||||
. '<div>'
|
||||
. '<div class=\"menuitemck_title\">' . $name . '</div>'
|
||||
. '</div>'
|
||||
. '<img src=\"' . $image . '\" />'
|
||||
. '</div>';
|
||||
echo '{"status" : "' . ($id == false ? '0' : '1') . '", "code" : "' . $returncode . '"}';
|
||||
exit;
|
||||
}
|
||||
|
||||
public function ajaxAddElementItem() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$id = $this->input->get('id', '', 'int');
|
||||
|
||||
$model = $this->getModel('Element');
|
||||
$result = $model->getHtml($id);
|
||||
echo ($result == false ? 'ERROR' : $result);
|
||||
exit;
|
||||
}
|
||||
|
||||
public function fixDb() {
|
||||
// $this->searchTable('elements');
|
||||
$db = JFactory::getDbo();
|
||||
$tablesList = $db->getTableList();
|
||||
// test if the table not exists
|
||||
$tableElementsExists = in_array($db->getPrefix() . 'pagebuilderck_elements', $tablesList);
|
||||
if (! $tableElementsExists) {
|
||||
$this->updateTable('2.2.0');
|
||||
}
|
||||
|
||||
$tableCategoriesExists = in_array($db->getPrefix() . 'pagebuilderck_categories', $tablesList);
|
||||
if (! $tableCategoriesExists) {
|
||||
$this->updateTable('2.14.0');
|
||||
}
|
||||
|
||||
$tableStylesExists = in_array($db->getPrefix() . 'pagebuilderck_styles', $tablesList);
|
||||
if (! $tableStylesExists) {
|
||||
$this->updateTable('2.16.0');
|
||||
}
|
||||
}
|
||||
|
||||
private function searchTable($tableName) {
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
$tablesList = $db->getTableList();
|
||||
$tableExists = in_array($db->getPrefix() . 'pagebuilderck_' . $tableName, $tablesList);
|
||||
// test if the table not exists
|
||||
|
||||
if (! $tableExists) {
|
||||
$query = $this->getSqlQueryElements();
|
||||
$db->setQuery($query);
|
||||
// // add the SQL field to the main table
|
||||
// $query = 'ALTER TABLE `' . $table . '` ADD `' . $name . '` text NOT NULL;';
|
||||
if (! $db->execute($query)) {
|
||||
echo '<p class="alert alert-danger">Error during table ' . $tableName . ' creation process !</p>';
|
||||
} else {
|
||||
echo '<p class="alert alert-success">Table ' . $tableName . ' created with success !</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*private function getSqlQueryElements() {
|
||||
$query = "CREATE TABLE IF NOT EXISTS `#__pagebuilderck_elements` (
|
||||
`id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL,
|
||||
`description` tinytext NOT NULL,
|
||||
`type` varchar(50) NOT NULL,
|
||||
`ordering` int(11) NOT NULL,
|
||||
`state` int(10) NOT NULL DEFAULT '1',
|
||||
`catid` varchar(255) NOT NULL,
|
||||
`htmlcode` longtext NOT NULL,
|
||||
`checked_out` varchar(10) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARSET=utf8;";
|
||||
return $query;
|
||||
}*/
|
||||
|
||||
/*
|
||||
* update the table
|
||||
*/
|
||||
function updateTable($version) {
|
||||
$sqlsrc = JPATH_ROOT.'/administrator/components/com_pagebuilderck/sql/updates/' . $version . '.sql';
|
||||
$query = file_get_contents($sqlsrc);
|
||||
$db = JFactory::getDbo();
|
||||
$db->setQuery($query);
|
||||
if (!$db->execute()) {
|
||||
echo '<p class="alert alert-danger">Error during table update for version ' . $version . '</p>';
|
||||
} else {
|
||||
echo '<p class="alert alert-success">Table successfully updated for version ' . $version . '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* DO NOT USE, use ajaxSetPluginOption
|
||||
*/
|
||||
public function ajaxSavePluginCustomData() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$customdata = $this->input->get('customdata', array(), 'array');
|
||||
$plugin = $this->input->get('plugin', '', 'string');
|
||||
|
||||
$query = "SELECT custom_data FROM #__extensions WHERE type='plugin' AND element ='" . $plugin . "' AND folder='pagebuilderck'";
|
||||
$db = JFactory::getDbo();
|
||||
$db->setQuery($query);
|
||||
$data = $db->loadResult();
|
||||
|
||||
// var_dump($customdata);
|
||||
$options = unserialize($data);
|
||||
// var_dump($options);
|
||||
$newdata = serialize($customdata);
|
||||
|
||||
$query = "UPDATE #__extensions "
|
||||
. "SET custom_data = '" . $newdata . "'"
|
||||
. "WHERE type='plugin' AND element ='" . $plugin . "' AND folder='pagebuilderck' ";
|
||||
$db->setQuery($query);
|
||||
$result = $db->execute();
|
||||
}
|
||||
|
||||
/*
|
||||
* DO NOT USE, use ajaxGetPluginOption
|
||||
*/
|
||||
public function ajaxLoadPluginCustomData() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$plugin = $this->input->get('plugin', '', 'string');
|
||||
$key = $this->input->get('key', '', 'string');
|
||||
|
||||
$query = "SELECT custom_data FROM #__extensions WHERE type='plugin' AND element ='" . $plugin . "' AND folder='pagebuilderck'";
|
||||
$db = JFactory::getDbo();
|
||||
$db->setQuery($query);
|
||||
$data = $db->loadResult();
|
||||
|
||||
// var_dump($data);
|
||||
$options = unserialize($data);
|
||||
// var_dump($options);
|
||||
echo isset($options[$key]) ? $options[$key] : '0';
|
||||
exit;
|
||||
}
|
||||
|
||||
public function ajaxSaveCustomCss() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$id = $this->input->get('id', 0, 'int');
|
||||
$name = $this->input->get('name', '', 'string');
|
||||
$customcss = $this->input->get('customcss', '', 'raw');
|
||||
|
||||
$data = array();
|
||||
// $data['id'] = 0;
|
||||
$data['name'] = $name;
|
||||
$data['value'] = $customcss;
|
||||
|
||||
$query = "SELECT id FROM #__pagebuilderck_options WHERE name='" . $name . "'";
|
||||
$data['id'] = (int) \Pagebuilderck\CKFof::dbLoadResult($query);
|
||||
|
||||
$id = \Pagebuilderck\CKFof::dbStore('#__pagebuilderck_options', $data);
|
||||
|
||||
echo '{"status" : "' . ($id == false ? '0' : '1') . '", "code" : "' . $id . '"}';
|
||||
exit;
|
||||
}
|
||||
|
||||
public function ajaxSetUserState() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$key = $this->input->get('key', '', 'string');
|
||||
$value = $this->input->get('value', '', 'string');
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$app->setUserState($key, $value);
|
||||
}
|
||||
|
||||
public function ajaxSetPluginOption() {
|
||||
PagebuilderckHelper::ajaxSetPluginOption();
|
||||
}
|
||||
|
||||
public function ajaxGetPluginOption() {
|
||||
PagebuilderckHelper::ajaxGetPluginOption();
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
|
||||
/**
|
||||
* Pages list controller class.
|
||||
*/
|
||||
class PagebuilderckControllerArticles extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'articles', $prefix = 'PagebuilderckModel', $config = array()) {
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function import() {
|
||||
exit('import not allowed');
|
||||
$app = JFactory::getApplication();
|
||||
if ($importClass = PagebuilderckHelper::getParams('import')) {
|
||||
$importClass->importFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=articles", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function export() {
|
||||
exit('export not allowed');
|
||||
$app = JFactory::getApplication();
|
||||
if ($exportClass = PagebuilderckHelper::getParams('export')) {
|
||||
$exportClass->exportFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=articles", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
require_once PAGEBUILDERCK_PATH . '/helpers/ckbrowse.php';
|
||||
|
||||
class PagebuilderckControllerBrowse extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function ajaxCreateFolder() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
if (CKFof::userCan('create', 'com_media')) {
|
||||
$path = $this->input->get('path', '', 'string');
|
||||
$name = $this->input->get('name', '', 'string');
|
||||
|
||||
require_once PAGEBUILDERCK_PATH . '/helpers/ckbrowse.php';
|
||||
if ($result = CKBrowse::createFolder($path, $name)) {
|
||||
$msg = JText::_('CK_FOLDER_CREATED_SUCCESS');
|
||||
} else {
|
||||
$msg = JText::_('CK_FOLDER_CREATED_ERROR');
|
||||
}
|
||||
|
||||
echo '{"status" : "' . ($result == false ? '0' : '1') . '", "message" : "' . $msg . '"}';
|
||||
} else {
|
||||
echo '{"status" : "2", "message" : "' . JText::_('CK_ERROR_USER_NO_AUTH') . '"}';
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the file and store it on the server
|
||||
*
|
||||
* @return mixed, the method return
|
||||
*/
|
||||
public function ajaxAddPicture() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
require_once PAGEBUILDERCK_PATH . '/helpers/ckbrowse.php';
|
||||
CKBrowse::ajaxAddPicture();
|
||||
}
|
||||
|
||||
public function getFiles() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$folder = $this->input->get('folder', '', 'string');
|
||||
$type = $this->input->get('type', '', 'string');
|
||||
$filetypes = CKBrowse::getFileTypes($type);
|
||||
$files = CKBrowse::getImagesInFolder(JPATH_SITE . '/' . $folder, implode('|', $filetypes));
|
||||
|
||||
if ($type == 'folder') {
|
||||
$pathway = str_replace('/', '</span><span class="ckfoldertreepath">', $folder);
|
||||
?>
|
||||
<div id="ckfoldertreelistfolderselection">
|
||||
<div class="ckbutton ckbutton-primary" style="font-size:20px;padding: 10px 20px;" onclick="ckBrowseSelectFolder('<?php echo ($folder) ?>')"><i class="fas fa-check-square"></i> <?php echo JText::_('CK_SELECT_FOLDER') ?><br /><small><?php echo $pathway ?></small></div>
|
||||
</div>
|
||||
<?php }
|
||||
if (empty($files)) {
|
||||
echo JText::_('CK_NO_FILE_FOUND');
|
||||
} else {
|
||||
foreach($files as $file) {
|
||||
$type = CKBrowse::getTypeByFilename($file);
|
||||
switch ($type) {
|
||||
case 'video' :
|
||||
$fileicon = PAGEBUILDERCK_MEDIA_URI . '/images/file_video.png';
|
||||
break;
|
||||
case 'audio' :
|
||||
$fileicon = PAGEBUILDERCK_MEDIA_URI . '/images/file_audio.png';
|
||||
break;
|
||||
case 'folder' :
|
||||
case 'image' :
|
||||
$fileicon = JUri::root(true) . '/' . PagebuilderckHelper::utf8_encode($folder) . '/' . PagebuilderckHelper::utf8_encode($file);
|
||||
break;
|
||||
default :
|
||||
$fileicon = PAGEBUILDERCK_MEDIA_URI . '/images/file_generic.png';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div class="ckfoldertreefile" data-type="<?php echo $type ?>" onclick="ckBrowseSelectFile(this)" data-path="<?php echo PagebuilderckHelper::utf8_encode($folder) ?>" data-filename="<?php echo PagebuilderckHelper::utf8_encode($file) ?>">
|
||||
<img src="<?php echo $fileicon ?>" title="<?php echo PagebuilderckHelper::utf8_encode($file); ?>" loading="lazy">
|
||||
<div class="ckimagetitle"><?php echo PagebuilderckHelper::utf8_encode($file); ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?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\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
/**
|
||||
* Pages list controller class.
|
||||
*/
|
||||
class PagebuilderckControllerCategories extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function save($id = 0, $task = 'save', $ajax = false) {
|
||||
// Check for request forgeries.
|
||||
if ($ajax === true) {
|
||||
CKFof::checkAjaxToken();
|
||||
} else {
|
||||
CKFof::checkToken();
|
||||
}
|
||||
|
||||
$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 = array();
|
||||
$data['id'] = $this->input->get('id', $id, 'int');
|
||||
$id = $data['id'];
|
||||
$data['name'] = $this->input->get('name', '', 'string');
|
||||
$data['description'] = '';
|
||||
$data['ordering'] = 0;
|
||||
$data['state'] = 1;
|
||||
$data['created'] = null;
|
||||
$data['created_by'] = 0;
|
||||
$data['access'] = 1;
|
||||
|
||||
// Check for errors.
|
||||
if ($data === false) {
|
||||
CKFof::enqueueMessage('ERROR : NO DATA SAVED', 'warning');
|
||||
// Redirect back to the edit screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=categories');
|
||||
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_ADMIN_URL . '&view=categories');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Redirect to the list screen.
|
||||
CKFof::enqueueMessage(JText::_('CK_ITEM_SAVED_SUCCESS'));
|
||||
|
||||
$model->checkin($return);
|
||||
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=categories');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
<?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.page-creator.com - https://www.joomlack.fr
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
|
||||
/**
|
||||
* Page controller class.
|
||||
*/
|
||||
class PagebuilderckControllerContenttype extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a user's profile data.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($key = null, $urlVar = null) {
|
||||
$app = JFactory::getApplication();
|
||||
if ($app->input->get('method','', 'cmd') == 'ajax') {
|
||||
// Check for request forgeries.
|
||||
JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));
|
||||
} else {
|
||||
// Check for request forgeries.
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
}
|
||||
|
||||
$task = $this->getTask();
|
||||
|
||||
// Initialise variables.
|
||||
|
||||
$model = $this->getModel('Contenttype', 'PagebuilderckModel');
|
||||
|
||||
$appendToUrl = $app->input->get('tmpl') ? '&tmpl=' . $app->input->get('tmpl') : '';
|
||||
$layout = $app->input->get('layout') == 'modal' ? '&layout=modal' : '&layout=edit';
|
||||
|
||||
// Get the user data.
|
||||
// $data = $app->input->getArray($_POST);
|
||||
$data = array();
|
||||
$data['type'] = $app->input->get('type', '', 'string');
|
||||
$data['htmlcode'] = $app->input->get('htmlcode', '', 'raw');
|
||||
$data['stylecode'] = $app->input->get('stylecode', '', 'raw');
|
||||
|
||||
$type = $data['type'];
|
||||
// Attempt to save the data.
|
||||
$return = $model->save($data);
|
||||
|
||||
// Check for errors.
|
||||
if ($return === false) {
|
||||
// Save the data in the session.
|
||||
// $app->setUserState('com_pagebuilderck.edit.contenttype.data', $data);
|
||||
|
||||
// Redirect back to the edit screen.
|
||||
// $id = (int) $app->getUserState('com_pagebuilderck.edit.contenttype.id');
|
||||
$app->enqueueMessage(JText::sprintf('Save failed', $model->getError()), 'warning');
|
||||
$this->setRedirect('index.php?option=com_pagebuilderck&view=contenttype'.$layout.'&type=' . $type . $appendToUrl, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Check in the profile.
|
||||
// if ($return) {
|
||||
// $model->checkin($return);
|
||||
// }
|
||||
|
||||
// Clear the profile id from the session.
|
||||
// $app->setUserState('com_pagebuilderck.edit.contenttype.id', null);
|
||||
|
||||
// Redirect to the list screen.
|
||||
$app->enqueueMessage(JText::_('Item saved successfully'));
|
||||
|
||||
switch ($task)
|
||||
{
|
||||
case 'apply':
|
||||
// Set the record data in the session.
|
||||
// $this->holdEditId($context, $recordId);
|
||||
// $app->setUserState($context . '.data', null);
|
||||
// $model->checkout($return);
|
||||
|
||||
// Redirect back to the edit screen.
|
||||
$this->setRedirect('index.php?option=com_pagebuilderck&view=contenttype'.$layout.'&type=' . $type . $appendToUrl, false);
|
||||
break;
|
||||
default:
|
||||
// Clear the record id and data from the session.
|
||||
// $this->releaseEditId($context, $recordId);
|
||||
// $app->setUserState($context . '.data', null);
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect('index.php?option=com_pagebuilderck&view=contenttypes', false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Flush the data from the session.
|
||||
// $app->setUserState('com_pagebuilderck.edit.contenttype.data', null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a user's profile data.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
public function cancel($key = NULL) {
|
||||
$this->setRedirect('index.php?option=com_pagebuilderck&view=contenttypes', false);
|
||||
}
|
||||
|
||||
public function ajaxLoadFields() {
|
||||
// security check
|
||||
if (! PagebuilderckHelper::getAjaxToken()) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
$type = $input->get('type', '', 'string');
|
||||
|
||||
$model = $this->getModel('Contenttype', '', array());
|
||||
$item = $model->getData($type);
|
||||
include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/simple_html_dom.php';
|
||||
$html = \Pagebuilderck\str_get_html($item->htmlcode);
|
||||
|
||||
$identifiers = array();
|
||||
// find all types in the page
|
||||
foreach($html->find('div.ckcontenttype') as $e) {
|
||||
$identifier = $e->attr['data-type'];
|
||||
$identifiers[] = str_replace($type . '.', '', $identifier);
|
||||
}
|
||||
|
||||
echo '{"status" : "1", "identifiers" : "' . implode('|', $identifiers) . '"}';
|
||||
exit;
|
||||
}
|
||||
|
||||
public function ajaxAddField() {
|
||||
// security check
|
||||
if (! PagebuilderckHelper::getAjaxToken()) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
$type = $input->get('type', '', 'string');
|
||||
$identifier = $input->get('identifier', '', 'string');
|
||||
$blocid = $input->get('blocid', '', 'string');
|
||||
|
||||
require_once(JPATH_SITE . '/plugins/pagebuilderck/' . $type . '/' . $type . 'helper.php');
|
||||
|
||||
$className = 'plgPagebuilderck' . ucfirst($type) . 'Helper';
|
||||
$html = $className::getField($identifier);
|
||||
echo str_replace('|ID|', $blocid, $html);
|
||||
exit;
|
||||
}
|
||||
|
||||
public function ajaxGetFieldPosition() {
|
||||
// security check
|
||||
if (! PagebuilderckHelper::getAjaxToken()) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
$type = $input->get('type', '', 'string');
|
||||
$identifier = $input->get('identifier', '', 'string');
|
||||
|
||||
require_once(JPATH_SITE . '/plugins/pagebuilderck/' . $type . '/' . $type . 'helper.php');
|
||||
|
||||
$className = 'plgPagebuilderck' . ucfirst($type) . 'Helper';
|
||||
$fieldsList = $className::getFieldsList();
|
||||
|
||||
$arrayPosition = array_search($identifier, $fieldsList);
|
||||
if ($arrayPosition === false) {
|
||||
$position = -1;
|
||||
} else if ($arrayPosition === 0) {
|
||||
$position = 'first';
|
||||
} else if ($arrayPosition === (count($fieldsList) -1)) {
|
||||
$position = 'last';
|
||||
} else {
|
||||
$position = $fieldsList[$arrayPosition - 1];
|
||||
}
|
||||
|
||||
echo '{"status" : "1", "position" : "' . $position . '"}';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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\CKController;
|
||||
|
||||
/**
|
||||
* Pages list controller class.
|
||||
*/
|
||||
class PagebuilderckControllerContenttypes extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'element', $prefix = 'PagebuilderckModel', $config = array()) {
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function import() {
|
||||
$app = JFactory::getApplication();
|
||||
if ($importClass = PagebuilderckHelper::getParams('import')) {
|
||||
$importClass->importFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=elements", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function export() {
|
||||
$app = JFactory::getApplication();
|
||||
if ($exportClass = PagebuilderckHelper::getParams('export')) {
|
||||
$exportClass->exportFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=elements", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function order() {
|
||||
// security check
|
||||
// if (! PagebuilderckHelper::getAjaxToken()) {
|
||||
// exit();
|
||||
// }
|
||||
$app = JFactory::getApplication();
|
||||
$ordering = $app->input->get('ordering', '', 'array');
|
||||
$model = $this->getModel('elements');
|
||||
$result = $model->saveOrder($ordering);
|
||||
echo (int) $result;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?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.page-creator.com - https://www.joomlack.fr
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
/**
|
||||
* Page controller class.
|
||||
*/
|
||||
class PagebuilderckControllerElement extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function apply() {
|
||||
return $this->save(0, 'apply');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a user's profile data.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($id = 0, $task = 'save') {
|
||||
// Check for request forgeries.
|
||||
CKFof::checkToken();
|
||||
|
||||
$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);
|
||||
$data['htmlcode'] = $this->input->get('htmlcode', '', 'raw');
|
||||
$data['htmlcode'] = str_replace(JUri::root(true), "|URIROOT|", $data['htmlcode']);
|
||||
|
||||
// Check for errors.
|
||||
if ($data === false) {
|
||||
CKFof::enqueueMessage('ERROR : NO DATA SAVED', 'warning');
|
||||
// Redirect back to the edit screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=element' . $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_ADMIN_URL . '&view=element' . $layout . '&id=' . $id . $appendToUrl);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Redirect to the list screen.
|
||||
CKFof::enqueueMessage(JText::_('CK_ITEM_SAVED_SUCCESS'));
|
||||
|
||||
switch ($task)
|
||||
{
|
||||
case 'apply':
|
||||
// Redirect back to the edit screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=element' . $layout . '&id=' . $return . $appendToUrl);
|
||||
break;
|
||||
default:
|
||||
// Redirect to the list screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=elements');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* copy an existing element
|
||||
* @return void
|
||||
*/
|
||||
function copy() {
|
||||
// Check for request forgeries.
|
||||
CKFof::checkToken();
|
||||
|
||||
$this->redirect = PAGEBUILDERCK_ADMIN_URL . '&view=elements';
|
||||
|
||||
parent::copy();
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
//Redirect back to list
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=elements');
|
||||
}
|
||||
|
||||
/**
|
||||
* copy an existing element
|
||||
* @return void
|
||||
*/
|
||||
function delete() {
|
||||
// Check for request forgeries.
|
||||
CKFof::checkToken();
|
||||
|
||||
$this->redirect = PAGEBUILDERCK_ADMIN_URL . '&view=elements';
|
||||
|
||||
parent::delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
/**
|
||||
* Pages list controller class.
|
||||
*/
|
||||
class PagebuilderckControllerElements extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function import() {
|
||||
$app = JFactory::getApplication();
|
||||
if ($importClass = PagebuilderckHelper::getParams('importelement')) {
|
||||
$importClass->importFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=elements", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function export() {
|
||||
exit('export not allowed');
|
||||
$app = JFactory::getApplication();
|
||||
if ($exportClass = PagebuilderckHelper::getParams('exportelement')) {
|
||||
$exportClass->exportFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=elements", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function order() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$ordering = $this->input->get('ordering', '', 'array');
|
||||
$model = $this->getModel('elements');
|
||||
$result = $model->saveOrder($ordering);
|
||||
echo (int) $result;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
209
administrator/components/com_pagebuilderck/controllers/fonts.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?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\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
class PagebuilderckControllerFonts extends CKController {
|
||||
|
||||
protected $imagespath;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the needed interface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
/*public function load() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$layout = $this->input->get('layout', '', 'cmd');
|
||||
if (! $layout) return;
|
||||
|
||||
// $this->interface = new CKInterface();
|
||||
$this->imagespath = PAGEBUILDERCK_MEDIA_URI . '/images/menustyles/';
|
||||
|
||||
require_once(PAGEBUILDERCK_PATH . '/interfaces/' . $layout . '.php');
|
||||
exit;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Save the font in the BDD and store the files locally if needed
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
// only store the font files locally if local is 1
|
||||
$local = $this->input->get('local', '', 'int');
|
||||
if ($local === 1) {
|
||||
$variants = $this->input->get('fontvars', '', 'string');
|
||||
$url = $this->input->get('url', '', 'string');
|
||||
$url = str_replace('http:', 'https:', $url);
|
||||
if (! $url) {
|
||||
echo '{"status" : "0", "msg" : "No url given"}';
|
||||
exit;
|
||||
}
|
||||
|
||||
$fontname = $this->input->get('fontname', '', 'string');
|
||||
if (! $fontname) {
|
||||
echo '{"status" : "0", "msg" : "No font name given"}';
|
||||
exit;
|
||||
}
|
||||
|
||||
$gfontFolderPath = PAGEBUILDERCK_MEDIA_PATH . '/gfonts/';
|
||||
// create fonts folder
|
||||
if (!JFolder::exists($gfontFolderPath)) {
|
||||
if (!JFolder::create($gfontFolderPath)) {
|
||||
// $msg = '<p class="errorck">' . JText::_('CK_ERROR_CREATING_FOLDER') . ' /fonts</p>';
|
||||
} else {
|
||||
// $msg = '<p class="successck">' . JText::_('CK_SUCCESS_CREATING_FOLDER') . ' /fonts</p>';
|
||||
}
|
||||
// $messages[] = $msg;
|
||||
}
|
||||
|
||||
// check if file exists
|
||||
$filePath = $gfontFolderPath . $fontname . '.css';
|
||||
|
||||
// get the file from url
|
||||
set_time_limit(0);
|
||||
|
||||
if (extension_loaded('curl')) {
|
||||
try {
|
||||
$ch = curl_init();
|
||||
$timeout = 30;
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
|
||||
|
||||
$file = curl_exec($ch);
|
||||
if($file === false)
|
||||
{
|
||||
echo '{"status" : "0", "msg" : "Curl error: ' . curl_error($ch) . '"}';
|
||||
// echo 'Curl error: ' . curl_error($ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
// echo 'Operation completed without any errors';
|
||||
}
|
||||
curl_close($ch);
|
||||
} catch (Exception $e) {
|
||||
// echo 'Exception : ', $e->getMessage(), "\n";
|
||||
echo '{"status" : "0", "msg" : "' . $e->getMessage() . '"}';
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
$file = file_get_contents(urldecode($url));
|
||||
} catch (Exception $e) {
|
||||
// echo 'Exception : ', $e->getMessage(), "\n";
|
||||
echo '{"status" : "0", "msg" : "' . $e->getMessage() . '"}';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// store the file locally
|
||||
$result = file_put_contents($filePath, $file);
|
||||
if (! $result) {
|
||||
echo '{"status" : "0", "file" : "", "msg" : "Error on file creation"}';
|
||||
exit();
|
||||
}
|
||||
|
||||
// download the ttf files
|
||||
$filesize = 0;
|
||||
preg_match_all('/url\((.*?)\)/', $file, $matches);
|
||||
if (isset($matches[0]) && ! empty($matches[1])) {
|
||||
if (is_array($matches[1])) {
|
||||
foreach($matches[1] as $fontfile) {
|
||||
try {
|
||||
$ch = curl_init();
|
||||
$timeout = 30;
|
||||
curl_setopt($ch, CURLOPT_URL, $fontfile);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
|
||||
|
||||
$ttffile = curl_exec($ch);
|
||||
if($ttffile === false)
|
||||
{
|
||||
echo '{"status" : "0", "msg" : "Curl error: ' . curl_error($ch) . '"}';
|
||||
}
|
||||
else
|
||||
{
|
||||
// echo 'Operation completed without any errors';
|
||||
}
|
||||
curl_close($ch);
|
||||
} catch (Exception $e) {
|
||||
echo '{"status" : "0", "msg" : "' . $e->getMessage() . '"}';
|
||||
exit;
|
||||
}
|
||||
$filename = explode('/', $fontfile);
|
||||
$filename = end($filename);
|
||||
$filePath = $gfontFolderPath . $filename;
|
||||
$result = file_put_contents($filePath, $ttffile);
|
||||
if (! $result) {
|
||||
echo '{"status" : "0", "file" : "", "msg" : "Error on file creation"}';
|
||||
exit();
|
||||
}
|
||||
$filesize += filesize($filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$model = $this->getModel();
|
||||
$result = $model->saveFont($fontname, $url, $local, $filesize, $variants);
|
||||
|
||||
if ($result) {
|
||||
echo '{"status" : "1", "file" : "' . $fontname . '.css' . '", "filesize" : "' . $filesize . '"}';
|
||||
} else {
|
||||
echo '{"status" : "0", "file" : "' . $fontname . '.css' . '", "filesize" : "' . $filesize . '"}';
|
||||
}
|
||||
} else {
|
||||
$model = $this->getModel();
|
||||
$result = $model->saveFont($fontname, $url, $local, $filesize, $variants);
|
||||
|
||||
if ($result) {
|
||||
echo '{"status" : "1", "file" : "", "filesize" : ""}';
|
||||
} else {
|
||||
echo '{"status" : "0", "file" : "", "filesize" : ""}';
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
public function delete() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$fontname = $this->input->get('fontname', '', 'string');
|
||||
$fontname = str_replace(' ', '+', $fontname);
|
||||
$model = $this->getModel();
|
||||
$result = $model->delete($fontname);
|
||||
if ($result) {
|
||||
echo '{"status" : "1", "msg" : ""}';
|
||||
} else {
|
||||
echo '{"status" : "0", "msg" : "' . $result . '"}';
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
class PagebuilderckControllerInterface extends CKController {
|
||||
|
||||
protected $imagespath;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the needed interface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function load() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$layout = $this->input->get('layout', '', 'cmd');
|
||||
if (! $layout) return;
|
||||
|
||||
// $this->interface = new CKInterface();
|
||||
$this->imagespath = PAGEBUILDERCK_MEDIA_URI . '/images/menustyles/';
|
||||
|
||||
require_once(PAGEBUILDERCK_PATH . '/interfaces/' . $layout . '.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
class PagebuilderckControllerLibrary extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the needed interface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function load() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$page = $this->input->get('path', '', 'string');
|
||||
if (! $page) return;
|
||||
|
||||
$section = explode('/', $page);
|
||||
$section = $section[0];
|
||||
|
||||
// $this->interface = new CKInterface();
|
||||
$file = PAGEBUILDERCK_PATH . '/libraries/' . $page;
|
||||
$content = file_get_contents($file);
|
||||
$json = json_decode($content);
|
||||
|
||||
if (! isset($json->htmlcode)) echo 'error';
|
||||
|
||||
// replace vars to allow data to be moved from another server
|
||||
$htmlcode = $json->htmlcode;
|
||||
$htmlcode = str_replace("|URIROOT|", JUri::root(true), $htmlcode);
|
||||
$htmlcode = str_replace("|URIBASE|", PAGEBUILDERCK_URI_ROOT, $htmlcode);
|
||||
$htmlcode = str_replace("|PBCK_COMPONENT|", "components/com_pagebuilderck", $htmlcode);
|
||||
$htmlcode = str_replace("|PBCK_ADMIN_COMPONENT|", "administrator/components/com_pagebuilderck", $htmlcode);
|
||||
$htmlcode = str_replace("|IMPORTFOLDER|", 'administrator/components/com_pagebuilderck/libraries/' . $section, $htmlcode);
|
||||
|
||||
echo $htmlcode;
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
$com_path = JPATH_SITE . '/components/com_content/';
|
||||
JLoader::register('ContentHelperRoute', $com_path . 'helpers/route.php');
|
||||
|
||||
class PagebuilderckControllerLinks extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the articles and categories list
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
public function ajaxShowArticles() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$parentId = $this->input->get('parentid', 0, 'int');
|
||||
|
||||
$model = $this->getModel();
|
||||
// $model = $this->getModel('Links', '', array());
|
||||
$categories = $model->getCategoriesById($parentId);
|
||||
$articles = $model->getArticlesByCategoryId($parentId);
|
||||
$items = array_merge($categories, $articles);
|
||||
?>
|
||||
<div class="cksubfolder">
|
||||
<?php
|
||||
// Access filter
|
||||
$access = !JComponentHelper::getParams('com_content')->get('show_noauth');
|
||||
$authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id'));
|
||||
foreach ($items as $item) {
|
||||
$Itemid = ''; //test
|
||||
$hasChild = isset($item->rgt) &&
|
||||
( (int)$item->rgt - (int)$item->lft > 1
|
||||
|| $item->counter > 0
|
||||
) ? true : false; // faire count articles
|
||||
$icon = isset($item->rgt) ? 'folder' : 'file';
|
||||
// check if category or article
|
||||
if ($item->type == 'article') {
|
||||
$item->slug = $item->id . ':' . $item->alias;
|
||||
if ($access || in_array($item->access, $authorised))
|
||||
{
|
||||
// We know that user has the privilege to view the article
|
||||
$item->link = ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if ($access || in_array($item->access, $authorised))
|
||||
{
|
||||
$item->link = ContentHelperRoute::getCategoryRoute($item->id);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="ckfoldertree parent">
|
||||
<div class="ckfoldertreetoggler <?php if (! $hasChild) { echo 'empty'; } ?>" onclick="ckLinksArticlesToggleTreeSub(this, <?php echo $item->id ?>)" ></div>
|
||||
<div class="ckfoldertreename hasTip" title="<?php echo $item->link ?>" onclick="ckSetLinksArticlesUrl('<?php echo $item->link ?>')"><span class="icon-<?php echo $icon ?>"></span><?php echo $item->title; ?>
|
||||
<?php if (isset($item->counter)) { ?><div class="ckfoldertreecount"><?php echo $item->counter ?></div><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
|
||||
private function getCategories($parentId) {
|
||||
|
||||
}
|
||||
|
||||
private function getArticles($parentId) {
|
||||
$query = "SELECT id, title, alias, catid"
|
||||
. " FROM #__content"
|
||||
. " WHERE catid = " . (int)$parentId
|
||||
. " ORDER BY title ASC"
|
||||
;
|
||||
$articles = CKFof::dbLoadObjectList($query);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
|
||||
/**
|
||||
* Pages list controller class.
|
||||
*/
|
||||
class PagebuilderckControllerModules2 extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'modules2', $prefix = 'PagebuilderckModel', $config = array()) {
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function import() {
|
||||
exit('import not allowed');
|
||||
$app = JFactory::getApplication();
|
||||
if ($importClass = PagebuilderckHelper::getParams('import')) {
|
||||
$importClass->importFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=modules2", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function export() {
|
||||
exit('export not allowed');
|
||||
$app = JFactory::getApplication();
|
||||
if ($exportClass = PagebuilderckHelper::getParams('export')) {
|
||||
$exportClass->exportFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=modules2", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
139
administrator/components/com_pagebuilderck/controllers/page.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?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.page-creator.com - https://www.joomlack.fr
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
/**
|
||||
* Page controller class.
|
||||
*/
|
||||
class PagebuilderckControllerPage extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function apply() {
|
||||
return $this->save(0, 'apply');
|
||||
}
|
||||
|
||||
public function ajaxSave($id = 0, $task = 'save') {
|
||||
$this->save($id, $task, true);
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a page
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save($id = 0, $task = 'save', $ajax = false) {
|
||||
// Check for request forgeries.
|
||||
if ($ajax === true) {
|
||||
CKFof::checkAjaxToken();
|
||||
} else {
|
||||
CKFof::checkToken();
|
||||
}
|
||||
|
||||
$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 = array();
|
||||
$data['id'] = $this->input->get('id', $id, 'int');
|
||||
$id = $data['id'];
|
||||
$data['title'] = $this->input->get('title', '', 'string');
|
||||
$data['alias'] = '';
|
||||
$data['ordering'] = 0;
|
||||
$data['state'] = 1;
|
||||
$data['created'] = null;
|
||||
// $data['created'] = '0000-00-00 00:00:00';
|
||||
$data['catid'] = '';
|
||||
$data['created_by'] = 0;
|
||||
$data['params'] = $this->input->get('params', '', 'string');
|
||||
$data['access'] = 1;
|
||||
$data['options'] = $this->input->get('options', array(), 'array');
|
||||
$data['htmlcode'] = $this->input->get('htmlcode', '', 'raw');
|
||||
$data['htmlcode'] = str_replace(JUri::root(true), "|URIROOT|", $data['htmlcode']);
|
||||
$data['categories'] = $this->input->get('categories', array(), 'array');
|
||||
$data['styles'] = $this->input->get('styles', array(), 'array');
|
||||
|
||||
// Check for errors.
|
||||
if ($data === false) {
|
||||
CKFof::enqueueMessage('ERROR : NO DATA SAVED', 'warning');
|
||||
// Redirect back to the edit screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_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_ADMIN_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_ADMIN_URL . '&view=page' . $layout . '&id=' . $return . $appendToUrl);
|
||||
break;
|
||||
default:
|
||||
// Redirect to the list screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=pages', false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* copy an existing page
|
||||
* @return void
|
||||
*/
|
||||
function copy() {
|
||||
// security check
|
||||
CKFof::checkToken();
|
||||
|
||||
$model = $this->getModel();
|
||||
$input = JFactory::getApplication()->input;
|
||||
$cid = $this->input->get('cid', '', 'array');
|
||||
$id = (int) $cid[0];
|
||||
if (!$model->copy($id)) {
|
||||
$msg = JText::_('CK_COPY_ERROR');
|
||||
$type = 'error';
|
||||
} else {
|
||||
$msg = JText::_('CK_COPY_SUCCESS');
|
||||
$type = 'message';
|
||||
}
|
||||
|
||||
CKFof::redirect('index.php?option=com_pagebuilderck', $msg, $type);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
$this->getModel()->checkin($this->input->get('id', 0, 'int'));
|
||||
|
||||
//Redirect back to list
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=pages');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?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\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
/**
|
||||
* Pages list controller class.
|
||||
*/
|
||||
class PagebuilderckControllerPages extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function import() {
|
||||
$app = JFactory::getApplication();
|
||||
if ($importClass = PagebuilderckHelper::getParams('import')) {
|
||||
$importClass->importFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=pages", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function export() {
|
||||
$app = JFactory::getApplication();
|
||||
if ($exportClass = PagebuilderckHelper::getParams('export')) {
|
||||
$exportClass->exportFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=pages", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkin() {
|
||||
$this->getModel()->checkin($this->input->get('id', 0, 'int'));
|
||||
|
||||
//Redirect back to list
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=pages');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
use Pagebuilderck\CKfile;
|
||||
use Pagebuilderck\CKfolder;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
class PagebuilderckControllerPixabay extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload the image
|
||||
*
|
||||
* @return json : result = boolean on success, file = the image filename
|
||||
*/
|
||||
public function upload() {
|
||||
// security check
|
||||
CKFof::checkAjaxToken();
|
||||
|
||||
$url = $this->input->get('image_url', '', 'url');
|
||||
|
||||
// $url = 'https://pixabay.com/get/57e6d04b4b5bb114a6da837ec32f2a7f1038dbed5b59724e7c_1280.jpg';
|
||||
$destFolder = JPATH_ROOT . '/images/pixabay/';
|
||||
$fileName = basename($url);
|
||||
$filePath = $destFolder . $fileName;
|
||||
|
||||
// create the destination folder if not exists
|
||||
if (! file_exists($destFolder)) {
|
||||
$result = CKFolder::create($destFolder);
|
||||
if (! $result) {
|
||||
echo '{"status" : "0", "file" : "", "message" : "Error on folder creation"}';
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
// get the file from url
|
||||
set_time_limit(0);
|
||||
try {
|
||||
$file = file_get_contents(urldecode($url));
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception : ', $e->getMessage(), "\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (! $file && extension_loaded('curl')) {
|
||||
$ch = curl_init();
|
||||
$timeout = 30;
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
|
||||
$file = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
|
||||
if (file_exists($filePath)) {
|
||||
$result = true;
|
||||
} else {
|
||||
// store the file locally
|
||||
$result = file_put_contents($filePath, $file);
|
||||
if (! $result) {
|
||||
echo '{"status" : "0", "file" : "", "message" : "Error on file creation"}';
|
||||
exit();
|
||||
}
|
||||
|
||||
$fileArray = array(
|
||||
"name" => $fileName
|
||||
,"type" => "image/png"
|
||||
,"tmp_name" => $filePath
|
||||
,"error" => 0
|
||||
,"size" => filesize($filePath)
|
||||
,"filepath" => $destFolder
|
||||
);
|
||||
// Trigger the onContentBeforeSave event.
|
||||
$fileObj = new JObject($fileArray);
|
||||
$result = CKFof::triggerEvent('onContentBeforeSave', array('com_media.file', &$fileObj, true));
|
||||
|
||||
if (in_array(false, $result, true))
|
||||
{
|
||||
// There are some errors in the plugins
|
||||
echo '{"status" : "0", "message" : "' . JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors)) . '"}';
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo '{"status" : "1", "file" : "' . 'images/pixabay/' . $fileName . '"}';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
137
administrator/components/com_pagebuilderck/controllers/style.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?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.page-creator.com - https://www.joomlack.fr
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pagebuilderck\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
/**
|
||||
* Page controller class.
|
||||
*/
|
||||
class PagebuilderckControllerStyle extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function apply() {
|
||||
return $this->save(0, 'apply');
|
||||
}
|
||||
|
||||
public function ajaxSave($id = 0, $task = 'save') {
|
||||
$this->save($id, $task, true);
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a page
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save($id = 0, $task = 'save', $ajax = false) {
|
||||
// Check for request forgeries.
|
||||
if ($ajax === true) {
|
||||
CKFof::checkAjaxToken();
|
||||
} else {
|
||||
CKFof::checkToken();
|
||||
}
|
||||
|
||||
$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 = array();
|
||||
$data['id'] = $this->input->get('id', $id, 'int');
|
||||
$id = $data['id'];
|
||||
$data['title'] = $this->input->get('title', '', 'string');
|
||||
$data['alias'] = '';
|
||||
$data['ordering'] = 0;
|
||||
$data['state'] = 1;
|
||||
$data['created'] = null;
|
||||
// $data['created'] = '0000-00-00 00:00:00';
|
||||
$data['catid'] = '';
|
||||
$data['created_by'] = 0;
|
||||
// $data['params'] = $this->input->get('params', '', 'string');
|
||||
$data['access'] = 1;
|
||||
// $data['options'] = $this->input->get('options', array(), 'array');
|
||||
$data['htmlcode'] = $this->input->get('htmlcode', '', 'raw');
|
||||
$data['htmlcode'] = str_replace(JUri::root(true), "|URIROOT|", $data['htmlcode']);
|
||||
|
||||
// Check for errors.
|
||||
if ($data === false) {
|
||||
CKFof::enqueueMessage('ERROR : NO DATA SAVED', 'warning');
|
||||
// Redirect back to the edit screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=style'.$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_ADMIN_URL . '&view=style' . $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_ADMIN_URL . '&view=style' . $layout . '&id=' . $return . $appendToUrl);
|
||||
break;
|
||||
default:
|
||||
// Redirect to the list screen.
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=styles', false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* copy an existing style
|
||||
* @return void
|
||||
*/
|
||||
function copy() {
|
||||
// security check
|
||||
CKFof::checkToken();
|
||||
|
||||
$model = $this->getModel();
|
||||
$input = JFactory::getApplication()->input;
|
||||
$cid = $this->input->get('cid', '', 'array');
|
||||
$id = (int) $cid[0];
|
||||
if (!$model->copy($id)) {
|
||||
$msg = JText::_('CK_COPY_ERROR');
|
||||
$type = 'error';
|
||||
} else {
|
||||
$msg = JText::_('CK_COPY_SUCCESS');
|
||||
$type = 'message';
|
||||
}
|
||||
|
||||
CKFof::redirect('index.php?option=com_pagebuilderck&view=styles', $msg, $type);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
$this->getModel()->checkin($this->input->get('id', 0, 'int'));
|
||||
|
||||
//Redirect back to list
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=styles');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?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\CKController;
|
||||
use Pagebuilderck\CKFof;
|
||||
|
||||
/**
|
||||
* Pages list controller class.
|
||||
*/
|
||||
class PagebuilderckControllerStyles extends CKController {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function import() {
|
||||
$app = JFactory::getApplication();
|
||||
if ($importClass = PagebuilderckHelper::getParams('import')) {
|
||||
$importClass->importFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=pages", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function export() {
|
||||
$app = JFactory::getApplication();
|
||||
if ($exportClass = PagebuilderckHelper::getParams('export')) {
|
||||
$exportClass->exportFile();
|
||||
} else {
|
||||
$msg = JText::_('CK_PAGEBUILDERCK_PARAMS_NOT_FOUND');
|
||||
$app->redirect("index.php?option=com_pagebuilderck&view=pages", $msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkin() {
|
||||
$this->getModel()->checkin($this->input->get('id', 0, 'int'));
|
||||
|
||||
//Redirect back to list
|
||||
CKFof::redirect(PAGEBUILDERCK_ADMIN_URL . '&view=pages');
|
||||
}
|
||||
|
||||
public function load() {
|
||||
CKFof::checkAjaxToken();
|
||||
$model = $this->getModel();
|
||||
$cid = $this->input->get('styles', '', 'array');
|
||||
if (empty($cid)) {
|
||||
echo '';
|
||||
} else {
|
||||
// Attempt to save the data.
|
||||
$styles = $model->getStyles($cid);
|
||||
foreach($styles as $style) {
|
||||
echo $style->stylecode;
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870
|
||||
* https://www.template-creator.com
|
||||
* https://www.joomlack.fr
|
||||
* @license GNU/GPL
|
||||
* */
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
jimport('joomla.event.plugin');
|
||||
|
||||
class plgPagebuilderckAccordion extends JPlugin {
|
||||
|
||||
private $context = 'PLG_PAGEBUILDERCK_ACCORDION';
|
||||
|
||||
private $type = 'accordion';
|
||||
|
||||
function __construct(&$subject, $params) {
|
||||
|
||||
parent::__construct($subject, $params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Construct the Menu Item to drag into the interface
|
||||
*
|
||||
* Return Object with item data
|
||||
*/
|
||||
public function onPagebuilderckAddItemToMenu() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// create the menu item
|
||||
$menuitem = new stdClass();
|
||||
$menuitem->type = $this->type;
|
||||
$menuitem->group = 'text';
|
||||
$menuitem->title = JText::_($this->context . '_MENUITEM_TITLE');
|
||||
$menuitem->description = JText::_($this->context . '_MENUITEM_DESC');
|
||||
$menuitem->image = JUri::root(true) . '/plugins/pagebuilderck/accordion/assets/images/accordion.svg';
|
||||
|
||||
return $menuitem;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the interface
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemContentAccordion() {
|
||||
$input = JFactory::getApplication()->input;
|
||||
$id = $input->get('ckid', '', 'string');
|
||||
// ckstyle and inner classes are needed to get the styles from the interface
|
||||
?>
|
||||
<div id="<?php echo $id; ?>" class="cktype" data-type="accordion" onshow="jQuery(this).find('.accordionsck').accordionck(accordionckOptions);ckAddEditionForNestedAddons('#<?php echo $id; ?>');">
|
||||
<div class="ckstyle">
|
||||
</div>
|
||||
<div id="<?php echo $id; ?>_accordion" class="accordionsck">
|
||||
<h3><span class="itemtitleck">Section 1</span></h3>
|
||||
<div>
|
||||
<div class="innercontent"></div>
|
||||
<div class="accordionck itemcontentck">
|
||||
<p>
|
||||
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
|
||||
ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
|
||||
amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
|
||||
odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
|
||||
</p>
|
||||
</div>
|
||||
<div class="innercontent"></div>
|
||||
</div>
|
||||
<h3><span class="itemtitleck">Section 2</span></h3>
|
||||
<div>
|
||||
<div class="innercontent"></div>
|
||||
<div class="accordionck itemcontentck">
|
||||
<p>
|
||||
Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
|
||||
purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor
|
||||
velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
|
||||
suscipit faucibus urna.
|
||||
</p>
|
||||
</div>
|
||||
<div class="innercontent"></div>
|
||||
</div>
|
||||
<h3><span class="itemtitleck">Section 3</span></h3>
|
||||
<div>
|
||||
<div class="innercontent"></div>
|
||||
<div class="accordionck itemcontentck">
|
||||
<p>
|
||||
Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
|
||||
Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
|
||||
ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
|
||||
lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
|
||||
</p>
|
||||
<ul>
|
||||
<li>List item one</li>
|
||||
<li>List item two</li>
|
||||
<li>List item three</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="innercontent"></div>
|
||||
</div>
|
||||
<h3><span class="itemtitleck">Section 4</span></h3>
|
||||
<div>
|
||||
<div class="innercontent"></div>
|
||||
<div class="accordionck itemcontentck">
|
||||
<p>
|
||||
Cras dictum. Pellentesque habitant morbi tristique senectus et netus
|
||||
et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia
|
||||
mauris vel est.
|
||||
</p>
|
||||
<p>
|
||||
Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
|
||||
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
|
||||
inceptos himenaeos.
|
||||
</p>
|
||||
</div>
|
||||
<div class="innercontent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the interface for the item edition
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemOptionsAccordion() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// load the interface for the options
|
||||
$tpl = JPATH_SITE . '/plugins/pagebuilderck/accordion/layouts/edit_accordion.php';
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the frontend page
|
||||
* @param string the item object from simple_html_dom
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckRenderItemAccordion($item) {
|
||||
return $item->innertext;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="3" type="plugin" group="pagebuilderck" method="upgrade">
|
||||
<name>plg_pagebuilderck_accordion_xml_name</name>
|
||||
<creationDate>December 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>https://www.joomlack.fr</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>Accordion item for Page Builder CK</description>
|
||||
<files>
|
||||
<filename plugin="accordion">accordion.php</filename>
|
||||
<folder>language</folder>
|
||||
<folder>layouts</folder>
|
||||
<folder>assets</folder>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_accordion.sys.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_accordion.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_accordion.sys.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_accordion.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="512px" height="512px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;"><g transform="matrix(2.08267,0,0,2.08267,-425.202,2.84748)"><g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)"><rect x="0" y="0" width="44" height="44" style="fill:none;"/></g><g transform="matrix(7.25534,0,0,4.33604,168.604,-23.5604)"><path d="M7.333,9.548C7.333,6.688 8.421,7.333 11,7.333L33,7.333C35.579,7.333 36.667,6.728 36.667,9.548L36.667,16.192C36.667,19.052 35.579,18.333 33,18.333L11,18.333C8.364,18.333 7.333,19.052 7.333,16.192L7.333,9.548Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.61px;"/></g><g transform="matrix(7.25534,0,0,4.33604,168.604,29.5271)"><path d="M7.333,9.548C7.333,6.688 8.421,7.333 11,7.333L33,7.333C35.579,7.333 36.667,6.728 36.667,9.548L36.667,16.192C36.667,19.052 35.579,18.333 33,18.333L11,18.333C8.364,18.333 7.333,19.052 7.333,16.192L7.333,9.548Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.61px;"/></g><g transform="matrix(7.25534,0,0,4.33604,168.604,150.36)"><path d="M7.333,9.548C7.333,6.688 8.421,7.333 11,7.333L33,7.333C35.579,7.333 36.667,6.728 36.667,9.548L36.667,16.192C36.667,19.052 35.579,18.333 33,18.333L11,18.333C8.364,18.333 7.333,19.052 7.333,16.192L7.333,9.548Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.61px;"/></g><g transform="matrix(0.623506,0,0,0.684822,181.074,-73.3238)"><path d="M120,270L120,372.665" style="fill:none;stroke:black;stroke-width:14.66px;stroke-miterlimit:1.5;"/></g><g transform="matrix(0.623506,0,0,0.684822,156.134,-73.3238)"><path d="M400,270L400,372.665" style="fill:none;stroke:black;stroke-width:14.66px;stroke-miterlimit:1.5;"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ACCORDION_XML_NAME="Page Builder CK - Accordion"
|
||||
PLG_PAGEBUILDERCK_ACCORDION_MENUITEM_TITLE="Accordion"
|
||||
PLG_PAGEBUILDERCK_ACCORDION_MENUITEM_DESC="Custom text into an accordion"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ACCORDION_XML_NAME="Page Builder CK - Accordion"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,9 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ACCORDION_XML_NAME="Page Builder CK - Accordéon"
|
||||
PLG_PAGEBUILDERCK_ACCORDION_MENUITEM_TITLE="Accordéon"
|
||||
PLG_PAGEBUILDERCK_ACCORDION_MENUITEM_DESC="Accordéon avec contenu personnalisé"
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ACCORDION_XML_NAME="Page Builder CK - Accordéon"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,209 @@
|
||||
<?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;
|
||||
|
||||
?>
|
||||
<div class="menustylescustom" data-prefix="accordionicon" data-rule=".ui-accordion-header .pbckicon"></div>
|
||||
<div id="elementscontainer">
|
||||
<div class="menulink" tab="tab_blocstyles"><?php echo JText::_('CK_ACCORDION_EDITION'); ?></div>
|
||||
<div class="tab menustyles ckproperty tab_fullscreen" id="tab_blocstyles">
|
||||
<?php // echo PagebuilderckHelper::renderEditionButtons(); ?>
|
||||
<div id="items_edition_list">
|
||||
</div>
|
||||
<div onclick="ckAddNewListItem()" class="item_add ckbutton ckbutton-primary"><?php echo JText::_('CK_ADD_ITEM'); ?></div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_iconstyles"><?php echo JText::_('CK_ICON'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_iconstyles">
|
||||
<?php echo $this->menustyles->createIconLight('accordionicon') ?>
|
||||
<?php echo $this->menustyles->createIconSvgLight('icon') ?>
|
||||
<?php //echo $this->menustyles->createIconOptions('icon') ?>
|
||||
<?php echo $this->menustyles->createBackground('icon') ?>
|
||||
<?php echo $this->menustyles->createDimensions('icon', true, true) ?>
|
||||
<?php echo $this->menustyles->createDecoration('icon') ?>
|
||||
<?php echo $this->menustyles->createShadow('icon') ?>
|
||||
<?php echo $this->menustyles->createCustom('icon') ?>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_headingaccordionstyles"><?php echo JText::_('CK_ACCORDION_HEADING_STYLE'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_headingaccordionstyles">
|
||||
<?php echo $this->menustyles->createBlocStyles('headingaccordion', 'accordionsck', false, false) ?>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_activeheadingaccordionstyles"><?php echo JText::_('CK_ACCORDION_ACTIVE_HEADING_STYLE'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_activeheadingaccordionstyles">
|
||||
<?php echo $this->menustyles->createBlocStyles('activeheadingaccordion', 'accordionsck', false, false) ?>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_contentaccordionstyles"><?php echo JText::_('CK_ACCORDION_CONTENT_STYLE'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_contentaccordionstyles">
|
||||
<?php echo $this->menustyles->createBlocStyles('contentaccordion', 'accordionsck', false, false) ?>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var focus = $ck('.editfocus');
|
||||
function ckLoadEditionPopup() {
|
||||
var noactivetabscss = focus.find('.accordionsck').attr('activetab') === 'false' ? ' ckbutton-warning active' : '';
|
||||
$ck('#items_edition_list').append('<div><div class="item_setdefault ckbutton'+noactivetabscss+'" onclick="ckSetDefaultEditItem($ck(this).parent())"><span class="icon icon-star"></span> <?php echo JText::_('CK_SET_DEFAULT_CLOSED', true) ?></div></div>');
|
||||
$ck('.accordionsck .itemtitleck', focus).each(function(i, el) {
|
||||
// B/C nested addons
|
||||
var content = $ck('.accordionsck > div').eq(i);
|
||||
if (content.hasClass('itemcontentck') && content.find('.itemcontentck').length) {
|
||||
content.removeClass('itemcontentck');
|
||||
}
|
||||
|
||||
var itemedition = ckCreateEditItem(i, $ck('#items_edition_list'), $ck(el).text(), ckContentToEditor($ck('.accordionsck .itemcontentck', focus).eq(i).html()), true, $ck('.accordionsck .itemtitleck .iconck', focus).eq(i).html());
|
||||
ckMakeEditItemAccordion(itemedition);
|
||||
ckLoadEditorOnTheFly('item_content_' + i);
|
||||
ckGetItemIcon(i, '.itemtitleck');
|
||||
});
|
||||
$ck('.item_setdefault').eq((parseInt(focus.find('.accordionsck').attr('activetab'))+1)).addClass('ckbutton-warning').addClass('active');
|
||||
ckMakeEditItemsSortable();
|
||||
ckFillEditionPopup(focus.attr('id'));
|
||||
}
|
||||
|
||||
/* override the JS function for custom use */
|
||||
function ckSelectIcon(icon) {
|
||||
/*var item = $ck('#items_edition_list .ckfieldfocus');
|
||||
if (! item.length) return;
|
||||
item.find('.iconck').empty().append(icon);
|
||||
var focusIcon = item.find('.iconck');
|
||||
// if svg icon, empty the css class
|
||||
if (focusIcon.find('svg').length) {
|
||||
item.find('.item_icon_edition').val('');
|
||||
}
|
||||
return focusIcon;*/
|
||||
return ckSelectIconFromEdition(icon);
|
||||
}
|
||||
|
||||
function ckMakeEditItemAccordion(el) {
|
||||
$ck(el).accordionck({
|
||||
header: ".item_toggler",
|
||||
collapsible: true,
|
||||
active: false,
|
||||
heightStyle: "content"
|
||||
});
|
||||
}
|
||||
|
||||
function ckAddNewListItem() {
|
||||
// add the element in the accordion
|
||||
$ck('.accordionsck', focus).append(ckGetNewAccordionItem('Lorem Ipsum ...', '<p>Lorem Ipsum ...</p>'));
|
||||
$ck('.accordionsck', focus).accordionck( "refresh" );
|
||||
// add the element for edition
|
||||
var index = $ck('.accordionsck > .ui-accordion-header', focus).length;
|
||||
var itemedition = ckCreateEditItem(index, $ck('#items_edition_list'), 'Lorem Ipsum ...', '<p>Lorem Ipsum ...</p>', true);
|
||||
ckMakeEditItemAccordion(itemedition);
|
||||
ckLoadEditorOnTheFly('item_content_' + index);
|
||||
}
|
||||
|
||||
function ckGetNewAccordionItem(title, content) {
|
||||
var html = '<h3><span class="itemtitleck">'+title+'</span></h3>'
|
||||
+'<div>'
|
||||
+'<div class="innercontent"></div>'
|
||||
+'<div class="accordionck itemcontentck">'
|
||||
+content
|
||||
+'</div>'
|
||||
+'<div class="innercontent"></div>';
|
||||
+'</div>'
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function ckBeforeSaveEditionPopup() {
|
||||
$ck('.item_content_edition').each(function() {
|
||||
var textID = $ck(this).attr('id');
|
||||
ckSaveEditorOnTheFly(textID);
|
||||
// ckRemoveEditorOnTheFly(textID);
|
||||
});
|
||||
$ck('#items_edition_list .item_edition:not(.ui-sortable-helper)').each(function(i, el) {
|
||||
var $el = $ck(el);
|
||||
$ck('.itemtitleck', focus).eq(i).text($el.find('.item_title_edition').val());
|
||||
$ck('.itemcontentck', focus).eq(i).html(ckEditorToContent($el.find('.item_content_edition').val()));
|
||||
if ($el.find('.iconck').html()) $ck('.itemtitleck', focus).eq(i).prepend('<span class="iconck">' + $el.find('.iconck').html() + '</span>');
|
||||
ckSetIconFromEdition(i, $el, focus, '.itemtitleck');
|
||||
});
|
||||
|
||||
var activetab = false;
|
||||
$ck('#popup_editionck .item_edition').each(function(i, el) {
|
||||
if ($ck(el).find('.item_setdefault.active').length) {
|
||||
activetab = i;
|
||||
}
|
||||
// since 2.19.0 add nested addons
|
||||
if (! $ck('.editfocus > .accordionsck > .ui-accordion-content').eq(i).find('> .innercontent').length) {
|
||||
var contentArea = $ck('.editfocus > .accordionsck > .ui-accordion-content').eq(i);
|
||||
contentArea.html('<div class="innercontent"></div><div class="itemcontentck">' + contentArea.html() + '</div><div class="innercontent"></div>');
|
||||
ckAddEditionForNestedAddons('#<?php echo $id; ?>');
|
||||
}
|
||||
});
|
||||
|
||||
focus.find('.accordionsck').attr('activetab', activetab).accordionck("refresh");
|
||||
var vPos = $ck('#iconicon-position button.active').attr('data-position');
|
||||
$ck('.editfocus .itemtitleck .pbckicon').css('vertical-align', vPos);
|
||||
}
|
||||
|
||||
function ckSaveInlineEditionPopup() {
|
||||
ckBeforeSaveEditionPopup();
|
||||
}
|
||||
|
||||
function ckSetDefaultEditItem(item) {
|
||||
$ck('.item_setdefault').removeClass('ckbutton-warning').removeClass('active');
|
||||
item.find('.item_setdefault').addClass('ckbutton-warning').addClass('active');
|
||||
}
|
||||
|
||||
function ckBeforeCloseEditionPopup() {
|
||||
$ck('.item_content_edition').each(function() {
|
||||
ckRemoveEditorOnTheFly($ck(this).attr('id'));
|
||||
});
|
||||
}
|
||||
|
||||
function ckBeforeDeleteEditItem(item) {
|
||||
var index_item = item.index('.item_edition');
|
||||
ckRemoveEditorOnTheFly(item.find('.item_content_edition').attr('id'));
|
||||
$ck('.accordionsck > .ui-accordion-header', focus).eq(index_item).find('+ .ui-accordion-content').remove();
|
||||
$ck('.accordionsck > .ui-accordion-header', focus).eq(index_item).remove();
|
||||
$ck('.accordionsck', focus).accordionck("refresh");
|
||||
}
|
||||
|
||||
function ckUpdatePreviewArea() {
|
||||
// var focus = $ck('.editfocus');
|
||||
// $ck('#items_edition_list .item_edition:not(.ui-sortable-helper)').each(function(i, el) {
|
||||
// $ck('.itemtitleck', focus).eq(i).text($ck(el).find('.item_title_edition').val());
|
||||
// $ck('.itemcontentck', focus).eq(i).html($ck(el).find('.item_content_edition').val());
|
||||
// });
|
||||
}
|
||||
|
||||
function ckMakeEditItemsSortable() {
|
||||
$ck( "#items_edition_list" ).sortable({
|
||||
items: ".item_edition",
|
||||
helper: "clone",
|
||||
// axis: "y",
|
||||
handle: "> .item_move",
|
||||
forcePlaceholderSize: true,
|
||||
tolerance: "pointer",
|
||||
placeholder: "placeholderck",
|
||||
// zIndex: 9999,
|
||||
start: function(e, ui){
|
||||
$ck(this).find('.item_content_edition').each(function(){
|
||||
if (tinymce.get($ck(this).attr('id'))) {
|
||||
ckRemoveEditorOnTheFly($ck(this).attr('id'));
|
||||
}
|
||||
});
|
||||
},
|
||||
update: function(e, ui) {
|
||||
$ck(this).find('.item_content_edition:not(.ui-sortable-helper)').each(function(){
|
||||
ckLoadEditorOnTheFly($ck(this).attr('id'));
|
||||
});
|
||||
ckUpdatePreviewArea();
|
||||
$ck( "#<?php echo $id; ?>_preview_accordion" ).accordionck("refresh");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ckInitIconPosition('.editfocus .itemtitleck .pbckicon', '#iconicon-position button');
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;">
|
||||
<g transform="matrix(2.08267,0,0,2.08267,-425.202,2.84748)">
|
||||
<g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)">
|
||||
<rect x="0" y="0" width="44" height="44" style="fill:none;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)">
|
||||
<path d="M27.5,14.667C29.806,16.397 31.167,19.117 31.167,22C31.167,24.883 29.806,27.603 27.5,29.333" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:2.15px;"/>
|
||||
</g>
|
||||
<g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)">
|
||||
<path d="M32.45,9.167C36.324,12.297 38.579,17.019 38.579,22C38.579,26.981 36.324,31.703 32.45,34.833" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:2.15px;"/>
|
||||
</g>
|
||||
<g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)">
|
||||
<path d="M11,27.5L7.333,27.5C6.328,27.5 5.5,26.672 5.5,25.667L5.5,18.333C5.5,17.328 6.328,16.5 7.333,16.5L11,16.5L17.417,8.25C17.668,7.762 18.172,7.455 18.721,7.455C19.525,7.455 20.187,8.117 20.187,8.921C20.187,9.004 20.18,9.086 20.167,9.167L20.167,34.833C20.18,34.914 20.187,34.996 20.187,35.079C20.187,35.883 19.525,36.545 18.721,36.545C18.172,36.545 17.668,36.238 17.417,35.75L11,27.5" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:2.15px;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870
|
||||
* https://www.template-creator.com
|
||||
* https://www.joomlack.fr
|
||||
* @license GNU/GPL
|
||||
* */
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
jimport('joomla.event.plugin');
|
||||
|
||||
class plgPagebuilderckAudio extends JPlugin {
|
||||
|
||||
private $context = 'PLG_PAGEBUILDERCK_AUDIO';
|
||||
|
||||
private $type = 'audio';
|
||||
|
||||
function __construct(&$subject, $params) {
|
||||
|
||||
parent::__construct($subject, $params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Construct the Menu Item to drag into the interface
|
||||
*
|
||||
* Return Object with item data
|
||||
*/
|
||||
public function onPagebuilderckAddItemToMenu() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// create the menu item
|
||||
$menuitem = new stdClass();
|
||||
$menuitem->type = $this->type;
|
||||
$menuitem->group = 'multimedia';
|
||||
$menuitem->title = JText::_($this->context . '_MENUITEM_TITLE');
|
||||
$menuitem->description = JText::_($this->context . '_MENUITEM_DESC');
|
||||
$menuitem->image = JUri::root(true) . '/plugins/pagebuilderck/audio/assets/images/audio.svg';
|
||||
|
||||
return $menuitem;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the interface
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemContentAudio() {
|
||||
$input = JFactory::getApplication()->input;
|
||||
$id = $input->get('ckid', '', 'string');
|
||||
// ckstyle and inner classes are needed to get the styles from the interface
|
||||
?>
|
||||
<div id="<?php echo $id; ?>" class="cktype" data-type="audio">
|
||||
<div class="ckstyle">
|
||||
</div>
|
||||
<div class="inner">
|
||||
<div class="audiock">
|
||||
<img src="<?php echo JUri::root(true); ?>/plugins/pagebuilderck/audio/assets/images/audio_example.jpg" width="300" height="auto" data-src="" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the interface for the item edition
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemOptionsAudio() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// load the interface for the options
|
||||
$tpl = JPATH_SITE . '/plugins/pagebuilderck/audio/layouts/edit_audio.php';
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the frontend page
|
||||
* @param string the item object from simple_html_dom
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckRenderItemAudio($item) {
|
||||
$attrs = $item->find('.tab_audio');
|
||||
$params = PagebuilderckFrontHelper::createParamsFromElement($attrs);
|
||||
|
||||
$audiosrc = PagebuilderckFrontHelper::getSource($params->get('audiourl'));
|
||||
$html ='<audio style="width:100%;box-sizing:border-box;max-width:100%;" controls src="' . $audiosrc . '" ' . ($params->get('autoplayyes') == 'checked' ? 'autoplay' : '') . '>'
|
||||
. 'Your browser does not support the audio element.'
|
||||
. '</audio>';
|
||||
|
||||
$html = preg_replace('#<div class="audiock"[^>]*>(.*?)<\/div>#is', $html, $item->innertext);
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="3" type="plugin" group="pagebuilderck" method="upgrade">
|
||||
<name>plg_pagebuilderck_audio_xml_name</name>
|
||||
<creationDate>December 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>https://www.joomlack.fr</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>Audio item for Page Builder CK</description>
|
||||
<files>
|
||||
<filename plugin="audio">audio.php</filename>
|
||||
<folder>language</folder>
|
||||
<folder>layouts</folder>
|
||||
<folder>assets</folder>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_audio.sys.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_audio.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_audio.sys.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_audio.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
@@ -0,0 +1,10 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_AUDIO_XML_NAME="Page Builder CK - Audio player"
|
||||
PLG_PAGEBUILDERCK_AUDIO_MENUITEM_TITLE="Audio player"
|
||||
PLG_PAGEBUILDERCK_AUDIO_MENUITEM_DESC="Play your audio files"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_AUDIO_XML_NAME="Page Builder CK - Audio player"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,9 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_AUDIO_XML_NAME="Page Builder CK - Lecteur audio"
|
||||
PLG_PAGEBUILDERCK_AUDIO_MENUITEM_TITLE="Lecteur audio"
|
||||
PLG_PAGEBUILDERCK_AUDIO_MENUITEM_DESC="Jouer vos fichiers audio"
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_AUDIO_XML_NAME="Page Builder CK - Lecteur audio"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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;
|
||||
|
||||
?>
|
||||
<div id="elementscontainer">
|
||||
<div class="menulink" tab="tab_audio"><?php echo JText::_('CK_AUDIO_EDITION'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_audio">
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_AUDIO_FILE'); ?></div>
|
||||
<div class="menustyles-row">
|
||||
<div class="menustyles-field-large" >
|
||||
<input class="inputbox" type="text" value="" name="audiourl" id="audiourl" onchange="ckUpdateAudioPreview()" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a class="ckbuttonstyle" href="javascript:void(0)" onclick="ckCallMediaManagerPopup('audiourl', 'audio')" onchange="ckUpdateAudioPreview()()"><?php echo JText::_('CK_SELECT') ?></a>
|
||||
</div>
|
||||
<div id="previewareabloc">
|
||||
<div class="audiock">
|
||||
</div>
|
||||
</div>
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_OPTIONS'); ?></div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>control_play.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_AUTOPLAY'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field ckbutton-group">
|
||||
<input type="radio" class="inputbox" name="autoplay" id="autoplayyes" onclick="ckUpdateAudioPreview()" value="1" />
|
||||
<label for="autoplayyes" class="ckbutton"><?php echo JText::_('JYES') ?></label>
|
||||
<input type="radio" class="inputbox" name="autoplay" id="autoplayno" onclick="ckUpdateAudioPreview()" value="0" />
|
||||
<label for="autoplayno" class="ckbutton"><?php echo JText::_('JNO') ?></label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_CSS_CLASS'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox" type="text" name="audiocssclass" id="audiocssclass" value="" onchange="ckUpdateAudioAttribute('class', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_blocstyles"><?php echo JText::_('CK_STYLES'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_blocstyles">
|
||||
<?php echo $this->menustyles->createBlocStyles('bloc', 'audio', '') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function ckLoadEditionPopup() {
|
||||
var focus = $ck('.editfocus');
|
||||
// var focus_audio = $ck('.editfocus iframe');
|
||||
$ck('#previewareabloc > .inner').html(focus.find('> .inner').html());
|
||||
$ck('#previewareabloc .ckstyle').html(focus.find('.ckstyle').html());
|
||||
ckFillEditionPopup(focus.attr('id'));
|
||||
}
|
||||
|
||||
function ckBeforeSaveEditionPopup() {
|
||||
var focus = $ck('.editfocus');
|
||||
ckUpdateAudioPreview();
|
||||
// focus.find('> .inner').html($ck('#previewareabloc > .inner').html());
|
||||
focus.find('.ckstyle').html($ck('#previewareabloc .ckstyle').html());
|
||||
// ckSaveEditionPopup(focus.attr('id'));
|
||||
// ckCloseEditionPopup();
|
||||
}
|
||||
|
||||
function ckUpdateAudioPreview() {
|
||||
var audioSrc = $ck('#audiourl').val();
|
||||
if (audioSrc.substr(0,1) == '/') {
|
||||
audioSrc = audioSrc.slice(1,audioSrc.length);
|
||||
}
|
||||
audioSrc = (/^(f|ht)tps?:\/\//i.test(audioSrc)) ? audioSrc : PAGEBUILDERCK.URIROOT + '/' + audioSrc;
|
||||
|
||||
var audioPlayer = $ck('#previewareabloc .audiock audio');
|
||||
|
||||
if (audioSrc) {
|
||||
var controls = $ck('#elementscontainer [name="controls"]:checked').val() == '1' ? 'controls' : '';
|
||||
var autoplay = $ck('#elementscontainer [name="autoplay"]:checked').val() == '1' ? 'autoplay' : '';
|
||||
|
||||
$ck('#previewareabloc .audiock').empty()
|
||||
.append(
|
||||
'<audio controls src="'+audioSrc+'" '+controls+autoplay+'>'
|
||||
+'Your browser does not support the audio element.'
|
||||
+ '</audio>');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function selectaudiofile(file) {
|
||||
$ck('#audiourl').val(file);
|
||||
CKBox.close();
|
||||
ckUpdateAudioPreview();
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(64.3571,0,0,64.3571,-16050.5,-341.281)">
|
||||
<path d="M251.751,7.125L252.027,6.708C252.166,6.499 252.4,6.375 252.651,6.375L254.097,6.375C254.348,6.375 254.582,6.499 254.72,6.708L254.999,7.125L255.625,7.125C256.246,7.125 256.75,7.629 256.75,8.25L256.75,10.875C256.75,11.496 256.246,12 255.625,12L251.125,12C250.504,12 250,11.496 250,10.875L250,8.25C250,7.629 250.504,7.125 251.125,7.125L251.751,7.125ZM254.5,9.563C254.5,8.945 253.992,8.438 253.375,8.438C252.758,8.438 252.25,8.945 252.25,9.563C252.25,10.18 252.758,10.688 253.375,10.688C253.992,10.688 254.5,10.18 254.5,9.563Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:0.31px;"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870
|
||||
* https://www.template-creator.com
|
||||
* https://www.joomlack.fr
|
||||
* @license GNU/GPL
|
||||
* */
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
jimport('joomla.event.plugin');
|
||||
|
||||
class plgPagebuilderckIcon extends JPlugin {
|
||||
|
||||
private $context = 'PLG_PAGEBUILDERCK_ICON';
|
||||
|
||||
private $type = 'icon';
|
||||
|
||||
function __construct(&$subject, $params) {
|
||||
|
||||
parent::__construct($subject, $params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Construct the Menu Item to drag into the interface
|
||||
*
|
||||
* Return Object with item data
|
||||
*/
|
||||
public function onPagebuilderckAddItemToMenu() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// create the menu item
|
||||
$menuitem = new stdClass();
|
||||
$menuitem->type = $this->type;
|
||||
$menuitem->group = 'text';
|
||||
$menuitem->title = JText::_($this->context . '_MENUITEM_TITLE');
|
||||
$menuitem->description = JText::_($this->context . '_MENUITEM_DESC');
|
||||
$menuitem->image = JUri::root(true) . '/plugins/pagebuilderck/icon/assets/images/icon.svg';
|
||||
|
||||
return $menuitem;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the interface
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemContentIcon() {
|
||||
$input = JFactory::getApplication()->input;
|
||||
$id = $input->get('ckid', '', 'string');
|
||||
// ckstyle and inner classes are needed to get the styles from the interface
|
||||
?>
|
||||
<div id="<?php echo $id; ?>" class="cktype" data-type="icon" >
|
||||
<div class="tab_blocstyles ckprops" iconalignementcenter="checked" fieldslist="iconalignementleft,iconalignementcenter,iconalignementright,iconalignementjustify"></div>
|
||||
<div class="tab_iconstyles ckprops" iconicontype="svg" iconiconsvgsize="40" iconiconsvgstrokewidth="2" iconalignementcenter="checked" fieldslist="iconicontype,iconiconsvgsize,iconiconsvgstrokewidth,iconalignementleft,iconalignementcenter,iconalignementright"></div>
|
||||
<div class="ckstyle">
|
||||
<style>
|
||||
#<?php echo $id; ?> .iconck {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#<?php echo $id; ?> .iconck {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#<?php echo $id; ?> svg * {
|
||||
stroke-width: 1.6;
|
||||
}
|
||||
|
||||
#<?php echo $id; ?> svg.svgicon-ionicon *, #<?php echo $id; ?> svg.svgicon-fontawesome * {
|
||||
stroke-width: 25.6;
|
||||
}
|
||||
|
||||
#<?php echo $id; ?> svg {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
<div class="iconck">
|
||||
<span class="pbckicon" data-path="tabler_photo.svg" data-pos="undefined" style="display:inline-block;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-photo" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block;">
|
||||
<line x1="15" y1="8" x2="15.01" y2="8"></line>
|
||||
<rect x="4" y="4" width="16" height="16" rx="3"></rect>
|
||||
<path d="M4 15l4 -4a3 5 0 0 1 3 0l5 5"></path>
|
||||
<path d="M14 14l1 -1a3 5 0 0 1 3 0l2 2"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the interface for the item edition
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemOptionsIcon() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// load the interface for the options
|
||||
$tpl = JPATH_SITE . '/plugins/pagebuilderck/icon/layouts/edit_icon.php';
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the frontend page
|
||||
* @param string the item object from simple_html_dom
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckRenderItemIcon($item) {
|
||||
return $item->innertext;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="3" type="plugin" group="pagebuilderck" method="upgrade">
|
||||
<name>plg_pagebuilderck_icon_xml_name</name>
|
||||
<creationDate>December 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>https://www.joomlack.fr</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>Icon item for Page Builder CK</description>
|
||||
<files>
|
||||
<filename plugin="icon">icon.php</filename>
|
||||
<folder>language</folder>
|
||||
<folder>layouts</folder>
|
||||
<folder>assets</folder>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_icon.sys.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_icon.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_icon.sys.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_icon.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
@@ -0,0 +1,10 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ICON_XML_NAME="Page Builder CK - Icon"
|
||||
PLG_PAGEBUILDERCK_ICON_MENUITEM_TITLE="Icon"
|
||||
PLG_PAGEBUILDERCK_ICON_MENUITEM_DESC="Select an icon from a collection"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ICON_XML_NAME="Page Builder CK - Icon"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,9 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ICON_XML_NAME="Page Builder CK - Icône"
|
||||
PLG_PAGEBUILDERCK_ICON_MENUITEM_TITLE="Icône"
|
||||
PLG_PAGEBUILDERCK_ICON_MENUITEM_DESC="Selectionner une icône dans la liste"
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ICON_XML_NAME="Page Builder CK - Icône"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?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;
|
||||
?>
|
||||
<div id="elementscontainer">
|
||||
<div class="menulink" tab="tab_iconstyles"><?php echo JText::_('CK_ICON'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_iconstyles">
|
||||
<?php echo $this->menustyles->createIcon('icon', '.editfocus .iconck i.fa', false, false, true) ?>
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_LINK') ?></div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>link.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_LINK_URL'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field ckoption-field-with-button">
|
||||
<input id="linkurl" name="linkurl" class="inputbox" value="" type="text" />
|
||||
<span class="ckbuttonstyle" onclick="ckCallLinkManagerPopup('linkurl', 'all')">+</span>
|
||||
</span>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_REL_TAG'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input id="linkrel" name="linkrel" class="inputbox" value="" type="text" />
|
||||
</span>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_CSS_CLASS'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input id="linkcss" name="linkcss" class="inputbox" value="" type="text" />
|
||||
</span>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>hand-point-090.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_ONCLICK'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input id="linkonlick" name="linkonlick" class="inputbox" value="" type="text" />
|
||||
</span>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>link_add.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_TARGET'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input id="linktarget" name="linktarget" class="inputbox" value="" type="text" />
|
||||
</span>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_blocstyles"><?php echo JText::_('CK_STYLES'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_blocstyles">
|
||||
<?php echo $this->menustyles->createBackground('icon') ?>
|
||||
<?php echo $this->menustyles->createDimensions('icon', true, true) ?>
|
||||
<?php echo $this->menustyles->createDecoration('icon') ?>
|
||||
<?php echo $this->menustyles->createShadow('icon') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
var focus = $ck('.editfocus');
|
||||
function ckLoadEditionPopup() {
|
||||
ckFillEditionPopup(focus.attr('id'));
|
||||
ckGetIconPosition('.editfocus .iconck i.fa', '#iconicon-position button');
|
||||
ckGetIconMargin('.editfocus .iconck i.fa', '#iconicon_margin');
|
||||
$ck('#iconicon-class').val(focus.find('.iconck > i').attr('data-iconclass'));
|
||||
}
|
||||
|
||||
function ckBeforeSaveEditionPopup() {
|
||||
if (ckCheckIconType()) {
|
||||
ckUpdatePreviewArea();
|
||||
}
|
||||
}
|
||||
|
||||
function ckCheckIconType() {
|
||||
var isSvg = focus.find('.iconck svg').length;
|
||||
var isFont = focus.find('.iconck > i').length;
|
||||
var type = $ck('#elementscontainer input[type="radio"][name="iconicontype"]:checked').val();
|
||||
if (isSvg && type == 'svg') return true;
|
||||
if (isFont && type == 'fa') return true;
|
||||
if (! isFont && ! isSvg) return true; // in case of ...
|
||||
alert('Please update the icon, it does not match the selected type');
|
||||
return false;
|
||||
}
|
||||
|
||||
function ckUpdatePreviewArea() {
|
||||
var focusIcon = focus.find('.iconck');
|
||||
var html = focus.find('i,.pbckicon')[0].outerHTML;
|
||||
var linkurl = $ck('#linkurl').val();
|
||||
// add link
|
||||
if (linkurl) {
|
||||
var linkrel = $ck('#linkrel').val();
|
||||
var linkcss = $ck('#linkcss').val();
|
||||
var linkonlick = $ck('#linkonlick').val();
|
||||
var linktarget = $ck('#linktarget').val();
|
||||
html = '<a href="' + linkurl + '"'
|
||||
+ (linkrel ? ' rel="' + linkrel + '"' : '')
|
||||
+ (linkcss ? ' class="' + linkcss + '"' : '')
|
||||
+ (linkonlick ? ' onclick="' + linkonlick + '"' : '')
|
||||
+ (linktarget ? ' target="' + linktarget + '"' : '')
|
||||
+ '>'
|
||||
+ html
|
||||
+ '</a>';
|
||||
}
|
||||
focusIcon.html(html);
|
||||
}
|
||||
|
||||
function ckSelectIcon(icon) {
|
||||
var focusIcon = $ck('.editfocus .iconck');
|
||||
focusIcon.empty().append(icon);
|
||||
return focusIcon;
|
||||
}
|
||||
|
||||
ckInitIconPosition('.editfocus .iconck i.fa', '#iconicon-position button');
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="512px" height="512px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;"><g transform="matrix(2.08267,0,0,2.08267,-425.202,2.84748)"><g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)"><rect x="0" y="0" width="44" height="44" style="fill:none;fill-rule:nonzero;"/></g><g transform="matrix(6.22744,0,0,6.22744,190.077,-15.4517)"><path d="M5.5,9.167C5.5,7.155 7.155,5.5 9.167,5.5L34.833,5.5C36.845,5.5 38.5,7.155 38.5,9.167L38.5,34.833C38.5,36.845 36.845,38.5 34.833,38.5L9.167,38.5C7.155,38.5 5.5,36.845 5.5,34.833L5.5,9.167Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.54px;"/></g><g transform="matrix(6.22744,0,0,6.22744,237.666,-9.36977)"><path d="M16.5,27.5L12.833,27.5" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.54px;"/></g><g transform="matrix(13.0951,0,0,6.22744,136.941,19.4394)"><path d="M16.5,27.5L12.833,27.5" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:0.94px;"/></g><g transform="matrix(6.22744,0,0,6.22744,212.911,-3.92804)"><path d="M23.833,22L12.833,22" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.54px;"/></g><g transform="matrix(11.8939,0,0,11.8939,-2684.62,-38.7788)"><path d="M251.751,7.125L252.027,6.708C252.166,6.499 252.4,6.375 252.651,6.375L254.097,6.375C254.348,6.375 254.582,6.499 254.72,6.708L254.999,7.125L255.625,7.125C256.246,7.125 256.75,7.629 256.75,8.25L256.75,10.875C256.75,11.496 256.246,12 255.625,12L251.125,12C250.504,12 250,11.496 250,10.875L250,8.25C250,7.629 250.504,7.125 251.125,7.125L251.751,7.125ZM254.5,9.563C254.5,8.945 253.992,8.438 253.375,8.438C252.758,8.438 252.25,8.945 252.25,9.563C252.25,10.18 252.758,10.688 253.375,10.688C253.992,10.688 254.5,10.18 254.5,9.563Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:0.81px;stroke-linecap:butt;stroke-miterlimit:2;"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870
|
||||
* https://www.template-creator.com
|
||||
* https://www.joomlack.fr
|
||||
* @license GNU/GPL
|
||||
* */
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
jimport('joomla.event.plugin');
|
||||
|
||||
class plgPagebuilderckIcontext extends JPlugin {
|
||||
|
||||
private $context = 'PLG_PAGEBUILDERCK_ICONTEXT';
|
||||
|
||||
private $type = 'icontext';
|
||||
|
||||
function __construct(&$subject, $params) {
|
||||
|
||||
parent::__construct($subject, $params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Construct the Menu Item to drag into the interface
|
||||
*
|
||||
* Return Object with item data
|
||||
*/
|
||||
public function onPagebuilderckAddItemToMenu() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// create the menu item
|
||||
$menuitem = new stdClass();
|
||||
$menuitem->type = $this->type;
|
||||
$menuitem->group = 'text';
|
||||
$menuitem->title = JText::_($this->context . '_MENUITEM_TITLE');
|
||||
$menuitem->description = JText::_($this->context . '_MENUITEM_DESC');
|
||||
$menuitem->image = JUri::root(true) . '/plugins/pagebuilderck/icontext/assets/images/icontext.svg';
|
||||
|
||||
return $menuitem;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the interface
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemContentIcontext() {
|
||||
$input = JFactory::getApplication()->input;
|
||||
$id = $input->get('ckid', '', 'string');
|
||||
// ckstyle and inner classes are needed to get the styles from the interface
|
||||
?>
|
||||
<div id="<?php echo $id; ?>" class="cktype" data-type="icontext" data-layout="top">
|
||||
<div class="tab_textedition ckprops" textalignementcenter="checked" fieldslist="textalignementleft,textalignementcenter,textalignementright,textalignementjustify"></div>
|
||||
<div class="tab_titleedition ckprops" titlefontsize="25" titlealignementcenter="checked" titlepaddings="10" fieldslist="titlefontsize,titlealignementleft,titlealignementcenter,titlealignementright,titlealignementjustify,titlepaddings"></div>
|
||||
<div class="tab_iconstyles ckprops" iconicontype="svg" iconiconsvgsize="40" iconiconsvgstrokewidth="1.6" iconalignementcenter="checked" fieldslist="iconicontype,iconiconsvgsize,iconiconsvgstrokewidth,iconalignementleft,iconalignementcenter,iconalignementright"></div>
|
||||
<div class="tab_blocstyles ckprops" fieldslist="blocbackgroundcolorstart,blocbackgroundpositionend,blocbackgrounddirection,blocbackgroundimageattachment,blocbackgroundimagerepeat,blocbackgroundimagesize,blocalignementleft,blocalignementcenter,blocalignementright,blocalignementjustify,blocpaddings,blocbordertopstyle,blocborderrightstyle,blocborderbottomstyle,blocborderleftstyle,blocbordersstyle,blocshadowinset" iconalignementcenter="checked" blocbackgroundcolorstart="" blocbackgroundpositionend="100" blocbackgrounddirection="topbottom" blocbackgroundimageattachment="scroll" blocbackgroundimagerepeat="no-repeat" blocbackgroundimagesize="auto" blocpaddings="" blocbordertopstyle="solid" blocborderrightstyle="solid" blocborderbottomstyle="solid" blocborderleftstyle="solid" blocbordersstyle="solid" blocshadowinset="0"></div> <div class="ckstyle">
|
||||
<style>
|
||||
#<?php echo $id; ?> > div.inner {
|
||||
}
|
||||
|
||||
#<?php echo $id; ?> .iconck {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#<?php echo $id; ?> .titleck {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
font-size: 25px;
|
||||
text-align: center;
|
||||
}
|
||||
#<?php echo $id; ?> .contentck {
|
||||
text-align: center;
|
||||
}
|
||||
#<?php echo $id; ?> svg * {
|
||||
stroke-width: 1.6;
|
||||
}
|
||||
|
||||
#<?php echo $id; ?> svg.svgicon-ionicon *, #<?php echo $id; ?> svg.svgicon-fontawesome * {
|
||||
stroke-width: 25.6;
|
||||
}
|
||||
|
||||
#<?php echo $id; ?> svg {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
<div class="inner">
|
||||
<div class="iconck">
|
||||
<span class="pbckicon" data-path="tabler_photo.svg" data-pos="undefined" style="display:inline-block;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-photo" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block;">
|
||||
<line x1="15" y1="8" x2="15.01" y2="8"></line>
|
||||
<rect x="4" y="4" width="16" height="16" rx="3"></rect>
|
||||
<path d="M4 15l4 -4a3 5 0 0 1 3 0l5 5"></path>
|
||||
<path d="M14 14l1 -1a3 5 0 0 1 3 0l2 2"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<div class="contentck">
|
||||
<div class="titleck">Title</div>
|
||||
<div class="textck">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed molestie scelerisque ultrices. Nullam venenatis, felis ut accumsan vestibulum, diam leo congue nisl, eget luctus sapien libero eget urna. Duis ac pellentesque nisi.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the interface for the item edition
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemOptionsIcontext() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// load the interface for the options
|
||||
$tpl = JPATH_SITE . '/plugins/pagebuilderck/icontext/layouts/edit_icontext.php';
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the frontend page
|
||||
* @param string the item object from simple_html_dom
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckRenderItemIcontext($item) {
|
||||
return $item->innertext;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="3" type="plugin" group="pagebuilderck" method="upgrade">
|
||||
<name>plg_pagebuilderck_icontext_xml_name</name>
|
||||
<creationDate>December 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>https://www.joomlack.fr</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>Icon and Text item for Page Builder CK</description>
|
||||
<files>
|
||||
<filename plugin="icontext">icontext.php</filename>
|
||||
<folder>language</folder>
|
||||
<folder>layouts</folder>
|
||||
<folder>assets</folder>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_icontext.sys.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_icontext.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_icontext.sys.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_icontext.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
@@ -0,0 +1,10 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ICONTEXT_XML_NAME="Page Builder CK - Icon and Text"
|
||||
PLG_PAGEBUILDERCK_ICONTEXT_MENUITEM_TITLE="Icon and Text"
|
||||
PLG_PAGEBUILDERCK_ICONTEXT_MENUITEM_DESC="Icon and text in one single block"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ICONTEXT_XML_NAME="Page Builder CK - Icon and Text"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,9 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ICONTEXT_XML_NAME="Page Builder CK - Icône et Texte"
|
||||
PLG_PAGEBUILDERCK_ICONTEXT_MENUITEM_TITLE="Icône et Texte"
|
||||
PLG_PAGEBUILDERCK_ICONTEXT_MENUITEM_DESC="Icône et texte dans un seul bloc"
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_ICONTEXT_XML_NAME="Page Builder CK - Icône et Texte"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,156 @@
|
||||
<?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;
|
||||
?>
|
||||
<div id="elementscontainer">
|
||||
<div class="menulink" tab="tab_iconstyles"><?php echo JText::_('CK_ICON'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_iconstyles">
|
||||
<?php echo $this->menustyles->createIcon('icon', '.editfocus .iconck i.fa', false, false, true) ?>
|
||||
<div class="ckoption">
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_POSITION'); ?></div>
|
||||
<div class="ckbutton" onclick="ckUpdateLayout(this)" data-layout="top"><?php echo JText::_('CK_TOP'); ?></div>
|
||||
<div class="ckbutton" onclick="ckUpdateLayout(this)" data-layout="bottom"><?php echo JText::_('CK_BOTTOM'); ?></div>
|
||||
<div class="ckbutton" onclick="ckUpdateLayout(this)" data-layout="left"><?php echo JText::_('CK_LEFT'); ?></div>
|
||||
<div class="ckbutton" onclick="ckUpdateLayout(this)" data-layout="right"><?php echo JText::_('CK_RIGHT'); ?></div>
|
||||
</div>
|
||||
<?php echo $this->menustyles->createBackground('icon') ?>
|
||||
<?php echo $this->menustyles->createDimensions('icon', true, true) ?>
|
||||
<?php echo $this->menustyles->createDecoration('icon') ?>
|
||||
<?php echo $this->menustyles->createShadow('icon') ?>
|
||||
<?php echo $this->menustyles->createCustom('icon') ?>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_titleedition"><?php echo JText::_('CK_TITLE'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_titleedition">
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_TITLE_CONTENT'); ?></div>
|
||||
<div class="ckoption">
|
||||
<input type="text" id="<?php echo $id; ?>_title" onchange="ckUpdatePreviewArea()" style="width: 275px;" />
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<?php echo JText::_('CK_TAG'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field ckbutton-group">
|
||||
<select type="text" id="<?php echo $id; ?>_headingtag" onchange="ckUpdatePreviewArea()" >
|
||||
<option value="div">DIV</option>
|
||||
<option value="h1">H1</option>
|
||||
<option value="h2">H2</option>
|
||||
<option value="h3">H3</option>
|
||||
<option value="h4">H4</option>
|
||||
<option value="h5">H5</option>
|
||||
<option value="h6">H6</option>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_CSS_CLASS'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input id="titlecss" name="titlecss" class="inputbox" value="" type="text" />
|
||||
</span>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_TITLE_STYLES'); ?></div>
|
||||
<?php echo $this->menustyles->createTextStyles('title', 'titleck', false) ?>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_textedition"><?php echo JText::_('CK_TEXT'); ?></div>
|
||||
<div class="tab menustyles ckproperty tab_fullscreen" id="tab_textedition">
|
||||
<?php // echo PagebuilderckHelper::renderEditionButtons(); ?>
|
||||
<textarea id="<?php echo $id; ?>_text" data-id="<?php echo $id; ?>_text"></textarea>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_textstyles"><?php echo JText::_('CK_TEXT_STYLES'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_textstyles">
|
||||
<?php echo $this->menustyles->createTextStyles('text', 'titleck', false) ?>
|
||||
</div>
|
||||
<div class="menulink" tab="tab_blocstyles"><?php echo JText::_('CK_BLOCK_STYLES'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_blocstyles">
|
||||
<?php echo $this->menustyles->createBlocStyles('bloc') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function ckLoadEditionPopup() {
|
||||
var focus = $ck('.editfocus');
|
||||
var textID = '<?php echo $id; ?>_text';
|
||||
|
||||
content = focus.find('.textck').html();
|
||||
content = ckContentToEditor(content);
|
||||
$ck('#<?php echo $id; ?>_text').val(content);
|
||||
|
||||
$ck('#<?php echo $id; ?>_title').val(focus.find('.titleck').html());
|
||||
$ck('#<?php echo $id; ?>_headingtag').val(focus.find('.titleck')[0].tagName.toLowerCase());
|
||||
ckUpdatePreviewArea();
|
||||
|
||||
ckLoadEditorOnTheFly(textID);
|
||||
|
||||
ckFillEditionPopup(focus.attr('id'));
|
||||
ckGetIconPosition('.editfocus .iconck i.fa', '#iconicon-position button');
|
||||
ckGetIconMargin('.editfocus .iconck i.fa', '#iconicon_margin');
|
||||
$ck('#iconicon-class').val(focus.find('.iconck > i').attr('data-iconclass'));
|
||||
}
|
||||
|
||||
function ckUpdateLayout(btn) {
|
||||
$ck(btn).parent().find('.active').removeClass('active');
|
||||
$ck(btn).addClass('active');
|
||||
var layout = $ck(btn).attr('data-layout');
|
||||
var focus = $ck('.editfocus');
|
||||
// for B/C
|
||||
if (! focus.find('.contentck').length) {
|
||||
focus.find('> .inner').append('<div class="contentck" />');
|
||||
var contentck = focus.find('.contentck');
|
||||
contentck.append(focus.find('.titleck'));
|
||||
contentck.append(focus.find('.textck'));
|
||||
}
|
||||
|
||||
focus.attr('data-layout', layout);
|
||||
}
|
||||
|
||||
/*
|
||||
* Method automatically called in ckCloseEditionPopup() if exists
|
||||
*/
|
||||
function ckBeforeCloseEditionPopup() {
|
||||
var textID = '<?php echo $id; ?>_text';
|
||||
ckRemoveEditorOnTheFly(textID);
|
||||
}
|
||||
|
||||
function ckBeforeSaveEditionPopup() {
|
||||
var textID = '<?php echo $id; ?>_text';
|
||||
ckSaveEditorOnTheFly(textID);
|
||||
var content = $ck('[data-id="' + textID + '"]').val();
|
||||
var focus = $ck('.editfocus');
|
||||
focus.find('.textck').html(content);
|
||||
}
|
||||
|
||||
function ckSaveInlineEditionPopup() {
|
||||
ckBeforeSaveEditionPopup();
|
||||
}
|
||||
|
||||
function ckUpdatePreviewArea() {
|
||||
var focus = $ck('.editfocus');
|
||||
$ck('.titleck', focus).html($ck('#<?php echo $id; ?>_title').val());
|
||||
// update the title
|
||||
var oldheading = focus.find('.titleck');
|
||||
var css = $ck('#titlecss').val() ? $ck('#titlecss').val() : '';
|
||||
var newheading = $ck('<' + $ck('#<?php echo $id; ?>_headingtag').val() + ' class="titleck' + (css ? ' ' + css : css) + '" contenteditable="true"></' + $ck('#<?php echo $id; ?>_headingtag').val() + '>');
|
||||
oldheading.after(newheading);
|
||||
newheading.append(oldheading.html());
|
||||
oldheading.remove();
|
||||
}
|
||||
|
||||
function ckSelectIcon(icon) {
|
||||
var focusIcon = $ck('.editfocus .iconck');
|
||||
focusIcon.empty().append(icon);
|
||||
return focusIcon;
|
||||
}
|
||||
|
||||
ckInitIconPosition('.editfocus .iconck i.fa', '#iconicon-position button');
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="512px" height="512px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;"><g transform="matrix(2.08267,0,0,2.08267,-425.202,2.84748)"><g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)"><rect x="0" y="0" width="44" height="44" style="fill:none;"/></g><g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)"><path d="M27.5,14.667L27.518,14.667" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.72px;"/></g><g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)"><path d="M5.5,11C5.5,7.983 7.983,5.5 11,5.5L33,5.5C36.017,5.5 38.5,7.983 38.5,11L38.5,33C38.5,36.017 36.017,38.5 33,38.5L11,38.5C7.983,38.5 5.5,36.017 5.5,33L5.5,11Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.72px;"/></g><g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)"><path d="M5.5,29.333L14.667,20.167C16.368,18.53 18.465,18.53 20.167,20.167L29.333,29.333" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.72px;"/></g><g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)"><path d="M25.667,25.667L27.5,23.833C29.201,22.196 31.299,22.196 33,23.833L38.5,29.333" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.72px;"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="800px" height="300px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"><g transform="matrix(2.57487,0,0,1.99517,-290.909,-139.33)"><rect x="112.98" y="69.834" width="310.696" height="150.363" style="fill:rgb(51,51,51);"/></g><g transform="matrix(1.42667,0,0,1.42667,-102.18,-25.2881)"><g transform="matrix(1,0,0,1,48.9989,0.68054)"><rect x="88.221" y="58.588" width="112.629" height="124.879" style="fill:white;stroke:white;stroke-width:2.92px;"/><g transform="matrix(0.953982,0,0,0.953982,6.6513,5.5695)"><rect x="88.221" y="58.588" width="112.629" height="124.879" style="fill:rgb(47,47,47);stroke:white;stroke-width:3.06px;"/></g></g><g transform="matrix(0.528511,0,0,0.528511,-12.3405,21.3382)"><g id="path828" transform="matrix(0.47865,0,0,0.47865,111.761,135.158)"><path d="M407.834,221.533L520.334,23.318L618.905,145.461L654.263,106.89L752.834,219.39L407.834,221.533Z" style="fill:white;fill-rule:nonzero;"/></g><g id="path830" transform="matrix(0.47865,0,0,0.47865,111.761,135.158)"><circle cx="647.679" cy="39.925" r="32.679" style="fill:white;"/></g></g></g><g transform="matrix(1,0,0,1,217.238,-86.4486)"><g transform="matrix(50,0,0,50,310.57,254.198)"><rect x="0.103" y="-0.71" width="0.07" height="0.71" style="fill:white;fill-rule:nonzero;"/></g><g transform="matrix(50,0,0,50,324.339,254.198)"><path d="M0.618,-0.71L0.691,-0.71L0.691,-0L0.621,-0L0.621,-0.61L0.628,-0.579L0.415,-0.099L0.365,-0.099L0.151,-0.569L0.158,-0.61L0.158,-0L0.088,-0L0.088,-0.71L0.162,-0.71L0.39,-0.197L0.618,-0.71Z" style="fill:white;fill-rule:nonzero;"/></g><g transform="matrix(50,0,0,50,362.816,254.198)"><path d="M0.281,-0.71L0.366,-0.71L0.628,-0L0.55,-0L0.324,-0.636L0.098,-0L0.02,-0L0.281,-0.71ZM0.14,-0.238L0.514,-0.238L0.514,-0.172L0.14,-0.172L0.14,-0.238Z" style="fill:white;fill-rule:nonzero;"/></g><g transform="matrix(50,0,0,50,393.236,254.198)"><path d="M0.573,-0.363L0.573,-0.258C0.573,-0.199 0.564,-0.15 0.546,-0.11C0.527,-0.071 0.5,-0.042 0.463,-0.022C0.426,-0.002 0.38,0.007 0.325,0.007C0.269,0.007 0.222,-0.002 0.185,-0.021C0.148,-0.039 0.12,-0.067 0.101,-0.104C0.083,-0.141 0.073,-0.187 0.073,-0.243L0.073,-0.452C0.073,-0.511 0.082,-0.561 0.101,-0.6C0.119,-0.639 0.147,-0.668 0.184,-0.688C0.22,-0.708 0.266,-0.717 0.322,-0.717C0.368,-0.717 0.407,-0.709 0.44,-0.694C0.474,-0.678 0.501,-0.655 0.522,-0.624C0.543,-0.593 0.558,-0.554 0.567,-0.506L0.491,-0.506C0.483,-0.539 0.471,-0.566 0.456,-0.587C0.441,-0.609 0.422,-0.625 0.4,-0.636C0.377,-0.646 0.351,-0.652 0.322,-0.652C0.282,-0.652 0.249,-0.644 0.223,-0.63C0.196,-0.615 0.177,-0.593 0.163,-0.563C0.15,-0.534 0.144,-0.497 0.144,-0.452L0.144,-0.243C0.144,-0.201 0.15,-0.167 0.164,-0.14C0.177,-0.113 0.197,-0.092 0.224,-0.079C0.251,-0.065 0.284,-0.058 0.325,-0.058C0.364,-0.058 0.397,-0.065 0.422,-0.079C0.448,-0.093 0.467,-0.115 0.48,-0.144C0.493,-0.173 0.499,-0.211 0.499,-0.257L0.499,-0.297L0.327,-0.297L0.327,-0.363L0.573,-0.363Z" style="fill:white;fill-rule:nonzero;"/></g><g transform="matrix(50,0,0,50,425.072,254.198)"><path d="M0.088,-0.71L0.158,-0.71L0.158,-0L0.088,-0L0.088,-0.71ZM0.136,-0.065L0.544,-0.065L0.544,-0L0.136,-0L0.136,-0.065ZM0.136,-0.385L0.49,-0.385L0.49,-0.32L0.136,-0.32L0.136,-0.385ZM0.136,-0.71L0.544,-0.71L0.544,-0.645L0.136,-0.645L0.136,-0.71Z" style="fill:white;fill-rule:nonzero;"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2015 Cédric KEIFLIN alias ced1870
|
||||
* https://www.template-creator.com
|
||||
* https://www.joomlack.fr
|
||||
* @license GNU/GPL
|
||||
* */
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
jimport('joomla.event.plugin');
|
||||
|
||||
class plgPagebuilderckImage extends JPlugin {
|
||||
|
||||
private $context = 'PLG_PAGEBUILDERCK_IMAGE';
|
||||
|
||||
private $type = 'image';
|
||||
|
||||
function __construct(&$subject, $params) {
|
||||
|
||||
parent::__construct($subject, $params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Construct the Menu Item to drag into the interface
|
||||
*
|
||||
* Return Object with item data
|
||||
*/
|
||||
public function onPagebuilderckAddItemToMenu() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// create the menu item
|
||||
$menuitem = new stdClass();
|
||||
$menuitem->type = $this->type;
|
||||
$menuitem->group = 'image';
|
||||
$menuitem->title = JText::_($this->context . '_MENUITEM_TITLE');
|
||||
$menuitem->description = JText::_($this->context . '_MENUITEM_DESC');
|
||||
$menuitem->image = JUri::root(true) . '/plugins/pagebuilderck/image/assets/images/image.svg';
|
||||
|
||||
return $menuitem;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the interface
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemContentImage() {
|
||||
$input = JFactory::getApplication()->input;
|
||||
$id = $input->get('ckid', '', 'string');
|
||||
// ckstyle and inner classes are needed to get the styles from the interface
|
||||
?>
|
||||
<div id="<?php echo $id; ?>" class="cktype" data-type="image" onshow="ckAddDndForImageUpload(jQuery('#<?php echo $id; ?>')[0]);">
|
||||
<div class="tab_image ckprops" imagewidth="100%" imageheight="auto" fieldslist="imagewidth,imageheight"></div>
|
||||
<div class="ckstyle">
|
||||
</div>
|
||||
<div class="imageck">
|
||||
<img width="100%" height="auto" src="<?php echo JUri::root(true); ?>/plugins/pagebuilderck/image/assets/images/image_example.svg" data-src="/plugins/pagebuilderck/image/assets/images/image_example.svg" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the interface for the item edition
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckLoadItemOptionsImage() {
|
||||
// load the language files of the plugin
|
||||
$this->loadLanguage();
|
||||
// load the interface for the options
|
||||
$tpl = JPATH_SITE . '/plugins/pagebuilderck/image/layouts/edit_image.php';
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the html code for the item to be used into the frontend page
|
||||
* @param string the item object from simple_html_dom
|
||||
*
|
||||
* Return String the html code
|
||||
*/
|
||||
public function onPagebuilderckRenderItemImage($item) {
|
||||
return $item->innertext;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="3" type="plugin" group="pagebuilderck" method="upgrade">
|
||||
<name>plg_pagebuilderck_image_xml_name</name>
|
||||
<creationDate>December 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>https://www.joomlack.fr</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>Image item for Page Builder CK</description>
|
||||
<files>
|
||||
<filename plugin="image">image.php</filename>
|
||||
<folder>language</folder>
|
||||
<folder>layouts</folder>
|
||||
<folder>assets</folder>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_image.sys.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_pagebuilderck_image.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_image.sys.ini</language>
|
||||
<language tag="fr-FR">fr-FR/fr-FR.plg_pagebuilderck_image.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
@@ -0,0 +1,10 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_IMAGE_XML_NAME="Page Builder CK - Image"
|
||||
PLG_PAGEBUILDERCK_IMAGE_MENUITEM_TITLE="Image"
|
||||
PLG_PAGEBUILDERCK_IMAGE_MENUITEM_DESC="Single Image"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_IMAGE_XML_NAME="Page Builder CK - Image"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,9 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_IMAGE_XML_NAME="Page Builder CK - Image"
|
||||
PLG_PAGEBUILDERCK_IMAGE_MENUITEM_TITLE="Image"
|
||||
PLG_PAGEBUILDERCK_IMAGE_MENUITEM_DESC="Image"
|
||||
@@ -0,0 +1,7 @@
|
||||
; @copyright Copyright (C) 2010 Cédric KEIFLIN alias ced1870
|
||||
; https://www.joomlack.fr
|
||||
; @license GNU/GPL
|
||||
; Double quotes in the values have to be formatted as "_QQ_"
|
||||
|
||||
|
||||
PLG_PAGEBUILDERCK_IMAGE_XML_NAME="Page Builder CK - Image"
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,361 @@
|
||||
<?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;
|
||||
?>
|
||||
<div class="menustylescustom" data-prefix="image" data-rule=".imageck img"></div>
|
||||
<div id="elementscontainer">
|
||||
<div class="menulink" tab="tab_image"><?php echo JText::_('CK_EDITION'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_image">
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_IMAGE') ?></div>
|
||||
<div class="ckoption">
|
||||
<input class="inputboxfake" type="text" value="" name="<?php echo $id; ?>imageurl" id="<?php echo $id; ?>imageurl" style="width:295px;margin:2px;" onchange="ckUpdateImagepreview()" />
|
||||
<a class="ckbuttonstyle" href="javascript:void(0)" onclick="ckCallLinkManagerPopup('<?php echo $id; ?>imageurl', 'image')"" ><?php echo JText::_('CK_SELECT'); ?></a>
|
||||
<a class="ckbuttonstyle" href="javascript:void(0)" onclick="$ck('#<?php echo $id; ?>imageurl').val('').trigger('change');"><?php echo JText::_('CK_CLEAR'); ?></a>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>width.png" width="15" height="15" />
|
||||
<?php echo JText::_('CK_WIDTH'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox" type="text" name="imagewidth" id="imagewidth" value="" style="" onchange="ckUpdateImagepreview()" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>height.png" width="15" height="15" />
|
||||
<?php echo JText::_('CK_HEIGHT'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox" type="text" name="imageheight" id="imageheight" value="" style="" onchange="ckUpdateImagepreview()" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<?php echo JText::_('CK_ALIGN'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field ckbutton-group">
|
||||
<input id="imagealignementleft" class="inputbox" name="imagealignement" value="left" type="radio" onclick="ckSetActiveAlignmentButton()">
|
||||
<label class="ckbutton" for="imagealignementleft">
|
||||
<img src="<?php echo $this->imagespath; ?>text_align_left.png" width="16" height="16" />
|
||||
</label>
|
||||
<input id="imagealignementcenter" class="inputbox" name="imagealignement" value="center" type="radio" onclick="ckSetActiveAlignmentButton()">
|
||||
<label class="ckbutton" for="imagealignementcenter">
|
||||
<img src="<?php echo $this->imagespath; ?>text_align_center.png" width="16" height="16" />
|
||||
</label>
|
||||
<input id="imagealignementright" class="inputbox" name="imagealignement" value="right" type="radio" onclick="ckSetActiveAlignmentButton()">
|
||||
<label class="ckbutton" for="imagealignementright">
|
||||
<img src="<?php echo $this->imagespath; ?>text_align_right.png" width="16" height="16" />
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_CSS_CLASS'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox" type="text" name="imagecssclass" id="imagecssclass" value="" style="" onchange="ckUpdateImageAttribute('class', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_ALT_TAG'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox" type="text" name="imagealt" id="imagealt" value="" style="" onchange="ckUpdateImageAttribute('alt', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_TITLE'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox" type="text" name="imagetitle" id="imagetitle" value="" onchange="ckUpdateImageAttribute('title', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<?php echo JText::_('CK_IMAGE_EFFECT'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<?php
|
||||
if (! JPluginHelper::isEnabled('system', 'imageeffectck') || ! JPluginHelper::isEnabled('editors-xtd', 'imageeffectckbutton')) { ?>
|
||||
<div class="alert alert-warning">
|
||||
<?php if (! JPluginHelper::isEnabled('system', 'imageeffectck')) { ?><b><?php echo JText::_('CK_IMAGEEFFECTCK_NOT_INSTALLED') ?></b>
|
||||
<br /><a href="https://www.joomlack.fr/en/joomla-extensions/image-effect-ck" target="_blank"><?php echo JText::_('CK_DOWNLOAD') ?> : Image Effect CK</a>
|
||||
<div class="clr"></div>
|
||||
<?php } ?>
|
||||
<?php if (! JPluginHelper::isEnabled('editors-xtd', 'imageeffectckbutton')) { ?><b><?php echo JText::_('CK_IMAGEEFFECTCK_BUTTON_NOT_INSTALLED') ?></b>
|
||||
<br /><a href="https://www.joomlack.fr/en/joomla-extensions/image-effect-ck" target="_blank"><?php echo JText::_('CK_DOWNLOAD') ?> : Image Effect CK Pro</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<script src="<?php echo JUri::root(true) ?>/plugins/editors-xtd/imageeffectckbutton/assets/imageeffectckbutton.js"></script>
|
||||
<a class="ckbuttonstyle" href="javascript:void(0)" onclick="CKApi.Imageeffect.showInterface('ckValidateImageEffect()');"><?php echo JText::_('CK_SELECT'); ?></a>
|
||||
<?php } ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckclr"></div>
|
||||
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_LINK') ?></div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>link.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_LINK_URL'); ?></span>
|
||||
<span class="ckoption-field ckoption-field-with-button">
|
||||
<input class="inputbox link_attrib" type="text" name="linkurl" id="linkurl" value="" onchange="ckUpdateLinkAttribute('href', this.value)" />
|
||||
<span class="ckbuttonstyle" onclick="ckCallLinkManagerPopup('linkurl', 'all')">+</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_REL_TAG'); ?></span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox link_attrib" type="text" name="linkrel" id="linkrel" value="" onchange="ckUpdateLinkAttribute('rel', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>text_signature.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_CSS_CLASS'); ?></span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox link_attrib" type="text" name="linkcss" id="linkcss" value="" onchange="ckUpdateLinkAttribute('class', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>hand-point-090.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_ONCLICK'); ?>
|
||||
</span>
|
||||
<span class="ckoption-field">
|
||||
<input id="linkonlick" name="linkonlick" class="inputbox" value="" type="text" onchange="ckUpdateLinkAttribute('onclick', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>link_add.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_TARGET'); ?></span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox link_attrib" type="text" name="linktarget" id="linktarget" value="" onchange="ckUpdateLinkAttribute('target', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>link_add.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_TITLE'); ?></span>
|
||||
<span class="ckoption-field">
|
||||
<input class="inputbox link_attrib" type="text" name="linktitle" id="linktitle" value="" onchange="ckUpdateLinkAttribute('title', this.value)" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="menupanetitle"><?php echo JText::_('CK_LIGHTBOX') ?></div>
|
||||
<?php
|
||||
if (! JPluginHelper::isEnabled('system', 'mediabox_ck')) { ?>
|
||||
<div class="alert alert-danger"><b><?php echo JText::_('CK_MEDIABOXCK_NOT_INSTALLED') ?></b><br /><a href="https://www.joomlack.fr/en/joomla-extensions/mediabox-ck" target="_blank"><?php echo JText::_('CK_DOWNLOAD') ?> : Mediabox CK</a></div>
|
||||
<?php }
|
||||
?>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>magnifier.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_USE_LIGHTBOX'); ?></span>
|
||||
<span class="ckoption-field">
|
||||
<select class="inputbox" type="list" value="" name="uselightbox" id="uselightbox" onchange="ckToggleLightboxState(this.value)">
|
||||
<option value="0"><?php echo JText::_('JNO'); ?></option>
|
||||
<option value="1"><?php echo JText::_('JYES'); ?></option>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
<div class="ckoption">
|
||||
<span class="ckoption-label">
|
||||
<img class="ckoption-icon" src="<?php echo $this->imagespath; ?>photo_album.png" width="16" height="16" />
|
||||
<?php echo JText::_('CK_LIGHTBOX_ALBUM'); ?></span>
|
||||
<span class="ckoption-field">
|
||||
<select class="inputbox" type="list" value="" name="lightboxalbum" id="lightboxalbum" onchange="ckToggleLightboxAlbum(this.value)">
|
||||
<option value="0"><?php echo JText::_('JNO'); ?></option>
|
||||
<option value="1"><?php echo JText::_('JYES'); ?></option>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="menulink" tab="tab_blocstyles"><?php echo JText::_('CK_STYLES'); ?></div>
|
||||
<div class="tab menustyles ckproperty" id="tab_blocstyles">
|
||||
<?php echo $this->menustyles->createImageStyles('image', 'image', '') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function ckLoadEditionPopup() {
|
||||
var focus = $ck('.editfocus');
|
||||
var focus_img = $ck('.editfocus img');
|
||||
$ck('#<?php echo $id; ?>imageurl').val(focus_img.attr('data-src'));
|
||||
ckFillEditionPopup(focus.attr('id'));
|
||||
ckUpdateLinkAttribute('href', $ck('#linkurl').val());
|
||||
ckUpdateLinkAttribute('rel', $ck('#linkrel').val());
|
||||
ckUpdateLinkAttribute('class', $ck('#linkcss').val());
|
||||
ckUpdateLinkAttribute('target', $ck('#linktarget').val());
|
||||
}
|
||||
|
||||
function ckBeforeSaveEditionPopup() {
|
||||
var focus = $ck('.editfocus');
|
||||
// var focus_img = $ck('.editfocus img');
|
||||
// var image = $ck('#<?php echo $id; ?>_preview_image img');
|
||||
ckUpdateImagepreview();
|
||||
// ckSaveEditionPopup(focus.attr('id'));
|
||||
// ckCloseEditionPopup();
|
||||
}
|
||||
|
||||
function ckUpdateImagepreview() {
|
||||
var focus_img = $ck('.editfocus img');
|
||||
var img_src = $ck('#<?php echo $id; ?>imageurl').val();
|
||||
// $ck('#<?php echo $id; ?>_preview_image img').attr('src', '<?php echo JUri::root(true); ?>/'+img_src)
|
||||
focus_img.attr('src', getImgPathFromImgSrc(img_src, true))
|
||||
.attr('width', $ck('#imagewidth').val())
|
||||
.attr('height', $ck('#imageheight').val())
|
||||
.attr('data-src', img_src);
|
||||
ckUpdateImageAttribute('class', $ck('#imagecssclass').val());
|
||||
ckUpdateImageAttribute('alt', $ck('#imagealt').val());
|
||||
ckUpdateImageAttribute('title', $ck('#imagetitle').val());
|
||||
ckAddDataOnImage($ck('.editfocus .imageck'));
|
||||
}
|
||||
|
||||
// set active class for radio buttons
|
||||
function ckSetActiveAlignmentButton() {
|
||||
$ck('#elementscontainer .inputbox[name="imagealignement"]').each(function() {
|
||||
if ($ck(this).prop('checked')) {
|
||||
$ck(this).next('label').addClass('active');
|
||||
} else {
|
||||
$ck(this).next('label').removeClass('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ckUpdateImageAttribute(attribute, value) {
|
||||
var focus_img = $ck('.editfocus img');
|
||||
if (value) {
|
||||
focus_img.attr(attribute, value);
|
||||
} else {
|
||||
focus_img.removeAttr(attribute);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ckUpdateLinkAttribute(attribute, value) {
|
||||
var focus_img = $ck('.editfocus img');
|
||||
if (focus_img.parent()[0].tagName.toLowerCase() == 'a') {
|
||||
var imagelink = focus_img.parent();
|
||||
if (value) {
|
||||
imagelink.attr(attribute, value);
|
||||
} else {
|
||||
if (attribute == 'href') {
|
||||
$ck('.editfocus .imageck ').append(focus_img);
|
||||
$ck('.editfocus .imageck > a').remove();
|
||||
} else {
|
||||
imagelink.removeAttr(attribute);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (value)
|
||||
focus_img.wrap('<a href="' + (attribute == 'href' ? value : '') + '"></a>');
|
||||
// if (attribute != 'href') {
|
||||
// alert('Warning : you must have an url to create a link');
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
function ckToggleLightboxState(value) {
|
||||
// TODO : checker champ à changer avec $mediaboxParams->get
|
||||
if (value == 1) {
|
||||
// if link is empty, auto target the image
|
||||
if ($ck('#linkurl').val() == '') {
|
||||
$ck('#linkurl').val(getImgPathFromImgSrc($ck('#<?php echo $id; ?>imageurl').val(), true)).trigger('change');
|
||||
}
|
||||
if ($ck('#elementscontainer #linkrel').val().indexOf('lightbox') == -1) {
|
||||
var relvalue = $ck('#elementscontainer #linkrel').val() + ' lightbox';
|
||||
$ck('#elementscontainer #linkrel').val(relvalue.trim());
|
||||
}
|
||||
if ($ck('#lightboxalbum').val() == '1') {
|
||||
ckToggleLightboxAlbum(1);
|
||||
}
|
||||
} else {
|
||||
var relvalue = $ck('#elementscontainer #linkrel').val().replace('lightbox', '').trim();
|
||||
$ck('#elementscontainer #linkrel').val(relvalue);
|
||||
$ck('#lightboxalbum').val('0');
|
||||
}
|
||||
ckUpdateLinkAttribute('rel', $ck('#linkrel').val());
|
||||
}
|
||||
|
||||
function ckToggleLightboxAlbum(value) {
|
||||
if ($ck('#uselightbox').val() != 1) {
|
||||
alert('Warning : you can not enable the album feature, the Lightbox option must be enabled');
|
||||
$ck('#lightboxalbum').val('0');
|
||||
return;
|
||||
}
|
||||
var pageid = $ck('input[name="id"]').val();
|
||||
if (value == 1) {
|
||||
if ($ck('#elementscontainer #linkrel').val().indexOf('lightbox[') != -1) { // check if lightbox already exists without album
|
||||
var re = /lightbox(\[.*?\])/g;
|
||||
var relvalue = $ck('#elementscontainer #linkrel').val();
|
||||
$ck('#elementscontainer #linkrel').val(relvalue.replace(re, 'lightbox[pagebuilderck' + pageid + ']'));
|
||||
} else {
|
||||
var relvalue = $ck('#elementscontainer #linkrel').val().replace('lightbox', '') + ' lightbox[pagebuilderck' + pageid + ']';
|
||||
$ck('#elementscontainer #linkrel').val(relvalue.trim());
|
||||
}
|
||||
} else {
|
||||
var re = /lightbox(\[.*?\])/g;
|
||||
var relvalue = $ck('#elementscontainer #linkrel').val().replace(re, 'lightbox').trim();
|
||||
$ck('#elementscontainer #linkrel').val(relvalue);
|
||||
}
|
||||
ckUpdateLinkAttribute('rel', $ck('#linkrel').val());
|
||||
}
|
||||
|
||||
function ckValidateImageEffect() {
|
||||
var title = $ck('#imageeffectckbuttonimgdesc').val() ? $ck('#imageeffectckbuttonimgtitle').val() + '::' + $ck('#imageeffectckbuttonimgdesc').val() : $ck('#imageeffectckbuttonimgtitle').val();
|
||||
var imgCustomClasses = $ck('#imageeffectckbuttonimgclass').val() != '' ? ' ' + $ck('#imageeffectckbuttonimgclass').val() : '';
|
||||
var cssclass = $ck('#imageeffectckbuttoneffectslist').val() + imgCustomClasses;
|
||||
$ck('#imagetitle').val(title);
|
||||
$ck('#imagecssclass').val(cssclass).trigger('change');
|
||||
}
|
||||
|
||||
/*
|
||||
* Triggered from the Image Effect CK Params plugin, used to fill the data
|
||||
|
||||
* @returns {undefined} */
|
||||
function onImageeffectckmodalLoaded() {
|
||||
var focus_img = $ck('.editfocus img');
|
||||
var imgsrc = focus_img.attr('src');
|
||||
var imgtitletmp = $ck('#imagetitle').val();
|
||||
var imgclass = $ck('#imagecssclass').val();
|
||||
CKApi.Imageeffect.setFieldsValue(imgsrc, imgtitletmp, imgclass);
|
||||
}
|
||||
|
||||
ckSetActiveAlignmentButton();
|
||||
</script>
|
||||
<style type="text/css">
|
||||
#image_preview {
|
||||
padding: 5px;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #ddd;
|
||||
margin: 10px 10px 10px 0;
|
||||
max-width: 600px;
|
||||
/*height: 200px;*/
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#image_preview > img {
|
||||
max-width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;">
|
||||
<g transform="matrix(2.08267,0,0,2.08267,-425.202,2.84748)">
|
||||
<g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)">
|
||||
<rect x="0" y="0" width="44" height="44" style="fill:none;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)">
|
||||
<path d="M14.667,16.5L29.333,16.5" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.72px;"/>
|
||||
</g>
|
||||
<g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)">
|
||||
<path d="M14.667,23.833L25.667,23.833" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.72px;"/>
|
||||
</g>
|
||||
<g transform="matrix(5.58723,0,0,5.58723,204.162,-1.36723)">
|
||||
<path d="M16.5,33L11,33C7.983,33 5.5,30.517 5.5,27.5L5.5,12.833C5.5,9.816 7.983,7.333 11,7.333L33,7.333C36.017,7.333 38.5,9.816 38.5,12.833L38.5,27.5C38.5,30.517 36.017,33 33,33L27.5,33L22,38.5L16.5,33Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1.72px;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |