Пример #1
0
 /**
  * Get cache tags for the block's content
  * @return array
  */
 function getCacheTags()
 {
     if (Zend_Registry::isRegistered('content_id')) {
         return array('node_' . Zend_Registry::get('content_id'));
     }
     return parent::getCacheTags();
 }
Пример #2
0
 /**
  * Get cache tags for the block's content
  * @return array
  */
 function getCacheTags()
 {
     if (Zend_Registry::get('context')->node) {
         return array('node_' . Zend_Registry::get('context')->node->id);
     }
     return parent::getCacheTags();
 }
Пример #3
0
 /**
  * Get cache ID - although this also benefits from the fact that this code is never cached, so HEAD javascript can be added
  * @see library/Zoo/Block/Zoo_Block_Abstract#getCacheId()
  */
 function getCacheId()
 {
     $view = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->view;
     $view->jQuery()->enable()->uiEnable();
     $view->jQuery()->addJavascriptFile('/js/jquery/treeview/jquery.treeview.js', 'text/javascript');
     $view->jQuery()->addStylesheet('/js/jquery/treeview/jquery.treeview.css');
     $js = ZendX_JQuery_View_Helper_JQuery::getJQueryHandler() . '("#treeview").treeview({collapsed: true, persist: "location"});';
     $view->jQuery()->addOnLoad($js);
     return parent::getCacheId();
 }
Пример #4
0
 /**
  * Get cache ID - differs depending on whether the user can edit the content or not
  * @see library/Zoo/Block/Zoo_Block_Abstract#getCacheId()
  */
 function getCacheId()
 {
     $select = Zoo::getService('content')->getContentSelect($this->getSelectOptions(), 0, 1);
     $rowset = Zoo::getService('content')->fetchAll($select);
     foreach ($rowset as $item) {
         // Will only be one item
         $this->content_id = $item->id;
         try {
             $this->can_edit = Zoo::getService('acl')->checkItemAccess($item, 'edit');
         } catch (Zoo_Exception_Service $e) {
             // No acl service installed
         }
         return parent::getCacheId() . ($this->can_edit ? "_edit" : "");
     }
 }