Exemplo n.º 1
0
 /**
  * Executes index action
  *
  * @param sfWebRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $themeSearcher = new opThemeAssetSearcher();
     $this->themeName = $request->getParameterHolder()->get('theme_name');
     if (null === $this->themeName) {
         $this->forward404('Request parameter id does not exist.');
     }
     $this->isExistsTheme = $themeSearcher->isAvailableTheme($this->themeName);
     $this->emptyThemeName = $this->themeName === null;
 }
Exemplo n.º 2
0
 public static function enablePreviewTheme(sfEvent $event)
 {
     if (!self::isFrontend()) {
         return false;
     }
     if (!self::isPreviewModule()) {
         return false;
     }
     $request = sfContext::getInstance()->getRequest();
     $themeName = $request->getParameter('theme_name');
     if (null === $themeName) {
         return false;
     }
     $themeSearcher = new opThemeAssetSearcher();
     if (!$themeSearcher->isAvailableTheme($themeName)) {
         return false;
     }
     self::enableSkinByTheme($themeName);
 }