本文整理汇总了PHP中Horde_View::addHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_View::addHelper方法的具体用法?PHP Horde_View::addHelper怎么用?PHP Horde_View::addHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde_View
的用法示例。
在下文中一共展示了Horde_View::addHelper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
*/
public function __construct(Horde_Variables $vars)
{
global $notification, $page_output;
$this->vars = $vars;
$this->view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/smartmobile'));
$this->view->addHelper('Horde_Core_Smartmobile_View_Helper');
$this->view->addHelper('Text');
$this->_initPages();
$this->_addBaseVars();
$page_output->addScriptFile('smartmobile.js');
$page_output->addScriptFile('json2.js', 'horde');
$page_output->addScriptFile('jquery.mobile/plugins/listviewtaphold.js');
$page_output->addScriptFile('jquery.mobile/plugins/swipebutton.js', 'horde');
if (IMP_Compose::canCompose()) {
$page_output->addScriptFile('jquery.mobile/plugins/autocomplete.js', 'horde');
$page_output->addScriptFile('jquery.mobile/plugins/textchange.js');
if (IMP_Compose::canUploadAttachment()) {
$page_output->addScriptFile('jquery.mobile/plugins/form.js', 'horde');
}
}
$page_output->smartmobileInit = array_merge($page_output->smartmobileInit, array('$.mobile.buttonMarkup.hoverDelay = 80;', '$.mobile.defaultPageTransition = \'none\';', '$.event.special.tap.tapholdThreshold = 600;'));
$page_output->addStylesheet(new Horde_Themes_Element('mime.css'));
// Load full jQuery Mobile source.
//$page_output->debug = true;
$notification->notify(array('listeners' => 'status'));
}
示例2: display
/**
*/
public function display(Horde_Core_Prefs_Ui $ui)
{
global $injector, $page_output, $prefs;
if ($prefs->isLocked('remote')) {
return;
}
$ui->nobuttons = true;
$page_output->addScriptFile('external/base64.js');
$page_output->addScriptFile('prefs/remote.js');
$page_output->addInlineJsVars(array('ImpRemotePrefs.confirm_delete' => _("Are you sure you want to delete this account?"), 'ImpRemotePrefs.empty_email' => _("The e-mail field cannot be empty."), 'ImpRemotePrefs.empty_password' => _("The password field cannot be empty."), 'ImpRemotePrefs.next' => _("Next"), 'ImpRemotePrefs.wait' => _("Please wait...")));
$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_Image');
$view->addHelper('Text');
switch ($ui->vars->remote_action) {
case 'new':
$view->new = true;
break;
default:
$view->accounts = iterator_to_array($injector->getInstance('IMP_Remote'));
break;
}
return $view->render('remote');
}
示例3: 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');
}
示例4: display
/**
*/
public function display(Horde_Core_Prefs_Ui $ui)
{
global $injector, $page_output, $prefs;
$page_output->addScriptFile('prefs/folder.js');
$page_output->addInlineJsVars(array('ImpFolderPrefs.mboxes.trash' => _("Enter the name for your new trash mailbox.")));
$imp_search = $injector->getInstance('IMP_Search');
$trash = IMP_Mailbox::getPref(IMP_Mailbox::MBOX_TRASH);
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
$view->addHelper('FormTag');
$view->addHelper('Horde_Core_View_Helper_Label');
$view->addHelper('Tag');
$iterator = new IMP_Ftree_IteratorFilter($injector->getInstance('IMP_Ftree'));
$iterator->add(array($iterator::NONIMAP, $iterator::REMOTE));
$iterator->mboxes = array('INBOX');
$view->flist = new IMP_Ftree_Select(array('iterator' => $iterator, 'new_mbox' => true, 'selected' => $trash));
$view->nombox = IMP_Mailbox::formTo(self::PREF_NO_MBOX);
$view->special_use = $this->_getSpecialUse(Horde_Imap_Client::SPECIALUSE_TRASH);
if (!$prefs->isLocked('vfolder') || $imp_search['vtrash']->enabled) {
$view->vtrash = IMP_Mailbox::formTo($imp_search->createSearchId('vtrash'));
if ($trash) {
$view->vtrash_select = $trash->vtrash;
}
}
return $view->render('trash');
}
示例5: _init
/**
*/
protected function _init()
{
global $injector, $notification, $page_output;
$this->_assertCategory('Ingo_Rule_System_Whitelist', _("Whitelist"));
$ingo_storage = $injector->getInstance('Ingo_Factory_Storage')->create();
$whitelist = $ingo_storage->getSystemRule('Ingo_Rule_System_Whitelist');
/* Token checking & perform requested actions. */
switch ($this->_checkToken(array('rule_update'))) {
case 'rule_update':
try {
$whitelist->addresses = $this->vars->whitelist;
$ingo_storage->updateRule($whitelist);
$notification->push(_("Changes saved."), 'horde.success');
$injector->getInstance('Ingo_Factory_Script')->activateAll();
} catch (Ingo_Exception $e) {
$notification->push($e);
}
break;
}
/* Prepare the view. */
$view = new Horde_View(array('templatePath' => INGO_TEMPLATES . '/basic/whitelist'));
$view->addHelper('Horde_Core_View_Helper_Help');
$view->addHelper('Horde_Core_View_Helper_Label');
$view->addHelper('Text');
$view->disabled = $whitelist->disable;
$view->formurl = $this->_addToken(self::url());
$view->whitelist = implode("\n", $whitelist->addresses);
$page_output->addScriptFile('whitelist.js');
$page_output->addInlineJsVars(array('IngoWhitelist.filtersurl' => strval(Ingo_Basic_Filters::url()->setRaw(true))));
$this->title = _("Whitelist Edit");
$this->output = $view->render('whitelist');
}
示例6: __construct
/**
*/
public function __construct(Horde_Variables $vars)
{
$this->vars = $vars;
$this->indices = new IMP_Indices_Mailbox($vars);
$this->view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/minimal'));
$this->view->addHelper('Text');
$this->_init();
}
示例7: create
public function create(Horde_Injector $injector)
{
$registry = $injector->getInstance('Horde_Registry');
$view = new Horde_View(array('templatePath' => $registry->get('templates', $registry->getApp())));
$view->addHelper('Tag');
$view->addHelper('Text');
return $view;
}
示例8: _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');
}
示例9: _init
/**
* URL Parameters:
* - sa: (string) List of selected addresses.
* - search: (string) Search term (defaults to '' which lists everyone).
* - searched: (boolean) Indicates we have already searched at least
* once.
* - source: (string) The addressbook source to use.
* - to_only: (boolean) Are we limiting to only the 'To:' field?
*/
protected function _init()
{
global $injector, $page_output, $prefs, $registry;
/* Sanity checking. */
if (!$registry->hasMethod('contacts/search')) {
$e = new IMP_Exception('Addressbook not available on this system.');
$e->logged = true;
throw $e;
}
/* Get the lists of address books. */
$contacts = $injector->getInstance('IMP_Contacts');
$source_list = $contacts->source_list;
/* If we self-submitted, use that source. Otherwise, choose a good
* source. */
if (!isset($this->vars->source) || !isset($source_list[$this->vars->source])) {
reset($source_list);
$this->vars->source = key($source_list);
}
if ($this->vars->searched || $prefs->getValue('display_contact')) {
$a_list = iterator_to_array($contacts->searchEmail($this->vars->get('search', ''), array('sources' => array($this->vars->source))));
} else {
$a_list = array();
}
/* If self-submitted, preserve the currently selected users encoded by
* javascript to pass as value|text. */
$selected_addresses = array();
foreach (explode('|', $this->vars->sa) as $addr) {
if (strlen(trim($addr))) {
$selected_addresses[] = $addr;
}
}
/* Prepare the contacts view. */
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/contacts'));
$view->addHelper('FormTag');
$view->addHelper('Tag');
$view->a_list = $a_list;
$view->action = self::url();
$view->sa = $selected_addresses;
$view->search = $this->vars->search;
$view->to_only = intval($this->vars->to_only);
if (count($source_list) > 1) {
$s_list = array();
foreach ($source_list as $key => $select) {
$s_list[] = array('label' => $select, 'selected' => $key == $this->vars->source, 'val' => $key);
}
$view->source_list = $s_list;
} else {
$view->source_list = key($source_list);
}
/* Display the form. */
$page_output->addScriptFile('hordecore.js', 'horde');
$page_output->addScriptFile('contacts.js');
$page_output->addInlineJsVars(array('ImpContacts.text' => array('closed' => _("The message being composed has been closed."), 'select' => _("You must select an address first."))));
$page_output->topbar = $page_output->sidebar = false;
$this->header = _("Address Book");
$this->output = $view->render('contacts');
}
示例10: __construct
/**
*/
public function __construct(Horde_Variables $vars)
{
global $notification, $page_output;
$this->vars = $vars;
$this->view = new Horde_View(array('templatePath' => INGO_TEMPLATES . '/smartmobile'));
$this->view->addHelper('Horde_Core_Smartmobile_View_Helper');
$this->view->addHelper('Text');
$this->_initPages();
$this->_addBaseVars();
$page_output->addScriptFile('smartmobile.js');
$notification->notify(array('listeners' => 'status'));
}
示例11: _init
/**
* URL Parameters:
* - search: (string) Search term (defaults to '').
* - source: (string) The addressbook source to use.
* - to_only: (boolean) Are we limiting to only the 'To:' field?
*/
protected function _init()
{
global $injector, $page_output, $registry;
/* Sanity checking. */
if (!$registry->hasMethod('contacts/search')) {
$e = new IMP_Exception('Addressbook not available on this system.');
$e->logged = true;
throw $e;
}
/* Get the lists of address books. */
$contacts = $injector->getInstance('IMP_Contacts');
$source_list = $contacts->source_list;
/* Choose the correct source. */
if (!isset($this->vars->source) || !isset($source_list[$this->vars->source])) {
reset($source_list);
$this->vars->source = key($source_list);
}
/* Prepare the contacts view. */
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/contacts'));
$view->addHelper('FormTag');
$view->addHelper('Tag');
$view->search = $this->vars->search;
$view->to_only = intval($this->vars->to_only);
if (count($source_list) > 1) {
$s_list = array();
foreach ($source_list as $key => $select) {
$s_list[] = array('label' => $select, 'selected' => $key == $this->vars->source, 'val' => $key);
}
$view->source_list = $s_list;
} else {
$view->source_list = key($source_list);
}
/* Pre-populate address list if search text is provided. */
if (strlen($this->vars->search)) {
$initial = array_map('strval', iterator_to_array($contacts->searchEmail($this->vars->search, array('sources' => array($this->vars->source)))));
} else {
$initial = null;
}
/* Display the form. */
$page_output->addScriptFile('hordecore.js', 'horde');
$page_output->addScriptFile('form_ghost.js', 'horde');
$page_output->addScriptFile('contacts.js');
$page_output->addInlineJsVars(array_filter(array('ImpContacts.initial' => $initial, 'ImpContacts.text' => array('rcpt' => array('to' => _("To"), 'cc' => _("Cc"), 'bcc' => _("Bcc")), 'closed' => _("The message being composed has been closed."), 'no_contacts_selected' => _("No addresses were selected."), 'searching' => _("Searching..."), 'select' => _("You must select an address first.")))));
$c_css = new Horde_Themes_Element('contacts.css');
$page_output->addStylesheet($c_css->fs, $c_css->uri);
$page_output->topbar = $page_output->sidebar = false;
$this->header = _("Address Book");
$this->output = $view->render('contacts');
}
示例12: display
/**
*/
public function display(Horde_Core_Prefs_Ui $ui)
{
global $prefs;
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
$view->addHelper('FormTag');
$view->addHelper('Tag');
$view->addHelper('Text');
$newmail_audio = $view->newmail_audio = $prefs->getValue('newmail_audio');
$sounds = array();
foreach (Horde_Themes::soundList() as $key => $val) {
$sounds[] = array('c' => $newmail_audio == $key, 'l' => $key, 's' => $val->uri, 'v' => $key);
}
$view->sounds = $sounds;
return $view->render('newmailaudio');
}
示例13: _renderInfo
/**
* Return the rendered information about the Horde_Mime_Part object.
*
* URL parameters used by this function:
* - zip_contents: (integer) If set, show contents of ZIP file.
*
* @return array See Horde_Mime_Viewer_Driver::render().
*/
protected function _renderInfo()
{
global $injector;
$vars = $injector->getInstance('Horde_Variables');
if (!$this->getConfigParam('show_contents') && !$vars->zip_contents) {
$status = new IMP_Mime_Status($this->_mimepart, _("This is a compressed file."));
$status->addMimeAction('zipViewContents', _("Click to display the file contents."));
$status->icon('mime/compressed.png');
return array($this->_mimepart->getMimeId() => array('data' => '', 'status' => $status, 'type' => 'text/html; charset=UTF-8'));
}
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/mime'));
$view->addHelper('Text');
$view->downloadclass = 'zipdownload';
$view->files = array();
$view->tableclass = 'zipcontents';
$zlib = Horde_Util::extensionExists('zlib');
foreach ($this->_getZipInfo() as $key => $val) {
$file = new stdClass();
$file->name = $val['name'];
$file->size = IMP::sizeFormat($val['size']);
/* TODO: Add ability to render in-browser for filetypes we can
* handle. */
if (!empty($val['size']) && strstr($val['attr'], 'D') === false && ($zlib && $val['method'] == 0x8 || $val['method'] == 0x0)) {
$file->download = $this->getConfigParam('imp_contents')->linkView($this->_mimepart, 'download_render', '', array('class' => 'iconImg downloadAtc', 'jstext' => _("Download"), 'params' => array('zip_attachment' => $key)));
} else {
$file->download = '';
}
$view->files[] = $file;
}
return array($this->_mimepart->getMimeId() => array('data' => $view->render('compressed'), 'type' => 'text/html; charset=UTF-8'));
}
示例14: display
/**
*/
public function display(Horde_Core_Prefs_Ui $ui)
{
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
$view->addHelper('Text');
$view->safe_addrs = implode("\n", $this->safeAddrList()->bare_addresses);
return $view->render('imagereplacement');
}
示例15: _renderInfo
/**
* Return the rendered information about the Horde_Mime_Part object.
*
* URL parameters used by this function:
* - tgz_contents: (integer) If set, show contents of ZIP file.
*
* @return array See Horde_Mime_Viewer_Driver::render().
*/
protected function _renderInfo()
{
global $injector;
$vars = $injector->getInstance('Horde_Variables');
if (!$this->getConfigParam('show_contents') && !isset($vars->tgz_contents)) {
$status = new IMP_Mime_Status($this->_mimepart, _("This is a compressed file."));
$status->addMimeAction('tgzViewContents', _("Click to display the file contents."));
$status->icon('mime/compressed.png');
return array($this->_mimepart->getMimeId() => array('data' => '', 'status' => $status, 'type' => 'text/html; charset=UTF-8'));
}
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/mime'));
$view->addHelper('Text');
$view->downloadclass = 'tgzdownload';
$view->files = array();
$view->tableclass = 'tgzcontents';
$tgzInfo = $this->_getTgzInfo();
foreach ($tgzInfo as $key => $val) {
if (!strlen($val['data'])) {
continue;
}
$file = new stdClass();
$file->download = '';
$file->name = $val['name'];
$file->size = IMP::sizeFormat($val['size']);
if (!empty($val['size'])) {
$file->download = $this->getConfigParam('imp_contents')->linkView($this->_mimepart, 'download_render', '', array('class' => 'iconImg downloadAtc', 'jstext' => _("Download"), 'params' => array('tgz_attachment' => $key)));
}
$view->files[] = $file;
}
return array($this->_mimepart->getMimeId() => array('data' => $view->render('compressed'), 'type' => 'text/html; charset=UTF-8'));
}