Esempio n. 1
0
 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>';
     }
 }
Esempio n. 2
0
 public function display()
 {
     parent::display();
     $document = WFDocument::getInstance();
     $document->addScript(array('colorpicker'), 'plugins');
     $document->addStyleSheet(array('colorpicker'), 'plugins');
 }
Esempio n. 3
0
 /**
  * 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;
 }
Esempio n. 4
0
 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>';
     }
 }
Esempio n. 5
0
 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];
 }
Esempio n. 6
0
 public function isEnabled()
 {
     $wf = WFEditorPlugin::getInstance();
     if (JPluginHelper::isEnabled('system', 'widgetkit_system') && $wf->getParam('popups.widgetkit.enable', 1) == 1) {
         return true;
     }
     return false;
 }
Esempio n. 7
0
 function execute()
 {
     $task = JRequest::getWord('task');
     if ($task == 'compile') {
         return $this->compile();
     }
     parent::execute();
 }
Esempio n. 8
0
File: preview.php Progetto: 01J/topm
 /**
  * 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();
 }
Esempio n. 9
0
 function isEnabled()
 {
     $wf = WFEditorPlugin::getInstance();
     if (JPluginHelper::isEnabled('system', 'rokbox') && $wf->getParam('popups.rokbox.enable', 1) == 1) {
         return true;
     }
     return false;
 }
Esempio n. 10
0
 function isEnabled()
 {
     $plugin = WFEditorPlugin::getInstance();
     if ($plugin->getParam('popups.window.enable', 1) && ($plugin->getName() == 'link' || $plugin->getName() == 'imgmanager_ext')) {
         return true;
     }
     return false;
 }
Esempio n. 11
0
 public function isEnabled()
 {
     $jce = WFEditorPlugin::getInstance();
     if (JPluginHelper::isEnabled('system', 'jcemediabox') && $jce->getParam('popups.jcemediabox.enable', 1) == 1) {
         return true;
     }
     return false;
 }
Esempio n. 12
0
 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>';
     }
 }
Esempio n. 13
0
 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;
 }
Esempio n. 14
0
 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;
 }
Esempio n. 15
0
 /**
  * Display the plugin
  */
 public function display()
 {
     parent::display();
     $document = WFDocument::getInstance();
     $document->addScript(array('pagebreak'), 'plugins');
     //$document->addStyleSheet(array('pagebreak'), 'plugins');
     $tabs = WFTabs::getInstance(array('base_path' => WF_EDITOR_PLUGIN));
     // Add tabs
     $tabs->addTab('pagebreak');
 }
Esempio n. 16
0
 function display()
 {
     parent::display();
     $document = WFDocument::getInstance();
     $document->addScript(array('fullpage'), 'plugins');
     $document->addStyleSheet(array('fullpage'), 'plugins');
     $tabs = WFTabs::getInstance(array('base_path' => WF_EDITOR_PLUGIN));
     $tabs->addTab('meta');
     $tabs->addTab('appearance');
 }
Esempio n. 17
0
 /**
  * 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;
 }
Esempio n. 18
0
 public function display()
 {
     parent::display();
     $document = WFDocument::getInstance();
     // get command, eg: mcePaste, mcePasteText
     $cmd = JRequest::getCmd('cmd', 'paste');
     // remove mce prefix
     $cmd = str_replace('mce', '', $cmd);
     // set title
     $document->setTitle(WFText::_('WF_' . strtoupper($cmd) . '_TITLE'));
     $document->addScript(array('clipboard'), 'plugins');
     $document->addStyleSheet(array('clipboard'), 'plugins');
 }
 /**
  * Display the plugin
  */
 public function display()
 {
     parent::display();
     $document = WFDocument::getInstance();
     $document->addScript(array('searchreplace'), 'plugins');
     $document->addStyleSheet(array('searchreplace'), 'plugins');
     $settings = $this->getSettings();
     $document->addScriptDeclaration('SearchReplaceDialog.settings=' . json_encode($settings) . ';');
     $tabs = WFTabs::getInstance(array('base_path' => WF_EDITOR_PLUGIN));
     // Add tabs
     $tabs->addTab('find');
     $tabs->addTab('replace');
 }
