本文整理汇总了PHP中jckimport函数的典型用法代码示例。如果您正苦于以下问题:PHP jckimport函数的具体用法?PHP jckimport怎么用?PHP jckimport使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了jckimport函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCKEDITORHeaderStyles
function addCKEDITORHeaderStyles()
{
jckimport('ckeditor.stylesheet.writer.inlinestyles');
$writer = new JCKInlineStyles();
$writer->addStyleDeclaration("table.admintable", "width: 100%;");
$writer->addToHead();
}
示例2: check
static function check()
{
$mainframe = JFactory::getApplication();
jckimport('ckeditor.plugins.helper');
//import core plugins first
JCKPluginsHelper::storePlugins('authenticate');
JCKPluginsHelper::importPlugin('authenticate');
return $mainframe->triggerEvent('authorise');
}
示例3: getSession
static function getSession()
{
static $instance;
if ($instance) {
return $instance;
}
jckimport('ckeditor.session.session');
$instance = JCKSession::getSessionInstance();
return $instance;
}
示例4: check
static function check()
{
jckimport('ckeditor.plugins.helper');
//import core plugins first
JCKPluginsHelper::storePlugins('authenticate');
JCKPluginsHelper::importPlugin('authenticate');
$dispatcher = JDispatcher::getInstance();
$results = $dispatcher->trigger('authorise');
for ($i = 0; $i < count($results); $i++) {
if ($results[$i]) {
return true;
}
}
return false;
}
示例5: import
public function import()
{
// Check for request forgeries
JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('import');
if ($model->import()) {
$cache = JFactory::getCache('mod_menu');
$cache->clean();
}
//now updated editor
jckimport('event.observable.editor');
$obs = new JCKEditorObservable('cpanel');
$handle = $obs->getEventHandler();
$handle->onSync();
$this->display();
}
示例6: beforeSetFilePath
function beforeSetFilePath(&$params)
{
$plugin = JPluginHelper::getPlugin('content', 'jw_allvideos');
if (!isset($plugin->params)) {
return;
}
$avParams = new JParameter($plugin->params);
$avBasePath = $avParams->get('afolder', 'images/stories/audio');
jckimport('ckeditor.user.user');
$user =& JCKUser::getInstance();
$mediatype = $user->mediatype;
if ($mediatype == 'video') {
$avBasePath = $avParams->get('vfolder', 'images/stories/video');
}
//now set filepath
$params->set('filePath', $avBasePath);
}
示例7: JCKRegisterAllEventlisetners
function JCKRegisterAllEventlisetners()
{
$files = JFolder::files(JPATH_COMPONENT . DS . 'event');
foreach ($files as $file) {
jckimport('event.' . str_replace('.php', '', $file));
}
}
示例8: onDisplay
/**
* ckeditor Lite WYSIWYG Editor - display the editor
*
* @param string The name of the editor area
* @param string The content of the field
* @param string The name of the form field
* @param string The width of the editor area
* @param string The height of the editor area
* @param int The number of columns for the editor area
* @param int The number of rows for the editor area
* @param mixed Can be boolean or array.
*/
function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true)
{
// Load modal popup behavior
JHTML::_('behavior.modal', 'a.modal-button');
// initialise $error varable
$errors = '';
/* Generate the Output */
$this->params->set('editorname', $name);
$javascript =& JCKJavascriptHelper::getHeadJavascript($this->params, $errors, $return_script);
$javascript->addToHead();
if (!$return_script) {
return;
}
//Here we will use JFCKJavascript output to screen //html element as well
jckimport('ckeditor.htmlwriter.helper');
return $errors . JCKHtmlwriterHelper::EditorTextArea($name, $content, $buttons);
}
示例9: Copyright
<?php
/*------------------------------------------------------------------------
# Copyright (C) 2005-2012 WebxSolution Ltd. All Rights Reserved.
# @license - GPLv2.0
# Author: WebxSolution Ltd
# Websites: http://www.webxsolution.com
# Terms of Use: An extension that is derived from the JoomlaCK editor will only be allowed under the following conditions: http://joomlackeditor.com/terms-of-use
# ------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die;
jckimport('event.observable.editor');
class JCKController extends JControllerLegacy
{
/**
* Custom Constructor
*/
private $editor_obervable;
protected $event_args;
public function __construct($default = array())
{
parent::__construct($default);
$app = JFactory::getApplication();
$this->_event_args = null;
$name = $app->input->get('controller', '');
if (!$name) {
$name = $app->input->get('view', $this->getName());
}
$eventListenerFile = JPATH_COMPONENT . DS . 'event' . DS . $name . '.php';
jimport('joomla.filesystem.file');
if (JFile::exists($eventListenerFile)) {
示例10: jimport
<?php
include '../../../includes.php';
jimport('joomla.filesystem.file');
//Needed for 1.6
define('JDEBUG', false);
if (!jckimport('ckeditor.authenticate')) {
die(false);
}
abstract class JTreeLinkHelper
{
public static function ListExtensions(&$extensions)
{
$root = JURI::root() . '../../';
$base = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'plugins';
$db = JFactory::getDBO();
$query = ' SELECT ext.name FROM #__jckplugins ext
INNER JOIN #__jckplugins parent on parent.id = ext.parentid
WHERE parent.name = "jtreelink"
AND parent.published = 1
AND ext.published = 1';
$db->setQuery($query);
$results = $db->loadResultArray();
if (empty($results)) {
return;
}
foreach ($results as $extension) {
$path = $base . DS . $extension . DS . 'images' . DS . 'icon.gif';
$url = $root . $extension . '/images/icon.gif';
$icon = array('_open', '_closed');
//We default to default icon if no custom icon has been supplied by plugin.
示例11: getHeadJavascript
static function getHeadJavascript(&$params, &$errors, &$excludeEventHandlers)
{
global $option;
//lets get JS object
$javascript =& JCKJavascript::getInstance();
//now Add intialisation scripts
$mainframe = JFactory::getApplication();
$path_root = '../';
if ($mainframe->isSite()) {
$path_root = '';
}
jimport('joomla.environment.browser');
$instance = JBrowser::getInstance();
$language = JFactory::getLanguage();
if ($language->isRTL()) {
$direction = 'rtl';
} else {
$direction = 'ltr';
}
/* Load the CK's Parameters */
$toolbar = $params->def('toolbar', 'Full');
$toolbar_ft = $params->def('toolbar_ft', 'Full');
$skin = $params->def('skin', 'office2007');
$hheight = $params->def('hheight', 480);
$wwidth = $params->def('wwidth', '100%');
$lang_mode = $params->def('lang_mode', 0);
$lang = $params->def('lang_code', 'en');
$entermode = $params->def('entermode', 1);
$shiftentermode = $params->def('shiftentermode', 0);
$uicolor = $params->def('uicolor', '#D6E6F4');
$imagepath = $params->def('magePath', 'images/stories');
$returnScript = $params->get('returnScript', true);
$editorname = $params->get('editorname');
$bgcolor = $params->get('bgcolor', '#ffffff');
$textalign = $params->get('textalign', 0);
$entities = $params->get('entities', 0);
$formatsource = $params->get('formatsource', 1);
//override autoLoad value if set in config
jckimport('ckeditor.autoload.startconfig');
$startConfig = new JCKStartConfig();
if (isset($startConfig->{$option})) {
$excludeEventHandlers = $startConfig->{$option};
} else {
$excludeEventHandlers = $returnScript;
}
//set default view for toolabar
$toolbar = $toolbar == 'Default' ? 'Full' : $toolbar;
$toolbar_ft = $toolbar_ft == 'Default' ? 'Full' : $toolbar_ft;
if (!$path_root) {
//set toolbar to compact mode
$toolbar = $toolbar_ft;
}
// If language mode set
// set default Joomla language setting
switch ($lang_mode) {
case 0:
$AutoDetectLanguage = $lang;
// User selection
break;
case 1:
$AutoDetectLanguage = "";
// Joomla Default
$lang = substr($language->getTag(), 0, strpos($language->getTag(), '-'));
//access joomlas global configuation and get the language setting from there
break;
case 2:
$AutoDetectLanguage = "";
// Browser default
$lang = "";
break;
}
$stylesheet =& JCKStylesheet::getInstance($path_root);
$content_css = $stylesheet->getPath($params, $errors);
$stylesheetJSO = $stylesheet->getJSObject();
/*
$jsloadJSO = 'var ckstyles_template;
window.addDomReadyEvent.add(function()
{
CKEDITOR.on("instanceReady",function(evt)
{
ckstyles_template = '.$stylesheetJSO .';
});
});';
$javascript->addScriptDeclaration($jsloadJSO);
*/
//Get toolbar plugins object
jckimport('ckeditor.plugins');
jckimport('ckeditor.plugins.toolbarplugins');
$plugins = new JCKtoolbarPlugins();
if ($textalign) {
$textalign = "text-align:{$textalign};";
} else {
$textalign = "";
}
if (!$formatsource) {
$formatsource = "\r\n\t\t\t\tvar format = [];\r\n\t\t\t\tformat['indent'] = false;\r\n\t\t\t\tformat['breakBeforeOpen'] = false; \r\n\t\t\t\tformat['breakAfterOpen'] = false;\r\n\t\t\t\tformat['breakBeforeClose'] = false;\r\n\t\t\t\tformat['breakAfterClose'] = false;\r\n\t\t\t\tvar dtd = CKEDITOR.dtd;\r\n\t\t\t\tfor ( var e in CKEDITOR.tools.extend( {}, dtd.\$nonBodyContent, dtd.\$block, dtd.\$listItem, dtd.\$tableContent ) ) {\r\n\t\t\t\t\t\teditor.dataProcessor.writer.setRules( e, format); \r\n\t\t\t\t} \r\n\t\t\r\n\t\t\t\teditor.dataProcessor.writer.setRules( 'pre',\r\n\t\t\t\t{\r\n\t\t\t\t\tindent: false\r\n\t\t\t\t}); \r\n\t\t\t";
} else {
$formatsource = '';
}
//.........这里部分代码省略.........
示例12: onDisplay
/**
* ckeditor Lite WYSIWYG Editor - display the editor
*
* @param string The name of the editor area
* @param string The content of the field
* @param string The name of the form field
* @param string The width of the editor area
* @param string The height of the editor area
* @param int The number of columns for the editor area
* @param int The number of rows for the editor area
* @param mixed Can be boolean or array.
*/
function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null)
{
// Load modal popup behavior
JHTML::_('behavior.modal', 'a.modal-button');
// initialise $error varable
$errors = '';
static $loaded;
if (empty($id)) {
$id = $name;
}
if (!$width) {
$width = "100%";
}
if (!$height) {
$height = "350px";
}
$skin = $this->params->get('skin');
if ($skin == 'kama' && $width == '100%') {
$width = '99%';
}
$arributes = array("rows" => $row, 'cols' => $col, "style" => "width:{$width};height:{$height}");
if (!$loaded) {
/* Generate the Output */
$this->params->set('editorname', $id);
if (!$this->params->get('hheight', '')) {
$this->params->set('hheight', $height);
}
if (!$this->params->get('wwidth', '')) {
$this->params->set('wwidth', $width);
}
$javascript = JCKJavascriptHelper::getHeadJavascript($this->params, $errors, $return_script);
$javascript->addToHead();
$loaded = JCKOutput::fixId($id);
if (!$return_script) {
return;
}
//Here we will use JFCKJavascript output to screen //html element as well
jckimport('ckeditor.htmlwriter.helper');
return $errors . JCKHtmlwriterHelper::EditorTextArea($id, $name, $content, $buttons, $this, $arributes, $asset, $author);
}
//end if
return JCKHtmlwriter::TextArea($id, $name, $content, $arributes) . '<script>window.addDomReadyEvent.add( function(){
CKEDITOR.on("instanceReady",function(evt)
{
if(evt.editor.name == "' . $loaded . '")
{
var editor = CKEDITOR.replace( "' . JCKOutput::fixId($id) . '", CKEDITOR.instances["' . $loaded . '"].config );
var xtdbuttons = CKEDITOR.document.getById("editor-xtd-buttons");
if(xtdbuttons)
{
buttonsHtml = xtdbuttons.getOuterHtml().replace(/' . $loaded . '/g,"' . JCKOutput::fixId($id) . '");
var buttonsElement = CKEDITOR.dom.element.createFromHtml(buttonsHtml);
editor.container.getParent().append(buttonsElement);
var elements = buttonsElement.getElementsByTag("a");
for(i= 0; i < elements.count();i++)
{
//override mootools model click event
if(elements.getItem(i).hasClass("modal-button"))
{
(function()
{
var el = $(elements.getItem(i).$);
el.addEvent("click", function(e)
{
new Event(e).stop();
SqueezeBox.fromElement(el, {
parse: "rel"
});
});
})();
}
}
}
}
})
});</script>';
}
示例13: onPublish
function onPublish($cid, $value)
{
if (!$this->canDo->get('core.edit.state')) {
$this->app->redirect(JRoute::_('index.php?option=com_jckman&view=list', false), JText::_('COM_JCKMAN_PLUGIN_PERM_NO_PUB'), 'error');
return false;
}
$db = JFactory::getDBO();
$user = JFactory::getUser();
$cids = implode(',', $cid);
$query = 'SELECT name FROM #__jckplugins' . ' WHERE id IN ( ' . $cids . ' )' . ' AND ( checked_out = 0 OR ( checked_out = ' . (int) $user->get('id') . ' ))';
$db->setQuery($query);
$pluginnames = $db->loadColumn();
if (!$pluginnames) {
JCKHelper::error($db->getErrorMsg());
}
jckimport('helper');
$config = JCKHelper::getEditorPluginConfig();
foreach ($pluginnames as $pname) {
$config->set($pname, $value);
}
$cfgFile = CKEDITOR_LIBRARY . DS . 'plugins' . DS . 'toolbarplugins.php';
// Get the toolbar registry in PHP class format and write it to file
$buffer = $config->toString('PHP', array('class' => 'JCKToolbarPlugins extends JCKPlugins'));
if (!JFile::write($cfgFile, $buffer)) {
$modify = $value ? 'publish ' : 'unpublish ';
JCKHelper::error(JText::sprintf('COM_JCK_PLUGIN_LIST_FAILED_TO_PUBLISH_UNPUBLISH_PLUGINS', $modify));
}
}
示例14: check
function check()
{
jckimport('ckeditor.user.user');
$user =& JCKUser::getInstance();
return $user->gid > 0;
}
示例15: beforeLoad
function beforeLoad(&$params)
{
//lets create JS object
$javascript = new JCKJavascript();
if ($this->_overwrite) {
$javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\r\n\t\t\t\t{\r\n\t\t\t\t\teditor.config.plugins = 'html5support,' + editor.config.plugins\r\n\t\t\t\t\tif(editor.config.extraPlugins)\r\n\t\t\t\t\t\teditor.config.extraPlugins += ',video,audio,uicolor,imagedragndrop,ie9selectionoverride';\r\n\t\t\t\t\telse \t\r\n\t\t\t\t\t\teditor.config.extraPlugins += 'video,audio,uicolor,imagedragndrop,ie9selectionoverride';\r\n\t\t\t\t\r\n\t\t\t\t\tif(editor.config.toolbar == 'Full')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar toolbar = editor.config.toolbar_Full[editor.config.toolbar_Full.length-1];\r\n\t\t\t\t\t\tvar extra = ['Video','Audio','UIColor'];\r\n\t\t\t\t\t\teditor.config.toolbar_Full[editor.config.toolbar_Full.length-1] = toolbar.concat(extra);\r\n\t\t\t\t\t}\t\r\n\t\t\t\t});");
}
$config = JFactory::getConfig();
$dbname = $config->get('db');
$db = JFactory::getDBO();
$query = "SELECT COUNT(1)\r\n\t\tFROM information_schema.tables \r\n\t\tWHERE table_schema = '" . $dbname . "' \r\n\t\tAND table_name = '" . $db->getPrefix() . "jcktoolbarplugins'";
$db->setQuery($query);
if (!$db->loadResult()) {
return $javascript->toRaw();
}
$query = "SELECT COUNT(p.id) AS pcount,COUNT(tp.pluginid) AS tpcount FROM #__jckplugins p\r\n\t\tLEFT JOIN #__jcktoolbarplugins tp on tp.pluginid = p.id\r\n\t\tWHERE `name` IN('html5support','video','audio','uicolor') ";
$db->setQuery($query);
$info = $db->loadObject();
if ($info && $info->tpcount) {
return;
}
if (!$info->pcount) {
$query = "INSERT INTO #__jckplugins (`title`,`name`,`type`,`row`,`published`,`editable`,`icon`,`iscore`,`params`, `parentid`) VALUES \r\n\t\t\t('','html5support','plugin',0,1,1,'',1,'',NULL)";
$db->setQuery($query);
if (!$db->query()) {
return $javascript->toRaw();
}
$parentid = $db->insertid();
$query = "INSERT INTO #__jckplugins (`title`,`name`,`type`,`row`,`published`,`editable`,`icon`,`iscore`,`params`, `parentid`) VALUES \r\n ('Video','video','plugin',3,1,1,'images/icon.png',1,''," . $parentid . "),\t\r\n ('Audio','audio','plugin',3,1,1,'images/icon.png',1,''," . $parentid . "),\t\r\n ('UIColor','uicolor','plugin',3,1,1,'uicolor.gif',1,'',NULL),\t\r\n ('','imagedragndrop','plugin',0,1,1,'',1,'',NULL),\r\n\t\t\t('','ie9selectionoverride','plugin',0,1,1,'',1,'',NULL)";
$db->setQuery($query);
if (!$db->query()) {
return $javascript->toRaw();
}
$first = $db->insertid();
$last = $first + 2;
//get next layout row details
$query = "SELECT row as rowid,MAX(`ordering`) +1 AS rowordering FROM #__jcktoolbarplugins WHERE toolbarid = 1 \r\n GROUP BY row\r\n ORDER BY row DESC LIMIT 1";
$db->setQuery($query);
$rowDetail = $db->loadObject();
$values = array();
for ($i = $first; $i <= $last; $i++) {
$values[] = '(1,' . $i . ',' . $rowDetail->rowid . ',' . $rowDetail->rowordering++ . ',1)';
}
$query = "INSERT INTO #__jcktoolbarplugins(toolbarid,pluginid,row,ordering,state) VALUES " . implode(",", $values);
$db->setQuery($query);
$db->query();
}
if ($this->_overwrite) {
//Get toolbar plugins object
jckimport('ckeditor.plugins');
jckimport('ckeditor.plugins.toolbarplugins');
$plugins = new JCKtoolbarPlugins();
foreach (get_object_vars($plugins) as $key => $value) {
if (strpos('p' . $key, '_')) {
unset($plugins->{$key});
}
}
$plugins->html5support = 1;
$plugins->video = 1;
$plugins->audio = 1;
$plugins->uicolor = 1;
$plugins->imagedragndrop = 1;
$plugins->ie9selectionoverride = 1;
$config = new JRegistry('config');
$config->loadObject($plugins);
$cfgFile = '';
$is1_6plus = file_exists(JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'jckeditor' . DS . 'includes' . DS . 'ckeditor');
if ($is1_6plus) {
$cfgFile = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'jckeditor' . DS . 'includes' . DS . 'ckeditor' . DS . 'plugins' . DS . 'toolbarplugins.php';
} else {
$cfgFile = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'includes' . DS . 'ckeditor' . DS . 'plugins' . DS . 'toolbarplugins.php';
}
// Get the config registry in PHP class format and write it to file
if ($is1_6plus) {
if (!JFile::write($cfgFile, $config->toString('PHP', array('class' => 'JCKToolbarPlugins extends JCKPlugins')))) {
return $javascript->toRaw();
}
//if fail then bail out
} else {
if (!JFile::write($cfgFile, $config->toString('PHP', 'config', array('class' => 'JCKToolbarPlugins extends JCKPlugins')))) {
return $javascript->toRaw();
}
//if fail then bail out
}
jckimport('ckeditor.toolbar');
jckimport('ckeditor.toolbar.full');
$toolbar = new JCKFull();
//fix toolbar values or they will get wiped out
foreach (get_object_vars($toolbar) as $k => $v) {
if (is_null($v)) {
$toolbar->{$k} = '';
}
if ($k[0] == '_') {
$toolbar->{$k} = NULL;
}
}
if (isset($toolbar->Video) || isset($toolbar->Audio) || isset($toolbar->UIColor)) {
return false;
}
$toolbar->Video = '';
//.........这里部分代码省略.........