コード例 #1
0
ファイル: field.class.php プロジェクト: ajv/Offline-Caching
 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
0
ファイル: deprecatedlib.php プロジェクト: ajv/Offline-Caching
/**
 * 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
0
 /**
  * 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
0
ファイル: config_form.php プロジェクト: ajv/Offline-Caching
    <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 />