本文整理汇总了PHP中Util::getFormData方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::getFormData方法的具体用法?PHP Util::getFormData怎么用?PHP Util::getFormData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util::getFormData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_themeselect
function handle_themeselect($updated)
{
global $prefs;
$theme = Util::getFormData('theme');
if (!is_null($theme)) {
$prefs->setValue('theme', $theme);
$updated = true;
}
return $updated;
}
示例2: define
<?php
/**
* $Horde: horde/services/images/pixel.php,v 1.10 2004/01/05 22:45:47 slusarz Exp $
*
* Copyright 2002-2004 Chuck Hagenbuch <chuck@horde.org>
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
define('HORDE_BASE', dirname(__FILE__) . '/../..');
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_LIBS . 'Horde/Image.php';
$gif =& Horde_Image::factory('gif', array('rgb' => Util::getFormData('c')));
header('Content-type: image/gif');
header('Expires: Wed, 21 Aug 1969 11:11:11 GMT');
header('Cache-Control: no-cache');
header('Cache-Control: must-revalidate');
echo $gif->makePixel();
示例3: header
}
}
if (Auth::isAuthenticated()) {
if ($browser->isMobile()) {
require HORDE_BASE . '/services/portal/mobile.php';
} else {
require HORDE_BASE . '/services/portal/index.php';
}
exit;
}
$login_screen = $auth->_getLoginScreen();
if (Util::removeParameter($login_screen, array('url', 'nocache')) != Util::removeParameter(Horde::url(Horde::selfUrl(), true), array('url', 'nocache'))) {
if ($url_param) {
$login_screen = Util::addParameter($login_screen, 'url', $url_param);
}
$login_screen = Util::addParameter($login_screen, 'frameset', Util::getFormData('frameset'));
header('Location: ' . $login_screen);
exit;
}
if ($browser->isMobile()) {
require_once HORDE_LIBS . 'Horde/Mobile.php';
require HORDE_TEMPLATES . '/login/mobile.inc';
exit;
}
/* Build the <select> widget containing the available languages. */
if (!$prefs->isLocked('language')) {
$_SESSION['horde_language'] = NLS::select();
$langs = '<select name="new_lang" onchange="selectLang()">';
foreach ($nls['languages'] as $key => $val) {
$sel = $key == $_SESSION['horde_language'] ? ' selected="selected"' : '';
$langs .= "<option value=\"{$key}\"{$sel}>{$val}</option>";
示例4:
<?php
/**
* $Horde: horde/services/download/index.php,v 1.6 2004/01/01 15:17:01 jan Exp $
*
* Copyright 2002-2004 Michael Slusarz <slusarz@bigworm.colorado.edu>
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
include_once '../../lib/base.php';
if (!($module = Util::getFormData('module')) || !file_exists($registry->getParam('fileroot', $module))) {
Horde::fatal('Do not call this script directly.', __FILE__, __LINE__);
}
include $registry->getParam('fileroot', $module) . '/view.php';
示例5: header
<?php
/**
* $Horde: horde/scripts/http_login_refer.php,v 1.3 2004/01/01 15:16:54 jan Exp $
*
* Copyright 1999-2004 Charles J. Hagenbuch <chuck@horde.org>
* Copyright 1999-2004 Jon Parise <jon@horde.org>
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
require_once '../lib/base.php';
$auth =& Auth::singleton($conf['auth']['driver']);
// Check for HTTP auth.
if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW']) || !$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => $_SERVER['PHP_AUTH_PW']))) {
header('WWW-Authenticate: Basic realm="' . $auth->getParam('realm') . '"');
header('HTTP/1.0 401 Unauthorized');
exit('Forbidden');
}
if ($url = Util::getFormData('url')) {
header('Location: ' . $url);
} else {
header('Location: ' . Horde::applicationUrl('login.php'));
}
示例6:
require_once HORDE_LIBS . 'Horde/Form/Renderer.php';
if (!Auth::isAdmin()) {
Horde::authenticationFailureRedirect();
}
$groups =& Group::singleton();
$auth =& Auth::singleton($conf['auth']['driver']);
/* Set up the form variables. */
$vars =& Variables::getDefaultVariables();
$cid = $vars->get('cid');
$category = $vars->get('category');
$permission =& $perms->getPermissionById($cid);
/* See if we need to (and are supposed to) autocreate the
* permission. */
if ($category !== null) {
$permission =& $perms->getPermission($category);
if (is_a($permission, 'PEAR_Error') && Util::getFormData('autocreate')) {
$parent = $vars->get('parent');
$permission =& $perms->newPermission($category);
$result = $perms->addPermission($permission, $parent);
if (!is_a($result, 'PEAR_Error')) {
$form = 'edit.inc';
}
}
} else {
$permission =& $perms->getPermissionById($cid);
}
/* If the permission fetched is an error return to the permissions
* list. */
if (is_a($permission, 'PEAR_Error')) {
$notification->push(_("Attempt to edit a non-existent permission."), 'horde.error');
$url = Horde::applicationUrl('admin/perms/index.php', true);
示例7: dirname
@define('NWNADMIN_BASE', dirname(__FILE__));
require_once NWNADMIN_BASE . '/lib/base.php';
require_once NWNADMIN_BASE . '/lib/ModuleForms.php';
// script global variables
global $nwndriver;
$admin = Auth::isAdmin('nwnadmin:admin');
$adminDelete = Auth::isAdmin('nwnadmin:admin', PERMS_DELETE);
$moduleDir = NWNAdmin::getModulePath();
$moduleDirWritable = is_writable($moduleDir);
$serverUp = $nwndriver->serverRunning();
if ($admin && !$serverUp) {
$notification->push(_("The server is down; module loading is unavailable."));
}
// figure out what to do
$actionId = Util::getFormData('actionId');
$moduleName = Util::getFormData('moduleName');
if (isset($actionId) && !isset($moduleName)) {
$notification->push(_("Invalid options! Try again..."), 'horde.warning');
} else {
switch ($actionId) {
case 'delete':
if ($adminDelete && strpos($conf['server']['root'], $moduleName) == 0) {
$moduleName = str_replace('../', '', $moduleName);
$result = unlink(escapeshellcmd($moduleName));
if (!$result) {
$notification->push(_("Could not delete the module."), 'horde.error');
} else {
$notification->push(_("Successfully deleted the module."), 'horde.success');
}
}
break;
示例8: elseif
exit;
} else {
$url = Util::getFormData('url');
$initial_app = $prefs->getValue('initial_application');
if (!empty($url)) {
$main_page = $url;
} elseif (!empty($initial_app) && !($GLOBALS['perms']->exists($initial_app) && !$GLOBALS['perms']->hasPermission($initial_app, Auth::getAuth(), PERMS_READ))) {
$main_page = Horde::url($registry->getInitialPage($initial_app));
} elseif (isset($registry->applications['horde']['initial_page'])) {
$main_page = Horde::applicationUrl($registry->applications['horde']['initial_page']);
} elseif (Auth::getAuth()) {
$main_page = Horde::applicationUrl('services/portal/');
} else {
$main_page = Horde::applicationUrl('login.php');
}
if (!Util::getFormData('frameset') && ($conf['menu']['always'] || $conf['menu']['display'] && Auth::getAuth() && $prefs->getValue('show_sidebar'))) {
if ($browser->hasQuirk('scrollbar_in_way')) {
$scrollbar = 'yes';
} else {
$scrollbar = 'auto';
}
$main_page = Util::addParameter($main_page, 'frameset', 1);
require HORDE_TEMPLATES . '/index/frames_index.inc';
} else {
header('Location: ' . $main_page);
exit;
}
}
} else {
define('HORDE_LIBS', '');
require HORDE_BASE . '/lib/Test.php';
示例9: elseif
if (strlen($log) > 80) {
$shortLog .= "...";
}
}
require CHORA_TEMPLATES . '/directory/file.inc';
}
/* Display the options control panel at the bottom */
$formwhere = $scriptName . '/' . $where;
require CHORA_TEMPLATES . '/directory/footer.inc';
require $registry->getParam('templates', 'horde') . '/common-footer.inc';
} elseif ($VC->isFile($fullname)) {
$fl =& $VC->getFileObject($where);
$title = sprintf(_("Source Log for %s"), Text::htmlAllSpaces($where));
$upwhere = preg_replace('|[^/]+$|', '', $where);
$onb = Util::getFormData('onb', 0);
$r1 = Util::getFormData('r1', 0);
$isBranch = isset($onb) && isset($fl->branches[$onb]) ? $fl->branches[$onb] : '';
$extraLink = Chora::getFileViews();
require CHORA_TEMPLATES . '/common-header.inc';
Chora::menu();
require CHORA_TEMPLATES . '/headerbar.inc';
$mimeType = MIME_Magic::filenameToMIME($fullname);
$defaultTextPlain = $mimeType == 'text/plain';
foreach ($fl->logs as $lg) {
$rev = $lg->rev;
/* Are we sticking only to one branch ? */
if ($onb && VC_Revision::valid($onb)) {
/* If so, if we are on the branch itself, let it through */
if (substr($rev, 0, strlen($onb)) != $onb) {
/* We are not on the branch, see if we are on a trunk
* branch below the branch */
示例10: _
Horde::fatal('Forbidden.', __FILE__, __LINE__);
}
$title = _("SQL Shell");
require HORDE_TEMPLATES . '/common-header.inc';
require HORDE_TEMPLATES . '/admin/common-header.inc';
?>
<form name="sqlshell" action="<?php
echo $_SERVER['PHP_SELF'];
?>
" method="post">
<?php
Util::pformInput();
?>
<?php
if ($command = trim(Util::getFormData('sql'))) {
// Keep a cache of prior queries for convenience.
if (!isset($_SESSION['_sql_query_cache'])) {
$_SESSION['_sql_query_cache'] = array();
}
if (($key = array_search($command, $_SESSION['_sql_query_cache'])) !== false) {
unset($_SESSION['_sql_query_cache'][$key]);
}
array_unshift($_SESSION['_sql_query_cache'], $command);
while (count($_SESSION['_sql_query_cache']) > 20) {
array_pop($_SESSION['_sql_query_cache']);
}
echo '<div class="header">' . _("SQL Query") . ':</div><br />';
echo '<table cellpadding="4" border="0"><tr><td class="text"><pre>' . htmlspecialchars($command) . '</pre></td></tr></table>';
echo '<br /><div class="header">' . _("Results") . ':</div><br />';
echo '<table cellpadding="2" border="0"><tr><td class="control">';
示例11: dirname
<?php
/*
* $Horde: horde/services/images/colorpicker.php,v 1.14 2004/01/01 16:17:37 jan Exp $
*
* Copyright 2002-2004 Michael Cochrane <mike@graftonhall.co.nz>
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
@define('HORDE_BASE', dirname(__FILE__) . '/../..');
require_once HORDE_BASE . '/lib/base.php';
$title = _("Color Picker");
require HORDE_TEMPLATES . '/common-header.inc';
$form = Util::getFormData('form');
$target = Util::getFormData('target');
echo Horde::img('colorpicker.png', '', 'id="colorpicker" onclick="changeColor(getColor(event)); return false;" onmousemove="demoColor(getColor(event)); return false;" style="cursor:crosshair;background-color:white;padding:1px"');
?>
<div id="colorDemo" style="background-color:white;width:100px;height:20px;padding:1px"></div>
<script language="Javascript" type="text/javascript">
<!--
function changeColor(color)
{
if (parent.opener.closed) {
alert("<?php
echo addslashes(_("The Options window has closed. Exiting."));
?>
");
this.close();
return;
示例12: array
if ($info['app'] != $newapp || $info['block'] != $newtype) {
// Change app or type.
$info = array();
$info['app'] = $newapp;
$info['block'] = $newtype;
$info['params'] = Util::getFormData('params');
$params = $blocks->getParams($newapp, $newtype);
foreach ($params as $newparam) {
if (is_null($info['params'][$newparam])) {
$info['params'][$newparam] = $blocks->getDefaultValue($newapp, $newtype, $newparam);
}
}
$layout->setBlockInfo($row, $col, $info);
} else {
// Change values.
$layout->setBlockInfo($row, $col, array('params' => Util::getFormData('params', array())));
}
}
$layout->save();
if ($action == 'save') {
break;
}
// Make a block the current block for editing.
// Make a block the current block for editing.
case 'edit':
$edit_row = $row;
$edit_col = $col;
break;
}
$title = _("My Portal Layout");
require HORDE_TEMPLATES . '/common-header.inc';
示例13:
$registry =& Registry::singleton();
/* Figure out which application we're setting preferences for. */
$app = Util::getFormData('app', 'horde');
$appbase = $registry->getParam('fileroot', $app);
/* Load $app's base environment. */
require_once $appbase . '/lib/base.php';
/* Load $app's preferences, if any. */
if (file_exists($appbase . '/config/prefs.php')) {
require $appbase . '/config/prefs.php';
}
/* Load custom preference handlers for $app, if present. */
if (file_exists($appbase . '/lib/prefs.php')) {
require_once $appbase . '/lib/prefs.php';
}
/* See if we have a preferences group set. */
$group = Util::getFormData('group');
if (Prefs_UI::handleForm($group)) {
require $appbase . '/config/prefs.php';
}
$title = _("User Options");
require $registry->getParam('templates', $app) . '/common-header.inc';
if ($app == 'horde') {
require $appbase . '/services/portal/navbar.php';
} else {
if (isset($menu) && is_a($menu, 'Menu')) {
/* App has a defined menu object and can return a menu
* array. */
$menu = $menu->getMenu();
/* Use the default menu template to output this menu array. */
require $registry->getParam('templates', 'horde') . '/menu/menu.inc';
} else {
示例14:
/* Initialise the form variables correctly.
* If r1/r2 are empty, then use the corresponding text field instead */
$r1 = Util::getFormData('r1', 0);
$r2 = Util::getFormData('r2', 0);
if (!$r1) {
$r1 = Util::getFormData('tr1');
}
if (!$r2) {
$r2 = Util::getFormData('tr2');
}
/* If no context-size has been specified, default to 3. */
$num = Util::getFormData('num', 3);
/* If no type has been specified, then default to human readable. */
$ty = Util::getFormData('ty', 'h');
/* Unless otherwise specified, show whitespace differences. */
$ws = Util::getFormData('ws', 1);
/* Figure out what type of diff has been requested. */
switch ($ty) {
case 's':
$type = 'column';
break;
case 'c':
$type = 'context';
break;
case 'e':
$type = 'ed';
break;
case 'u':
case 'h':
default:
$type = 'unified';
示例15: array
$vars->set('password', array('original' => $info['password'], 'confirm' => $info['password']));
unset($info['password']);
$vars->set('extra', $info);
$vars->set('removeQueuedSignup', true);
$addForm->addHidden('', 'removeQueuedSignup', 'boolean', true);
break;
case 'removequeued_f':
$f_user_name = Util::getFormData('user_name');
$removequeued_form = true;
break;
case 'removequeued':
$result = $signup->removeQueuedSignup(Util::getFormData('user_name'));
if (is_a($result, 'PEAR_Error')) {
$notification->push($result);
} else {
$notification->push(sprintf(_("The signup request for %s has been removed."), Util::getFormData('user_name')));
}
break;
}
$title = _("User Administration");
require HORDE_TEMPLATES . '/common-header.inc';
require HORDE_TEMPLATES . '/admin/common-header.inc';
$notification->notify(array('listeners' => 'status'));
if (isset($update_form) && $auth->hasCapability('list')) {
require_once HORDE_LIBS . 'Horde/Identity.php';
$identity =& Identity::singleton('none', $f_user_name);
require HORDE_TEMPLATES . '/admin/user/update.inc';
} elseif (isset($remove_form) && $auth->hasCapability('list') && $auth->hasCapability('remove')) {
require HORDE_TEMPLATES . '/admin/user/remove.inc';
} elseif (isset($removequeued_form)) {
require HORDE_TEMPLATES . '/admin/user/removequeued.inc';