Esempio n. 20
0
 /**
  * Display the plugin
  */
 public function display()
 {
     parent::display();
     $document = WFDocument::getInstance();
     $element = $this->getElementName();
     $document->setTitle(WFText::_('WF_' . strtoupper($element) . '_TITLE'));
     $document->addScript(array('xhtmlxtras'), 'plugins');
     $document->addStyleSheet(array('xhtmlxtras'), 'plugins');
     $document->addScriptDeclaration('XHTMLXtrasDialog.settings=' . json_encode($this->getSettings()) . ';');
     $tabs = WFTabs::getInstance(array('base_path' => WF_EDITOR_PLUGIN));
     $tabs->addTab('standard', 1, array('plugin' => $this));
     if ($element == 'attributes') {
         $tabs->addTab('events');
     }
 }
Esempio n. 21
0
 /**
  * Constructor activating the default information of the class
  *
  * @access	protected
  */
 public function __construct()
 {
     parent::__construct();
     $engine = $this->getEngine();
     if (!$engine) {
         self::error('No Spellchecker Engine available');
     }
     $request = WFRequest::getInstance();
     // Setup plugin XHR callback functions
     $request->setRequest(array($engine, 'checkWords'));
     $request->setRequest(array($engine, 'getSuggestions'));
     $request->setRequest(array($engine, 'ignoreWord'));
     $request->setRequest(array($engine, 'ignoreWords'));
     $request->setRequest(array($engine, 'learnWord'));
     $this->execute();
 }
 /**
  * Constructor activating the default information of the class
  *
  * @access	protected
  */
 function __construct()
 {
     parent::__construct();
     $config = $this->getConfig();
     $engine = $this->getEngine();
     if (isset($config['general.remote_rpc_url'])) {
         $this->remoteRPC();
     }
     $request = WFRequest::getInstance();
     // Setup plugin XHR callback functions
     $request->setRequest(array($engine, 'checkWords'));
     $request->setRequest(array($engine, 'getSuggestions'));
     $request->setRequest(array($engine, 'ignoreWord'));
     $request->setRequest(array($engine, 'ignoreWords'));
     $request->setRequest(array($engine, 'learnWord'));
     $this->execute();
 }
