本文整理汇总了PHP中Horde_Util::formInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Util::formInput方法的具体用法?PHP Horde_Util::formInput怎么用?PHP Horde_Util::formInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde_Util
的用法示例。
在下文中一共展示了Horde_Util::formInput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html
public function html($active = true)
{
if (!$this->contact) {
echo '<h3>' . _("The requested contact was not found.") . '</h3>';
return;
}
if (!$this->contact->hasPermission(Horde_Perms::DELETE)) {
if (!$this->contact->hasPermission(Horde_Perms::READ)) {
echo '<h3>' . _("You do not have permission to view this contact.") . '</h3>';
return;
} else {
echo '<h3>' . _("You only have permission to view this contact.") . '</h3>';
return;
}
}
echo '<div id="DeleteContact"' . ($active ? '' : ' style="display:none"') . '>';
?>
<form action="<?php
echo Horde::url('delete.php');
?>
" method="post">
<?php
echo Horde_Util::formInput();
?>
<input type="hidden" name="url" value="<?php
echo htmlspecialchars(Horde_Util::getFormData('url'));
?>
" />
<input type="hidden" name="source" value="<?php
echo htmlspecialchars($this->contact->driver->getName());
?>
" />
<input type="hidden" name="key" value="<?php
echo htmlspecialchars($this->contact->getValue('__key'));
?>
" />
<div class="headerbox" style="padding: 8px">
<p><?php
echo _("Permanently delete this contact?");
?>
</p>
<input type="submit" class="horde-delete" name="delete" value="<?php
echo _("Delete");
?>
" />
</div>
</form>
</div>
<?php
if ($active && $GLOBALS['browser']->hasFeature('dom')) {
if ($this->contact->hasPermission(Horde_Perms::READ)) {
$view = new Turba_View_Contact($this->contact);
$view->html(false);
}
if ($this->contact->hasPermission(Horde_Perms::EDIT)) {
$delete = new Turba_View_EditContact($this->contact);
$delete->html(false);
}
}
}
示例2: _content
/**
*/
protected function _content()
{
global $page_output;
$name = strval(new Horde_Support_Randomid());
$page_output->addScriptFile('vatid.js', 'horde');
$page_output->addInlineScript(array('$("' . $name . '").observe("submit", HordeBlockVatid.onSubmit.bindAsEventListener(HordeBlockVatid))'), true);
return '<form style="padding:2px" action="' . $this->_ajaxUpdateUrl() . '" id="' . $name . '">' . Horde_Util::formInput() . Horde::label('vatid', _("VAT identification number:")) . '<br /><input type="text" length="14" name="vatid" />' . '<br /><input type="submit" id="vatbutton" value="' . _("Check") . '" class="horde-default" /> ' . Horde_Themes_Image::tag('loading.gif', array('alt' => _("Checking"), 'attr' => array('style' => 'display:none'))) . '<div class="vatidResults"></div>' . '</form>';
}
示例3: display
/**
* Renders this page in display mode.
*
* @throws Wicked_Exception
*/
public function display()
{
$GLOBALS['page_output']->addScriptFile('edit.js');
$view = $GLOBALS['injector']->createInstance('Horde_View');
$view->action = Wicked::url('NewPage');
$view->formInput = Horde_Util::formInput();
$view->referrer = $this->referrer();
if (!empty($GLOBALS['conf']['wicked']['captcha']) && !$GLOBALS['registry']->getAuth()) {
$figlet = new Text_Figlet();
Horde_Exception_Pear::catchError($figlet->loadFont($GLOBALS['conf']['wicked']['figlet_font']));
$view->captcha = $figlet->lineEcho(Wicked::getCAPTCHA(true));
}
if ($this->_template) {
$view->text = Wicked_Page::getPage($this->_template)->getText();
}
return $view->render('edit/new');
}
示例4: run
/**
* $registry
* $notification
* $conf
* $criteria
*
*/
public function run()
{
extract($this->_params, EXTR_REFS);
$templates = Horde::loadConfiguration('templates.php', 'templates', 'jonah');
/* Get requested channel. */
try {
$channel = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannel($criteria['feed']);
} catch (Exception $e) {
Horde::log($e, 'ERR');
$notification->push(_("Invalid channel."), 'horde.error');
Horde::url('delivery/index.php', true)->redirect();
exit;
}
$title = sprintf(_("HTML Delivery for \"%s\""), $channel['channel_name']);
$options = array();
foreach ($templates as $key => $info) {
$options[] = '<option value="' . $key . '"' . ($key == $criteria['format'] ? ' selected="selected"' : '') . '>' . $info['name'] . '</option>';
}
$template = new Horde_Template();
$template->setOption('gettext', 'true');
$template->set('url', Horde::selfUrl());
$template->set('session', Horde_Util::formInput());
$template->set('channel_id', $criteria['feed']);
$template->set('channel_name', $channel['channel_name']);
$template->set('format', $criteria['format']);
$template->set('options', $options);
// @TODO: This is ugly. storage driver shouldn't be rendering any display
// refactor this to use individual views possibly with a choice of different templates
$template->set('stories', $GLOBALS['injector']->getInstance('Jonah_Driver')->renderChannel($criteria['feed'], $criteria['format']));
// Buffer the notifications and send to the template
Horde::startBuffer();
$GLOBALS['notification']->notify(array('listeners' => 'status'));
$template->set('notify', Horde::endBuffer());
$GLOBALS['page_output']->header(array('title' => $title));
echo $template->fetch(JONAH_TEMPLATES . '/delivery/html.html');
$GLOBALS['page_output']->footer();
}
示例5: display
/**
* Renders this page in display mode.
*
* @throws Wicked_Exception
*/
public function display()
{
global $injector, $page_output, $wicked;
$view = $injector->createInstance('Horde_View');
$view->action = Wicked::url('NewPage');
$view->formInput = Horde_Util::formInput();
$view->referrer = $this->referrer();
$view->name = $this->pageName();
if ($this->_results) {
$page_output->addScriptFile('tables.js', 'horde');
$view->pages = array();
foreach ($this->_results as $page) {
if (!empty($page['page_history'])) {
$page = new Wicked_Page_StandardHistoryPage($page);
} else {
$page = new Wicked_Page_StandardPage($page);
}
$view->pages[] = $page->toView();
}
}
$view->templates = $wicked->getMatchingPages('Template', Wicked_Page::MATCH_ENDS);
$view->help = Horde_Help::link('wicked', 'Templates');
return $view->render('edit/create');
}
示例6: catch
$storage->delete($memo_id);
$notification->push(_("The note was deleted."), 'horde.success');
} catch (Mnemo_Exception $e) {
$notification->push(sprintf(_("There was an error removing the note: %s"), $e->getMessage()), 'horde.warning');
}
} else {
$notification->push(_("Access denied deleting note."), 'horde.warning');
}
}
/* Return to the notepad. */
Horde::url('list.php', true)->redirect();
default:
Horde::url('list.php', true)->redirect();
}
$view = $injector->createInstance('Horde_View');
$view->formInput = Horde_Util::formInput();
$view->id = $memo_id;
$view->listid = $memolist_id;
$view->modify = $actionID == 'modify_memo';
$view->passphrase = $show_passphrase;
$view->title = $title;
$view->url = Horde::url('memo.php');
if (!$view->modify || !$view->passphrase) {
$injector->getInstance('Horde_Core_Factory_Imple')->create('Mnemo_Ajax_Imple_TagAutoCompleter', array('id' => 'memo_tags'));
$view->body = $memo_body;
$view->count = sprintf(_("%s characters"), '<span id="mnemo-count">' . Horde_String::length(str_replace(array("\r", "\n"), '', $memo_body)) . '</span>');
$view->encrypted = $memo_encrypted;
$view->encryption = $storage->encryptionSupported();
try {
$view->help = Horde::callHook('description_help', array(), 'mnemo', '');
} catch (Horde_Exception_HookNotSet $e) {
示例7: display
/**
* Returns this page rendered in Display mode.
*
* @throws Wicked_Exception
*/
public function display()
{
global $registry, $wicked, $notification, $conf;
try {
$attachments = $this->content();
} catch (Wicked_Exception $e) {
$notification->push(sprintf(_("Error retrieving attachments: %s"), $e->getMessage()), 'horde.error');
throw $e;
}
$GLOBALS['page_output']->addScriptFile('tables.js', 'horde');
$view = $GLOBALS['injector']->createInstance('Horde_View');
$view->pageName = $this->pageName();
$view->formAction = Wicked::url('AttachedFiles');
$view->deleteButton = Horde_Themes::img('delete.png');
$view->referrerLink = Wicked::url($this->referrer());
$refreshIcon = Horde::link($this->pageUrl()) . Horde::img('reload.png', sprintf(_("Reload \"%s\""), $this->pageTitle())) . '</a>';
$view->refreshIcon = $refreshIcon;
$view->attachments = $attachments;
/* Get an array of unique filenames for the update form. */
$files = array();
foreach ($attachments as $attachment) {
$files[$attachment['attachment_name']] = true;
}
$files = array_keys($files);
sort($files);
$view->files = $files;
$view->canUpdate = $this->allows(Wicked::MODE_EDIT) && count($files);
$view->canAttach = $this->allows(Wicked::MODE_EDIT);
$view->requireChangelog = $conf['wicked']['require_change_log'];
$view->requiredMarker = Horde::img('required.png', '*');
$view->referrer = $this->referrer();
$view->formInput = Horde_Util::formInput();
echo $view->render('display/AttachedFiles');
}
示例8: history
/**
* Renders this page in History mode.
*
* @return string The content.
* @throws Wicked_Exception
*/
public function history()
{
global $injector, $page_output;
$page_output->addScriptFile('history.js');
$view = $injector->createInstance('Horde_View');
// Header.
$view->formInput = Horde_Util::formInput();
$view->name = $this->pageName();
$view->pageLink = $this->pageUrl()->link() . htmlspecialchars($this->pageName()) . '</a>';
$view->refreshLink = $this->pageUrl('history.php')->link() . Horde::img('reload.png', _("Reload History")) . '</a>';
if ($this->allows(Wicked::MODE_REMOVE)) {
$view->remove = Horde::img('delete.png', _("Delete Version"));
}
if ($this->allows(Wicked::MODE_EDIT) && !$this->isLocked(Wicked::lockUser())) {
$view->edit = Horde::img('edit.png', _("Edit Version"));
$view->restore = Horde::img('restore.png', _("Restore Version"));
}
$content = $view->render('history/header');
// First item is this page.
$view->showRestore = false;
$this->_setViewProperties($view, $this);
$content .= $view->render('history/summary');
// Now the rest of the histories.
$view->showRestore = true;
foreach ($GLOBALS['wicked']->getHistory($this->pageName()) as $page) {
$page = new Wicked_Page_StandardHistoryPage($page);
$this->_setViewProperties($view, $page);
$view->pversion = $page->version();
$content .= $view->render('history/summary');
}
// Footer.
return $content . $view->render('history/footer');
}
示例9: _init
/**
*/
private function _init()
{
global $conf, $page_output;
// Get the backend details.
$backend_key = $this->_vars->backend;
if (!isset($this->_backends[$backend_key])) {
$backend_key = null;
}
if ($backend_key && $this->_vars->submit) {
$this->_changePassword($backend_key);
}
// Choose the prefered backend from config/backends.php.
foreach ($this->_backends as $k => $v) {
if (!isset($backend_key) && substr($k, 0, 1) != '_') {
$backend_key = $k;
}
if ($this->_isPreferredBackend($v)) {
$backend_key = $k;
break;
}
}
$view = new Horde_View(array('templatePath' => PASSWD_TEMPLATES));
$view->addHelper('FormTag');
$view->addHelper('Horde_Core_View_Helper_Help');
$view->addHelper('Horde_Core_View_Helper_Label');
$view->addHelper('Tag');
$view->formInput = Horde_Util::formInput();
$view->url = $this->_vars->return_to;
$view->userid = $this->_userid;
$view->userChange = $conf['user']['change'];
$view->showlist = $conf['backend']['backend_list'] == 'shown';
$view->backend = $backend_key;
// Build the <select> widget for the backends list.
if ($view->showlist) {
$view->backends = $this->_backends;
$view->header = _("Change your password");
} else {
$view->header = sprintf(_("Changing password for %s"), htmlspecialchars($this->_backends[$backend_key]['name']));
}
$page_output->sidebar = false;
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->addScriptFile('passwd.js');
$page_output->addInlineJsVars(array('var Passwd' => array('current_pass' => _("Please provide your current password"), 'new_pass' => _("Please provide a new password"), 'verify_pass' => _("Please verify your new password"), 'no_match' => _("Your passwords do not match"))));
$this->_output = $view->render('index');
}
示例10: vfsEditUrl
/**
* Returns a link to display, download, and delete a file from the VFS
* backend associated with this object.
*
* @param string $file The file name.
*
* @return string The HTML code of the generated link.
*/
public function vfsEditUrl($file)
{
$delform = '<form action="' . Horde::url('deletefile.php') . '" style="display:inline" method="post">' . Horde_Util::formInput() . '<input type="hidden" name="file" value="' . htmlspecialchars($file['name']) . '" />' . '<input type="hidden" name="source" value="' . htmlspecialchars($this->driver->getName()) . '" />' . '<input type="hidden" name="key" value="' . htmlspecialchars($this->getValue('__key')) . '" />' . '<input type="image" class="img" src="' . Horde_Themes::img('delete.png') . '" />' . '</form>';
return $this->vfsDisplayUrl($file) . ' ' . $delform;
}
示例11: elseif
Horde::url('forums.php', true)->redirect();
} elseif (empty($messages_list)) {
$messages_count = 0;
$notification->push(_("No messages are waiting for moderation."), 'horde.message');
} else {
$messages_count = count($messages_list);
$messages_list = array_slice($messages_list, $messages_start, $messages_per_page);
}
/* Set up the column headers. */
$col_headers = array('forum_id' => _("Forum"), 'message_subject' => _("Subject"), 'message_author' => _("Posted by"), 'message_body' => _("Body"), 'message_timestamp' => _("Date"));
$col_headers = Agora::formatColumnHeaders($col_headers, $sort_by, $sort_dir, 'moderate');
/* Set up the template tags. */
$view = new Agora_View();
$view->col_headers = $col_headers;
$view->messages = $messages_list;
$view->buttons = array(_("Approve"), _("Delete"));
$view->session_tag = Horde_Util::formInput();
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
$view->notify = Horde::endBuffer();
/* Set up pager. */
$vars = Horde_Variables::getDefaultVariables();
$pager_ob = new Horde_Core_Ui_Pager('moderate_page', $vars, array('num' => $messages_count, 'url' => Horde::selfUrl(true), 'perpage' => $messages_per_page));
$pager_ob->preserve('agora', Horde_Util::getFormData('agora'));
$view->pager = $pager_ob->render();
if (isset($api_call)) {
return $view->render('moderate');
}
$page_output->header(array('title' => _("Messages Awaiting Moderation")));
echo $view->render('moderate');
$page_output->footer();
示例12: formInputs
/**
* Generates hidden form fields with all required parameters.
*
* @return string The form fields, with session information if necessary.
*/
public static function formInputs()
{
$arglist = self::_getArgList($GLOBALS['acts'], $GLOBALS['defaultActs'], array());
$fields = Horde_Util::formInput();
foreach ($arglist as $key => $val) {
$fields .= '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($val) . '" />';
}
return $fields;
}
示例13: _uploadFTP
$upload = _uploadFTP($info);
if ($upload) {
$notification->push(_("Uploaded all application configuration files to the server."), 'horde.success');
Horde::url('admin/config/index.php', true)->redirect();
}
}
/* Render the form. */
Horde::startBuffer();
$ftpform->renderActive(new Horde_Form_Renderer(), $vars, Horde::url('admin/config/index.php'), 'post');
$ftpform = Horde::endBuffer();
}
if (file_exists(Horde::getTempDir() . '/horde_configuration_upgrade.php')) {
/* Action to remove the configuration upgrade PHP script. */
$url = Horde::url('admin/config/scripts.php')->add('clean', 'tmp');
$action = _("Remove saved script from server's temporary directory.");
$actions[] = array('icon' => Horde_Themes_Image::tag('delete.png', array('attr' => array('align' => 'middle'))), 'link' => Horde::link($url) . $action . '</a>');
}
$view = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/admin/config'));
$view->actions = $actions;
$view->apps = $apps;
$view->config_outdated = $config_outdated;
$view->ftpform = $ftpform;
$view->schema_outdated = $schema_outdated;
$view->version_action = Horde::url('admin/config/index.php');
$view->version_input = Horde_Util::formInput();
$view->versions = !empty($versions);
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => sprintf(_("%s Configuration"), $registry->get('name', 'horde'))));
require HORDE_TEMPLATES . '/admin/menu.inc';
echo $view->render('index');
$page_output->footer();
示例14: generateUI
//.........这里部分代码省略.........
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();
foreach ($apps as $key => $val) {
$tmp[] = array('l' => htmlspecialchars($val), 'v' => htmlspecialchars($key));
}
$t->set('apps', $tmp);
if ($this->app == 'horde') {
$header = Horde_Core_Translation::t("Global Preferences");
} else {
$header = sprintf(Horde_Core_Translation::t("Preferences for %s"), Horde::url($registry->getInitialPage($this->app))->link() . htmlspecialchars($registry->get('name', $this->app)) . '</a>');
}
$t->set('header', $header);
$t->set('has_advanced', $this->hasAdvancedPrefs());
if ($GLOBALS['session']->get('horde', 'prefs_advanced')) {
$t->set('basic', $this->selfUrl()->add('show_basic', 1));
} else {
$t->set('advanced', $this->selfUrl()->add('show_advanced', 1));
}
echo $t->fetch($h_templates . '/prefs/app.html');
/* Generate navigation header. */
if ($this->group) {
$t = clone $base_ui;
$t->set('app', htmlspecialchars($this->app));
$t->set('group', htmlspecialchars($this->group));
$t->set('label', htmlspecialchars($this->prefGroups[$this->group]['label']));
$t->set('token', $GLOBALS['injector']->getInstance('Horde_Token')->get('horde.prefs'));
// Search for previous and next groups.
if (count($prefgroups) > 1) {
$prefgroups = array_keys($prefgroups);
$key = array_search($this->group, $prefgroups);
$previous = isset($prefgroups[$key - 1]) ? $prefgroups[$key - 1] : end($prefgroups);
$next = isset($prefgroups[$key + 1]) ? $prefgroups[$key + 1] : reset($prefgroups);
$prefs_url = $this->selfUrl();
if ($next != $previous) {
$t->set('prev', $prefs_url->copy()->add('group', $previous));
$t->set('prevlabel', htmlspecialchars($this->prefGroups[$previous]['label']));
$t->set('previcon', Horde_Themes_Image::tag('nav/left.png'));
}
$t->set('next', $prefs_url->copy()->add('group', $next));
$t->set('nextlabel', htmlspecialchars($this->prefGroups[$next]['label']));
$t->set('nexticon', Horde_Themes_Image::tag('nav/right.png'));
}
echo $t->fetch($h_templates . '/prefs/begin.html');
}
echo $content;
$GLOBALS['page_output']->footer();
}
示例15: renderActive
public function renderActive($form, $action, $method = 'get', $enctype = null, $focus = true)
{
$this->_name = $form->getName();
echo "<form class=\"horde-form\" action=\"{$action}\" method=\"{$method}\"" . (empty($this->_name) ? '' : ' id="' . $this->_name . '"') . (is_null($this->_enctype) ? '' : ' enctype="' . $this->_enctype . '"') . ">\n";
echo Horde_Util::formInput();
$this->listFormVars($form);
if (!empty($this->_name)) {
$this->_preserveVarByPost('formname', $this->_name);
}
if ($form->useToken()) {
$this->_preserveVarByPost($this->_name . '_formToken', Horde_Token::generateId($this->_name));
}
if (count($form->getSections())) {
$this->_preserveVarByPost('__formOpenSection', $form->getOpenSection());
}
$vars = $form->getVars();
$variables = $form->getVariables();
foreach ($variables as $var) {
if ($var->getOption('trackchange')) {
$varname = $var->getVarName();
$this->preserveVarByPost($vars, $varname, '__old_' . $varname);
}
}
foreach ($form->getHiddenVariables() as $var) {
$this->preserveVarByPost($vars, $var->getVarName());
}
$this->_renderBeginActive($form->getTitle());
$this->_renderForm($form, true);
$this->submit($this->_submit, $this->_reset);
echo "\n</fieldset>\n</form>\n";
if ($focus && !empty($this->_firstField)) {
echo '<script type="text/javascript">
try {
document.getElementById("' . $this->_firstField . '").focus();
} catch (e) {}
</script>
';
}
}