本文整理汇总了PHP中field函数的典型用法代码示例。如果您正苦于以下问题:PHP field函数的具体用法?PHP field怎么用?PHP field使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了field函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: offsetGet
/**
* Get an offset if already set or traverse Pod and then set plus reutrn.
*
* @since 0.1.0
*
* @param mixed $offset Offset to get
*
* @return mixed
*/
public function offsetGet($offset)
{
if ($this->offsetExists($offset)) {
return parent::offsetGet($offset);
} else {
if ('id' == $offset || 'ID' == $offset) {
$_value = $this->pod->id();
} else {
$_value = $this->pod->field($offset);
}
if ($_value) {
parent::offsetSet($offset, $_value);
return $_value;
}
}
}
示例2: doDefault
function doDefault()
{
global $misc, $lang;
$onchange = "onchange=\"location.href='history.php?server=' + encodeURI(server.options[server.selectedIndex].value) + '&database=' + encodeURI(database.options[database.selectedIndex].value) + '&'\"";
$misc->printHeader($lang['strhistory']);
// Bring to the front always
echo "<body onload=\"window.focus();\">\n";
echo "<form action=\"history.php\" method=\"post\">\n";
$misc->printConnection($onchange);
echo "</form><br />";
if (!isset($_REQUEST['database'])) {
echo "<p>{$lang['strnodatabaseselected']}</p>\n";
return;
}
if (isset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']])) {
include_once 'classes/ArrayRecordSet.php';
$history = new ArrayRecordSet($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]);
$columns = array('query' => array('title' => $lang['strsql'], 'field' => field('query')), 'paginate' => array('title' => $lang['strpaginate'], 'field' => field('paginate'), 'type' => 'yesno'), 'actions' => array('title' => $lang['stractions']));
$actions = array('run' => array('content' => $lang['strexecute'], 'attr' => array('href' => array('url' => 'sql.php', 'urlvars' => array('subject' => 'history', 'nohistory' => 't', 'queryid' => field('queryid'), 'paginate' => field('paginate'))), 'target' => 'detail')), 'remove' => array('content' => $lang['strdelete'], 'attr' => array('href' => array('url' => 'history.php', 'urlvars' => array('action' => 'confdelhistory', 'queryid' => field('queryid'))))));
$misc->printTable($history, $columns, $actions, 'history-history', $lang['strnohistory']);
} else {
echo "<p>{$lang['strnohistory']}</p>\n";
}
$navlinks = array('refresh' => array('attr' => array('href' => array('url' => 'history.php', 'urlvars' => array('action' => 'history', 'server' => $_REQUEST['server'], 'database' => $_REQUEST['database']))), 'content' => $lang['strrefresh']));
if (isset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]) && count($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']])) {
$navlinks['download'] = array('attr' => array('href' => array('url' => 'history.php', 'urlvars' => array('action' => 'download', 'server' => $_REQUEST['server'], 'database' => $_REQUEST['database']))), 'content' => $lang['strdownload']);
$navlinks['clear'] = array('attr' => array('href' => array('url' => 'history.php', 'urlvars' => array('action' => 'confclearhistory', 'server' => $_REQUEST['server'], 'database' => $_REQUEST['database']))), 'content' => $lang['strclearhistory']);
}
$misc->printNavLinks($navlinks, 'history-history', get_defined_vars());
}
示例3: doTree
function doTree()
{
global $misc, $conf;
$nodes = array();
$group_id = isset($_GET['group']) ? $_GET['group'] : false;
/* root with srv_groups */
if (isset($conf['srv_groups']) and count($conf['srv_groups']) > 0 and $group_id === false) {
$nodes = $misc->getServersGroups(true);
} else {
if (isset($conf['srv_groups']) and $group_id !== false) {
if ($group_id !== 'all') {
$nodes = $misc->getServersGroups(false, $group_id);
}
$nodes = array_merge($nodes, $misc->getServers(false, $group_id));
include_once './classes/ArrayRecordSet.php';
$nodes = new ArrayRecordSet($nodes);
} else {
$nodes = $misc->getServers(true, false);
}
}
$reqvars = $misc->getRequestVars('server');
$attrs = array('text' => field('desc'), 'icon' => field('icon'), 'toolTip' => field('id'), 'action' => field('action'), 'branch' => field('branch'));
$misc->printTree($nodes, $attrs, 'servers');
exit;
}
示例4: doDefault
function doDefault()
{
global $misc, $lang;
$onchange = "onchange=\"location.href='history.php?server=' + encodeURI(server.options[server.selectedIndex].value) + '&database=' + encodeURI(database.options[database.selectedIndex].value) + '&'\"";
$misc->printHeader($lang['strhistory']);
// Bring to the front always
echo "<body onload=\"window.focus();\">\n";
echo "<form action=\"history.php\" method=\"post\">\n";
$misc->printConnection($onchange);
echo "</form><br />";
if (!isset($_REQUEST['database'])) {
echo "<p>{$lang['strnodatabaseselected']}</p>\n";
return;
}
if (isset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']])) {
include_once 'classes/ArrayRecordSet.php';
$history = new ArrayRecordSet($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]);
$columns = array('query' => array('title' => $lang['strsql'], 'field' => field('query')), 'paginate' => array('title' => $lang['strpaginate'], 'field' => field('paginate'), 'type' => 'yesno'), 'actions' => array('title' => $lang['stractions']));
$actions = array('run' => array('title' => $lang['strexecute'], 'url' => "sql.php?{$misc->href}&nohistory=t&subject=history&", 'vars' => array('queryid' => 'queryid', 'paginate' => 'paginate'), 'target' => 'detail'), 'remove' => array('title' => $lang['strdelete'], 'url' => "history.php?{$misc->href}&action=confdelhistory&", 'vars' => array('queryid' => 'queryid')));
$misc->printTable($history, $columns, $actions, $lang['strnohistory']);
} else {
echo "<p>{$lang['strnohistory']}</p>\n";
}
echo "<ul class=\"navlink\">\n";
if (isset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]) && count($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']])) {
echo "\t<li><a href=\"history.php?action=confclearhistory&{$misc->href}\">{$lang['strclearhistory']}</a></li>\n";
}
echo "\t<li><a href=\"history.php?action=history&{$misc->href}\">{$lang['strrefresh']}</a></li>\n</ul>\n";
}
示例5: doTree
/**
* Generate XML for the browser tree.
*/
function doTree()
{
global $misc, $data;
$conversions = $data->getconversions();
$attrs = array('text' => field('conname'), 'icon' => 'Conversion', 'toolTip' => field('concomment'));
$misc->printTree($conversions, $attrs, 'conversions');
exit;
}
示例6: doTree
/**
* Generate XML for the browser tree.
*/
function doTree()
{
global $misc, $data;
$languages = $data->getLanguages();
$attrs = array('text' => field('lanname'), 'icon' => 'Language');
$misc->printTreeXML($languages, $attrs);
exit;
}
示例7: escape
function escape($fields)
{
global $lang;
if ($fields['id'] === 'all') {
return $lang['strallservers'];
} else {
return value(field('desc'), $fields, 'xml');
}
}
示例8: doTree
/**
* Generate XML for the browser tree.
*/
function doTree()
{
global $misc, $data;
$casts = $data->getCasts();
$proto = concat(field('castsource'), ' AS ', field('casttarget'));
$attrs = array('text' => $proto, 'icon' => 'Cast');
$misc->printTree($casts, $attrs, 'casts');
exit;
}
示例9: doTree
/**
* Generate XML for the browser tree.
*/
function doTree()
{
global $misc, $data;
$sequences = $data->getSequences();
$reqvars = $misc->getRequestVars('sequence');
$attrs = array('text' => field('seqname'), 'icon' => 'Sequence', 'toolTip' => field('seqcomment'), 'action' => url('sequences.php', $reqvars, array('action' => 'properties', 'sequence' => field('seqname'))));
$misc->printTreeXML($sequences, $attrs);
exit;
}
示例10: doTree
/**
* Generate XML for the browser tree.
*/
function doTree()
{
global $misc, $data;
$opclasses = $data->getOpClasses();
// OpClass prototype: "op_class/access_method"
$proto = concat(field('opcname'), '/', field('amname'));
$attrs = array('text' => $proto, 'icon' => 'OperatorClass', 'toolTip' => field('opccomment'));
$misc->printTree($opclasses, $attrs, 'opclasses');
exit;
}
示例11: doTree
/**
* Generate XML for the browser tree.
*/
function doTree()
{
global $misc, $data;
$domains = $data->getDomains();
$reqvars = $misc->getRequestVars('domain');
$attrs = array('text' => field('domname'), 'icon' => 'Domain', 'toolTip' => field('domcomment'), 'action' => url('domains.php', $reqvars, array('action' => 'properties', 'domain' => field('domname'))));
$misc->printTree($domains, $attrs, 'domains');
exit;
}
示例12: getServers
/**
* Get list of servers
* @param $recordset return as RecordSet suitable for printTable if true,
* otherwise just return an array.
* @param $group a group name to filter the returned servers using $conf[srv_groups]
*/
function getServers($recordset = false, $group = false)
{
global $conf;
$logins = isset($_SESSION['webdbLogin']) && is_array($_SESSION['webdbLogin']) ? $_SESSION['webdbLogin'] : array();
$srvs = array();
if ($group !== false and $group !== 'all') {
if (isset($conf['srv_groups'][$group]['servers'])) {
$group = array_fill_keys(explode(',', preg_replace('/\\s/', '', $conf['srv_groups'][$group]['servers'])), 1);
} else {
$group = '';
}
}
foreach ($conf['servers'] as $idx => $info) {
$server_id = $info['host'] . ':' . $info['port'] . ':' . $info['sslmode'];
if ($group === false or isset($group[$idx]) or $group === 'all') {
$server_id = $info['host'] . ':' . $info['port'] . ':' . $info['sslmode'];
if (isset($logins[$server_id])) {
$srvs[$server_id] = $logins[$server_id];
} else {
$srvs[$server_id] = $info;
}
$srvs[$server_id]['id'] = $server_id;
$srvs[$server_id]['action'] = url('redirect.php', array('subject' => 'server', 'server' => field('id')));
if (isset($srvs[$server_id]['username'])) {
$srvs[$server_id]['icon'] = 'Server';
$srvs[$server_id]['branch'] = url('all_db.php', array('action' => 'tree', 'subject' => 'server', 'server' => field('id')));
} else {
$srvs[$server_id]['icon'] = 'DisconnectedServer';
$srvs[$server_id]['branch'] = false;
}
}
}
function _cmp_desc($a, $b)
{
return strcmp($a['desc'], $b['desc']);
}
uasort($srvs, '_cmp_desc');
if ($recordset) {
include_once './classes/ArrayRecordSet.php';
return new ArrayRecordSet($srvs);
}
return $srvs;
}
示例13: doTree
function doTree()
{
global $misc, $data, $lang;
$databases = $data->getDatabases();
$reqvars = $misc->getRequestVars('database');
$attrs = array('text' => field('datname'), 'icon' => 'Database', 'toolTip' => field('datcomment'), 'action' => url('redirect.php', $reqvars, array('database' => field('datname'))), 'branch' => url('database.php', $reqvars, array('action' => 'tree', 'database' => field('datname'))));
$misc->printTree($databases, $attrs, 'databases');
exit;
}
示例14: doTree
function doTree()
{
global $misc, $data;
$triggers = $data->getTriggers($_REQUEST['table']);
$reqvars = $misc->getRequestVars('table');
$attrs = array('text' => field('tgname'), 'icon' => 'Trigger');
$misc->printTree($triggers, $attrs, 'triggers');
exit;
}
示例15: validation_errors
<?php
echo validation_errors('<p class="error">');
echo form_open('admin/comment/save');
?>
<?php
$comment_id = @field($this->validation->comment_id, $comment->comment_id);
echo form_input(array('name' => 'comment_id', 'id' => 'comment_id', 'size' => '20', 'maxlength' => '50', 'value' => $comment_id, 'type' => 'hidden'));
?>
<legend accesskey="D" tabindex="1">Comment Information</legend>
<div class="control-group">
<label for='comment'>Comment : </label>
<div class="controls">
<?php
$comm = @field($this->validation->comment, $comment->comment);
?>
<textarea placeholder="Comment" rows="3" id="textarea" class="input-xlarge" name="comm" ><?php
echo $comm;
?>
</textarea><BR>
</div>
</div>
<div class="form-actions">
<?php
echo form_submit('submit', 'Save');
?>
<?php
echo anchor('admin/comment', 'Cancel');
?>