コード例 #1
0
ファイル: Passwordless.php プロジェクト: grrr-amsterdam/garp3
 protected function _getSnippet($identifier)
 {
     $snippetModel = new Model_Snippet();
     if ($snippetModel->isMultilingual()) {
         $snippetModel = instance(new Garp_I18n_ModelFactory())->getModel('Snippet');
     }
     return $snippetModel->fetchByIdentifier($identifier)->text;
 }
コード例 #2
0
 protected function _setCmsClosedMessage()
 {
     $config = Zend_Registry::get('config');
     if (!isset($config->cms->closed) || !$config->cms->closed) {
         return;
     }
     $this->view->isClosed = true;
     try {
         $snippetModel = new Model_Snippet();
         if ($snippetModel->isMultilingual()) {
             $snippetModel = instance(new Garp_I18n_ModelFactory())->getModel('Snippet');
         }
         $snippet = $snippetModel->fetchByIdentifier('cms closed message');
         $cmsClosedMessage = $snippet->html;
         if (isset($cmsClosedMessage[Garp_I18n::getCurrentLocale()])) {
             $cmsClosedMessage = $cmsClosedMessage[Garp_I18n::getCurrentLocale()];
         }
         $this->view->cmsClosedMessage = $cmsClosedMessage;
     } catch (Exception $e) {
         throw $e;
         $this->view->cmsClosedMessage = '<p>The CMS is closed.</p>';
     }
 }