本文整理汇总了PHP中html_select::add_action方法的典型用法代码示例。如果您正苦于以下问题:PHP html_select::add_action方法的具体用法?PHP html_select::add_action怎么用?PHP html_select::add_action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html_select
的用法示例。
在下文中一共展示了html_select::add_action方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
echo "</td>";
}
echo "</tr>";
}
if ($abletomovecourses) {
$movetocategories = array();
$notused = array();
make_categories_list($movetocategories, $notused, 'moodle/category:manage');
$movetocategories[$category->id] = get_string('moveselectedcoursesto');
echo '<tr><td colspan="3" align="right">';
$select = new html_select();
$select->options = $movetocategories;
$select->name = 'moveto';
$select->selectedvalue = $category->id;
$select->add_action('change', 'submit_form_by_id', array('id' => 'movecourses'));
echo $OUTPUT->select($select);
echo '<input type="hidden" name="id" value="' . $category->id . '" />';
echo '</td></tr>';
}
echo '</table>';
echo '</div></form>';
echo '<br />';
}
}
echo '<div class="buttons">';
if (has_capability('moodle/category:manage', $context) and $numcourses > 1) {
/// Print button to re-sort courses by name
unset($options);
$options['id'] = $category->id;
$options['resort'] = 'name';
示例2: unset
//echo "wiki list ";print_r($wiki_list);
$selected = "";
if (isset($wiki_list['selected'])) {
$selected = $wiki_list['selected'];
unset($wiki_list['selected']);
}
echo '<tr><td colspan="2">';
echo '<form id="otherwikis" action="' . $CFG->wwwroot . '/mod/wiki/view.php">';
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>';
echo '<td class="sideblockheading"> ' . $WIKI_TYPES[$wiki->wtype] . ' ' . get_string('modulename', 'wiki') . " " . get_string('for', "wiki") . " " . wiki_get_owner($wiki_entry) . ':</td>';
echo '<td class="sideblockheading">' . get_string('otherwikis', 'wiki') . ': ';
$select = new html_select();
$select->options = $wiki_list;
$select->name = 'wikiselect';
$select->selectedvalue = $selected;
$select->add_action('change', 'go_to_wiki');
echo $OUTPUT->select($select);
echo '</td>';
echo '</tr></table>';
echo '</form>';
echo '</td>';
echo '</tr>';
}
if ($wiki_entry) {
$specialpages = array("WikiExport", "SiteMap", "SearchPages", "PageIndex", "NewestPages", "MostVisitedPages", "MostOftenChangedPages", "UpdatedPages", "FileDownload", "FileUpload", "OrphanedPages", "WantedPages");
/// Page Actions
echo '<table border="0" width="100%">';
echo '<tr>';
/// Searchform
echo '<td class="wikisearchform">';
wiki_print_search_form($cm->id, $q, $userid, $groupid, false);
示例3: get_category_cell
public function get_category_cell($category, $levelclass, $params)
{
global $CFG, $OUTPUT;
if (empty($params['id'])) {
throw new Exception('Array key (id) missing from 3rd param of grade_edit_tree_column_aggregation::get_category_cell($category, $levelclass, $params)');
}
$options = array(GRADE_AGGREGATE_MEAN => get_string('aggregatemean', 'grades'), GRADE_AGGREGATE_WEIGHTED_MEAN => get_string('aggregateweightedmean', 'grades'), GRADE_AGGREGATE_WEIGHTED_MEAN2 => get_string('aggregateweightedmean2', 'grades'), GRADE_AGGREGATE_EXTRACREDIT_MEAN => get_string('aggregateextracreditmean', 'grades'), GRADE_AGGREGATE_MEDIAN => get_string('aggregatemedian', 'grades'), GRADE_AGGREGATE_MIN => get_string('aggregatemin', 'grades'), GRADE_AGGREGATE_MAX => get_string('aggregatemax', 'grades'), GRADE_AGGREGATE_MODE => get_string('aggregatemode', 'grades'), GRADE_AGGREGATE_SUM => get_string('aggregatesum', 'grades'));
$visible = explode(',', $CFG->grade_aggregations_visible);
foreach ($options as $constant => $string) {
if (!in_array($constant, $visible) && $constant != $category->aggregation) {
unset($options[$constant]);
}
}
$select = new html_select();
$select->options = $options;
$select->name = 'aggregation_' . $category->id;
$select->selectedvalue = $category->aggregation;
$select->add_action('change', 'update_category_aggregation', array('courseid' => $params['id'], 'category' => $category->id, 'sesskey' => sesskey()));
$aggregation = $OUTPUT->select($select);
if ($this->forced) {
$aggregation = $options[$category->aggregation];
}
return '<td class="cell ' . $levelclass . '">' . $aggregation . '</td>';
}
示例4: foreach
foreach ($users as $u) {
$data = array('<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $u->userid . '&course=' . $course->id . '">' . fullname($u, true) . '</a>' . "\n", !empty($u->count) ? get_string('yes') . ' (' . $u->count . ') ' : get_string('no'), '<input type="checkbox" name="user' . $u->userid . '" value="' . $u->count . '" />' . "\n");
$table->add_data($data);
}
$table->print_html();
if ($perpage == SHOW_ALL_PAGE_SIZE) {
echo '<div id="showall"><a href="' . $baseurl . '&perpage=' . DEFAULT_PAGE_SIZE . '">' . get_string('showperpage', '', DEFAULT_PAGE_SIZE) . '</a></div>' . "\n";
} else {
if ($matchcount > 0 && $perpage < $matchcount) {
echo '<div id="showall"><a href="' . $baseurl . '&perpage=' . SHOW_ALL_PAGE_SIZE . '">' . get_string('showall', '', $matchcount) . '</a></div>' . "\n";
}
}
echo '<input type="button" onclick="checkall()" value="' . get_string('selectall') . '" /> ' . "\n";
echo '<input type="button" onclick="checknone()" value="' . get_string('deselectall') . '" /> ' . "\n";
if ($perpage >= $matchcount) {
echo '<input type="button" onclick="checknos()" value="' . get_string('selectnos') . '" />' . "\n";
}
$displaylist['messageselect.php'] = get_string('messageselectadd');
$select = new html_select();
$select->options = $displaylist;
$select->name = "formaction";
$select->label = get_string("withselectedusers");
$select->add_action('change', 'conditionalsubmit', array('formid' => 'studentsform'));
echo $OUTPUT->select($select);
echo $OUTPUT->help_icon(moodle_help_icon::make("participantswithselectedusers", get_string("withselectedusers")));
echo '<input type="submit" value="' . get_string('ok') . '" />' . "\n";
echo '</div>' . "\n";
echo '</form>' . "\n";
echo '</div>' . "\n";
}
echo $OUTPUT->footer();
示例5: array
echo '<input type="hidden" name="id" value="' . $id . '" />';
echo '<input type="hidden" name="courseitemfilter" value="' . $courseitemfilter . '" />';
echo '<input type="hidden" name="courseitemfiltertyp" value="' . $courseitemfiltertyp . '" />';
echo '<input type="hidden" name="courseid" value="' . $courseid . '" />';
echo $PAGE->requires->js('mod/feedback/feedback.js')->asap();
$sql = 'select c.id, c.shortname from {course} c, ' . '{feedback_value} fv, {feedback_item} fi ' . 'where c.id = fv.course_id and fv.item = fi.id ' . 'and fi.feedback = ?' . 'and
(c.shortname ' . $DB->sql_ilike() . ' ?
OR c.fullname ' . $DB->sql_ilike() . ' ?)';
$params = array($feedback->id, "%{$searchcourse}%", "%{$searchcourse}%");
if ($courses = $DB->get_records_sql_menu($sql, $params)) {
echo ' ' . get_string('filter_by_course', 'feedback') . ': ';
$select = new html_select();
$select->options = $courses;
$select->name = 'coursefilter';
$select->selectedvalue = $coursefilter;
$select->add_action('change', 'submit_form_by_id', array('id' => 'analysis-form'));
echo $OUTPUT->select($select);
}
echo '<hr />';
$itemnr = 0;
//print the items in an analysed form
echo '<tr><td>';
foreach ($items as $item) {
if ($item->hasvalue == 0) {
continue;
}
echo '<table width="100%" class="generalbox">';
//get the class from item-typ
$itemclass = 'feedback_item_' . $item->typ;
//get the instance of the item-class
$itemobj = new $itemclass();
示例6: return
}
}
echo '<div id="scormtablecontainer">';
if (has_capability('mod/scorm:deleteresponses', $contextmodule)) {
echo '<form id="attemptsform" method="post" action="' . $FULLSCRIPT . '" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \'' . addslashes_js(get_string('deleteattemptcheck', 'quiz')) . '\' : true);">';
echo '<input type="hidden" name="id" value="' . $id . '">';
echo $OUTPUT->table($table);
echo '<a href="javascript:select_all_in(\'DIV\',null,\'scormtablecontainer\');">' . get_string('selectall', 'quiz') . '</a> / ';
echo '<a href="javascript:deselect_all_in(\'DIV\',null,\'scormtablecontainer\');">' . get_string('selectnone', 'quiz') . '</a> ';
echo ' ';
$select = new html_select();
$select->options = array('delete' => get_string('delete'));
$select->name = 'action';
$select->button->label = get_string('withselected', 'quiz');
$select->id = 'menuaction';
$select->add_action('change', 'submit_form_by_id', array('id' => 'attemptsform', 'selectid' => 'menuaction'));
echo $OUTPUT->select($select);
echo '<noscript id="noscriptmenuaction" style="display: inline;">';
echo '<div>';
echo '<input type="submit" value="' . get_string('go') . '" /></div></noscript>';
$PAGE->requires->js_function_call('hide_item', array('noscriptmenuaction'));
echo '</form>';
} else {
echo $OUTPUT->table($table);
}
echo '</div>';
} else {
echo $OUTPUT->notification(get_string('noactivity', 'scorm'));
}
} else {
if (!empty($user)) {
示例7: choice_show_results
//.........这里部分代码省略.........
$count = 0;
if ($choice->showunanswered) {
echo "<td></td>";
}
foreach ($choice->option as $optionid => $optiontext) {
echo "<td align=\"center\" class=\"count\">";
if ($choice->limitanswers) {
echo get_string("taken", "choice") . ":";
echo $columncount[$optionid];
echo "<br/>";
echo get_string("limit", "choice") . ":";
$choice_option = $DB->get_record("choice_options", array("id" => $optionid));
echo $choice_option->maxanswers;
} else {
if (isset($columncount[$optionid])) {
echo $columncount[$optionid];
}
}
echo "</td>";
$count++;
}
echo "</tr>";
/// Print "Select all" etc.
if ($viewresponses and has_capability('mod/choice:deleteresponses', $context)) {
echo '<tr><td></td><td>';
echo '<a href="javascript:select_all_in(\'DIV\',null,\'tablecontainer\');">' . get_string('selectall', 'quiz') . '</a> / ';
echo '<a href="javascript:deselect_all_in(\'DIV\',null,\'tablecontainer\');">' . get_string('selectnone', 'quiz') . '</a> ';
echo ' ';
$select = new html_select();
$select->options = array('delete' => get_string('delete'));
$select->name = 'action';
$select->button->label = get_string('withselected', 'quiz');
$select->id = 'menuaction';
$select->add_action('change', 'submit_form_by_id', array('id' => 'attemptsform', 'selectid' => 'menuaction'));
echo $OUTPUT->select($select);
echo '<noscript id="noscriptmenuaction" style="display: inline;">';
echo '<div>';
echo '<input type="submit" value="' . get_string('go') . '" /></div></noscript>';
$PAGE->requires->js_function_call('hide_item', array('noscriptmenuaction'));
echo '</td><td></td></tr>';
}
echo "</table></div>";
if ($viewresponses) {
echo "</form></div>";
}
break;
case CHOICE_PUBLISH_ANONYMOUS:
echo "<table cellpadding=\"5\" cellspacing=\"0\" class=\"results anonymous\">";
echo "<tr>";
$maxcolumn = 0;
if ($choice->showunanswered) {
echo "<th class=\"col0 header\" scope=\"col\">";
print_string('notanswered', 'choice');
echo "</th>";
$column[0] = 0;
foreach ($allresponses[0] as $user) {
$column[0]++;
}
$maxcolumn = $column[0];
}
$count = 1;
foreach ($choice->option as $optionid => $optiontext) {
echo "<th class=\"col{$count} header\" scope=\"col\">";
echo format_string($optiontext);
echo "</th>";
$column[$optionid] = 0;
示例8: scorm_view_display
function scorm_view_display($user, $scorm, $action, $cm, $boxwidth = '')
{
global $CFG, $DB, $PAGE, $OUTPUT;
if ($scorm->updatefreq == UPDATE_EVERYTIME) {
scorm_parse($scorm, false);
}
$organization = optional_param('organization', '', PARAM_INT);
if ($scorm->displaycoursestructure == 1) {
echo $OUTPUT->box_start('generalbox boxaligncenter');
?>
<div class="structurehead"><?php
print_string('contents', 'scorm');
?>
</div>
<?php
}
if (empty($organization)) {
$organization = $scorm->launch;
}
if ($orgs = $DB->get_records_menu('scorm_scoes', array('scorm' => $scorm->id, 'organization' => '', 'launch' => ''), 'id', 'id,title')) {
if (count($orgs) > 1) {
?>
<div class='scorm-center'>
<?php
print_string('organizations', 'scorm');
?>
<form id='changeorg' method='post' action='<?php
echo $action;
?>
'>
<?php
$select = new html_select();
$select->options = $orgs;
$select->name = 'organization';
$select->selectedvalue = $organization;
$select->add_action('change', 'submit_form_by_id', array('id' => 'changeorg'));
echo $OUTPUT->select($select);
?>
</form>
</div>
<?php
}
}
$orgidentifier = '';
if ($sco = scorm_get_sco($organization, SCO_ONLY)) {
if ($sco->organization == '' && $sco->launch == '') {
$orgidentifier = $sco->identifier;
} else {
$orgidentifier = $sco->organization;
}
}
/*
$orgidentifier = '';
if ($org = $DB->get_record('scorm_scoes', array('id'=>$organization))) {
if (($org->organization == '') && ($org->launch == '')) {
$orgidentifier = $org->identifier;
} else {
$orgidentifier = $org->organization;
}
}*/
$scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR));
// Just to be safe
if (!file_exists($CFG->dirroot . '/mod/scorm/datamodels/' . $scorm->version . 'lib.php')) {
$scorm->version = 'scorm_12';
}
require_once $CFG->dirroot . '/mod/scorm/datamodels/' . $scorm->version . 'lib.php';
$result = scorm_get_toc($user, $scorm, 'structlist', $orgidentifier);
$incomplete = $result->incomplete;
// do we want the TOC to be displayed?
if ($scorm->displaycoursestructure == 1) {
echo $result->toc;
echo $OUTPUT->box_end();
}
// is this the first attempt ?
$attemptcount = scorm_get_attempt_count($user, $scorm);
// do not give the player launch FORM if the SCORM object is locked after the final attempt
if ($scorm->lastattemptlock == 0 || $result->attemptleft > 0) {
?>
<div class="scorm-center">
<form id="theform" method="post" action="<?php
echo $CFG->wwwroot;
?>
/mod/scorm/player.php">
<?php
if ($scorm->hidebrowse == 0) {
print_string('mode', 'scorm');
echo ': <input type="radio" id="b" name="mode" value="browse" /><label for="b">' . get_string('browse', 'scorm') . '</label>' . "\n";
echo '<input type="radio" id="n" name="mode" value="normal" checked="checked" /><label for="n">' . get_string('normal', 'scorm') . "</label>\n";
} else {
echo '<input type="hidden" name="mode" value="normal" />' . "\n";
}
if ($scorm->forcenewattempt == 1) {
if ($incomplete === false) {
echo '<input type="hidden" name="newattempt" value="on" />' . "\n";
}
} elseif ($attemptcount != 0 && $incomplete === false && ($result->attemptleft > 0 || $scorm->maxattempt == 0)) {
?>
<br />
<input type="checkbox" id="a" name="newattempt" />
<label for="a"><?php
//.........这里部分代码省略.........
示例9: array
echo $grade_edit_tree->build_html_tree($gtree->top_element, true, array(), $categories, $level, $row_count);
echo '<div id="gradetreesubmit">';
if (!$moving) {
echo '<input class="advanced" type="submit" value="' . get_string('savechanges') . '" />';
}
// We don't print a bulk move menu if there are no other categories than course category
if (!$moving && count($categories) > 1) {
echo '<br /><br />';
echo '<input type="hidden" name="bulkmove" value="0" id="bulkmoveinput" />';
echo get_string('moveselectedto', 'grades') . ' ';
$select = new html_select();
$select->options = $categories;
$select->name = 'moveafter';
$select->disabled = true;
$select->id = 'menumoveafter';
$select->add_action('change', 'submit_bulk_move');
echo $OUTPUT->select($select);
echo '<div id="noscriptgradetreeform" style="display: inline;">
<input type="submit" value="' . get_string('go') . '" />
</div>';
echo $PAGE->requires->js_function_call('hide_item', array('noscriptgradetreeform'))->asap();
}
echo '</div>';
echo '</div></form>';
echo $OUTPUT->box_end();
// Print action buttons
echo $OUTPUT->container_start('buttons');
if ($moving) {
echo $OUTPUT->button(html_form::make_button('index.php', array('id' => $course->id), get_string('cancel'), 'get'));
} else {
echo $OUTPUT->button(html_form::make_button('category.php', array('courseid' => $course->id), get_string('addcategory', 'grades'), 'get'));
示例10: array
// add it to the table data[] object
$table->data[] = array($studentname, $attempts, $bestgrade . "%");
}
}
// print it all out !
if (has_capability('mod/lesson:edit', $context)) {
echo "<form id=\"theform\" method=\"post\" action=\"report.php\">\n\n <input type=\"hidden\" name=\"sesskey\" value=\"" . sesskey() . "\" />\n\n <input type=\"hidden\" name=\"id\" value=\"{$cm->id}\" />\n\n <input type=\"hidden\" name=\"id\" value=\"{$cm->id}\" />\n";
}
echo $OUTPUT->table($table);
if (has_capability('mod/lesson:edit', $context)) {
echo '<br /><table width="90%" align="center"><tr><td>' . '<a href="javascript: checkall();">' . get_string('selectall') . '</a> / ' . '<a href="javascript: checknone();">' . get_string('deselectall') . '</a> ';
$select = new html_select();
$select->options = array('delete' => get_string('deleteselected'));
$select->name = 'attemptaction';
$select->selectedvalue = 0;
$select->add_action('change', 'submit_form_by_id', array('id' => 'theform'));
echo $OUTPUT->select($select);
echo '</td></tr></table></form>';
}
// some stat calculations
if ($numofattempts == 0) {
$avescore = get_string("notcompleted", "lesson");
} else {
$avescore = format_float($avescore / $numofattempts, 2);
}
if ($avetime == NULL) {
$avetime = get_string("notcompleted", "lesson");
} else {
$avetime = format_float($avetime / $numofattempts, 0);
$avetime = format_time($avetime);
}
示例11: array
$displaylist = array();
$displaylist['messageselect.php'] = get_string('messageselectadd');
if (!empty($CFG->enablenotes) && has_capability('moodle/notes:manage', $context) && $context->id != $frontpagectx->id) {
$displaylist['addnote.php'] = get_string('addnewnote', 'notes');
$displaylist['groupaddnote.php'] = get_string('groupaddnewnote', 'notes');
}
if ($context->id != $frontpagectx->id) {
$displaylist['extendenrol.php'] = get_string('extendenrol');
$displaylist['groupextendenrol.php'] = get_string('groupextendenrol');
}
echo $OUTPUT->help_icon(moodle_help_icon::make("participantswithselectedusers", get_string("withselectedusers")));
$select = new html_select();
$select->options = $displaylist;
$select->name = "formaction";
$select->label = get_string("withselectedusers");
$select->add_action('change', 'conditionalsubmit', array('formid' => 'participantsform'));
echo $OUTPUT->select($select);
echo '<input type="hidden" name="id" value="' . $course->id . '" />';
echo '<div id="noscriptparticipantsform" style="display: inline;">';
echo '<input type="submit" value="' . get_string('ok') . '" /></div>';
$PAGE->requires->js_function_call('hide_item', array('noscriptparticipantsform'));
echo '</div>';
echo '</div>';
echo '</form>';
}
if ($bulkoperations && $totalcount > $perpage * 3) {
echo '<form action="index.php" class="searchform"><div><input type="hidden" name="id" value="' . $course->id . '" />' . get_string('search') . ': ' . "\n";
echo '<input type="text" name="search" value="' . s($search) . '" /> <input type="submit" value="' . get_string('search') . '" /></div></form>' . "\n";
}
$perpageurl = clone $baseurl;
$perpageurl->remove_params('perpage');