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


PHP Horde_Themes::viewDir方法代码示例

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


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

示例1: get

 /**
  */
 public function get($item, $mask = 0)
 {
     if ($mask & self::VIEW) {
         $item_dir = Horde_Themes::viewDir($GLOBALS['registry']->getView()) . '/' . $item;
         $mask &= ~self::VIEW;
         if (!is_null($out = $this->get($item_dir, $mask))) {
             return $out;
         }
     }
     if (!($entry = $this->_get($item))) {
         return null;
     }
     if ($mask) {
         $entry &= $mask;
     }
     if ($entry & self::APP_THEME) {
         $app = $this->_app;
         $theme = $this->_theme;
     } elseif ($entry & self::HORDE_THEME) {
         $app = 'horde';
         $theme = $this->_theme;
     } elseif ($entry & self::APP_DEFAULT) {
         $app = $this->_app;
         $theme = 'default';
     } elseif ($entry & self::HORDE_DEFAULT) {
         $app = 'horde';
         $theme = 'default';
     } else {
         return null;
     }
     return $this->_getOutput($app, $theme, $item);
 }
开发者ID:horde,项目名称:horde,代码行数:34,代码来源:Cache.php

示例2: header

 /**
  * Output the page header.
  *
  * @param array $opts  Options:
  *   - body_class: (string)
  *   - body_id: (string)
  *   - html_id: (string)
  *   - smartmobileinit: (string) (@deprecated; use $this->smartmobileInit
  *                      instead)
  *   - stylesheet_opts: (array)
  *   - title: (string)
  *   - view: (integer)
  */
 public function header(array $opts = array())
 {
     global $injector, $language, $registry, $session;
     $view = new Horde_View(array('templatePath' => $registry->get('templates', 'horde') . '/common'));
     $view->outputJs = !$this->deferScripts;
     $view->stylesheetOpts = array();
     $this->_view = empty($opts['view']) ? $registry->hasView($registry->getView()) ? $registry->getView() : Horde_Registry::VIEW_BASIC : $opts['view'];
     if ($session->regenerate_due) {
         $session->regenerate();
     }
     switch ($this->_view) {
         case $registry::VIEW_BASIC:
             $this->_addBasicScripts();
             break;
         case $registry::VIEW_DYNAMIC:
             $this->ajax = true;
             $this->growler = true;
             $this->_addBasicScripts();
             $this->addScriptPackage('Horde_Core_Script_Package_Popup');
             break;
         case $registry::VIEW_MINIMAL:
             $view->stylesheetOpts['subonly'] = true;
             $view->minimalView = true;
             $this->sidebar = $this->topbar = false;
             break;
         case $registry::VIEW_SMARTMOBILE:
             $smobile_files = array($this->debug ? 'jquery.mobile/jquery.js' : 'jquery.mobile/jquery.min.js', 'growler-jquery.js', 'horde-jquery.js', 'smartmobile.js', 'horde-jquery-init.js', $this->debug ? 'jquery.mobile/jquery.mobile.js' : 'jquery.mobile/jquery.mobile.min.js');
             foreach ($smobile_files as $val) {
                 $ob = $this->addScriptFile(new Horde_Script_File_JsFramework($val, 'horde'));
                 $ob->cache = 'package_smartmobile';
             }
             $this->smartmobileInit = array_merge(array('$.mobile.page.prototype.options.backBtnText = "' . Horde_Core_Translation::t("Back") . '";', '$.mobile.dialog.prototype.options.closeBtnText = "' . Horde_Core_Translation::t("Close") . '";', '$.mobile.loader.prototype.options.text = "' . Horde_Core_Translation::t("loading") . '";'), isset($opts['smartmobileinit']) ? $opts['smartmobileinit'] : array(), $this->smartmobileInit);
             $this->addInlineJsVars(array('HordeMobile.conf' => array('ajax_url' => $registry->getServiceLink('ajax', $registry->getApp())->url, 'logout_url' => strval($registry->getServiceLink('logout')), 'sid' => SID, 'token' => $session->getToken())));
             $this->addMetaTag('viewport', 'width=device-width, initial-scale=1', false);
             $view->stylesheetOpts['subonly'] = true;
             $this->addStylesheet($registry->get('jsfs', 'horde') . '/jquery.mobile/jquery.mobile.min.css', $registry->get('jsuri', 'horde') . '/jquery.mobile/jquery.mobile.min.css');
             $view->smartmobileView = true;
             // Force JS to load at top of page, so we don't see flicker when
             // mobile styles are applied.
             $view->outputJs = true;
             $this->sidebar = $this->topbar = false;
             break;
     }
     $view->stylesheetOpts['sub'] = Horde_Themes::viewDir($this->_view);
     if ($this->ajax || $this->growler) {
         $this->addScriptFile(new Horde_Script_File_JsFramework('hordecore.js', 'horde'));
         /* Configuration used in core javascript files. */
         $js_conf = array_filter(array('URI_AJAX' => $registry->getServiceLink('ajax', $registry->getApp())->url, 'URI_DLOAD' => strval($registry->getServiceLink('download', $registry->getApp())), 'URI_LOGOUT' => strval($registry->getServiceLink('logout')), 'URI_SNOOZE' => strval(Horde::url($registry->get('webroot', 'horde') . '/services/snooze.php', true, -1)), 'SID' => SID, 'TOKEN' => $session->getToken(), 'growler_log' => $this->topbar, 'popup_height' => 610, 'popup_width' => 820));
         /* Gettext strings used in core javascript files. */
         $js_text = array('ajax_error' => Horde_Core_Translation::t("Error when communicating with the server."), 'ajax_recover' => Horde_Core_Translation::t("The connection to the server has been restored."), 'ajax_timeout' => Horde_Core_Translation::t("There has been no contact with the server for several minutes. The server may be temporarily unavailable or network problems may be interrupting your session. You will not see any updates until the connection is restored."), 'snooze' => sprintf(Horde_Core_Translation::t("You can snooze it for %s or %s dismiss %s it entirely"), '#{time}', '#{dismiss_start}', '#{dismiss_end}'), 'snooze_select' => array('0' => Horde_Core_Translation::t("Select..."), '5' => Horde_Core_Translation::t("5 minutes"), '15' => Horde_Core_Translation::t("15 minutes"), '60' => Horde_Core_Translation::t("1 hour"), '360' => Horde_Core_Translation::t("6 hours"), '1440' => Horde_Core_Translation::t("1 day")), 'dismissed' => Horde_Core_Translation::t("The alarm was dismissed."));
         if ($this->topbar) {
             $js_text['growlerclear'] = Horde_Core_Translation::t("Clear All");
             $js_text['growlerinfo'] = Horde_Core_Translation::t("This is the notification log.");
             $js_text['growlernoalerts'] = Horde_Core_Translation::t("No Alerts");
         }
         $this->addInlineJsVars(array('HordeCore.conf' => $js_conf, 'HordeCore.text' => $js_text), array('top' => true));
     }
     if ($this->growler) {
         $this->addScriptFile('growler.js', 'horde');
         $this->addScriptFile('scriptaculous/effects.js', 'horde');
         $this->addScriptFile('scriptaculous/sound.js', 'horde');
     }
     if (isset($opts['stylesheet_opts'])) {
         $view->stylesheetOpts = array_merge($view->stylesheetOpts, $opts['stylesheet_opts']);
     }
     $html = '';
     if (isset($language)) {
         $html .= ' lang="' . htmlspecialchars(strtr($language, '_', '-')) . '"';
     }
     if (isset($opts['html_id'])) {
         $html .= ' id="' . htmlspecialchars($opts['html_id']) . '"';
     }
     $view->htmlAttr = $html;
     $body = '';
     if (isset($opts['body_class'])) {
         $body .= ' class="' . htmlspecialchars($opts['body_class']) . '"';
     }
     if (isset($opts['body_id'])) {
         $body .= ' id="' . htmlspecialchars($opts['body_id']) . '"';
     }
     $view->bodyAttr = $body;
     $page_title = $registry->get('name');
     if (isset($opts['title'])) {
         $page_title .= ' :: ' . $opts['title'];
     }
     $view->pageTitle = htmlspecialchars($page_title);
     $view->pageOutput = $this;
//.........这里部分代码省略.........
开发者ID:jubinpatel,项目名称:horde,代码行数:101,代码来源:PageOutput.php


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