コード例 #1
0
ファイル: actions.class.php プロジェクト: te-koyama/openpne
 /**
  * Executes index action
  *
  * @param sfWebRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $themeObjects = $this->searcher->getThemes();
     $this->validThemeObjects = $themeObjects['valid'];
     $this->invalidDirNames = $themeObjects['invalid']['invalid'];
     $this->invalidMainCss = $themeObjects['invalid']['maincss'];
     $this->config->removeUsedThemeName(array_merge($this->invalidDirNames, $this->invalidMainCss), $this->validThemeObjects);
     $this->usedThemeName = $this->config->getUsedThemeName();
     if (null === $this->usedThemeName) {
         $this->existsUsedTheme = true;
     } else {
         $this->existsUsedTheme = $this->searcher->existsAssetsByThemeName($this->config->getUsedThemeName());
     }
     $this->form = new opThemeActivationForm(array(), array('themes' => $this->validThemeObjects));
     if ($request->isMethod(sfWebRequest::POST)) {
         $this->form->bind($this->request->getParameter('theme_activation'));
         if ($this->form->isValid()) {
             $this->getUser()->setFlash('notice', 'Saved.');
             $this->form->save();
         } else {
             $this->getUser()->setFlash('error', $this->form->getErrorSchema()->getMessage());
         }
         $this->redirect('opSkinThemePlugin/index');
     }
 }