本文整理汇总了PHP中html_select::make_time_selector方法的典型用法代码示例。如果您正苦于以下问题:PHP html_select::make_time_selector方法的具体用法?PHP html_select::make_time_selector怎么用?PHP html_select::make_time_selector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html_select
的用法示例。
在下文中一共展示了html_select::make_time_selector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_add_field
function display_add_field($recordid = 0)
{
global $DB, $OUTPUT;
if ($recordid) {
$content = (int) $DB->get_field('data_content', 'content', array('fieldid' => $this->field->id, 'recordid' => $recordid));
} else {
$content = time();
}
$str = '<div title="' . s($this->field->description) . '">';
$dayselector = html_select::make_time_selector('days', 'field_' . $this->field->id . '_day', $content);
$monthselector = html_select::make_time_selector('months', 'field_' . $this->field->id . '_month', $content);
$yearselector = html_select::make_time_selector('years', 'field_' . $this->field->id . '_year', $content);
$str .= $OUTPUT->select($dayselector) . $OUTPUT->select($monthselector) . $OUTPUT->select($yearselector);
$str .= '</div>';
return $str;
}
示例2: print_date_selector
/**
* Prints form items with the names $day, $month and $year
*
* @deprecated since Moodle 2.0
*
* @param string $day fieldname
* @param string $month fieldname
* @param string $year fieldname
* @param int $currenttime A default timestamp in GMT
* @param boolean $return If set to true returns rather than echo's
* @return string|bool Depending on value of $return
*/
function print_date_selector($day, $month, $year, $currenttime = 0, $return = false)
{
debugging('print_date_selector() has been deprecated. Please change your code to use $OUTPUT->select($dateselector).');
global $OUTPUT;
$dayselector = html_select::make_time_selector('days', $day, $currenttime);
$monthselector = html_select::make_time_selector('months', $month, $currenttime);
$yearselector = html_select::make_time_selector('years', $year, $currenttime);
$output = $OUTPUT->select($dayselector) . $OUTPUT->select($monthselector) . $OUTPUT->select($yearselector);
if ($return) {
return $output;
} else {
echo $output;
}
}
示例3: make_time_selectors
/**
* Given an associative array of type => fieldname and an optional timestamp,
* returns an array of html_select components representing date/time selectors.
* @param array $selectors Arrays of type => fieldname. Selectors will be returned in the order of the types given
* @param int $currenttime A UNIX timestamp
* @param int $step minute spacing
* @return array Instantiated date/time selectors
*/
public function make_time_selectors($selectors, $currenttime = 0, $step = 5)
{
$selects = array();
foreach ($selectors as $type => $name) {
$selects[] = html_select::make_time_selector($type, $name, $currenttime, $step);
}
return $selects;
}
示例4: p
<td><input type="text" name="an_referer" size="35" value="<?php
p($frm->an_referer);
?>
" /><br />
<?php
print_string("anreferer", "enrol_authorize");
?>
</td>
</tr>
<tr valign="top">
<td align="right">an_cutoff:</td>
<td><?php
$curtime = make_timestamp(2000, 1, 1, $frm->an_cutoff_hour, $frm->an_cutoff_min);
$hourselector = html_select::make_time_selector('hours', 'an_cutoff_hour', $curtime);
$minselector = html_select::make_time_selector('minutes', 'an_cutoff_min', $curtime);
echo $OUTPUT->select($hourselector) . $OUTPUT->select($minselector);
?>
<br />
<?php
print_string("cutofftime", "enrol_authorize");
?>
</td>
</tr>
<tr valign="top">
<td align="right">an_avs:</td>
<td><?php
echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_avs)), 'an_avs');
?>
<br />