當前位置: 首頁>>代碼示例>>PHP>>正文


PHP html_select::make_time_selector方法代碼示例

本文整理匯總了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;
 }
開發者ID:ajv,項目名稱:Offline-Caching,代碼行數:16,代碼來源:field.class.php

示例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;
    }
}
開發者ID:ajv,項目名稱:Offline-Caching,代碼行數:26,代碼來源:deprecatedlib.php

示例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;
 }
開發者ID:ajv,項目名稱:Offline-Caching,代碼行數:16,代碼來源:outputcomponents.php

示例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 />
開發者ID:ajv,項目名稱:Offline-Caching,代碼行數:31,代碼來源:config_form.php


注:本文中的html_select::make_time_selector方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。