Esempio n. 23
0
 public function getLinks($args)
 {
     $wf = WFEditorPlugin::getInstance();
     $items = array();
     switch ($args->view) {
         // Get all WebLink categories
         default:
         case 'categories':
             $categories = WFLinkBrowser::getCategory('com_weblinks');
             foreach ($categories as $category) {
                 $itemid = WFLinkBrowser::getItemId('com_weblinks', array('categories' => null, 'category' => $category->id));
                 $items[] = array('id' => 'index.php?option=com_weblinks&view=category&id=' . $category->id . $itemid, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder weblink');
             }
             break;
             // Get all links in the category
         // Get all links in the category
         case 'category':
             require_once JPATH_SITE . DS . 'includes' . DS . 'application.php';
             require_once JPATH_SITE . DS . 'components' . DS . 'com_weblinks' . DS . 'helpers' . DS . 'route.php';
             if (!WF_JOOMLA15) {
                 $categories = WFLinkBrowser::getCategory('com_weblinks', $args->id);
                 if (count($categories)) {
                     foreach ($categories as $category) {
                         $children = WFLinkBrowser::getCategory('com_weblinks', $category->id);
                         if ($children) {
                             $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id;
                         } else {
                             $itemid = WFLinkBrowser::getItemId('com_weblinks', array('categories' => null, 'category' => $category->slug));
                             $id = 'index.php?option=com_weblinks&view=category&id=' . $category->slug . $itemid;
                         }
                         $items[] = array('id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder weblink');
                     }
                 }
             }
             $weblinks = self::_weblinks($args->id);
             foreach ($weblinks as $weblink) {
                 $items[] = array('id' => WeblinksHelperRoute::getWeblinkRoute($weblink->id, $args->id), 'name' => $weblink->title . ' / ' . $weblink->alias, 'class' => 'file');
             }
             break;
     }
     return $items;
 }
Esempio n. 24
0
 function getLinks($args)
 {
     global $_DOCMAN, $mainframe;
     $wf = WFEditorPlugin::getInstance();
     jimport('joomla.filesystem.file');
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_docman' . DS . 'docman.class.php';
     //DOCMan core interaction API
     $_DOCMAN = new dmMainFrame(_DM_TYPE_DOCLINK);
     // Load classes and language
     require_once $_DOCMAN->getPath('classes', 'utils');
     $cid = isset($args->gid) ? $args->gid : 0;
     //get folders
     $categories = DOCMAN_Cats::getChildsByUserAccess($cid);
     $items = array();
     $view = isset($args->view) ? $args->view : '';
     switch ($view) {
         default:
             foreach ($categories as $category) {
                 $items[] = array('id' => 'index.php?option=com_docman&view=category&gid=' . $category->id . WFLinkBrowser::getItemId('com_docman'), 'name' => $category->name, 'class' => 'folder docmanlinks');
             }
             break;
         case 'category':
             //get items
             if ($cid) {
                 $categories = DOCMAN_Cats::getChildsByUserAccess($cid);
                 $documents = DOCMAN_Docs::getDocsByUserAccess($cid, 'name', 'ASC', 999, 0);
             } else {
                 $categories = array();
                 $documents = array();
             }
             foreach ($categories as $category) {
                 $items[] = array('id' => 'index.php?option=com_docman&view=category&gid=' . $category->id . WFLinkBrowser::getItemId('com_docman'), 'name' => $category->name, 'class' => 'folder docmanlinks');
             }
             foreach ($documents as $document) {
                 $items[] = array('id' => 'index.php?option=com_docman&task=doc_' . $wf->getParam('docmanlinks_link', 'download') . '&gid=' . $document->id . WFLinkBrowser::getItemId('com_docman'), 'name' => $document->dmname, 'class' => 'file docmanlinks ' . JFile::getExt($document->dmfilename));
             }
             break;
     }
     return $items;
 }
Esempio n. 25
0
 /**
  * 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 (!$root) {
         $user = JFactory::getUser();
         $wf = WFEditorPlugin::getInstance();
         $profile = $wf->getProfile();
         // Get base directory as shared parameter
         $root = $this->get('dir', 'images');
         // Remove whitespace
         $root = trim($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);
             $usertype = array_shift(array_keys($groups));
         } else {
             $usertype = $user->usertype;
         }
         // Replace any path variables
         $pattern = array('/\\$id/', '/\\$username/', '/\\$usertype/', '/\\$(group|profile)/', '/\\$day/', '/\\$month/', '/\\$year/');
         $replace = array($user->id, strtolower($user->username), strtolower($usertype), strtolower($profile->name), date('d'), date('m'), date('Y'));
         $root = preg_replace($pattern, $replace, $root);
         // Clean
         $root = preg_replace(array('/$\\w+\\b/', '/(\\.) {2,}/', '/[^A-Za-z0-9:\\.\\_\\-\\/]/'), '', $root);
     }
     return $root;
 }
Esempio n. 26
0
 function getSettings()
 {
     $profile = $this->getProfile();
     $settings = array('file_browser' => $this->getParam('file_browser', 1) && in_array('browser', explode(',', $profile->plugins)), 'attributes' => array('target' => $this->getParam('attributes_target', 1), 'anchor' => $this->getParam('attributes_anchor', 1)));
     return parent::getSettings($settings);
 }
Esempio n. 27
0
 function getParams()
 {
     $plugin = WFEditorPlugin::getInstance();
     return array('width' => $plugin->getParam('aggregator.vimeo.width', 400), 'height' => $plugin->getParam('aggregator.vimeo.height', 225));
 }
 public function getSettings($settings = array())
 {
     return parent::getSettings($settings);
 }
Esempio n. 29
0
 private static function route($url)
 {
     $wf = WFEditorPlugin::getInstance();
     if ($wf->getParam('links.joomlalinks.sef_url', 0)) {
         $url = WFLinkExtension::route($url);
     }
     return $url;
 }
Esempio n. 30
0
 function getParams()
 {
     $plugin = WFEditorPlugin::getInstance();
     return array('extensions' => $plugin->getParam('jceplayer.extensions', 'flv,f4v,mp3,mp4'), 'dimensions' => array('audio' => array('width' => 300, 'height' => 35)), 'path' => $plugin->getParam('jceplayer.path', 'media/jce/mediaplayer/mediaplayer.swf'));
 }