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


PHP Horde::stripAccessKey方法代码示例

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


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

示例1: perms

 /**
  */
 public function perms()
 {
     $permissions = array('max_blocks' => array('title' => _("Maximum Number of Portal Blocks"), 'type' => 'int'), 'administration' => array('title' => _("Administration")));
     if (!empty($GLOBALS['conf']['activesync']['enabled'])) {
         $this->_addActiveSyncPerms($permissions);
     }
     try {
         foreach ($GLOBALS['registry']->callByPackage('horde', 'admin_list') as $perm_key => $perm_details) {
             $permissions['administration:' . $perm_key] = array('title' => Horde::stripAccessKey($perm_details['name']));
         }
     } catch (Horde_Exception $e) {
         /*what to do if this fails?*/
     }
     return $permissions;
 }
开发者ID:horde,项目名称:horde,代码行数:17,代码来源:Application.php

示例2: getTree

 /**
  * Generates the topbar tree object.
  *
  * @return Horde_Tree_Renderer_Base  The topbar tree object.
  */
 public function getTree()
 {
     if ($this->_generated) {
         return $this->_tree;
     }
     global $injector, $prefs, $registry;
     $current = $registry->getApp();
     $isAdmin = $registry->isAdmin();
     $menu = array();
     foreach ($registry->listApps(array('active', 'admin', 'noadmin', 'heading', 'link', 'notoolbar', 'topbar'), true, null) as $app => $params) {
         /* Check if the current user has permisson to see this application,
          * and if the application is active. Headings are visible to
          * everyone (but get filtered out later if they have no
          * children). Administrators always see all applications except
          * those marked 'inactive'. */
         if ($app != 'horde' && (in_array($params['status'], array('heading', 'link')) || in_array($params['status'], array('active', 'admin', 'noadmin', 'topbar')) && !($isAdmin && $params['status'] == 'noadmin') && $registry->hasPermission(!empty($params['app']) ? $params['app'] : $app, Horde_Perms::SHOW))) {
             $menu[$app] = $params;
         }
     }
     do {
         $children = array();
         foreach ($menu as $params) {
             if (isset($params['menu_parent'])) {
                 $children[$params['menu_parent']] = true;
             }
         }
         $found = false;
         foreach (array_keys($menu) as $key) {
             if ($menu[$key]['status'] == 'heading' && empty($children[$key])) {
                 unset($menu[$key]);
                 $found = true;
             }
         }
     } while ($found);
     /* Add the administration menu if the user is an admin or has any
      * admin permissions. */
     $perms = $injector->getInstance('Horde_Perms');
     $admin_item_count = 0;
     try {
         foreach ($registry->callByPackage('horde', 'admin_list') as $method => $val) {
             if ($isAdmin || $perms->hasPermission('horde:administration:' . $method, $registry->getAuth(), Horde_Perms::SHOW)) {
                 ++$admin_item_count;
                 $menu['administration_' . $method] = array('icon' => $val['icon'], 'menu_parent' => 'administration', 'name' => Horde::stripAccessKey($val['name']), 'status' => 'active', 'url' => Horde::url($registry->applicationWebPath($val['link'], 'horde')));
             }
         }
     } catch (Horde_Exception $e) {
     }
     if ($admin_item_count) {
         $menu['administration'] = array('name' => Horde_Core_Translation::t("Administration"), 'status' => 'heading', 'menu_parent' => 'settings');
     }
     $menu['settings'] = array('class' => 'horde-settings horde-icon-settings', 'name' => '', 'noarrow' => true, 'status' => 'active');
     /* Add preferences. */
     if ($registry->showService('prefs') && !$prefs instanceof Horde_Prefs_Session) {
         $menu['prefs'] = array('icon' => Horde_Themes::img('prefs.png'), 'menu_parent' => 'settings', 'name' => Horde_Core_Translation::t("Preferences"), 'status' => 'active', 'url' => $registry->getServiceLink('prefs', $current));
         /* Get a list of configurable applications. */
         $prefs_apps = $registry->listApps(array('active', 'admin'), true, Horde_Perms::READ);
         if (!empty($prefs_apps['horde'])) {
             $menu['prefs_' . 'horde'] = array('icon' => $registry->get('icon', 'horde'), 'menu_parent' => 'prefs', 'name' => Horde_Core_Translation::t("Global Preferences"), 'status' => 'active', 'url' => $registry->getServiceLink('prefs', 'horde'));
             unset($prefs_apps['horde']);
         }
         uasort($prefs_apps, array($this, '_sortByName'));
         foreach ($prefs_apps as $app => $params) {
             $menu['prefs_' . $app] = array('icon' => $registry->get('icon', $app), 'menu_parent' => 'prefs', 'name' => $params['name'], 'status' => 'active', 'url' => $registry->getServiceLink('prefs', $app));
         }
     }
     /* Add notification log. */
     $menu['growlerlog'] = array('icon' => 'info.png', 'menu_parent' => 'settings', 'name' => Horde_Core_Translation::t("Toggle Alerts Log"), 'status' => 'active', 'url' => 'javascript:void(HordeCore.Growler.toggleLog());');
     /* Add problem link. */
     if ($registry->showService('problem') && ($problem_link = $registry->getServiceLink('problem', $current))) {
         $menu['problem_' . $current] = array('icon' => 'problem.png', 'menu_parent' => 'settings', 'name' => Horde_Core_Translation::t("Problem"), 'status' => 'active', 'url' => $problem_link);
     }
     /* Add help link. */
     if ($registry->showService('help') && ($help_link = $registry->getServiceLink('help', $current))) {
         $menu['help_' . $current] = array('icon' => 'help_index.png', 'menu_parent' => 'settings', 'name' => Horde_Core_Translation::t("Help"), 'onclick' => Horde::popupJs($help_link, array('urlencode' => true)) . 'return false;', 'status' => 'active', 'target' => 'help', 'url' => $help_link);
     }
     foreach ($menu as $app => $params) {
         switch ($params['status']) {
             case 'topbar':
                 try {
                     $registry->callAppMethod($params['app'], 'topbarCreate', array('args' => array($this->_tree, empty($params['menu_parent']) ? null : $params['menu_parent'], isset($params['topbar_params']) ? $params['topbar_params'] : array())));
                 } catch (Horde_Exception_PushApp $e) {
                     // Ignore
                 } catch (Horde_Exception $e) {
                     Horde::log($e, 'ERR');
                 }
                 break;
             default:
                 /* Need to run the name through Horde's gettext since the
                  * user's locale may not have been loaded when registry.php was
                  * parsed, and the translations of the application names are
                  * not in the Core package. */
                 $name = strlen($params['name']) ? _($params['name']) : '';
                 /* Headings have no webroot; they're just containers for other
                  * menu items. */
                 if (isset($params['url'])) {
//.........这里部分代码省略.........
开发者ID:jubinpatel,项目名称:horde,代码行数:101,代码来源:Topbar.php

示例3: _init


//.........这里部分代码省略.........
     $mh_count = 0;
     $sortImg = $sortpref->sortdir ? 'sortup' : 'sortdown';
     $headers = array(Horde_Imap_Client::SORT_TO => array('id' => 'mboxto', 'stext' => _("Sort by To Address"), 'text' => _("To")), Horde_Imap_Client::SORT_FROM => array('id' => 'mboxfrom', 'stext' => _("Sort by From Address"), 'text' => _("Fro_m")), Horde_Imap_Client::SORT_THREAD => array('id' => 'mboxthread', 'stext' => _("Sort by Thread"), 'text' => _("_Thread")), Horde_Imap_Client::SORT_SUBJECT => array('id' => 'mboxsubject', 'stext' => _("Sort by Subject"), 'text' => _("Sub_ject")), IMP::IMAP_SORT_DATE => array('id' => 'mboxdate', 'stext' => _("Sort by Date"), 'text' => _("Dat_e")), Horde_Imap_Client::SORT_SIZE => array('id' => 'mboxsize', 'stext' => _("Sort by Message Size"), 'text' => _("Si_ze")));
     /* If this is the Drafts or Sent-Mail mailbox, sort by To instead of
      * From. */
     if ($mailbox->special_outgoing) {
         unset($headers[Horde_Imap_Client::SORT_FROM]);
     } else {
         unset($headers[Horde_Imap_Client::SORT_TO]);
     }
     /* Determine which of Subject/Thread to emphasize. */
     if (!$mailbox->access_sortthread || $sortpref->sortby_locked) {
         unset($headers[Horde_Imap_Client::SORT_THREAD]);
         if ($sortpref->sortby_locked && $thread_sort) {
             $sortpref->sortby = Horde_Imap_Client::SORT_SUBJECT;
         }
     } else {
         if ($thread_sort) {
             $extra = Horde_Imap_Client::SORT_SUBJECT;
             $standard = Horde_Imap_Client::SORT_THREAD;
         } else {
             $extra = Horde_Imap_Client::SORT_THREAD;
             $standard = Horde_Imap_Client::SORT_SUBJECT;
         }
         $headers[$standard]['altsort'] = Horde::widget(array('url' => $mailbox_imp_url->copy()->add(array('actionID' => 'change_sort', 'token' => $token, 'sortby' => $extra)), 'title' => $headers[$extra]['text']));
         unset($headers[$extra]);
     }
     foreach ($headers as $key => $val) {
         $ptr =& $headers[$key];
         if ($sortpref->sortby == $key) {
             $csl_icon = '<span class="iconImg ' . $sortImg . '"></span>';
             if ($sortpref->sortdir_locked) {
                 $ptr['change_sort_link'] = $csl_icon;
                 $ptr['change_sort_widget'] = Horde::stripAccessKey($val['text']);
             } else {
                 $tmp = $mailbox_imp_url->copy()->add(array('sortby' => $key, 'sortdir' => intval(!$sortpref->sortdir), 'actionID' => 'change_sort', 'token' => $token));
                 $ptr['change_sort_link'] = Horde::link($tmp, $val['stext'], null, null, null, $val['stext']) . $csl_icon . '</a>';
                 $ptr['change_sort_widget'] = Horde::widget(array('url' => $tmp, 'title' => $val['text']));
             }
         } else {
             $ptr['change_sort_link'] = null;
             $ptr['change_sort_widget'] = $sortpref->sortby_locked ? Horde::stripAccessKey($val['text']) : Horde::widget(array('url' => $mailbox_imp_url->copy()->add(array('actionID' => 'change_sort', 'token' => $token, 'sortby' => $key)), 'title' => $val['text']));
         }
         $ptr['class'] = 'horde-split-left';
     }
     /* Output the form start. */
     $f_view = clone $view;
     $f_view->mailbox = $mailbox->form_to;
     $f_view->mailbox_url = $mailbox_url;
     $f_view->page = $pageOb['page'];
     $f_view->token = $token;
     $this->output .= $f_view->render('form_start');
     /* Prepare the message headers template. */
     $mh_view = clone $view;
     $mh_view->headers = $headers;
     if (!$search_mbox) {
         $mh_view->show_checkbox = !$mh_count++;
         $this->output .= $mh_view->render('message_headers');
     }
     /* Initialize repetitively used variables. */
     $fromlinkstyle = $prefs->getValue('from_link');
     $imp_ui = new IMP_Mailbox_Ui($mailbox);
     /* Display message information. */
     $msgs = array();
     $search_view = clone $view;
     $summary_view = clone $view;
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:67,代码来源:Mailbox.php

示例4: getAccessKeyAndTitle

 /**
  * Returns the appropriate "accesskey" and "title" attributes for an HTML
  * tag and the given label.
  *
  * @param string $label     The title of an HTML element
  * @param boolean $nocheck  Don't check if the access key already has been
  *                          used?
  *
  * @return string  The title, and if appropriate, the accesskey attributes
  *                 for the element.
  */
 function getAccessKeyAndTitle($label, $nocheck = false)
 {
     $ak = Horde::getAccessKey($label, $nocheck);
     $attributes = 'title="' . Horde::stripAccessKey($label);
     if (!empty($ak)) {
         $attributes .= sprintf(_(" (Accesskey %s)"), $ak);
         $attributes .= '" accesskey="' . $ak;
     }
     return $attributes . '"';
 }
开发者ID:justinlyon,项目名称:scc,代码行数:21,代码来源:Horde.php


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