/** * @see sfTask */ protected function execute($arguments = array(), $options = array()) { $themeImport = new w3sThemeImport(); $events = $themeImport->publishAssets($arguments, $options); foreach ($events as $event) { $this->dispatcher->notify(new sfEvent($this, 'application.log', array($event))); } }
public function executeAdd($request) { if ($request->hasParameter('themeName')) { $theme = new w3sThemeImport(); $result = $theme->add($this->getRequestParameter('themeName')); if (!$result) { $this->getResponse()->setStatusCode(404); $message = w3sCommonFunctions::toI18n('An error occoured while addinf the new theme.'); return $this->renderText(w3sCommonFunctions::displayMessage($message, 'error', true)); } else { $options = array('web_dir' => sfConfig::get('sf_web_dir'), 'themes_dir' => sfConfig::get('sf_themes_dir', sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . 'themes')); $theme->publishAssets(array(), $options); return $this->renderPartial('refresh'); } } else { $this->getResponse()->setStatusCode(404); $message = w3sCommonFunctions::toI18n('themeName parameter is required.'); return $this->renderText(w3sCommonFunctions::displayMessage($message, 'error', true)); } }