public function execute($task) { // Load language $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $layout = JRequest::getCmd('layout'); $plugin = JRequest::getCmd('plugin'); if ($layout) { switch ($layout) { case 'editor': if ($task == 'pack' || $task == 'loadlanguages') { wfimport('admin.models.editor'); $model = new WFModelEditor(); if ($task == 'loadlanguages') { $model->loadLanguages(); } else { $model->pack(); } } break; case 'plugin': $file = basename(JRequest::getCmd('file', $plugin)); $path = WF_EDITOR_PLUGINS . '/' . $plugin; if (is_dir($path) && file_exists($path . '/' . $file . '.php')) { include_once $path . '/' . $file . '.php'; } else { throw new InvalidArgumentException('File ' . $file . ' not found!'); } break; } exit; } else { throw new InvalidArgumentException('No Layout'); } }