public function display() { parent::display(); $document = WFDocument::getInstance(); // get all popups extensions $popups = parent::loadExtensions('popups'); $config = $this->getProperties(); if ($config) { // Create global config $document->addScriptDeclaration('WFExtensions.Popups.setConfig(' . json_encode($config) . ');'); } // Create an instance of each popup and check if enabled foreach ($popups as $name) { $popup = $this->getPopupExtension($name); if ($popup->isEnabled()) { $this->addPopup($name); $params = $popup->getParams(); if (!empty($params)) { $document->addScriptDeclaration('WFExtensions.Popups.setParams("' . $name . '",' . json_encode($params) . ');'); } } } $tabs = WFTabs::getInstance(); // Add popup tab and assign popups reference to document if (count($this->getPopups())) { $tabs->addTab('popups', 1); $tabs->getPanel('popups')->assign('popups', $this); } }
/** * Returns a reference to a plugin object * * This method must be invoked as: * <pre> $advlink =AdvLink::getInstance();</pre> * * @access public * @return JCE The editor object. * @since 1.5 */ public static function getInstance($type = 'joomla', $config = array()) { static $instance; if (!is_object($instance)) { $fs = parent::loadExtensions('filesystem', $type); $classname = 'WF' . ucfirst($fs) . 'FileSystem'; if (class_exists($classname)) { $instance = new $classname($config); } else { $instance = new WFFileSystem($config); } } return $instance; }
/** * Returns a reference to a manager object * * This method must be invoked as: * <pre> $manager =MediaManager::getInstance();</pre> * * @access public * @return MediaManager The manager object. * @since 1.5 */ public static function getInstance($name = 'jceplayer') { if (!isset(self::$instance)) { $classname = ''; if ($name && $name != 'none') { $player = parent::loadExtensions('mediaplayer', $name); $classname = 'WFMediaPlayerExtension_' . ucfirst($player); } if ($classname && class_exists($classname)) { self::$instance = new $classname(); } else { self::$instance = new WFMediaPlayerExtension(); } } return self::$instance; }
/** * Returns a reference to a manager object * * This method must be invoked as: * <pre> $manager =MediaManager::getInstance();</pre> * * @access public * @return MediaManager The manager object. * @since 1.5 */ public static function getInstance($name = 'jceplayer') { static $instance; if (!is_object($instance)) { $classname = ''; if ($name && $name != 'none') { $player = parent::loadExtensions(array('types' => array('mediaplayer'), 'extension' => $name)); $classname = 'WFMediaPlayerExtension_' . ucfirst($player); } if ($classname && class_exists($classname)) { $instance = new $classname(); } else { $instance = new WFMediaPlayerExtension(); } } return $instance; }
/** * Load & Call an extension * * @access protected * @param array $config * @return array */ protected function loadExtensions($type, $extension = null, $config = array()) { return WFExtension::loadExtensions($type, $extension, $config); }