当前位置: 首页>>代码示例>>PHP>>正文


PHP Menu::getCurrentUserRole方法代码示例

本文整理汇总了PHP中Menu::getCurrentUserRole方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::getCurrentUserRole方法的具体用法?PHP Menu::getCurrentUserRole怎么用?PHP Menu::getCurrentUserRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Menu的用法示例。


在下文中一共展示了Menu::getCurrentUserRole方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: menuXmlAction

 public function menuXmlAction()
 {
     //echo "<!-- start ts " . calcTS() . "-->";
     header("Cache-Control: public");
     header("Pragma: public");
     $cache = Zend_Registry::get('cache');
     $cacheKey = "menu-" . Menu::getCurrentlySelectedActivityGroup() . "-" . Menu::getCurrentUserRole();
     $cacheKey = str_replace('-', '_', $cacheKey);
     $cacheKey = str_replace('/', '_', $cacheKey);
     if ($cache->test($cacheKey . "_hash")) {
         $hash = $cache->load($cacheKey . "_hash");
         $lastModified = $cache->load($cacheKey . "_lastModified");
         $headers = getallheaders();
         if (isset($headers['If-None-Match']) && preg_match('/' . $hash . '/', $headers['If-None-Match'])) {
             header("Last-Modified: " . $lastModified);
             header('HTTP/1.1 304 Not Modified');
             exit;
         }
     }
     $menuXml = "";
     if (false && $cache->test($cacheKey)) {
         $menuXml = $cache->load($cacheKey);
     } else {
         $menuXml = Menu::generateCurrentMenu();
         $hash = md5($menuXml);
         $lastModified = gmdate("D, d M Y H:i:s") . " GMT";
         $objConfig = new ConfigItem();
         $objConfig->configId = 'enableCache';
         $objConfig->populate();
         if ($objConfig->value) {
             $cache->save($hash, $cacheKey . "_hash", array('tagMenu'));
             $cache->save($lastModified, $cacheKey . "_lastModified", array('tagMenu'));
             $cache->save($menuXml, $cacheKey, array('tagMenu'));
         }
         header("ETag: " . $hash);
         header("Last-Modified: " . $lastModified);
         header("Content-length: " . mb_strlen($menuXml));
     }
     $this->view->menuXml = $menuXml;
     header('Content-Type: application/xml;');
     $this->render('menuXml');
     //echo "<!-- second ts " . calcTS() . "-->";
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:43,代码来源:MenuController.php

示例2: _renderToolbar

 protected function _renderToolbar($phtml = "toolbar")
 {
     header("Cache-Control: public");
     header("Pragma: public");
     $cache = Zend_Registry::get('cache');
     $className = get_class($this);
     $className = str_replace('Controller', '', $className);
     $keyPref = substr(strtolower(preg_replace('/([A-Z]{1})/', '_\\1', $className)), 1);
     $cacheKey = $keyPref . "-toolbar-" . Menu::getCurrentlySelectedActivityGroup() . "-" . Menu::getCurrentUserRole();
     $cacheKey = str_replace('-', '_', $cacheKey);
     $cacheKey = str_replace('/', '_', $cacheKey);
     if ($cache->test($cacheKey . "_hash")) {
         $hash = $cache->load($cacheKey . "_hash");
         $lastModified = $cache->load($cacheKey . "_lastModified");
         $headers = getallheaders();
         if (isset($headers['If-None-Match']) && ereg($hash, $headers['If-None-Match'])) {
             header("Last-Modified: " . $lastModified);
             header('HTTP/1.1 304 Not Modified');
             exit;
         }
     }
     if ($cache->test($cacheKey)) {
         $items = $cache->load($cacheKey);
     } else {
         $items = $this->render($phtml);
         $hash = md5($items);
         $lastModified = gmdate("D, d M Y H:i:s") . " GMT";
         $objConfig = new ConfigItem();
         $objConfig->configId = 'enableCache';
         $objConfig->populate();
         if ($objConfig->value) {
             $cache->save($hash, $cacheKey . "_hash", array('tagToolbar'));
             $cache->save($lastModified, $cacheKey . "_lastModified", array('tagToolbar'));
             $cache->save($items, $cacheKey, array('tagToolbar'));
         }
         header("ETag: " . $hash);
         header("Last-Modified: " . $lastModified);
         header("Content-length: " . mb_strlen($items));
     }
     header("Content-type: text/xml");
     return $items;
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:42,代码来源:Action.php

示例3: toolbarAction

 public function toolbarAction()
 {
     header("Cache-Control: public");
     header("Pragma: public");
     $cache = Zend_Registry::get('cache');
     $cacheKey = "toolbar-" . Menu::getCurrentlySelectedActivityGroup() . "-" . Menu::getCurrentUserRole();
     $cacheKey = str_replace('-', '_', $cacheKey);
     $cacheKey = str_replace('/', '_', $cacheKey);
     if ($cache->test($cacheKey . "_hash")) {
         $hash = $cache->load($cacheKey . "_hash");
         $lastModified = $cache->load($cacheKey . "_lastModified");
         $headers = getallheaders();
         if (isset($headers['If-None-Match']) && ereg($hash, $headers['If-None-Match'])) {
             header("Last-Modified: " . $lastModified);
             header('HTTP/1.1 304 Not Modified');
             exit;
         }
     }
     if ($cache->test($cacheKey)) {
         $items = $cache->load($cacheKey);
     } else {
         $items = $this->render('toolbar');
         $hash = md5($items);
         $lastModified = gmdate("D, d M Y H:i:s") . " GMT";
         $objConfig = new ConfigItem();
         $objConfig->configId = 'enableCache';
         $objConfig->populate();
         if ($objConfig->value) {
             $cache->save($hash, $cacheKey . "_hash", array('tagToolbar'));
             $cache->save($lastModified, $cacheKey . "_lastModified", array('tagToolbar'));
             $cache->save($items, $cacheKey, array('tagToolbar'));
         }
         header("ETag: " . $hash);
         header("Last-Modified: " . $lastModified);
         header("Content-length: " . mb_strlen($items));
     }
     if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml")) {
         header("Content-type: application/xhtml+xml");
     } else {
         header("Content-type: text/xml");
     }
     return $items;
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:43,代码来源:MedicationsController.php


注:本文中的Menu::getCurrentUserRole方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。