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


PHP Horde::link方法代码示例

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


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

示例1: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output, $prefs, $session;
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Help');
     if (!Horde::isConnectionSecure()) {
         $view->notsecure = true;
     } else {
         $smime_url = IMP_Basic_Smime::url();
         $view->has_key = $prefs->getValue('smime_public_key') && $prefs->getValue('smime_private_key');
         if ($view->has_key) {
             $view->viewpublic = Horde::link($smime_url->copy()->add('actionID', 'view_personal_public_key'), _("View Personal Public Certificate"), null, 'view_key');
             $view->infopublic = Horde::link($smime_url->copy()->add('actionID', 'info_personal_public_key'), _("Information on Personal Public Certificate"), null, 'info_key');
             if ($injector->getInstance('IMP_Crypt_Smime')->getPassphrase()) {
                 $view->passphrase = Horde::link($ui->selfUrl(array('special' => true, 'token' => true))->add('unset_smime_passphrase', 1), _("Unload Passphrase")) . _("Unload Passphrase");
             } else {
                 $imple = $injector->getInstance('Horde_Core_Factory_Imple')->create('IMP_Ajax_Imple_PassphraseDialog', array('params' => array('reload' => $ui->selfUrl()->setRaw(true)), 'type' => 'smimePersonal'));
                 $view->passphrase = Horde::link('#', _("Enter Passphrase"), null, null, null, null, null, array('id' => $imple->getDomId())) . _("Enter Passphrase");
             }
             $view->viewprivate = Horde::link($smime_url->copy()->add('actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key');
             $page_output->addInlineScript(array('$("delete_smime_personal").observe("click", function(e) { if (!window.confirm(' . json_encode(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")) . ')) { e.stop(); } })'), true);
         } elseif ($session->get('imp', 'file_upload')) {
             $view->import = true;
             $page_output->addInlineScript(array('$("import_smime_personal").observe("click", function(e) { ' . Horde::popupJs($smime_url, array('params' => array('actionID' => 'import_personal_certs', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 275, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
         }
     }
     return $view->render('smimeprivatekey');
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:SmimePrivateKey.php

示例2: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output, $prefs, $session;
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $imp_pgp = $injector->getInstance('IMP_Crypt_Pgp');
     /* Get list of Public Keys on keyring. */
     try {
         $pubkey_list = $imp_pgp->listPublicKeys();
     } catch (Horde_Exception $e) {
         $pubkey_list = array();
     }
     $pgp_url = IMP_Basic_Pgp::url();
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Help');
     $view->addHelper('Text');
     if (!empty($pubkey_list)) {
         $plist = array();
         $self_url = $ui->selfUrl(array('special' => true, 'token' => true));
         foreach ($pubkey_list as $val) {
             $plist[] = array('name' => $val['name'], 'email' => $val['email'], 'view' => Horde::link($pgp_url->copy()->add(array('actionID' => 'view_public_key', 'email' => $val['email'])), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'), 'info' => Horde::link($pgp_url->copy()->add(array('actionID' => 'info_public_key', 'email' => $val['email'])), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'), 'delete' => Horde::link($self_url->copy()->add(array('delete_pgp_pubkey' => 1, 'email' => $val['email'])), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "window.confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')"));
         }
         $view->pubkey_list = $plist;
     }
     if ($session->get('imp', 'file_upload')) {
         $view->can_import = true;
         $view->no_source = !$prefs->getValue('add_source');
         if (!$view->no_source) {
             $page_output->addInlineScript(array('$("import_pgp_public").observe("click", function(e) { ' . Horde::popupJs($pgp_url, array('params' => array('actionID' => 'import_public_key', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 275, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
         }
     }
     return $view->render('pgppublickey');
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:34,代码来源:PgpPublicKey.php

示例3: token

 /**
  * Renders a token into text matching the requested format.
  *
  * @param array $options  The "options" portion of the token (second
  *                        element).
  *
  * @return string  The text rendered from the token options.
  */
 public function token($options)
 {
     if (!isset($options['attr']['alt'])) {
         $options['attr']['alt'] = $options['src'];
     }
     if (strpos($options['src'], '://') === false) {
         if ($options['src'][0] != '/') {
             if (strpos($options['src'], ':')) {
                 list($page, $options['src']) = explode(':', $options['src'], 2);
             } else {
                 $page = Horde_Util::getFormData('page');
                 if ($page == 'EditPage') {
                     $page = Horde_Util::getFormData('referrer');
                 }
                 if (empty($page)) {
                     $page = 'Wiki/Home';
                 }
             }
             $params = array('page' => $page, 'mime' => '1', 'file' => $options['src']);
             $options['src'] = $GLOBALS['registry']->downloadUrl($options['src'], $params)->setRaw(true);
         }
     } else {
         $options['src'] = new Horde_Url(Horde::externalUrl($options['src']));
         $options['src']->setRaw(true);
     }
     // Send external links through Horde::externalUrl().
     if (isset($options['attr']['link']) && strpos($options['attr']['link'], '://')) {
         $href = htmlspecialchars($options['attr']['link']);
         unset($options['attr']['link']);
         return Horde::link(Horde::externalUrl($href), $href) . $this->_token($options) . '</a>';
     } else {
         return $this->_token($options);
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:42,代码来源:Image2.php

示例4: _content

 /**
  */
 protected function _content()
 {
     global $registry, $prefs;
     if (!empty($this->_params['show_notepad'])) {
         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create();
     }
     $html = '';
     $memos = Mnemo::listMemos($prefs->getValue('sortby'), $prefs->getValue('sortdir'));
     foreach ($memos as $id => $memo) {
         $html .= '<tr>';
         if (!empty($this->_params['show_actions'])) {
             $editImg = Horde_Themes::img('edit.png');
             $editurl = Horde::url('memo.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id']));
             $html .= '<td width="1%">' . Horde::link(htmlspecialchars(Horde::url($editurl, true)->add('actionID', 'modify_memo')), _("Edit Note")) . Horde::img($editImg, _("Edit Note")) . '</a></td>';
         }
         if (!empty($this->_params['show_notepad'])) {
             $html .= '<td>' . htmlspecialchars(Mnemo::getLabel($shares->getShare($memo['memolist_id']))) . '</td>';
         }
         $viewurl = Horde::url('view.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id']));
         $html .= '<td>' . Horde::linkTooltip(htmlspecialchars(Horde::url($viewurl, true)), '', '', '', '', $memo['body'] != $memo['desc'] ? Mnemo::getNotePreview($memo) : '') . (strlen($memo['desc']) ? htmlspecialchars($memo['desc']) : '<em>' . _("Empty Note") . '</em>') . '</a> <ul class="horde-tags">';
         foreach ($memo['tags'] as $tag) {
             $html .= '<li>' . htmlspecialchars($tag) . '</li>';
         }
         $html .= '</ul></td></tr>';
     }
     if (!$memos) {
         return '<p><em>' . _("No notes to display") . '</em></p>';
     }
     return '<table cellspacing="0" width="100%" class="linedRow">' . $html . '</table>';
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:32,代码来源:Summary.php

示例5: _content

 /**
  */
 protected function _content()
 {
     global $whups_driver;
     $queues = Whups::permissionsFilter($whups_driver->getQueues(), 'queue', Horde_Perms::READ);
     $qsummary = $whups_driver->getQueueSummary(array_keys($queues));
     if (!$qsummary) {
         return '<p class="horde-content"><em>' . _("There are no open tickets.") . '</em></p>';
     }
     $summary = $types = array();
     foreach ($qsummary as $queue) {
         $types[$queue['type']] = $queue['type'];
         if (!isset($summary[$queue['id']])) {
             $summary[$queue['id']] = $queue;
         }
         $summary[$queue['id']][$queue['type']] = $queue['open_tickets'];
     }
     $html = '<thead><tr>';
     $sortby = 'queue_name';
     foreach (array_merge(array('queue_name' => _("Queue")), $types) as $column => $name) {
         $html .= '<th' . ($sortby == $column ? ' class="sortdown"' : '') . '>' . $name . '</th>';
     }
     $html .= '</tr></thead><tbody>';
     foreach ($summary as $queue) {
         $html .= '<tr><td>' . Horde::link(Whups::urlFor('queue', $queue, true), $queue['description']) . htmlspecialchars($queue['name']) . '</a></td>';
         foreach ($types as $type) {
             $html .= '<td>' . (isset($queue[$type]) ? $queue[$type] : '&nbsp;') . '</td>';
         }
         $html .= '</tr>';
     }
     $GLOBALS['page_output']->addScriptFile('tables.js', 'horde');
     return '<table id="whups_block_queuesummary" class="horde-table sortable" style="width:100%">' . $html . '</tbody></table>';
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:34,代码来源:Queuesummary.php

示例6: _title

 /**
  */
 protected function _title()
 {
     if (($query = $this->_getQuery()) && $query->name) {
         return Horde::link(Whups::urlFor('query', empty($query->slug) ? array('id' => $query->id) : array('slug' => $query->slug))) . htmlspecialchars($query->name) . '</a>';
     }
     return $this->getName();
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:9,代码来源:Query.php

示例7: _title

 /**
  * The title to go in this block.
  *
  * @return string   The title text.
  */
 function _title()
 {
     global $registry;
     $title = isset($this->_params['title']) ? $this->_params['title'] : $this->_params['iframe'];
     $html = Horde::link($this->_params['iframe'], $title, 'header') . $title . '</a>';
     $html .= Horde::link($this->_params['iframe'], _("Open in a new window"), 'smallheader', '_new') . Horde::img('webserver.gif', _("Open in a new window"), 'hspace="5"', Horde::url($registry->getParam('graphics'), true, -1)) . _("Open in a new window") . '</a>';
     return $html;
 }
开发者ID:Artea,项目名称:freebeer,代码行数:13,代码来源:iframe.php

示例8: __toString

 /**
  * String representation of this object.
  *
  * @return string  String representation.
  */
 public function __toString()
 {
     $text = null;
     switch ($this->type) {
         case 'horde.alarm':
             $alarm = $this->flags['alarm'];
             $text = $alarm['title'];
             if (!empty($alarm['params']['notify']['show'])) {
                 try {
                     $text = Horde::link(Horde::url($GLOBALS['registry']->linkByPackage($alarm['params']['notify']['show']['__app'], 'show', $alarm['params']['notify']['show'])), $alarm['text']) . $text . '</a>';
                 } catch (Horde_Exception $e) {
                     return $e->getMessage();
                 }
             }
             if (!empty($alarm['user']) && $GLOBALS['browser']->hasFeature('xmlhttpreq')) {
                 try {
                     $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/snooze.php', true);
                 } catch (Horde_Exception $e) {
                     return $e->getMessage();
                 }
                 $opts = array('-1' => Horde_Core_Translation::t("Dismiss"), '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"));
                 $id = 'snooze_' . hash('md5', $alarm['id']);
                 $text .= ' <small onmouseover="if(typeof ' . $id . '_t!=\'undefined\')clearTimeout(' . $id . '_t);Element.show(\'' . $id . '\')" onmouseout="' . $id . '_t=setTimeout(function(){Element.hide(\'' . $id . '\')},500)">[' . Horde_Core_Translation::t("Snooze...") . '<span id="' . $id . '" style="display:none"> ';
                 $first = true;
                 foreach ($opts as $minutes => $desc) {
                     if (!$first) {
                         $text .= ', ';
                     }
                     $text .= Horde::link('#', '', '', '', 'new Ajax.Request(\'' . $url . '\',{parameters:{alarm:\'' . $alarm['id'] . '\',snooze:' . $minutes . '},onSuccess:function(){Element.remove(this);}.bind(this.parentNode.parentNode.parentNode)});return false;') . $desc . '</a>';
                     $first = false;
                 }
                 $text .= '</span>]</small>';
             }
             $img = 'alerts/alarm.png';
             $label = Horde_Core_Translation::t("Alarm");
             break;
         case 'horde.error':
             $img = 'alerts/error.png';
             $label = Horde_Core_Translation::t("Error");
             break;
         case 'horde.message':
             $img = 'alerts/message.png';
             $label = Horde_Core_Translation::t("Message");
             break;
         case 'horde.success':
             $img = 'alerts/success.png';
             $label = Horde_Core_Translation::t("Success");
             break;
         case 'horde.warning':
             $img = 'alerts/warning.png';
             $label = Horde_Core_Translation::t("Warning");
             break;
         default:
             return parent::__toString();
     }
     return Horde_Themes_Image::tag($img, array('alt' => $label)) . '<div class="noticetext">' . (is_null($text) ? parent::__toString() : $text) . '</div>';
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:62,代码来源:Status.php

示例9: _init

 /**
  */
 protected function _init()
 {
     global $injector, $notification;
     if (!$this->indices->mailbox->access_search) {
         $notification->push(_("Searching is not available."), 'horde.error');
         $this->indices->mailbox->url('mailbox')->redirect();
     }
     $imp_flags = $injector->getInstance('IMP_Flags');
     $imp_search = $injector->getInstance('IMP_Search');
     /* If search_basic is set, we are processing the search query. */
     if ($this->vars->search_basic) {
         $c_list = array();
         if ($this->vars->search_criteria_text) {
             switch ($this->vars->search_criteria) {
                 case 'from':
                 case 'subject':
                     $c_list[] = new IMP_Search_Element_Header($this->vars->search_criteria_text, $this->vars->search_criteria, $this->vars->search_criteria_not);
                     break;
                 case 'recip':
                     $c_list[] = new IMP_Search_Element_Recipient($this->vars->search_criteria_text, $this->vars->search_criteria_not);
                     break;
                 case 'body':
                 case 'text':
                     $c_list[] = new IMP_Search_Element_Text($this->vars->search_criteria_text, $this->vars->search_criteria == 'body', $this->vars->search_criteria_not);
                     break;
             }
         }
         if ($this->vars->search_criteria_flag) {
             $formdata = $imp_flags->parseFormId($this->vars->search_criteria_flag);
             $c_list[] = new IMP_Search_Element_Flag($formdata['flag'], $formdata['set'] && !$this->vars->search_criteria_flag_not);
         }
         if (empty($c_list)) {
             $notification->push(_("No search criteria specified."), 'horde.error');
         } else {
             /* Store the search in the session. */
             $q_ob = $imp_search->createQuery($c_list, array('id' => IMP_Search::BASIC_SEARCH, 'mboxes' => array($this->indices->mailbox), 'type' => IMP_Search::CREATE_QUERY));
             /* Redirect to the mailbox screen. */
             IMP_Mailbox::get($q_ob)->url('mailbox')->redirect();
         }
     }
     $flist = $imp_flags->getList(array('imap' => true, 'mailbox' => $this->indices->mailbox));
     $flag_set = array();
     foreach ($flist as $val) {
         $flag_set[] = array('val' => $val->form_set, 'label' => $val->label);
     }
     /* Prepare the search template. */
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/basic/search'));
     $view->addHelper('FormTag');
     $view->addHelper('Tag');
     $view->action = self::url();
     $view->advsearch = Horde::link($this->indices->mailbox->url(IMP_Basic_Search::url()));
     $view->mbox = $this->indices->mailbox->form_to;
     $view->search_title = sprintf(_("Search %s"), $this->indices->mailbox->display_html);
     $view->flist = $flag_set;
     $this->title = _("Search");
     $this->output = $view->render('search-basic');
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:59,代码来源:Searchbasic.php

示例10: show

 public function show()
 {
     $this->list = array();
     $this->list[0] = Horde::link($this->urlFor(array('controller' => 'check', 'action' => 'run', 'id' => 'all')), _("All tests")) . _("All tests") . '</a>';
     $this->list[1] = '';
     for ($i = 0; $i < $this->suite->count(); $i++) {
         $class_name = $this->suite->testAt($i)->getName();
         $this->list[$i + 2] = Horde::link($this->urlFor(array('controller' => 'check', 'action' => 'run', 'id' => $i + 1)), $class_name) . $class_name . '</a>';
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:10,代码来源:CheckController.php

示例11: actionButton

 /**
  * Output an action button.
  *
  * @param array $params  A list of parameters:
  *   - class: (string) The CSS classname to use for the link.
  *   - htmltitle: (string) The string to use for the HTML title attribute,
  *                if different than 'title'.
  *   - icon: (string) The icon CSS classname.
  *   - id: (string) The DOM ID of the link.
  *   - title: (string) The title string.
  *
  * @return string  An HTML link to $url.
  */
 public function actionButton(array $params = array())
 {
     $class = '';
     if (!empty($params['icon'])) {
         $class .= 'action' . $params['icon'];
     }
     if (!empty($params['class'])) {
         $class .= ' ' . $params['class'];
     }
     return Horde::link('', '', $class, '', '', isset($params['htmltitle']) ? $params['htmltitle'] : $params['title'], '', empty($params['id']) ? array() : array('id' => $params['id']), true) . $params['title'] . '</a>';
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:24,代码来源:Base.php

示例12: columnHeaders

 /**
  * Builds column header array out of the list of properties and default
  * attributes.
  */
 protected function columnHeaders($sortdir, $sortby)
 {
     $prefs_url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs/', true);
     $sortdirclass = $sortdir ? 'sortup' : 'sortdown';
     $baseurl = Horde::url('list.php');
     $column_headers = array(array('id' => 's' . Sesha::SORT_STOCKID, 'class' => $sortby == Sesha::SORT_STOCKID ? ' class="' . $sortdirclass . '"' : '', 'link' => Horde::link($baseurl->copy()->add('sortby', Sesha::SORT_STOCKID), _("Sort by stock ID"), 'sortlink') . _("Stock ID") . '</a>', 'width' => ' width="5%"'), array('id' => 's' . Sesha::SORT_NAME, 'class' => $sortby == Sesha::SORT_NAME ? ' class="' . $sortdirclass . '"' : '', 'link' => Horde::link($baseurl->copy()->add('sortby', Sesha::SORT_NAME), _("Sort by item name"), 'sortlink') . _("Item Name") . '</a>', 'width' => ''));
     foreach ($this->shownProperties as $property) {
         $column_headers[] = array('id' => 'sp' . $property->property_id, 'class' => $sortby == 'p' . $property->property_id ? ' class="' . $sortdirclass . '"' : '', 'link' => Horde::link($baseurl->copy()->add('sortby', 'p' . $property->property_id), sprintf(_("Sort by %s"), htmlspecialchars($property->property)), 'sortlink') . htmlspecialchars($property->property) . '</a>', 'width' => '');
     }
     $column_headers[] = array('id' => 's' . Sesha::SORT_NOTE, 'class' => $sortby == Sesha::SORT_NOTE ? ' class="' . $sortdirclass . '"' : '', 'link' => Horde::link($baseurl->copy()->add('sortby', Sesha::SORT_NOTE), _("Sort by note"), 'sortlink') . _("Note") . '</a>', 'width' => '');
     return $column_headers;
 }
开发者ID:horde,项目名称:horde,代码行数:16,代码来源:List.php

示例13: _title

 /**
  */
 protected function _title()
 {
     try {
         $channel = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannel($this->_params['source']);
     } catch (Exception $e) {
         return htmlspecialchars($e->getMessage());
     }
     if (!empty($channel['channel_link'])) {
         $title = Horde::link(htmlspecialchars($channel['channel_link']), '', '', '_blank') . htmlspecialchars($channel['channel_name']) . _(" - Most read stories") . '</a>';
     } else {
         $title = htmlspecialchars($channel['channel_name']) . _(" - Most read stories");
     }
     return $title;
 }
开发者ID:horde,项目名称:horde,代码行数:16,代码来源:NewsPopular.php

示例14: _content

 /**
  * The content to go in this block.
  *
  * @return string   The content
  */
 function _content()
 {
     require_once __DIR__ . '/../base.php';
     global $prefs, $klutz, $klutz_driver;
     $showall = $prefs->getValue('summ_showall');
     $date = time();
     // Get the list of comics to display.
     $comics = explode("\t", $prefs->getValue('viewcomics'));
     if (count($comics) == 1 && empty($comics[0])) {
         $comics = null;
     }
     $comicstoday = $klutz->listEnabled($comics, $date);
     if ($showall) {
         $summary = '';
         foreach ($comicstoday as $index) {
             $name = $klutz->getProperty($index, 'name');
             $author = $klutz->getProperty($index, 'author');
             if ($klutz_driver->imageExists($index, $date)) {
                 $size = $klutz_driver->imageSize($index, $date);
                 $url = Horde::url('comics.php')->add(array('date' => $date, 'index' => $index));
                 $img = Horde::img($url->copy()->add('actionID', 'image'), sprintf("%s by %s", $name, $author), $size, '');
                 $link = Horde::link($url->copy()->add('actionID', 'comic'), sprintf("%s by %s", $name, $author));
                 $summary .= '<p>' . $link . $img . '</a></p>';
             }
         }
     } else {
         $this->updateable = true;
         // Pick a comic from the list and make sure it exists.
         do {
             // Make sure we actually have some comics to choose
             // from.
             if (!count($comicstoday)) {
                 return _("Could not find any comics to display.");
             }
             // Pick a comic by random and remove it from the list.
             $i = rand(0, count($comicstoday) - 1);
             $tmp = array_splice($comicstoday, $i, 1);
             $index = array_shift($tmp);
         } while ($klutz_driver->imageExists($index, $date) === false);
         $name = $klutz->getProperty($index, 'name');
         $author = $klutz->getProperty($index, 'author');
         $size = $klutz_driver->imageSize($index, $date);
         $url = Horde::url('comics.php')->add(array('date' => $date, 'index' => $index));
         $img = Horde::img($url->copy()->add('actionID', 'image'), sprintf("%s by %s", $name, $author), $size, '');
         $link = Horde::link($url->copy()->add('actionID', 'comic'), sprintf("%s by %s", $name, $author));
         $summary = '<p class="text">' . $link . $name . ' by ' . $author . '</a></p>' . '<p>' . $link . $img . '</a></p>';
     }
     return $summary;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:54,代码来源:Comics.php

示例15: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $browser, $injector, $page_output, $prefs;
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $p_css = new Horde_Themes_Element('prefs.css');
     $page_output->addStylesheet($p_css->fs, $p_css->uri);
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Help');
     if (!Horde::isConnectionSecure()) {
         $view->notsecure = true;
         return $view->render('smimeprivatekey');
     }
     $smime_url = IMP_Basic_Smime::url();
     $view->has_key = $prefs->getValue('smime_public_key') && $prefs->getValue('smime_private_key');
     $view->has_sign_key = $prefs->getValue('smime_public_sign_key') && $prefs->getValue('smime_private_sign_key');
     if ($browser->allowFileUploads()) {
         $view->import = true;
         $page_output->addInlineScript(array('$("import_smime_personal").observe("click", function(e) { ' . Horde::popupJs($smime_url, array('params' => array('actionID' => 'import_personal_certs', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 450, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
     }
     if (!$view->has_key) {
         return $view->render('smimeprivatekey');
     }
     $smime = $injector->getInstance('IMP_Smime');
     foreach (array('' => false, '_sign' => true) as $suffix => $secondary) {
         if ($secondary && !$view->has_sign_key) {
             continue;
         }
         $cert = $smime->parseCert($smime->getPersonalPublicKey($secondary));
         if (!empty($cert['validity']['notafter'])) {
             $expired = new Horde_Date($cert['validity']['notafter']);
             if ($expired->before(time())) {
                 $view->{'expiredate' . $suffix} = $expired->strftime($prefs->getValue('date_format'));
                 $view->{'expiretime' . $suffix} = $expired->strftime($prefs->getValue('time_format'));
             }
         }
         $view->{'viewpublic' . $suffix} = $smime_url->copy()->add('actionID', 'view_personal_public' . $suffix . '_key')->link(array('title' => $secondary ? _("View Secondary Personal Public Certificate") : _("View Personal Public Certificate"), 'target' => 'view_key')) . _("View") . '</a>';
         $view->{'infopublic' . $suffix} = $smime_url->copy()->add('actionID', 'info_personal_public' . $suffix . '_key')->link(array('title' => _("Information on Personal Public Certificate"), 'target' => 'info_key')) . _("Details") . '</a>';
         if ($smime->getPassphrase($secondary)) {
             $view->{'passphrase' . $suffix} = $ui->selfUrl(array('special' => true, 'token' => true))->add('unset_smime' . $suffix . '_passphrase', 1)->link(array('title' => _("Unload Passphrase"))) . _("Unload Passphrase") . '</a>';
         } else {
             $imple = $injector->getInstance('Horde_Core_Factory_Imple')->create('IMP_Ajax_Imple_PassphraseDialog', array('params' => array('reload' => $ui->selfUrl()->setRaw(true), 'secondary' => intval($secondary)), 'type' => 'smimePersonal'));
             $view->{'passphrase' . $suffix} = Horde::link('#', _("Enter Passphrase"), null, null, null, null, null, array('id' => $imple->getDomId())) . _("Enter Passphrase");
         }
         $view->{'viewprivate' . $suffix} = $smime_url->copy()->add('actionID', 'view_personal_private' . $suffix . '_key')->link(array('title' => _("View Secondary Personal Private Key"), 'target' => 'view_key')) . _("View") . '</a>';
         $page_output->addInlineScript(array('$("delete_smime_personal' . $suffix . '").observe("click", function(e) { if (!window.confirm(' . json_encode(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")) . ')) { e.stop(); } })'), true);
     }
     return $view->render('smimeprivatekey');
 }
开发者ID:horde,项目名称:horde,代码行数:50,代码来源:SmimePrivateKey.php


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