本文整理汇总了PHP中WFEditorPlugin类的典型用法代码示例。如果您正苦于以下问题:PHP WFEditorPlugin类的具体用法?PHP WFEditorPlugin怎么用?PHP WFEditorPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WFEditorPlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
function getList()
{
$wf =& WFEditorPlugin::getInstance();
if ($wf->checkAccess('menu', '1')) {
return '<li id="index.php?option=com_menu"><div class="tree-row"><div class="tree-image"></div><span class="folder menu nolink"><a href="javascript:;">' . JText::_('MENU') . '</a></span></div></li>';
}
}
示例2: getRootDir
/**
* Return the full user directory path. Create if required
*
* @param string The base path
* @access public
* @return Full path to folder
*/
function getRootDir()
{
static $root;
if (!isset($root)) {
$root = parent::getRootDir();
$wf = WFEditorPlugin::getInstance();
// Restricted Joomla! folders
$restricted = explode(',', $wf->getParam('editor.filesystem.joomla.restrict_dir', 'administrator,cache,components,includes,language,libraries,logs,media,modules,plugins,templates,xmlrpc'));
$allowroot = $wf->getParam('editor.filesystem.joomla.allow_root', 0);
// Revert to default if empty
if (empty($root) && !$allowroot) {
$root = 'images';
}
// Force default if directory is a joomla directory
$parts = explode('/', $root);
if (in_array(strtolower($parts[0]), $restricted) && !$allowroot) {
$root = 'images';
}
if (!empty($root)) {
// Create the folder
$full = WFUtility::makePath(JPATH_SITE, $root);
if (!JFolder::exists($full)) {
$this->folderCreate($full);
}
// Fallback
$root = JFolder::exists($full) ? $root : 'images';
}
}
return $root;
}
示例3: getList
function getList()
{
$wf = WFEditorPlugin::getInstance();
if ($wf->checkAccess('links.joomlalinks.menu', 1)) {
return '<li id="index.php?option=com_menu"><div class="tree-row"><div class="tree-image"></div><span class="folder menu nolink"><a href="javascript:;">' . WFText::_('WF_LINKS_JOOMLALINKS_MENU') . '</a></span></div></li>';
}
}
示例4: array
public function &getAggregators()
{
static $aggregators;
if (!isset($aggregators)) {
$aggregators = array();
}
// get the aggregator format for this instance
$format = $this->get('format');
if (empty($aggregators[$format])) {
jimport('joomla.filesystem.folder');
// get a plugin instance
$plugin = WFEditorPlugin::getInstance();
$aggregators[$format] = array();
$path = WF_EDITOR_EXTENSIONS . '/aggregator';
$files = JFolder::files($path, '\\.php$', false, true);
foreach ($files as $file) {
require_once $file;
$name = basename($file, '.php');
$classname = 'WFAggregatorExtension_' . ucfirst($name);
// only load if enabled
if (class_exists($classname)) {
$aggregator = new $classname();
// check if enabled
if ($aggregator->isEnabled()) {
if ($aggregator->get('format') == $format) {
$aggregator->set('name', $name);
$aggregator->set('title', 'WF_AGGREGATOR_' . strtoupper($name) . '_TITLE');
$aggregators[$format][] = $aggregator;
}
}
}
}
}
return $aggregators[$format];
}
示例5: isEnabled
public function isEnabled()
{
$wf = WFEditorPlugin::getInstance();
if (JPluginHelper::isEnabled('system', 'widgetkit_system') && $wf->getParam('popups.widgetkit.enable', 1) == 1) {
return true;
}
return false;
}
示例6: isEnabled
function isEnabled()
{
$wf = WFEditorPlugin::getInstance();
if (JPluginHelper::isEnabled('system', 'rokbox') && $wf->getParam('popups.rokbox.enable', 1) == 1) {
return true;
}
return false;
}
示例7: isEnabled
function isEnabled()
{
$plugin = WFEditorPlugin::getInstance();
if ($plugin->getParam('popups.window.enable', 1) && ($plugin->getName() == 'link' || $plugin->getName() == 'imgmanager_ext')) {
return true;
}
return false;
}
示例8: isEnabled
public function isEnabled()
{
$jce = WFEditorPlugin::getInstance();
if (JPluginHelper::isEnabled('system', 'jcemediabox') && $jce->getParam('popups.jcemediabox.enable', 1) == 1) {
return true;
}
return false;
}
示例9: getList
public function getList()
{
//Reference to JConentEditor (JCE) instance
$wf = WFEditorPlugin::getInstance();
if ($wf->checkAccess('links.joomlalinks.contacts', 1)) {
return '<li id="index.php?option=com_contact"><div class="tree-row"><div class="tree-image"></div><span class="folder contact nolink"><a href="javascript:;">' . WFText::_('WF_LINKS_JOOMLALINKS_CONTACTS') . '</a></span></div></li>';
}
}
示例10: getList
public function getList()
{
$advlink = WFEditorPlugin::getInstance();
$list = '';
if ($advlink->checkAccess('flexicontentlinks.items', '1')) {
return '<li id="index.php?option=com_flexicontent_items&view=category&cid=1"><div class="tree-row"><div class="tree-image"></div><span class="folderflexicontent nolink"><a href="javascript:;">' . JText::_('FLEXIcontent') . '</a></span></div></li>';
}
return $list;
}
示例11: getList
public function getList()
{
$advlink = WFEditorPlugin::getInstance();
$list = '';
if ($advlink->checkAccess('JEventslinks.JEvents', '1')) {
$list = '<li id="index.php?option=com_jevents"><div class="tree-row"><div class="tree-image"></div><span class="folder content nolink"><a href="javascript:;">' . JText::_('JEvents Content') . '</a></span></div></li>';
}
return $list;
}
示例12: getRootDir
/**
* Return the full user directory path. Create if required
*
* @param string The base path
* @access public
* @return Full path to folder
*/
function getRootDir()
{
static $root;
if (!isset($root)) {
$user = JFactory::getUser();
$wf = WFEditorPlugin::getInstance();
$profile = $wf->getProfile();
// Get base directory as shared parameter
$root = $this->get('dir', '');
// Remove whitespace
$root = trim($root);
if (!empty($root)) {
// Convert slashes / Strip double slashes
$root = preg_replace('/[\\\\]+/', '/', $root);
// Remove first leading slash
$root = ltrim($root, '/');
// Force default directory if base param starts with a variable or a . eg $id
if (preg_match('/[\\.\\$]/', $root[0])) {
$root = 'images';
}
jimport('joomla.user.helper');
// Joomla! 1.6+
if (method_exists('JUserHelper', 'getUserGroups')) {
$groups = JUserHelper::getUserGroups($user->id);
// get the first group
$group_id = array_shift(array_keys($groups));
// Joomla! 2.5?
if (is_int($group_id)) {
// usergroup table
$group = JTable::getInstance('Usergroup', 'JTable');
$group->load($group_id);
// usertype
$usertype = $group->title;
} else {
$usertype = $group_id;
}
} else {
$usertype = $user->usertype;
}
// Replace any path variables
$pattern = array('/\\$id/', '/\\$username/', '/\\$usertype/', '/\\$(group|profile)/', '/\\$day/', '/\\$month/', '/\\$year/');
$replace = array($user->id, $user->username, $usertype, $profile->name, date('d'), date('m'), date('Y'));
$root = preg_replace($pattern, $replace, $root);
// split into path parts to preserve /
$parts = explode('/', $root);
// clean path parts
$parts = WFUtility::makeSafe($parts, $wf->getParam('editor.websafe_mode', 'utf-8'), $wf->getParam('editor.websafe_allow_spaces', 0));
//join path parts
$root = implode('/', $parts);
}
}
return $root;
}
示例13: display
public function display()
{
parent::display();
$document = WFDocument::getInstance();
$document->addScript(array('colorpicker'), 'plugins');
$document->addStyleSheet(array('colorpicker'), 'plugins');
}
示例14: execute
function execute()
{
$task = JRequest::getWord('task');
if ($task == 'compile') {
return $this->compile();
}
parent::execute();
}
示例15:
/**
* Constructor activating the default information of the class
*
* @access protected
*/
function __construct()
{
parent::__construct();
$request = WFRequest::getInstance();
// Setup plugin XHR callback functions
$request->setRequest(array($this, 'showPreview'));
$this->execute();
}