本文整理汇总了PHP中Horde::widget方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde::widget方法的具体用法?PHP Horde::widget怎么用?PHP Horde::widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde
的用法示例。
在下文中一共展示了Horde::widget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _
$sortby = $prefs->getValue('sortby');
$sortdir = $prefs->getValue('sortdir');
$baseurl = Horde::url('list.php');
if ($actionID == 'search_memos') {
$baseurl->add(array('actionID' => 'search_memos', 'search_pattern' => $search_pattern, 'search_type' => $search_type));
}
$page_output->addInlineJsVars(array('Mnemo_List.ajaxUrl' => $registry->getServiceLink('ajax', 'mnemo')->url . 'setPrefValue'));
$view->editImg = Horde::img('edit.png', _("Edit Note"), '');
$view->showNotepad = $prefs->getValue('show_notepad');
$view->sortdirclass = $sortdir ? 'sortup' : 'sortdown';
$view->headers = array();
if ($view->showNotepad) {
$view->headers[] = array('id' => 's' . Mnemo::SORT_NOTEPAD, 'sorted' => $sortby == Mnemo::SORT_NOTEPAD, 'width' => '2%', 'label' => Horde::widget(array('url' => $baseurl->add('sortby', Mnemo::SORT_NOTEPAD), 'class' => 'sortlink', 'title' => _("Notepad"))));
}
$view->headers[] = array('id' => 's' . MNEMO::SORT_DESC, 'sorted' => $sortby == MNEMO::SORT_DESC, 'width' => '80%', 'label' => Horde::widget(array('url' => $baseurl->add('sortby', Mnemo::SORT_DESC), 'class' => 'sortlink', 'title' => _("No_te"))));
$view->headers[] = array('id' => 's' . MNEMO::SORT_MOD_DATE, 'sorted' => $sortby == Mnemo::SORT_MOD_DATE, 'width' => '2%', 'label' => Horde::widget(array('url' => $baseurl->add('sortby', MNEMO::SORT_MOD_DATE), 'class' => 'sortlink', 'title' => _("Date"))));
foreach ($memos as $memo_id => &$memo) {
try {
$share = $mnemo_shares->getShare($memo['memolist_id']);
} catch (Horde_Share_Exception $e) {
$notification->push($e);
continue;
}
if ($view->showNotepad) {
$memo['notepad'] = Mnemo::getLabel($share);
}
if ($share->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$label = sprintf(_("Edit \"%s\""), $memo['desc']);
$memo['edit'] = Horde::url('memo.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id'], 'actionID' => 'modify_memo'))->link(array('title' => $label)) . Horde::img('edit.png', $label, '') . '</a>';
}
$memo['link'] = Horde::linkTooltip(Horde::url('view.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id'])), '', '', '', '', $memo['body'] != $memo['desc'] ? Mnemo::getNotePreview($memo) : '') . (strlen($memo['desc']) ? htmlspecialchars($memo['desc']) : '<em>' . _("Empty Note") . '</em>') . '</a>';
示例2: _init
//.........这里部分代码省略.........
}
if ($mailbox->access_search) {
if (!$search_mbox) {
$hdr_view->search_url = $mailbox->url(IMP_Basic_Searchbasic::url());
} else {
if ($mailbox->editvfolder) {
$edit_search = _("Edit Virtual Folder");
} elseif ($mailbox->query) {
if ($mailbox->editquery) {
$edit_search = _("Edit Search Query");
} else {
/* Basic search results. */
$search_mailbox = IMP_Mailbox::get($imp_search[$mailbox]->mboxes[0]);
$hdr_view->search_url = $search_mailbox->url(IMP_Basic_Searchbasic::url());
$hdr_view->searchclose = $search_mailbox->url('mailbox');
}
}
if (isset($edit_search)) {
$hdr_view->edit_search_url = $imp_search->editUrl($mailbox);
$hdr_view->edit_search_title = $edit_search;
}
}
}
if ($mailbox->access_empty) {
$hdr_view->empty = $mailbox_imp_url->copy()->add(array('actionID' => 'empty_mailbox', 'token' => $token));
}
$this->output = $hdr_view->render('header');
/* If no messages, exit immediately. */
if (empty($pageOb['end'])) {
if ($pageOb['anymsg'] && isset($deleted_prompt)) {
/* Show 'Show Deleted' prompt if mailbox has no viewable
* message but has hidden, deleted messages. */
$del_view = clone $view;
$del_view->hide = Horde::widget(array('url' => $refresh_url->copy()->add(array('actionID' => 'hide_deleted', 'token' => $token)), 'class' => 'hideAction', 'title' => $deleted_prompt));
if ($mailbox->access_expunge) {
$del_view->purge = Horde::widget(array('url' => $refresh_url->copy()->add(array('actionID' => 'expunge_mailbox', 'token' => $token)), 'class' => 'purgeAction', 'title' => _("Pur_ge Deleted")));
}
$this->output .= $del_view->render('actions_deleted');
}
$empty_view = clone $view;
$empty_view->search_mbox = $search_mbox;
$this->output .= $empty_view->render('empty_mailbox');
return;
}
$clink_ob = new IMP_Compose_Link();
$clink = $clink_ob->link();
/* Display the navbar and actions if there is at least 1 message in
* mailbox. */
if ($pageOb['msgcount']) {
/* Prepare the navbar template. */
$n_view = clone $view;
$n_view->id = 1;
$n_view->readonly = $readonly;
$filtermsg = false;
if ($mailbox->access_flags) {
$args = array('imap' => true, 'mailbox' => $search_mbox ? null : $mailbox);
$form_set = $form_unset = array();
foreach ($imp_flags->getList($args) as $val) {
if ($val->canset) {
$form_set[] = array('f' => $val->form_set, 'l' => $val->label, 'v' => IMP_Mailbox::formTo(self::FLAG_FILTER_PREFIX . $val->form_set));
$form_unset[] = array('f' => $val->form_unset, 'l' => $val->label, 'v' => IMP_Mailbox::formTo(self::FLAG_FILTER_PREFIX . $val->form_unset));
}
}
$n_view->flaglist_set = $form_set;
$n_view->flaglist_unset = $form_unset;
if (!$search_mbox && $mailbox->access_search) {
示例3: displayContents
/**
* @throws Wicked_Exception
*/
public function displayContents($isBlock)
{
$view = $GLOBALS['injector']->createInstance('Horde_View');
$view->addHelper('Wicked_View_Helper_Navigation');
$view->name = $this->pageName();
$view->text = $this->getProcessor()->transform($this->getText());
if ($isBlock) {
return $view->render('display/standard');
}
$view->showTools = true;
if ($this->allows(Wicked::MODE_EDIT) && !$this->isLocked(Wicked::lockUser())) {
$view->edit = Horde::widget(array('url' => Wicked::url('EditPage')->add('referrer', $this->pageName()), 'title' => _("_Edit"), 'class' => 'wicked-edit'));
}
if ($this->isLocked()) {
if ($this->allows(Wicked::MODE_UNLOCKING)) {
$view->unlock = Horde::widget(array('url' => $this->pageUrl(null, 'unlock')->remove('version'), 'title' => _("Un_lock"), 'class' => 'wicked-unlock'));
}
} else {
if ($this->allows(Wicked::MODE_LOCKING)) {
$view->lock = Horde::widget(array('url' => $this->pageUrl(null, 'lock')->remove('version'), 'title' => _("_Lock"), 'class' => 'wicked-lock'));
}
}
if ($this->allows(Wicked::MODE_REMOVE)) {
$params = array('referrer' => $this->pageName());
if ($this->isOld()) {
$params['version'] = $this->version();
}
$view->remove = Horde::widget(array('url' => Wicked::url('DeletePage')->add($params), 'title' => _("_Delete"), 'class' => 'wicked-delete'));
}
if ($this->allows(Wicked::MODE_REMOVE) && !$this->isLocked(Wicked::lockUser())) {
$view->rename = Horde::widget(array('url' => Wicked::url('MergeOrRename')->add('referrer', $this->pageName()), 'title' => _("_Merge/Rename")));
}
$view->backLinks = Horde::widget(array('url' => Wicked::url('BackLinks')->add('referrer', $this->pageName()), 'title' => _("_Backlinks")));
$view->likePages = Horde::widget(array('url' => Wicked::url('LikePages')->add('referrer', $this->pageName()), 'title' => _("S_imilar Pages")));
$view->attachedFiles = Horde::widget(array('url' => Wicked::url('AttachedFiles')->add('referrer', $this->pageName()), 'title' => _("Attachments")));
if ($this->allows(Wicked::MODE_HISTORY)) {
$view->changes = Horde::widget(array('url' => $this->pageUrl('history.php')->remove('version'), 'title' => _("Hi_story")));
}
if ($GLOBALS['registry']->isAdmin()) {
$permsurl = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/admin/perms/edit.php')->add(array('category' => 'wicked:pages:' . $this->pageId(), 'autocreate' => 1, 'autocreate_copy' => 'wicked', 'autocreate_guest' => Horde_Perms::SHOW | Horde_Perms::READ, 'autocreate_default' => Horde_Perms::SHOW | Horde_Perms::READ | Horde_Perms::EDIT | Horde_Perms::DELETE));
$view->perms = Horde::widget(array('url' => $permsurl, 'target' => '_blank', 'title' => _("Permissio_ns")));
}
if ($histories = $GLOBALS['session']->get('wicked', 'history')) {
$view->history = Horde::widget(array('url' => '#', 'onclick' => 'document.location = document.display.history[document.display.history.selectedIndex].value;', 'title' => _("Ba_ck to")));
$view->histories = array();
foreach ($histories as $history) {
if (!strlen($history)) {
continue;
}
$view->histories[(string) Wicked::url($history)] = $history;
}
}
$pageId = $GLOBALS['wicked']->getPageId($this->pageName());
$attachments = $GLOBALS['wicked']->getAttachedFiles($pageId);
if (count($attachments)) {
$view->attachments = array();
foreach ($attachments as $attachment) {
$url = $GLOBALS['registry']->downloadUrl($attachment['attachment_name'], array('page' => $this->pageName(), 'file' => $attachment['attachment_name'], 'version' => $attachment['attachment_version']));
$icon = $GLOBALS['injector']->getInstance('Horde_Core_Factory_MimeViewer')->getIcon(Horde_Mime_Magic::filenameToMime($attachment['attachment_name']));
$view->attachments[] = Horde::link($url) . '<img src="' . $icon . '" width="16" height="16" alt="" /> ' . htmlspecialchars($attachment['attachment_name']) . '</a>';
}
}
$view->downloadPlain = Wicked::url($this->pageName())->add(array('actionID' => 'export', 'format' => 'plain'))->link() . _("Plain Text") . '</a>';
$view->downloadHtml = Wicked::url($this->pageName())->add(array('actionID' => 'export', 'format' => 'html'))->link() . _("HTML") . '</a>';
$view->downloadLatex = Wicked::url($this->pageName())->add(array('actionID' => 'export', 'format' => 'tex'))->link() . _("Latex") . '</a>';
$view->downloadRest = Wicked::url($this->pageName())->add(array('actionID' => 'export', 'format' => 'rst'))->link() . _("reStructuredText") . '</a>';
return $view->render('display/standard');
}
示例4: _init
//.........这里部分代码省略.........
$h_page_label = htmlspecialchars($page_label);
$header_label = $h_page_label;
if ($mailbox->search) {
$header_label .= ' [' . $msg_index['m']->url('mailbox')->link() . $msg_index['m']->display_html . '</a>]';
}
/* Prepare the navbar top template. */
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/basic/message'));
$view->addHelper('FormTag');
$view->addHelper('Tag');
$t_view = clone $view;
$t_view->buid = $buid;
$t_view->message_url = $message_url;
$t_view->mailbox = $mailbox->form_to;
$t_view->start = $msgindex;
$t_view->token = $token;
/* Prepare the navbar navigate template. */
$n_view = clone $view;
$n_view->readonly = $readonly;
$n_view->id = 1;
if ($mailbox->access_flags) {
$n_view->mailbox = $mailbox->form_to;
$args = array('imap' => true, 'mailbox' => $mailbox);
$form_set = $form_unset = array();
foreach ($imp_flags->getList($args) as $val) {
if ($val->canset) {
$form_set[] = array('f' => $val->form_set, 'l' => $val->label);
$form_unset[] = array('f' => $val->form_unset, 'l' => $val->label);
}
}
$n_view->flaglist_set = $form_set;
$n_view->flaglist_unset = $form_unset;
}
if ($imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
$n_view->move = Horde::widget(array('url' => '#', 'class' => 'moveAction', 'title' => _("Move"), 'nocheck' => true));
$n_view->copy = Horde::widget(array('url' => '#', 'class' => 'copyAction', 'title' => _("Copy"), 'nocheck' => true));
$iterator = new IMP_Ftree_IteratorFilter($injector->getInstance('IMP_Ftree'));
$iterator->add($iterator::NONIMAP);
$n_view->options = new IMP_Ftree_Select(array('heading' => _("This message to"), 'inc_tasklists' => true, 'inc_notepads' => true, 'iterator' => $iterator, 'new_mbox' => true));
}
$n_view->back_to = Horde::widget(array('url' => $mailbox_url, 'title' => sprintf(_("Bac_k to %s"), $h_page_label), 'nocheck' => true));
if ($prev_url) {
$n_view->prev = Horde::link($prev_url, _("Previous Message"));
$n_view->prev_img = 'navleftImg';
} else {
$n_view->prev_img = 'navleftgreyImg';
}
if ($next_url) {
$n_view->next = Horde::link($next_url, _("Next Message"));
$n_view->next_img = 'navrightImg';
} else {
$n_view->next_img = 'navrightgreyImg';
}
/* Prepare the navbar actions template. */
$a_view = clone $view;
$compose_params = array('buid' => $buid, 'identity' => $identity, 'mailbox' => IMP_Mailbox::formTo($mailbox));
if (!$prefs->getValue('compose_popup')) {
$compose_params['start'] = $msgindex;
}
if ($msg_index['m']->access_deletemsgs) {
if (in_array(Horde_Imap_Client::FLAG_DELETED, $flags)) {
$a_view->delete = Horde::widget(array('url' => $self_link->copy()->add('actionID', 'undelete_message'), 'title' => _("Undelete"), 'nocheck' => true));
} else {
$a_view->delete = Horde::widget(array('url' => $self_link->copy()->add('actionID', 'delete_message'), 'title' => _("_Delete"), 'nocheck' => true));
if (!$msg_index['m']->is_imap) {
$js_vars['ImpMessage.pop3delete'] = _("Are you sure you want to PERMANENTLY delete these messages?");
}
示例5: tabs
/**
* @param object $renderer A Kronolith view.
*/
public static function tabs($renderer)
{
global $injector, $prefs;
$view = $injector->createInstance('Horde_View');
$date = self::currentDate();
$date_stamp = array('date' => $date->dateString());
$tabname = basename($_SERVER['PHP_SELF']) == 'index.php' ? $GLOBALS['prefs']->getValue('defaultview') : str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$view->active = $tabname;
$view->previous = $renderer->link(-1);
$view->next = $renderer->link(1);
switch ($tabname) {
case 'day':
$view->current = $renderer->getTime($prefs->getValue('date_format'));
break;
case 'workweek':
case 'week':
$view->current = $renderer->days[$renderer->startDay]->getTime($prefs->getValue('date_format')) . ' - ' . $renderer->days[$renderer->endDay]->getTime($prefs->getValue('date_format'));
break;
case 'month':
$view->current = $renderer->date->strftime('%B %Y');
break;
case 'year':
$view->current = $renderer->year;
break;
}
$view->today = Horde::url($prefs->getValue('defaultview') . '.php')->link(Horde::getAccessKeyAndTitle(_("_Today"), false, true)) . _("Today") . '</a>';
$view->day = Horde::widget(array('url' => Horde::url('day.php')->add($date_stamp), 'id' => 'kronolithNavDay', 'accesskey' => '1', 'title' => _("Day")));
$view->workWeek = Horde::widget(array('url' => Horde::url('workweek.php')->add($date_stamp), 'id' => 'kronolithNavWorkweek', 'accesskey' => '2', 'title' => _("Work Week")));
$view->week = Horde::widget(array('url' => Horde::url('week.php')->add($date_stamp), 'id' => 'kronolithNavWeek', 'accesskey' => '3', 'title' => _("Week")));
$view->month = Horde::widget(array('url' => Horde::url('month.php')->add($date_stamp), 'id' => 'kronolithNavMonth', 'accesskey' => '4', 'title' => _("Month")));
$view->year = Horde::widget(array('url' => Horde::url('year.php')->add($date_stamp), 'id' => 'kronolithNavYear', 'accesskey' => '5', 'title' => _("Year")));
echo $view->render('buttonbar');
}
示例6: _popupSuccess
/**
* Generate a popup success window.
*/
protected function _popupSuccess()
{
global $page_output;
$page_output->topbar = $page_output->sidebar = false;
$page_output->addInlineScript(array('$("close_success").observe("click", function() { window.close(); })'), true);
$this->title = _("Message Successfully Sent");
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/basic/compose'));
$view->close = Horde::widget(array('id' => 'close_success', 'url' => new Horde_Url('#'), 'title' => _("Close this window")));
$view->new = Horde::widget(array('url' => self::url(), 'title' => _("New Message")));
$this->output = $view->render('success');
}
示例7: render
/**
* Renders the view.
*
* @param Horde_PageOutput $output The output object.
*
* @return string The HTML needed to render the view.
*/
public function render(Horde_PageOutput $output)
{
global $prefs, $injector, $registry, $mnemo_shares;
$output->addScriptFile('tables.js', 'horde');
$output->addScriptFile('quickfinder.js', 'horde');
$output->addScriptFile('list.js');
$output->header(array('title' => $this->_title));
$view = $injector->createInstance('Horde_View');
$view->count = count($this->_notes);
$view->searchImg = Horde::img('search.png', _("Search"), '');
$view->searchUrl = Horde::url('search.php');
$view->title = $this->_title;
$view->browser = $this->_showTagBrowser ? $this->_getRelatedTags() . $this->_getTagTrail() : '';
if (count($this->_notes)) {
$sortby = $prefs->getValue('sortby');
$sortdir = $prefs->getValue('sortdir');
$output->addInlineJsVars(array('Mnemo_List.ajaxUrl' => $registry->getServiceLink('ajax', 'mnemo')->url . 'setPrefValue'));
$view->editImg = Horde::img('edit.png', _("Edit Note"), '');
$view->showNotepad = $prefs->getValue('show_notepad');
$view->sortdirclass = $sortdir ? 'sortup' : 'sortdown';
$view->headers = array();
if ($view->showNotepad) {
$view->headers[] = array('id' => 's' . Mnemo::SORT_NOTEPAD, 'sorted' => $sortby == Mnemo::SORT_NOTEPAD, 'width' => '2%', 'label' => Horde::widget(array('url' => $this->_baseurl->add('sortby', Mnemo::SORT_NOTEPAD), 'class' => 'sortlink', 'title' => _("Notepad"))));
}
$view->headers[] = array('id' => 's' . MNEMO::SORT_DESC, 'sorted' => $sortby == MNEMO::SORT_DESC, 'width' => '80%', 'label' => Horde::widget(array('url' => $this->_baseurl->add('sortby', Mnemo::SORT_DESC), 'class' => 'sortlink', 'title' => _("No_te"))));
$view->headers[] = array('id' => 's' . MNEMO::SORT_MOD_DATE, 'sorted' => $sortby == Mnemo::SORT_MOD_DATE, 'width' => '2%', 'label' => Horde::widget(array('url' => $this->_baseurl->add('sortby', MNEMO::SORT_MOD_DATE), 'class' => 'sortlink', 'title' => _("Date"))));
foreach ($this->_notes as $memo_id => &$memo) {
try {
$share = $mnemo_shares->getShare($memo['memolist_id']);
} catch (Horde_Share_Exception $e) {
$notification->push($e);
continue;
}
if ($view->showNotepad) {
$memo['notepad'] = Mnemo::getLabel($share);
}
if ($share->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$label = sprintf(_("Edit \"%s\""), $memo['desc']);
$memo['edit'] = Horde::url('memo.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id'], 'actionID' => 'modify_memo'))->link(array('title' => $label)) . Horde::img('edit.png', $label, '') . '</a>';
}
$memo['link'] = Horde::linkTooltip(Horde::url('view.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id'])), '', '', '', '', $memo['body'] != $memo['desc'] ? Mnemo::getNotePreview($memo) : '') . (strlen($memo['desc']) ? htmlspecialchars($memo['desc']) : '<em>' . _("Empty Note") . '</em>') . '</a>';
// Get memo's most recent modification date or, if nonexistent,
// the creation (add) date
if (isset($memo['modified'])) {
$modified = $memo['modified'];
} elseif (isset($memo['created'])) {
$modified = $memo['created'];
} else {
$modified = null;
}
if ($modified) {
$memo['modifiedStamp'] = $modified->timestamp();
$memo['modifiedString'] = $modified->strftime($prefs->getValue('date_format'));
} else {
$memo['modifiedStamp'] = $memo['modifiedString'] = '';
}
}
}
Horde::startBuffer();
echo $view->render('list/header');
if (count($this->_notes)) {
echo $view->render('list/memo_headers');
echo $view->renderPartial('list/summary', array('collection' => array_values($this->_notes)));
echo $view->render('list/memo_footers');
} else {
echo $view->render('list/empty');
}
$output->footer();
return Horde::endBuffer();
}
示例8: _
<div class="horde-buttonbar">
<ul>
<?php
if (class_exists('Horde_Pdf_Writer')) {
?>
<li class="horde-icon"><?php
echo Horde::widget(array('url' => $this->pdfurl, 'title' => _("Save as PDF"), 'class' => 'mnemo-pdf'));
?>
</li>
<?php
}
if ($this->edit) {
?>
<li class="horde-icon"><?php
echo $this->edit;
?>
</li>
<?php
}
if ($this->delete) {
?>
<li class="horde-icon"><?php
echo $this->delete;
?>
</li>
<?php
}
?>
</ul>
</div>
示例9: _init
//.........这里部分代码省略.........
} elseif ($this->vars->actionID == 'empty_mbox_confirm') {
$v->actionID = 'empty_mbox';
$v->empty = true;
}
$v->mboxes = $loop;
$v->folders_url = $folders_url;
$this->output = $v->render('folders_confirm');
return;
}
break;
case 'mbox_size':
if (!empty($mbox_list)) {
$loop = array();
$sum = 0;
foreach ($mbox_list as $val) {
$size = $val->size;
$data = array('name' => $val->display, 'size' => sprintf(_("%.2fMB"), $size / (1024 * 1024)), 'sort' => $size);
$sum += $size;
$loop[] = $data;
}
/* Prepare the topbar. */
$injector->getInstance('Horde_View_Topbar')->subinfo = $injector->getInstance('IMP_View_Subinfo')->render();
$v = clone $view;
$v->folders_url = $folders_url;
$v->mboxes = $loop;
$v->mboxes_sum = sprintf(_("%.2fMB"), $sum / (1024 * 1024));
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->addScriptFile('tables.js', 'horde');
$this->title = _("Mailbox Sizes");
$this->output = $v->render('folders_size');
return;
}
break;
case 'search':
if (!empty($mbox_list)) {
IMP_Basic_Search::url()->add(array('mailbox_list' => IMP_Mailbox::formTo($mbox_list), 'subfolder' => 1))->redirect();
}
break;
}
$this->title = _("Folder Navigator");
$folders_url->add('token', $token);
/* Prepare the topbar. */
$injector->getInstance('Horde_View_Topbar')->subinfo = $injector->getInstance('IMP_View_Subinfo')->render();
if ($session->get('imp', 'file_upload') && $this->vars->actionID == 'import_mbox') {
/* Prepare import template. */
$v = clone $view;
$v->folders_url = $folders_url;
$v->import_mbox = $mbox_list[0];
$this->output = $v->render('import');
return;
}
/* Prepare the header template. */
$head_view = clone $view;
$head_view->folders_url = $folders_url;
/* Prepare the actions template. */
$actions = clone $view;
$actions->addHelper('Horde_Core_View_Helper_Accesskey');
$actions->addHelper('Horde_Core_View_Helper_Help');
$actions->id = 0;
$actions->refresh = Horde::widget(array('title' => _("_Refresh"), 'url' => $folders_url->copy()));
$actions->create_mbox = $imp_imap->access(IMP_Imap::ACCESS_CREATEMBOX) && $imp_imap->access(IMP_Imap::ACCESS_CREATEMBOX_MAX);
if ($prefs->getValue('subscribe')) {
$actions->subscribe = true;
$subToggleText = $showAll ? _("Hide Unsubscribed") : _("Show All");
$actions->toggle_subscribe = Horde::widget(array('url' => $folders_url->copy()->add(array('actionID' => 'toggle_subscribed_view', 'token' => $token)), 'title' => $subToggleText, 'nocheck' => true));
}
$actions->nav_poll = !$prefs->isLocked('nav_poll') && !$prefs->getValue('nav_poll_all');
$actions->notrash = !$prefs->getValue('use_trash');
$actions->file_upload = $session->get('imp', 'file_upload');
$actions->expand_all = Horde::widget(array('url' => $folders_url->copy()->add(array('actionID' => 'expand_all_folders', 'token' => $token)), 'title' => _("Expand All"), 'nocheck' => true));
$actions->collapse_all = Horde::widget(array('url' => $folders_url->copy()->add(array('actionID' => 'collapse_all_folders', 'token' => $token)), 'title' => _("Collapse All"), 'nocheck' => true));
/* Build the folder tree. */
$iterator = new IMP_Ftree_IteratorFilter($ftree);
$iterator->add(array($iterator::REMOTE, $iterator::VFOLDER));
if ($showAll) {
$ftree->loadUnsubscribed();
$iterator->remove($iterator::UNSUB);
}
$tree = $ftree->createTree('imp_folders', array('checkbox' => true, 'editvfolder' => true, 'iterator' => $iterator, 'poll_info' => true));
$displayNames = $fullNames = array();
foreach ($ftree as $val) {
$mbox_ob = $val->mbox_ob;
$tmp = $displayNames[] = $mbox_ob->display;
$tmp2 = $mbox_ob->display_notranslate;
if ($tmp != $tmp2) {
$fullNames[strval($val)] = $tmp2;
}
}
$page_output->addInlineJsVars(array('ImpFolders.ajax' => $registry->getServiceLink('ajax', 'imp')->url, 'ImpFolders.displayNames' => $displayNames, 'ImpFolders.fullNames' => $fullNames, '-ImpFolders.mbox_expand' => intval($prefs->getValue('nav_expanded') == 2)));
$page_output->metaRefresh($refresh_time, $this->url());
Horde::startBuffer();
$tree->renderTree();
$this->output = $head_view->render('head') . $actions->render('actions') . Horde::endBuffer();
if (count($tree) > 10) {
$actions->id = 1;
$this->output .= $actions->render('actions');
}
/* No need for extra template - close out the tags here. */
$this->output .= '</form>';
}
示例10: generateUI
//.........这里部分代码省略.........
break;
case 'number':
$t->set('val', htmlspecialchars(intval($prefs->getValue($pref))));
break;
case 'password':
case 'text':
case 'textarea':
$t->set('val', htmlspecialchars($prefs->getValue($pref)));
break;
case 'rawhtml':
$t->set('html', $this->prefs[$pref]['value']);
break;
default:
throw new LogicException(sprintf('Missing or invalid type option for the %s preference.', $pref));
}
echo $t->fetch(HORDE_TEMPLATES . '/prefs/' . $type . '.html');
if (isset($this->_errors[$pref])) {
$t->set('error', htmlspecialchars($this->_errors[$pref]));
echo $t->fetch(HORDE_TEMPLATES . '/prefs/error_end.html');
}
}
$t = clone $base;
$t->set('buttons', !$this->nobuttons);
$t->set('prefgroups', count($prefgroups) > 1);
echo $t->fetch($h_templates . '/prefs/end.html');
} elseif (!empty($columns)) {
$t = clone $base;
$span = round(100 / count($columns));
$cols = array();
foreach ($columns as $key => $column) {
$tmp = array('groups' => array(), 'hdr' => htmlspecialchars($key), 'width' => $span - 1);
foreach ($column as $group => $gvals) {
if ($this->groupIsEditable($group)) {
$tmp['groups'][] = array('desc' => htmlspecialchars($gvals['desc']), 'link' => Horde::widget(array('url' => $options_link->copy()->add(array('app' => $this->app, 'group' => $group)), 'title' => $gvals['label'])));
}
}
$cols[] = $tmp;
}
$t->set('columns', $cols);
echo $t->fetch($h_templates . '/prefs/overview.html');
}
$content = Horde::endBuffer();
/* Get the menu output before we start to output the page.
* Again, this will catch any javascript inserted into the page. */
$GLOBALS['page_output']->sidebar = false;
/* Get list of accessible applications. */
$apps = array();
foreach ($registry->listApps() as $app) {
// Make sure the app is installed and has a prefs file.
if (file_exists($registry->get('fileroot', $app) . '/config/prefs.php')) {
$apps[$app] = $registry->get('name', $app);
}
}
asort($apps);
/* Ouptut screen. */
$page_output->header(array('body_id' => 'services_prefs', 'title' => Horde_Core_Translation::t("User Preferences"), 'view' => $registry::VIEW_BASIC));
$notification->notify(array('listeners' => 'status'));
$base_ui = clone $base;
$base_ui->set('action', $options_link);
$base_ui->set('forminput', Horde_Util::formInput());
/* Show the current application and a form for switching
* applications. */
$t = clone $base_ui;
$t->set('horde', !empty($apps['horde']) && $this->app != 'horde');
unset($apps['horde'], $apps[$this->app]);
$tmp = array();
示例11: _
<h1 class="header"><?php
echo $this->header;
?>
</h1>
<div class="horde-buttonbar">
<ul>
<li class="horde-icon"><?php
echo Horde::widget(array('url' => Horde::url('delete.php'), 'title' => _("_Delete"), 'class' => 'skeleton-delete'));
?>
</li>
<li><?php
echo Horde::url('foo.php')->link() . _("Foo") . '</a>';
?>
</li>
</ul>
</div>
<table class="horde-table sortable">
<thead>
<tr>
<th width="10%"><?php
echo _("Column 1");
?>
</th>
<th class="horde-split-left"><?php
echo _("Column 2");
?>
</t4>
</tr>
</thead>
示例12: _
</li>
<?php
}
}
if ($this->perms_delete) {
?>
<li><?php
echo Horde::widget(array('url' => '#', 'title' => _("Delete"), 'id' => 'gollem-delete'));
?>
</li>
<?php
}
if ($this->perms_edit) {
?>
<li><?php
echo Horde::widget(array('url' => '#', 'title' => _("Rename"), 'id' => 'gollem-rename'));
?>
</li>
<?php
}
}
?>
</ul>
</div>
<?php
if ($this->empty_dir) {
?>
<p class="text">
<em><?php
echo _("There are no files in this folder.");
示例13: array
$view = $injector->createInstance('Horde_View');
$view->assign($memo);
try {
$view->body = Horde::callHook('format_description', array($body), 'mnemo', $body);
} catch (Horde_Exception_HookNotSet $e) {
$view->body = $body;
}
$view->id = $memo_id;
$view->listid = $memolist_id;
$view->passphrase = $show_passphrase;
$view->pdfurl = Horde::url('note/pdf.php')->add(array('note' => $memo_id, 'notepad' => $memolist_id));
$view->tags = implode(', ', $memo['tags']);
if ($share->hasPermission($registry->getAuth(), Horde_Perms::DELETE)) {
$view->delete = Horde::widget(array('url' => $url->add('actionID', 'delete_memos'), 'class' => 'mnemo-delete', 'id' => 'mnemo-delete', 'title' => _("_Delete")));
}
if ($share->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$view->edit = Horde::widget(array('url' => $url->add('actionID', 'modify_memo'), 'class' => 'mnemo-edit', 'title' => _("_Edit")));
}
if (isset($memo['created'])) {
$view->created = $memo['created']->strftime($prefs->getValue('date_format')) . ' ' . $memo['created']->format($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a');
}
if (isset($memo['modified'])) {
$view->modified = $memo['modified']->strftime($prefs->getValue('date_format')) . ' ' . $memo['modified']->format($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a');
}
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->addScriptFile('view.js');
$page_output->addInlineJsVars(array('Mnemo_View.confirm' => _("Really delete this note?")));
$page_output->header(array('title' => $memo ? $memo['desc'] : _("Note Details")));
$notification->notify();
echo $view->render('view/view');
$page_output->footer();
示例14: headerWidget
public function headerWidget($baseurl, $sortdir, $sortby, $by, $content)
{
return Horde::widget(array('url' => $baseurl->add(array('sortby' => $by, 'sortdir' => $sortby == $by ? 1 - $sortdir : $sortdir)), 'class' => 'sortlink', 'title' => $content)) . ' ';
}
示例15: linkViewJS
/**
* Generate a javascript link to the download/view page.
*
* @param Horde_Mime_Part $mime_part The MIME part to view.
* @param string $actionID The actionID to perform.
* @param string $text The ESCAPED (!) link text.
* @param array $options Additional options:
* - css: (string) The CSS class to use.
* - jstext: (string) The javascript link text.
* - onload: (string) A JS function to run when popup window is
* fully loaded.
* - params: (array) A list of any additional parameters that need to be
* passed to download/view page. (key = name)
* - widget: (boolean) If true use Horde::widget() to generate,
* Horde::link() otherwise.
*
* @return string A HTML href link to the download/view page.
*/
public function linkViewJS($mime_part, $actionID, $text, $options = array())
{
if (empty($options['params'])) {
$options['params'] = array();
}
if (empty($options['jstext'])) {
$options['jstext'] = ($description = $mime_part->getDescription(true)) ? sprintf(_("View %s"), $description) : null;
}
$url = Horde::popupJs(Horde::url('view.php'), array('menu' => true, 'onload' => empty($options['onload']) ? 'IMP_JS.resizePopup' : $options['onload'], 'params' => $this->_urlViewParams($mime_part, $actionID, isset($options['params']) ? $options['params'] : array()), 'urlencode' => true));
return empty($options['widget']) ? Horde::link('#', $options['jstext'], empty($options['css']) ? null : $options['css'], null, $url) . $text . '</a>' : Horde::widget(array('url' => '#', 'class' => empty($options['css']) ? null : $options['css'], 'onclick' => $url, 'title' => $text));
}