当前位置: 首页>>代码示例>>PHP>>正文


PHP html_select::make_time_selectors方法代码示例

本文整理汇总了PHP中html_select::make_time_selectors方法的典型用法代码示例。如果您正苦于以下问题:PHP html_select::make_time_selectors方法的具体用法?PHP html_select::make_time_selectors怎么用?PHP html_select::make_time_selectors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在html_select的用法示例。


在下文中一共展示了html_select::make_time_selectors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: forum_print_big_search_form

/**
 * @todo Document this function
 */
function forum_print_big_search_form($course)
{
    global $CFG, $DB, $words, $subject, $phrase, $user, $userid, $fullwords, $notwords, $datefrom, $dateto, $PAGE, $OUTPUT;
    echo $OUTPUT->box(get_string('searchforumintro', 'forum'), 'searchbox boxaligncenter', 'intro');
    echo $OUTPUT->box_start('generalbox boxaligncenter');
    echo $PAGE->requires->js('mod/forum/forum.js')->asap();
    echo '<form id="searchform" action="search.php" method="get">';
    echo '<table cellpadding="10" class="searchbox" id="form">';
    echo '<tr>';
    echo '<td class="c0"><label for="words">' . get_string('searchwords', 'forum') . '</label>';
    echo '<input type="hidden" value="' . $course->id . '" name="id" alt="" /></td>';
    echo '<td class="c1"><input type="text" size="35" name="words" id="words"value="' . s($words, true) . '" alt="" /></td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="c0"><label for="phrase">' . get_string('searchphrase', 'forum') . '</label></td>';
    echo '<td class="c1"><input type="text" size="35" name="phrase" id="phrase" value="' . s($phrase, true) . '" alt="" /></td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="c0"><label for="notwords">' . get_string('searchnotwords', 'forum') . '</label></td>';
    echo '<td class="c1"><input type="text" size="35" name="notwords" id="notwords" value="' . s($notwords, true) . '" alt="" /></td>';
    echo '</tr>';
    if ($DB->get_dbfamily() == 'mysql' || $DB->get_dbfamily() == 'postgres') {
        echo '<tr>';
        echo '<td class="c0"><label for="fullwords">' . get_string('searchfullwords', 'forum') . '</label></td>';
        echo '<td class="c1"><input type="text" size="35" name="fullwords" id="fullwords" value="' . s($fullwords, true) . '" alt="" /></td>';
        echo '</tr>';
    }
    echo '<tr>';
    echo '<td class="c0">' . get_string('searchdatefrom', 'forum') . '</td>';
    echo '<td class="c1">';
    if (empty($datefrom)) {
        $datefromchecked = '';
        $datefrom = make_timestamp(2000, 1, 1, 0, 0, 0);
    } else {
        $datefromchecked = 'checked="checked"';
    }
    echo '<input name="timefromrestrict" type="checkbox" value="1" alt="' . get_string('searchdatefrom', 'forum') . '" onclick="return lockoptions(\'searchform\', \'timefromrestrict\', timefromitems)" ' . $datefromchecked . ' /> ';
    $selectors = html_select::make_time_selectors(array('days' => 'fromday', 'months' => 'frommonth', 'years' => 'fromyear', 'hours' => 'fromhour', 'minutes' => 'fromminute'), $datefrom);
    foreach ($selectors as $select) {
        echo $OUTPUT->select($select);
    }
    echo '<input type="hidden" name="hfromday" value="0" />';
    echo '<input type="hidden" name="hfrommonth" value="0" />';
    echo '<input type="hidden" name="hfromyear" value="0" />';
    echo '<input type="hidden" name="hfromhour" value="0" />';
    echo '<input type="hidden" name="hfromminute" value="0" />';
    echo '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="c0">' . get_string('searchdateto', 'forum') . '</td>';
    echo '<td class="c1">';
    if (empty($dateto)) {
        $datetochecked = '';
        $dateto = time() + 3600;
    } else {
        $datetochecked = 'checked="checked"';
    }
    echo '<input name="timetorestrict" type="checkbox" value="1" alt="' . get_string('searchdateto', 'forum') . '" onclick="return lockoptions(\'searchform\', \'timetorestrict\', timetoitems)" ' . $datetochecked . ' /> ';
    $selectors = html_select::make_time_selectors(array('days' => 'today', 'months' => 'tomonth', 'years' => 'toyear', 'hours' => 'tohour', 'minutes' => 'tominute'), $dateto);
    foreach ($selectors as $select) {
        echo $OUTPUT->select($select);
    }
    echo '<input type="hidden" name="htoday" value="0" />';
    echo '<input type="hidden" name="htomonth" value="0" />';
    echo '<input type="hidden" name="htoyear" value="0" />';
    echo '<input type="hidden" name="htohour" value="0" />';
    echo '<input type="hidden" name="htominute" value="0" />';
    echo '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="c0"><label for="menuforumid">' . get_string('searchwhichforums', 'forum') . '</label></td>';
    echo '<td class="c1">';
    echo $OUTPUT->select(html_select::make(forum_menu_list($course), 'forumid', '', get_string('allforums', 'forum')));
    echo '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="c0"><label for="subject">' . get_string('searchsubject', 'forum') . '</label></td>';
    echo '<td class="c1"><input type="text" size="35" name="subject" id="subject" value="' . s($subject, true) . '" alt="" /></td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="c0"><label for="user">' . get_string('searchuser', 'forum') . '</label></td>';
    echo '<td class="c1"><input type="text" size="35" name="user" id="user" value="' . s($user, true) . '" alt="" /></td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="submit" colspan="2" align="center">';
    echo '<input type="submit" value="' . get_string('searchforums', 'forum') . '" alt="" /></td>';
    echo '</tr>';
    echo '</table>';
    echo '</form>';
    echo $PAGE->requires->js_function_call('lockoptions_timetoitems')->asap();
    echo $PAGE->requires->js_function_call('lockoptions_timefromitems')->asap();
    echo $OUTPUT->box_end();
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:96,代码来源:search.php


注:本文中的html_select::make_time_selectors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。