本文整理汇总了PHP中smarty_function_html_select_time函数的典型用法代码示例。如果您正苦于以下问题:PHP smarty_function_html_select_time函数的具体用法?PHP smarty_function_html_select_time怎么用?PHP smarty_function_html_select_time使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smarty_function_html_select_time函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_calendar
function smarty_function_calendar($params, &$smarty)
{
require_once SMARTY_PLUGINS_DIR . 'function.html_select_time.php';
$time_params = array('prefix', 'time', 'field_array', 'all_extra', 'hour_extra', 'minute_extra', 'second_extra', 'meridian_extra', 'display_hours', 'display_minutes', 'display_seconds', 'display_meridian', 'use_24_hours', 'minute_interval', 'second_interval');
if (!isset($params["name"])) {
$params["name"] = $params["id"];
}
if (!isset($params["type"])) {
$params["type"] = "text";
}
if (!isset($params["class"])) {
$params["class"] = "calendarInput";
}
if (!isset($params["display_seconds"])) {
$params["display_seconds"] = false;
}
if (!isset($params["display_time"])) {
$params["display_time"] = false;
}
if (!isset($params["prefix"])) {
$params["prefix"] = $params["name"] . "_";
}
$input = "<input";
$select_time = array();
foreach ($params as $param => $value) {
if (!in_array($param, $time_params)) {
$input .= " {$param}=\"{$value}\"";
} else {
$select_time[$param] = $value;
}
}
$input .= "/><img src=\"" . url::base() . "static/images/calendar/calendar.gif\" onclick=\"displayCalendar(document.getElementById('" . $params["id"] . "'),'yyyy-mm-dd',this)\" class=\"calendarImg\"/>\n";
if ($params["display_time"] == true) {
$input .= smarty_function_html_select_time($select_time, $smarty);
}
return $input;
}
示例2: smarty_function_html_select_date
</PRE>
This is an example of the html_select_date function:
<form>
<?php
echo smarty_function_html_select_date(array('start_year' => 1998, 'end_year' => 2010), $_smarty_tpl->smarty, $_smarty_tpl);
?>
</form>
This is an example of the html_select_time function:
<form>
<?php
echo smarty_function_html_select_time(array('use_24_hours' => false), $_smarty_tpl->smarty, $_smarty_tpl);
?>
</form>
This is an example of the html_options function:
<form>
<select name=states>
<?php
echo smarty_function_html_options(array('values' => $_smarty_tpl->getVariable('option_values')->value, 'selected' => $_smarty_tpl->getVariable('option_selected')->value, 'output' => $_smarty_tpl->getVariable('option_output')->value), $_smarty_tpl->smarty, $_smarty_tpl);
?>
</select>
</form>
<?php
$_template = new Smarty_Internal_Template("footer.tpl", $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, null);
开发者ID:ViniciusFelix,项目名称:ProjetoPadrao,代码行数:30,代码来源:749422d4cfc3eb5677cf499730392b6accd4d1c7.file.index.tpl.cache.php
示例3: printTime
/** */
public function printTime()
{
global $ari;
$function = "function";
require_once $ari->t->_get_plugin_filepath($function, 'html_select_time');
$class = $this->class;
$checked = '';
$disabled = '';
if ($this->value['check'] == '1') {
$checked = 'checked';
$disabled = 'disabled';
}
/*
$attributes = array('prefix'=> $this->name,
'time'=> $this->value['time'],
'all_extra' => $disabled
);
*/
$attributes = array('prefix' => $this->name, 'time' => $this->value['time'], 'hour_extra' => "id='" . $this->name . "Hour'", 'minute_extra' => "id='" . $this->name . "Minute'", 'second_extra' => "id='" . $this->name . "Second'", 'all_extra' => $disabled);
$name_check = $this->name . 'Check';
$return = smarty_function_html_select_time($attributes, $ari->t);
$return .= "<input type='checkbox' class='{$class}' id='{$name_check}' name='{$name_check}' {$checked} value='1' onclick=enabledTime('{$this->name}')>Sin especificar";
return $return;
}
示例4: smarty_function_html_select_time
<td bgcolor="<?php
echo $this->_tpl_vars['light_color'];
?>
" width="80%">
<table>
<tr>
<td class="default">Start:</td>
<td><?php
echo smarty_function_html_select_time(array('minute_interval' => 5, 'time' => $this->_tpl_vars['info']['prr_blackout_start'], 'field_array' => 'blackout_start', 'prefix' => "", 'display_seconds' => false, 'all_extra' => "class='default'"), $this);
?>
</td>
</tr>
<tr>
<td class="default">End:</td>
<td><?php
echo smarty_function_html_select_time(array('minute_interval' => 5, 'time' => $this->_tpl_vars['info']['prr_blackout_end'], 'field_array' => 'blackout_end', 'prefix' => "", 'display_seconds' => false, 'all_extra' => "class='default'"), $this);
?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="<?php
echo $this->_tpl_vars['cell_color'];
?>
" align="center">
<?php
if ($_GET['cat'] == 'edit') {
?>
<input class="button" type="submit" value="Update Round Robin Entry">
示例5: content_56453e89398133_84829262
function content_56453e89398133_84829262($_smarty_tpl)
{
if (!is_callable('smarty_modifier_capitalize')) {
require_once '/var/www/html/smarty/libs/plugins/modifier.capitalize.php';
}
if (!is_callable('smarty_modifier_date_format')) {
require_once '/var/www/html/smarty/libs/plugins/modifier.date_format.php';
}
if (!is_callable('smarty_function_html_select_date')) {
require_once '/var/www/html/smarty/libs/plugins/function.html_select_date.php';
}
if (!is_callable('smarty_function_html_select_time')) {
require_once '/var/www/html/smarty/libs/plugins/function.html_select_time.php';
}
if (!is_callable('smarty_function_html_options')) {
require_once '/var/www/html/smarty/libs/plugins/function.html_options.php';
}
$_smarty_tpl->properties['nocache_hash'] = '141063041656453e88eecc04_08919544';
Smarty_Internal_Extension_Config::configLoad($_smarty_tpl, "test.conf", "setup", 'local');
echo $_smarty_tpl->getSubTemplate("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array('title' => 'foo'), 0);
?>
<PRE>
<?php
if ($_smarty_tpl->getConfigVariable('bold')) {
?>
<b><?php
}
?>
Title: <?php
echo smarty_modifier_capitalize($_smarty_tpl->getConfigVariable('title'));
?>
<?php
if ($_smarty_tpl->getConfigVariable('bold')) {
?>
</b><?php
}
?>
The current date and time is <?php
echo smarty_modifier_date_format(time(), "%Y-%m-%d %H:%M:%S");
?>
The value of global assigned variable $SCRIPT_NAME is <?php
echo $_smarty_tpl->tpl_vars['SCRIPT_NAME']->value;
?>
Example of accessing server environment variable SERVER_NAME: <?php
echo $_SERVER['SERVER_NAME'];
?>
The value of {$Name} is <b><?php
echo '/*%%SmartyNocache:141063041656453e88eecc04_08919544%%*/<?php echo $_smarty_tpl->tpl_vars[\'Name\']->value;?>
/*/%%SmartyNocache:141063041656453e88eecc04_08919544%%*/';
?>
</b>
variable modifier example of {$Name|upper}
<b><?php
echo '/*%%SmartyNocache:141063041656453e88eecc04_08919544%%*/<?php echo mb_strtoupper($_smarty_tpl->tpl_vars[\'Name\']->value, \'UTF-8\');?>
/*/%%SmartyNocache:141063041656453e88eecc04_08919544%%*/';
?>
</b>
An example of a section loop:
<?php
if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['outer'])) {
unset($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']);
}
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['name'] = 'outer';
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['FirstName']->value) ? count($_loop) : max(0, (int) $_loop);
unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['loop'] - 1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['show']) {
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['loop'];
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total'] == 0) {
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['show'] = false;
}
} else {
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total'] = 0;
}
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['show']) {
for ($_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration']++) {
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['outer']['step'];
//.........这里部分代码省略.........
开发者ID:HarukiHashimoto,项目名称:htdocs,代码行数:101,代码来源:7a9dcff75315c538ac24344dee4c6dbfdf1725fc_0.file.index.tpl.cache.php
示例6: smarty_function_html_select_date
</PRE>
This is an example of the html_select_date function:
<form>
<?php
echo smarty_function_html_select_date(array('start_year' => 1998, 'end_year' => 2010), $this);
?>
</form>
This is an example of the html_select_time function:
<form>
<?php
echo smarty_function_html_select_time(array('use_24_hours' => false), $this);
?>
</form>
This is an example of the html_options function:
<form>
<select name=states>
<?php
echo smarty_function_html_options(array('values' => $this->_tpl_vars['option_values'], 'selected' => $this->_tpl_vars['option_selected'], 'output' => $this->_tpl_vars['option_output']), $this);
?>
</select>
</form>
示例7: content_56789a6a17e782_53410507
function content_56789a6a17e782_53410507($_smarty_tpl)
{
if (!is_callable('smarty_modifier_capitalize')) {
require_once '/home/hammad/Desktop/Sportoya/application/libraries/smarty/plugins/modifier.capitalize.php';
}
if (!is_callable('smarty_function_ci_config')) {
require_once '/home/hammad/Desktop/Sportoya/application/libraries/smarty/plugins/function.ci_config.php';
}
if (!is_callable('smarty_modifier_date_format')) {
require_once '/home/hammad/Desktop/Sportoya/application/libraries/smarty/plugins/modifier.date_format.php';
}
if (!is_callable('smarty_function_html_select_date')) {
require_once '/home/hammad/Desktop/Sportoya/application/libraries/smarty/plugins/function.html_select_date.php';
}
if (!is_callable('smarty_function_html_select_time')) {
require_once '/home/hammad/Desktop/Sportoya/application/libraries/smarty/plugins/function.html_select_time.php';
}
if (!is_callable('smarty_function_ci_language')) {
require_once '/home/hammad/Desktop/Sportoya/application/libraries/smarty/plugins/function.ci_language.php';
}
if (!is_callable('smarty_function_ci_form_validation')) {
require_once '/home/hammad/Desktop/Sportoya/application/libraries/smarty/plugins/function.ci_form_validation.php';
}
if (!is_callable('smarty_function_html_options')) {
require_once '/home/hammad/Desktop/Sportoya/application/libraries/smarty/plugins/function.html_options.php';
}
$_smarty_tpl->properties['nocache_hash'] = '23305161056789a69797566_98732353';
echo $_smarty_tpl->getSubTemplate("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('title' => "Example Smarty Page", 'name' => (string) $_smarty_tpl->tpl_vars['Name']->value), 0);
?>
<h1>
<?php
if ($_smarty_tpl->tpl_vars['bold']->value) {
?>
<b><?php
}
?>
Title: <?php
echo smarty_modifier_capitalize($_smarty_tpl->tpl_vars['title']->value);
?>
<?php
if ($_smarty_tpl->tpl_vars['bold']->value) {
?>
</b><?php
}
?>
</h1>
<?php
if ($_smarty_tpl->tpl_vars['error']->value != '') {
?>
<p class="error"><?php
echo $_smarty_tpl->tpl_vars['error']->value;
?>
</p><?php
}
if ($_smarty_tpl->tpl_vars['message']->value != '') {
?>
<p class="message"><?php
echo $_smarty_tpl->tpl_vars['message']->value;
?>
</p><?php
}
?>
<?php
echo smarty_function_ci_config(array('name' => "base_url"), $_smarty_tpl);
?>
<p>The configuration value of base_url is <em><?php
echo $_smarty_tpl->tpl_vars['base_url']->value;
?>
</em></p>
<p>The current date and time is <em><?php
echo smarty_modifier_date_format(time(), "%Y-%m-%d %H:%M:%S");
?>
</em></p>
<p>The value of global assigned variable $SCRIPT_NAME is <em><?php
echo $_smarty_tpl->tpl_vars['SCRIPT_NAME']->value;
?>
</em></p>
<p>The value of server environment variable SERVER_NAME is <em><?php
echo $_SERVER['SERVER_NAME'];
?>
</em></p>
<p>The value of your IP address is: <em><?php
echo $_smarty_tpl->tpl_vars['ip_address']->value;
?>
</em></p>
<p>The value of {$Name} is <em><?php
echo $_smarty_tpl->tpl_vars['Name']->value;
?>
//.........这里部分代码省略.........
开发者ID:Hammad90,项目名称:SportoyaRepo,代码行数:101,代码来源:aea8ffdbbdf37e0b39bfc0ed127dff9ce173d1a2_0.file.example.tpl.php
示例8: smarty_function_bit_select_datetime
function smarty_function_bit_select_datetime($pParams, &$gBitSmarty)
{
global $gBitSystem;
global $gBitUser;
// Default values
$name = 'date';
// ID of the input field
// unsupported as of now $format = $gBitSystem->getConfig( 'site_short_date_format' ).' '.$gBitSystem->getConfig( 'site_short_time_format' ); // date format used
$showtime = 'true';
//true: show time; false: pick date only
$time = time();
// override the currently set date
//extract actual parameters from the params hashmap.
extract($pParams);
//calculate a name we can use for additional (internal) fields
$nname = str_replace('[', '_', str_replace(']', '_', $name));
if ($gBitSystem->isFeatureActive('site_use_jscalendar')) {
// A readonly field will be used to display the currently selected value.
//A button besides the field will bring up the calendar (style similar to other PIM rich client applications)
//It is the readonly input field that will be evaluated back on the server
//unsupported $format = preg_replace( "/%Z/", "", $format ); // JSCalendar does not know about time zones
$html_result = "<input type=\"text\" name=\"{$name}\" id=\"{$nname}_id\" value=\"{$time}\" readonly />\n";
$html_result = $html_result . "<button type=\"reset\" id=\"{$nname}_button\">...</button>\n";
$html_result = $html_result . "<script type=\"text/javascript\">\n";
$html_result = $html_result . " Calendar.setup({\n";
$html_result = $html_result . " date : \"{$time}\",\n";
$html_result = $html_result . " inputField : \"{$nname}_id\", // id of the input field\n";
$html_result = $html_result . " ifFormat : \"%Y-%m-%d %H:%M\", // format of the input field\n";
$html_result = $html_result . " showsTime : {$showtime}, // will display a time selector\n";
$html_result = $html_result . " button : \"{$nname}_button\", // trigger for the calendar (button ID)\n";
$html_result = $html_result . " singleClick : true, // double-click mode\n";
$html_result = $html_result . " step : 1 // show all years in drop-down boxes (instead of every other year as default)\n";
$html_result = $html_result . " });\n";
$html_result = $html_result . "</script>\n";
} else {
$gBitSmarty->loadPlugin('smarty_modifier_html_select_date');
$gBitSmarty->loadPlugin('smarty_modifier_html_select_time');
// we use html_select_date and html_select_time to pick a date, which generate a number of select fields.
//On every change a hidden field will be updated via javascript.
//it's the hidden field that is evaluated back on the server.
$pDate = array('prefix' => $nname, 'all_extra' => "onchange=\"bit_select_datetime_{$nname}()\"", 'time' => $time);
$pTime = array('prefix' => $nname, 'all_extra' => "onchange=\"bit_select_datetime_{$nname}()\"", 'display_seconds' => false, 'time' => $time);
$html_result = "<input type=\"hidden\" name=\"{$name}\" value=\"{$time}\">";
$html_result .= smarty_function_html_select_date($pDate, $gBitSmarty);
if ($showtime == 'true') {
$html_result .= smarty_function_html_select_time($pTime, $gBitSmarty);
$html_result .= "<script type=\"text/javascript\"> \n";
$html_result .= " function bit_select_datetime_{$nname} () {\n";
$html_result .= " \tvar date = new Date(); \n date.setHours ( document.getElementsByName(\"{$nname}Hour\")[0].value);\ndate.setMinutes( document.getElementsByName(\"{$nname}Minute\")[0].value); \n date.setFullYear(document.getElementsByName(\"{$nname}Year\")[0].value,document.getElementsByName(\"{$nname}Month\")[0].value-1,document.getElementsByName(\"{$nname}Day\")[0].value); \n ";
$html_result .= "document.getElementsByName(\"{$name}\")[0].value = Math.floor(date.getTime() / 1000);";
$html_result .= "}\n";
$html_result .= "</script>\n";
} else {
$html_result .= "<script type=\"text/javascript\">\n";
$html_result .= " function bit_select_datetime_{$name} () {\n";
$html_result .= " \tvar date = new Date(); \n date.setDate( document.getElementsByName(\"{$nname}Day\")[0].value ); \n date.setMonth(document.getElementsByName(\"{$nname}Month\")[0].value-1); \n date.setFullYear(document.getElementsByName(\"{$nname}Year\")[0].value); \n ";
$html_result .= " document.getElementsByName(\"{$name}\")[0].value = Math.floor(date.getTime() / 1000);";
$html_result .= "}\n";
$html_result .= "</script>\n";
}
}
return $html_result . "(" . $gBitUser->getPreference('site_display_utc') . ")\n";
}
示例9: elseif
</td>
<?php
} elseif ($this->_tpl_vars['data'][$this->_sections['d']['index']]['Type'] == 'datetime') {
?>
<td class="table-form-title" ><?php
echo $this->_tpl_vars['lang']['db'][$this->_tpl_vars['fullField']];
if ($this->_tpl_vars['data'][$this->_sections['d']['index']]['Null'] != 'YES') {
?>
*<?php
}
?>
:</td><td class="table-form-field" ><?php
echo smarty_function_html_select_date(array('time' => $this->_tpl_vars['data'][$this->_sections['d']['index']]['value'], 'prefix' => "CONDATETIME_" . $this->_tpl_vars['data'][$this->_sections['d']['index']]['fullField'] . "_"), $this);
?>
- <?php
echo smarty_function_html_select_time(array('time' => $this->_tpl_vars['data'][$this->_sections['d']['index']]['value'], 'prefix' => "CONDATETIME_" . $this->_tpl_vars['data'][$this->_sections['d']['index']]['fullField'] . "_"), $this);
?>
</td>
<?php
} elseif ($this->_tpl_vars['data'][$this->_sections['d']['index']]['Type'] == 'text') {
?>
<td class="table-form-title" ><?php
echo $this->_tpl_vars['lang']['db'][$this->_tpl_vars['fullField']];
if ($this->_tpl_vars['data'][$this->_sections['d']['index']]['Null'] != 'YES') {
?>
*<?php
}
?>
:</td><td class="table-form-field" ><textarea class="fld-form-input" name="<?php
echo $this->_tpl_vars['data'][$this->_sections['d']['index']]['fullField'];
?>
示例10: wikiplugin_tracker
//.........这里部分代码省略.........
}
$checked = $f['value'] == 'y' ? 'checked="checked"' : '';
$back .= '</td><td><input type="checkbox" name="track[' . $f["fieldId"] . ']" value="y" ' . $checked . '/>';
} elseif ($f['type'] == 'i') {
$back .= "<tr><td>" . wikiplugin_tracker_name($f['fieldId'], $f['name'], $field_errors);
if ($showmandatory == 'y' and $f['isMandatory'] == 'y') {
$back .= " <b>*</b> ";
$onemandatory = true;
}
$back .= "</td><td>";
$back .= '<input type="file" name="track[' . $f["fieldId"] . ']" />';
} elseif ($f['type'] == 'f') {
$back .= "<tr><td>" . wikiplugin_tracker_name($f['fieldId'], $f['name'], $field_errors);
if ($showmandatory == 'y' and $f['isMandatory'] == 'y') {
$back .= " <b>*</b> ";
$onemandatory = true;
}
$back .= "</td><td>";
include_once 'lib/smarty_tiki/function.html_select_date.php';
include_once 'lib/smarty_tiki/function.html_select_time.php';
$params['prefix'] = 'track_' . $f['fieldId'];
if (isset($f['options_array'][1])) {
$params['start_year'] = $f['options_array'][1];
}
if (isset($f['options_array'][2])) {
$params['end_year'] = $f['options_array'][2];
}
if (isset($f['value'])) {
$params['time'] = $f['value'];
}
$back .= smarty_function_html_select_date($params, $smarty);
if (empty($f['options_array'][0]) || $f['options_array'][0] != 'd') {
$params['display_seconds'] = false;
$back .= smarty_function_html_select_time($params, $smarty);
}
} elseif ($f['type'] == 'j') {
$back .= "<tr><td>" . wikiplugin_tracker_name($f['fieldId'], $f['name'], $field_errors);
if ($showmandatory == 'y' and $f['isMandatory'] == 'y') {
$back .= " <b>*</b> ";
$onemandatory = true;
}
$back .= "</td><td>";
include_once 'lib/smarty_tiki/function.jscalendar.php';
$params['id'] = 'track[' . $f['fieldId'] . ']';
$params['fieldname'] = 'track[' . $f['fieldId'] . ']';
if (empty($f['options_array'][0]) || $f['options_array'][0] != 'd') {
$params['showtime'] = 'y';
} else {
$params['showtime'] = 'n';
}
if (isset($f['value'])) {
$params['date'] = $f['value'];
}
$back .= smarty_function_jscalendar_body($params, $smarty);
} elseif ($f['type'] == 'C' && isset($_REQUEST['tr_preview'])) {
// computed
$back .= "<tr><td>" . wikiplugin_tracker_name($f['fieldId'], $f['name'], $field_errors) . "</td><td>";
$calc = preg_replace('/#([0-9]+)/', '$assocNumerics[\\1]', $f['options_array'][0]);
eval('$computed = ' . $calc . ';');
$back .= $computed;
} elseif ($f['type'] == 'l' && isset($_REQUEST['tr_preview'])) {
// itemlist
$back .= "<tr><td>" . wikiplugin_tracker_name($f['fieldId'], $f['name'], $field_errors) . "</td><td>";
$items = $trklib->get_items_list($f['options_array'][0], $f['options_array'][1], $assocValues[$f['options_array'][2]]);
$i = 0;
foreach ($items as $id) {
示例11: smarty_function_datagrid
//.........这里部分代码省略.........
}
# Tenemos permiso para mostrar este campo?
if (isset($dd[$_key]['extra']['role']) && $dd[$_key]['extra']['role'] !== $_SESSION['idalm_role']) {
$dd[$_key]['type'] = 'hidden';
}
if ($parent == $_key) {
$parentid = $_val;
$dd[$_key]['type'] = 'hidden';
} elseif ($dd[$_key]['references']) {
$_selected = $_val;
if (!isset($references[$dd[$_key]['references']])) {
$references[$dd[$_key]['references']] = 0;
}
if ($dd[$_key]['references'] == $name && !$references[$dd[$_key]['references']]) {
$references[$dd[$_key]['references']] += 2;
} else {
$references[$dd[$_key]['references']]++;
}
$n = $references[$dd[$_key]['references']] == 1 ? '' : $references[$dd[$_key]['references']];
$_val = $row[$dd[$_key]['references'] . $n];
$dd[$_key]['type'] = 'references';
}
switch ($dd[$_key]['type']) {
case 'file':
case 'image':
case 'img':
$_tmp = '';
if ($_val) {
$_tmp = '<input type="checkbox" checked name="' . $_key . '_keep" /> ' . ALM_KEEP_FILE . ' (' . $_val . ')<br /><img src="' . URL . '/' . ALM_URI . '/pic/50/' . $table . '/' . $_val . '" alt="' . $_val . '" width="50" border="0" /><br />';
}
$_tmp .= '<input type="file" name="' . $_key . '" value="' . $_val . '" />';
break;
case 'time':
$_tmp = smarty_function_html_select_time(array('prefix' => $_key . '_', 'time' => $_val, 'display_seconds' => false), $smarty);
break;
case 'datetime':
$_tmp = '<input type="hidden" name="' . $_key . '" value="' . $_val . '" />';
$_tmp .= $_val;
break;
case 'date':
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => "-10", 'end_year' => "+10"), $smarty);
break;
case 'boolean':
case 'bool':
if ($dd[$_key]['extra']['label_bool']) {
list($_si, $_no) = preg_split('/:/', $dd[$_key]['extra']['label_bool']);
$_tchecked = $_val == 't' ? 'checked' : '';
$_fchecked = $_val == 'f' ? 'checked' : '';
$_tmp = $_si . '<input type="radio" name="' . $_key . '" ' . $_tchecked . ' value="on">' . $_no . '<input type="radio" name="' . $_key . '" ' . $_fchecked . ' value="">';
} else {
$_checked = $_val == 't' ? 'checked' : '';
$_tmp = '<input type="checkbox" name="' . $_key . '" ' . $_checked . ' />';
}
break;
case 'text':
$_tmp = preg_replace("/_VALUE_/", qdollar(htmlentities($_val, ENT_COMPAT, 'UTF-8')), DGCELLMODSTR);
$_tmp = preg_replace("/_FIELD_/", $_key, $_tmp);
break;
case 'xhtml':
$_tmp = '<textarea rows="5" cols="40" class="adm" id="grid' . $_key . '" name="' . $_key . '"' . ($dd[$_key]['extra']['style'] ? ' style="' . $dd[$_key]['extra']['style'] . '"' : '') . '>' . $_val . '</textarea>';
$_tmp .= "<script language=\"JavaScript\">\ntinyMCE.execCommand(\"mceAddControl\", true,\"grid{$_key}\");\n</script>\n";
break;
case 'varchar':
case 'char':
if ($dd[$_key]['extra']['list_values']) {
$_options = $dd[$_key]['extra']['list_values'];
示例12: smarty_function_dataform
//.........这里部分代码省略.........
if ($_val) {
$_tmp .= '<input type="checkbox" checked name="' . $_key . '_keep" /> Conservar archivo actual (' . $_val . ')<br /><img src="' . URL . '/' . ALM_URI . '/pic/50/' . $table . '/' . $_val . '" alt="' . $_val . '" width="50" border="0" /><br />';
}
$_tmp .= '<input type="file" name="' . $_key . '" value="' . $_val . '" />';
break;
case 'boolean':
case 'bool':
if (preg_match("/:/", $dd[$_key]['extra']['label_bool'])) {
list($_si, $_no) = preg_split('/:/', $dd[$_key]['extra']['label_bool']);
$_tchecked = $_val == 't' ? 'checked' : '';
$_fchecked = $_val == 'f' ? 'checked' : '';
$_tmp = $_si . '<input type="radio" name="' . $_key . '" ' . $_tchecked . ' value="on" />' . $_no . '<input type="radio" name="' . $_key . '" ' . $_fchecked . ' value="" />';
} else {
$_checked = $_val == 't' ? 'checked' : '';
$_tmp = '<input type="checkbox" name="' . $_key . '" ' . $_checked . ' />';
}
break;
case 'datenull':
if (preg_match("/:/", $dd[$_key]['extra']['range'])) {
list($_start_year, $_end_year) = preg_split('/:/', $dd[$_key]['extra']['range']);
}
if (!isset($_val) || empty($_val)) {
$_val = '--';
}
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => $_start_year, 'end_year' => $_end_year, 'day_empty' => '--', 'month_empty' => '--', 'year_empty' => '--'), $smarty);
break;
case 'date':
if (preg_match("/:/", $dd[$_key]['extra']['range'])) {
list($_start_year, $_end_year) = preg_split('/:/', $dd[$_key]['extra']['range']);
}
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => $_start_year, 'end_year' => $_end_year), $smarty);
break;
case 'time':
$_tmp = smarty_function_html_select_time(array('prefix' => $_key . '_', 'time' => $_val, 'display_seconds' => false), $smarty);
break;
case 'datetime':
if (preg_match("/:/", $dd[$_key]['extra']['range'])) {
list($_start_year, $_end_year) = preg_split('/:/', $dd[$_key]['extra']['range']);
}
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => $_start_year, 'end_year' => $_end_year), $smarty);
$_tmp .= smarty_function_html_select_time(array('prefix' => $_key . '_', 'time' => $_val, 'display_seconds' => false), $smarty);
break;
case 'datetimenull':
if (preg_match("/:/", $dd[$_key]['extra']['range'])) {
list($_start_year, $_end_year) = preg_split('/:/', $dd[$_key]['extra']['range']);
}
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => $_start_year, 'end_year' => $_end_year, 'day_empty' => '--', 'month_empty' => '--', 'year_empty' => '--'), $smarty);
$_tmp .= smarty_function_html_select_time(array('prefix' => $_key . '_', 'time' => $_val, 'display_seconds' => false), $smarty);
break;
case 'password':
$_tmp = '<input type="password" name="' . $_key . '" size="20" maxlength="16" />';
break;
case 'text':
$_tmp = '<textarea rows="5" cols="40" name="' . $_key . '">' . $_val . '</textarea> <a href="javascript:edittext(\'' . $name . '\', \'' . $_key . '\', document.forms[\'' . $name . '\'].' . $_key . '.value);">' . ALM_MAX . '</a>';
break;
case 'html':
$_tmp = '<textarea rows="5" cols="40" id="' . $_key . '" name="' . $_key . '">' . $_val . '</textarea> <a href="javascript:edithtml(\'' . $name . '\', \'' . $_key . '\', document.forms[\'' . $name . '\'].' . $_key . '.value);">' . ALM_MAX . '</a>';
$_tmp .= "<script language=\"JavaScript\">\ngenerate_wysiwyg('" . $_key . "');\n</script>\n";
break;
case 'xhtml':
$_tmp = '<textarea rows="5" cols="40" class="adm" id="' . $_key . '" name="' . $_key . '"' . ($dd[$_key]['extra']['style'] ? ' style="' . $dd[$_key]['extra']['style'] . '"' : '') . '>' . $_val . '</textarea>';
$_tmp .= "<script language=\"JavaScript\">\ntinyMCE.execCommand(\"mceAddControl\", true,\"{$_key}\");\n</script>\n";
break;
case 'varchar':
case 'char':
if ($dd[$_key]['extra']['list_values']) {
示例13: smarty_function_datagrid2
//.........这里部分代码省略.........
$_html_row = '';
$_chosen = $key2 ? $_REQUEST[$key1] == $row[$key1] && $_REQUEST[$key2] == $row[$key2] : $_REQUEST[$key] == $row[$key];
if ($_REQUEST['f'] == $name && $_REQUEST['action'] == 'mod' && $_chosen) {
$_cols = 0;
foreach ($row as $_key => $_val) {
if ($maxcols && $_cols >= $maxcols) {
break;
}
if (!$dd[$_key]) {
continue;
}
if ($parent == $_key) {
$parentid = $_val;
$dd[$_key]['type'] = 'hidden';
} elseif ($dd[$_key]['references']) {
$_selected = $_val;
$_val = $row[$dd[$_key]['references']];
$dd[$_key]['type'] = 'references';
}
switch ($dd[$_key]['type']) {
case 'hidden':
$_tmp = '<input type="hidden" name="' . $_key . '" value="' . $_val . '" />';
break;
case 'file':
case 'image':
case 'img':
$_tmp = '';
if ($_val) {
$_tmp = '<input type="checkbox" checked name="' . $_key . '_keep" /> Conservar archivo actual (' . $_val . ')<br /><img src="' . URL . '/' . ALM_URI . '/pic/50/' . $table . '/' . $_val . '" alt="' . $_val . '" width="50" border="0" /><br />';
}
$_tmp .= '<input type="file" name="' . $_key . '" value="' . $_val . '" />';
break;
case 'time':
$_tmp = smarty_function_html_select_time(array('prefix' => $_key . '_', 'time' => $_val, 'display_seconds' => false), $smarty);
break;
case 'datetime':
$_tmp = '<input type="hidden" name="' . $_key . '" value="' . $_val . '" />';
$_tmp .= $_val;
break;
case 'date':
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => "-10", 'end_year' => "+10"), $smarty);
break;
case 'boolean':
case 'bool':
if ($dd[$_key]['extra']['label_bool']) {
list($_si, $_no) = preg_split('/:/', $dd[$_key]['extra']['label_bool']);
$_tchecked = $_val == 't' ? 'checked' : '';
$_fchecked = $_val == 'f' ? 'checked' : '';
$_tmp = $_si . '<input type="radio" name="' . $_key . '" ' . $_tchecked . ' value="on">' . $_no . '<input type="radio" name="' . $_key . '" ' . $_fchecked . ' value="">';
} else {
$_checked = $_val == 't' ? 'checked' : '';
$_tmp = '<input type="checkbox" name="' . $_key . '" ' . $_checked . ' />';
}
break;
case 'text':
$_tmp = preg_replace("/_VALUE_/", qdollar($_val), DGCELLMODTXT);
$_tmp = preg_replace("/_FIELD_/", $_key, $_tmp);
break;
case 'xhtml':
$_tmp = '<textarea rows="5" cols="40" class="adm" id="grid' . $_key . '" name="' . $_key . '"' . ($dd[$_key]['extra']['style'] ? ' style="' . $dd[$_key]['extra']['style'] . '"' : '') . '>' . $_val . '</textarea>';
$_tmp .= "<script language=\"JavaScript\">\ntinyMCE.execCommand(\"mceAddControl\", true,\"grid{$_key}\");\n</script>\n";
break;
case 'varchar':
case 'char':
if ($dd[$_key]['extra']['list_values']) {
$_options = $dd[$_key]['extra']['list_values'];
示例14: smarty_function_html_select_date
<tr>
<td><?php
echo $this->_tpl_vars['labels']['date'];
?>
</td><td><?php
echo smarty_function_html_select_date(array('prefix' => 'end_', 'time' => $this->_tpl_vars['gui']->selected_end_date, 'month_format' => '%m', 'start_year' => "-1", 'end_year' => "+1", 'field_order' => $this->_tpl_vars['gsmarty_html_select_date_field_order']), $this);
?>
</td>
</tr>
<tr>
<td><?php
echo $this->_tpl_vars['labels']['hour'];
?>
</td>
<td align='left'><?php
echo smarty_function_html_select_time(array('prefix' => 'end_', 'display_minutes' => false, 'time' => $this->_tpl_vars['gui']->selected_end_time, 'display_seconds' => false, 'use_24_hours' => true), $this);
?>
</td>
</tr>
</table>
</td>
</tr>
<!--
KL - 20070627 -Functionality to allow query by executor or grep the notes field
Allows user to change what data / results are displayed in report
-->
<tr>
<th><?php
echo lang_get_smarty(array('s' => 'select_owner_header'), $this);
示例15: smarty_function_dataform2
//.........这里部分代码省略.........
$_tmp .= '<input type="file" name="' . $_key . '" value="' . $_val . '" />';
break;
case 'boolean':
case 'bool':
if (preg_match("/:/", $dd[$_key]['extra']['label_bool'])) {
list($_si, $_no) = preg_split('/:/', $dd[$_key]['extra']['label_bool']);
$_tchecked = $_val == 't' ? 'checked' : '';
$_fchecked = $_val == 'f' ? 'checked' : '';
$_tmp = $_si . '<input type="radio" name="' . $_key . '" ' . $_tchecked . ' value="on" />' . $_no . '<input type="radio" name="' . $_key . '" ' . $_fchecked . ' value="" />';
} else {
$_checked = $_val == 't' ? 'checked' : '';
$_tmp = '<input type="checkbox" name="' . $_key . '" ' . $_checked . ' />';
}
break;
case 'datenull':
if (preg_match("/:/", $dd[$_key]['extra']['range'])) {
list($_start_year, $_end_year) = preg_split('/:/', $dd[$_key]['extra']['range']);
}
if (!isset($_val) || empty($_val)) {
$_val = '--';
}
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => $_start_year, 'end_year' => $_end_year, 'day_empty' => '--', 'month_empty' => '--', 'year_empty' => '--'), $smarty);
break;
case 'date':
if (!$_val) {
$_val = $dd[$_key]['extra']['default'];
}
if (preg_match("/:/", $dd[$_key]['extra']['range'])) {
list($_start_year, $_end_year) = preg_split('/:/', $dd[$_key]['extra']['range']);
}
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => $_start_year, 'end_year' => $_end_year), $smarty);
break;
case 'time':
$_tmp = smarty_function_html_select_time(array('prefix' => $_key . '_', 'time' => $_val, 'display_seconds' => false), $smarty);
break;
case 'datetime':
if (!$_val) {
$_val = $dd[$_key]['extra']['default'];
}
if (preg_match("/:/", $dd[$_key]['extra']['range'])) {
list($_start_year, $_end_year) = preg_split('/:/', $dd[$_key]['extra']['range']);
}
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => $_start_year, 'end_year' => $_end_year), $smarty);
$_tmp .= smarty_function_html_select_time(array('prefix' => $_key . '_', 'time' => $_val, 'display_seconds' => false), $smarty);
break;
case 'datetimenull':
if (!$_val) {
$_val = $dd[$_key]['extra']['default'];
}
if (preg_match("/:/", $dd[$_key]['extra']['range'])) {
list($_start_year, $_end_year) = preg_split('/:/', $dd[$_key]['extra']['range']);
}
$_tmp = smarty_function_html_select_date(array('prefix' => $_key . '_', 'time' => $_val, 'start_year' => $_start_year, 'end_year' => $_end_year, 'day_empty' => '--', 'month_empty' => '--', 'year_empty' => '--'), $smarty);
$_tmp .= smarty_function_html_select_time(array('prefix' => $_key . '_', 'time' => $_val, 'display_seconds' => false), $smarty);
break;
case 'password':
$_tmp = '<input type="password" name="' . $_key . '" size="20" maxlength="16" />';
break;
case 'text':
$_tmp = '<textarea rows="5" cols="40" name="' . $_key . '">' . $_val . '</textarea> <a href="javascript:edittext(\'' . $name . '\', \'' . $_key . '\', document.forms[\'' . $name . '\'].' . $_key . '.value);">' . ALM_MAX . '</a>';
break;
case 'html':
$_tmp = '<textarea rows="5" cols="40" class="adm" id="' . $_key . '" name="' . $_key . '">' . $_val . '</textarea>';
$_tmp .= "<script language=\"JavaScript\">\ngenerate_wysiwyg('" . $_key . "');\n</script>\n";
break;
case 'xhtml':