コード例 #1
0
ファイル: Template.class.php プロジェクト: Kwadz/wallabag
 /**
  * Returns true if selected theme is installed
  *
  * @return bool
  */
 private function _themeIsInstalled()
 {
     $errors = array();
     // Twig is an absolute requirement for wallabag to function.
     // Abort immediately if the Composer installer hasn't been run yet
     if (!$this->canRenderTemplates) {
         $errors[] = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. You can also download <a href="http://wllbg.org/vendor">vendor.zip</a> and extract it in your wallabag folder.';
     }
     // Check if the selected theme and its requirements are present
     $theme = $this->getTheme();
     if ($theme != '' && !is_dir(THEME . '/' . $theme)) {
         $errors[] = 'The currently selected theme (' . $theme . ') does not seem to be properly installed (Missing directory: ' . THEME . '/' . $theme . ')';
         $this->canRenderTemplates = FALSE;
     }
     $themeInfo = $this->getThemeInfo($theme);
     if (isset($themeInfo['requirements']) && is_array($themeInfo['requirements'])) {
         foreach ($themeInfo['requirements'] as $requiredTheme) {
             if (!is_dir(THEME . '/' . $requiredTheme)) {
                 $errors[] = 'The required "' . $requiredTheme . '" theme is missing for the current theme (' . $theme . ')';
                 $this->canRenderTemplates = FALSE;
             }
         }
     }
     $currentErrors = is_null(Session::getParam('errors')) ? array() : Session::getParam('errors');
     Session::setParam('errors', array_merge($errors, $currentErrors));
     return $errors;
 }
コード例 #2
0
ファイル: Api.php プロジェクト: highhair20/glo
 protected function _roundTripRedirect($url, $options = array())
 {
     Session::setParam('_roundTripRedirectUrl', $_SERVER['REQUEST_URI']);
     return parent::_redirect($url, $options);
 }