コード例 #1
0
 /**
  * Retrieve snippet model for system messages.
  *
  * @return Model_Snippet
  */
 protected function _getSnippetModel()
 {
     $snippetModel = new Model_Snippet();
     if ($snippetModel->getObserver('Translatable')) {
         $i18nModelFactory = new Garp_I18n_ModelFactory();
         $snippetModel = $i18nModelFactory->getModel($snippetModel);
     }
     return $snippetModel;
 }
コード例 #2
0
ファイル: Snippet.php プロジェクト: grrr-amsterdam/garp3
 /**
  * Fetch existing snippet by identifier
  *
  * @param string $identifier
  * @return Garp_Db_Table_Row
  */
 protected function _fetchExisting($identifier)
 {
     $this->_validateLoadable();
     $snippetModel = new Model_Snippet();
     $select = $snippetModel->select()->where('identifier = ?', $identifier);
     $row = $snippetModel->fetchRow($select);
     return $row;
 }
コード例 #3
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;
 }
コード例 #4
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>';
     }
 }