mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-20204 a lot more steps away from html_select
This commit is contained in:
parent
94a9b9e770
commit
f8dab96615
@ -183,10 +183,9 @@
|
||||
make_categories_list($displaylist, $notused);
|
||||
|
||||
echo '<div class="categorypicker">';
|
||||
$select = html_select::make_popup_form('category.php', 'id', $displaylist, 'switchcategory', $category->id);
|
||||
$select = new single_select(new moodle_url('category.php'), 'id', $displaylist, $category->id, null, 'switchcategory');
|
||||
$select->set_label($strcategories.':');
|
||||
$select->nothinglabel = false;
|
||||
echo $OUTPUT->select($select);
|
||||
echo $OUTPUT->render($select);
|
||||
echo '</div>';
|
||||
|
||||
/// Print current category description
|
||||
|
@ -356,10 +356,9 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
|
||||
unset($tempdisplaylist[$key]);
|
||||
}
|
||||
}
|
||||
$popupurl = "index.php?move=$category->id&sesskey=".sesskey();
|
||||
$select = html_select::make_popup_form($popupurl, 'moveto', $tempdisplaylist, "moveform$category->id", $category->parent);
|
||||
$select->nothinglabel = false;
|
||||
echo $OUTPUT->select($select);
|
||||
$popupurl = new moodle_url("index.php?move=$category->id&sesskey=".sesskey());
|
||||
$select = new single_select($popupurl, 'moveto', $tempdisplaylist, $category->parent, null, "moveform$category->id");
|
||||
echo $OUTPUT->render($select);
|
||||
}
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
@ -44,9 +44,9 @@ function report_stats_mode_menu($course, $mode, $time, $url) {
|
||||
$options[STATS_MODE_RANKED] = get_string('reports');
|
||||
}
|
||||
$popupurl = $url."?course=$course->id&time=$time";
|
||||
$select = html_select::make_popup_form($popupurl, 'mode', $options, 'switchmode', $mode);
|
||||
$select->nothinglabel = false;
|
||||
return $OUTPUT->select($select);
|
||||
$select = new single_select(new moodle_url($popupurl), 'mode', $options, $mode, null);
|
||||
$select->formid = 'switchmode';
|
||||
echo $OUTPUT->render($select);
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ function authorize_print_orders($courseid, $userid) {
|
||||
if (($popupcrs = $DB->get_records_sql_menu($sql, $params))) {
|
||||
$popupcrs = array($SITE->id => $SITE->fullname) + $popupcrs;
|
||||
}
|
||||
$popupmenu = empty($popupcrs) ? '' : $OUTPUT->select(html_select::make_popup_form($baseurl.'&status='.$status, 'course', $popupcrs, 'coursesmenu', $courseid));
|
||||
$popupmenu = empty($popupcrs) ? '' : $OUTPUT->single_select(new moodle_url($baseurl.'&status='.$status), 'course', $popupcrs, $courseid, null, 'coursesmenu');
|
||||
$popupmenu .= '<br />';
|
||||
$statusmenu = array(
|
||||
AN_STATUS_NONE => $strs->all,
|
||||
@ -66,7 +66,7 @@ function authorize_print_orders($courseid, $userid) {
|
||||
AN_STATUS_TEST => $authstrs->tested
|
||||
);
|
||||
|
||||
$popupmenu .= $OUTPUT->select(html_select::make_popup_form($baseurl.'&course='.$courseid, 'status', $statusmenu, 'statusmenu', $status));
|
||||
$popupmenu .= $OUTPUT->single_select(new moodle_url($baseurl.'&course='.$courseid), 'status', $statusmenu, $status, null, 'statusmenu');
|
||||
if ($canmanagepayments) {
|
||||
$popupmenu .= '<br />';
|
||||
$id = html_writer::random_id('ea');
|
||||
@ -94,7 +94,7 @@ function authorize_print_orders($courseid, $userid) {
|
||||
|
||||
if ($perpage > 100) { $perpage = 100; }
|
||||
$perpagemenus = array(5 => 5, 10 => 10, 20 => 20, 50 => 50, 100 => 100);
|
||||
$perpagemenu = $OUTPUT->select(html_select::make_popup_form($baseurl.'&status='.$status.'&course='.$courseid, 'perpage',$perpagemenus,'perpagemenu',$perpage));
|
||||
$perpagemenu = $OUTPUT->single_select(new moodle_url($baseurl.'&status='.$status.'&course='.$courseid), 'perpage', $perpagemenus, $perpage, array(''=>'choosedots'), 'perpagemenu');
|
||||
$table->define_columns(array('id', 'userid', 'timecreated', 'status', 'action'));
|
||||
$table->define_headers(array($authstrs->orderid, $authstrs->shopper, $strs->time, $strs->status, $perpagemenu));
|
||||
$table->define_baseurl($baseurl."&status=$status&course=$courseid&perpage=$perpage");
|
||||
|
@ -318,9 +318,10 @@ function print_graded_users_selector($course, $actionpage, $userid=0, $groupid=0
|
||||
if ($includeall) {
|
||||
$menu[0] .= " (" . (count($menu) - 1) . ")";
|
||||
}
|
||||
$select = html_select::make_popup_form($CFG->wwwroot.'/grade/' . $actionpage, 'userid', $menu, 'choosegradeuser', $userid);
|
||||
$select->set_label($label);
|
||||
return $OUTPUT->select($select);
|
||||
$select = new single_select(new moodle_url('/grade/'.$actionpage), 'userid', $menu, $userid);
|
||||
$select->label = $label;
|
||||
$select->formid = 'choosegradeuser';
|
||||
return $OUTPUT->render($select);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -141,10 +141,11 @@ if (!empty($CFG->enablegroupings)) {
|
||||
foreach ($groupings as $grouping) {
|
||||
$options[$grouping->id] = strip_tags(format_string($grouping->name));
|
||||
}
|
||||
$popupurl = $rooturl.'&group='.$groupid;
|
||||
$select = html_select::make_popup_form($popupurl, 'grouping', $options, 'selectgrouping', $groupingid);
|
||||
$select->set_label($strgrouping);
|
||||
echo $OUTPUT->select($select);
|
||||
$popupurl = new moodle_url($rooturl.'&group='.$groupid);
|
||||
$select = new single_select($popupurl, 'grouping', $options, $groupingid);
|
||||
$select->label = $strgrouping;
|
||||
$select->formid = 'selectgrouping';
|
||||
echo $OUTPUT->render($select);
|
||||
}
|
||||
|
||||
$options = array();
|
||||
@ -152,10 +153,11 @@ $options[0] = get_string('all');
|
||||
foreach ($groups as $group) {
|
||||
$options[$group->id] = strip_tags(format_string($group->name));
|
||||
}
|
||||
$popupurl = $rooturl.'&grouping='.$groupingid;
|
||||
$select = html_select::make_popup_form($popupurl, 'group', $options, 'selectgroup', $groupid);
|
||||
$select->set_label($strgroup);
|
||||
echo $OUTPUT->select($select);
|
||||
$popupurl = new moodle_url($rooturl.'&grouping='.$groupingid);
|
||||
$select = new single_select($popupurl, 'group', $options, $groupid);
|
||||
$select->label = $strgroup;
|
||||
$select->formid = 'selectgroup';
|
||||
echo $OUTPUT->render($select);
|
||||
|
||||
/// Print table
|
||||
$printed = false;
|
||||
|
@ -1445,10 +1445,8 @@ function block_add_block_ui($page, $output) {
|
||||
asort($menu, SORT_LOCALE_STRING);
|
||||
|
||||
$actionurl = new moodle_url($page->url, array('sesskey'=>sesskey()));
|
||||
$select = html_select::make_popup_form($actionurl, 'bui_addblock', $menu, 'add_block');
|
||||
$select->nothinglabel = get_string('adddots');
|
||||
|
||||
$bc->content = $OUTPUT->select($select);
|
||||
$select = new single_select($actionurl, 'bui_addblock', $menu, null, array(''=>get_string('adddots')), 'add_block');
|
||||
$bc->content = $OUTPUT->render($select);
|
||||
return $bc;
|
||||
}
|
||||
|
||||
|
@ -477,10 +477,9 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
|
||||
$groupname = reset($groupsmenu);
|
||||
$output = $grouplabel.': '.$groupname;
|
||||
} else {
|
||||
$select = html_select::make_popup_form($urlroot, 'group', $groupsmenu, 'selectgroup', $activegroup);
|
||||
$select->nothinglabel = false;
|
||||
$select->set_label($grouplabel);
|
||||
$output = $OUTPUT->select($select);
|
||||
$select = new single_select(new moodle_url($urlroot), 'group', $groupsmenu, $activegroup, null, 'selectgroup');
|
||||
$select->label = $grouplabel;
|
||||
$output = $OUTPUT->render($select);
|
||||
}
|
||||
|
||||
$output = '<div class="groupselector">'.$output.'</div>';
|
||||
@ -594,10 +593,9 @@ function groups_print_activity_menu($cm, $urlroot, $return=false, $hideallpartic
|
||||
$groupname = reset($groupsmenu);
|
||||
$output = $grouplabel.': '.$groupname;
|
||||
} else {
|
||||
$select = html_select::make_popup_form($urlroot, 'group', $groupsmenu, 'selectgroup', $activegroup);
|
||||
$select->nothinglabel = false;
|
||||
$select->set_label($grouplabel);
|
||||
$output = $OUTPUT->select($select);
|
||||
$select = new single_select($urlroot, 'group', $groupsmenu, $activegroup, null, 'selectgroup');
|
||||
$select->label = $grouplabel;
|
||||
$output = $OUTPUT->render($select);
|
||||
}
|
||||
|
||||
$output = '<div class="groupselector">'.$output.'</div>';
|
||||
|
@ -346,13 +346,15 @@ class single_select implements renderable {
|
||||
* @param array $options list of options
|
||||
* @param string $selected selected element
|
||||
* @param array $nothing
|
||||
* @param string $formid
|
||||
*/
|
||||
public function __construct(moodle_url $url, $name, array $options, $selected='', $nothing=array(''=>'choosedots')) {
|
||||
public function __construct(moodle_url $url, $name, array $options, $selected='', $nothing=array(''=>'choosedots'), $formid=null) {
|
||||
$this->url = $url;
|
||||
$this->name = $name;
|
||||
$this->options = $options;
|
||||
$this->selected = $selected;
|
||||
$this->nothing = $nothing;
|
||||
$this->formid = $formid;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -373,6 +375,27 @@ class single_select implements renderable {
|
||||
public function add_action(component_action $action) {
|
||||
$this->actions[] = $action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor: sets up the other components in case they are needed
|
||||
* @param string $page The keyword that defines a help page
|
||||
* @param string $title A descriptive text for accesibility only
|
||||
* @param string $component
|
||||
* @param bool $linktext add extra text to icon
|
||||
* @return void
|
||||
*/
|
||||
public function set_help_icon($helppage, $title, $component = 'moodle') {
|
||||
$this->helpicon = new help_icon($helppage, $title, $component);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set's select lable
|
||||
* @param string $label
|
||||
* @return void
|
||||
*/
|
||||
public function set_label($label) {
|
||||
$this->label = $label;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1088,13 +1088,14 @@ class core_renderer extends renderer_base {
|
||||
* @param array $options list of options
|
||||
* @param string $selected selected element
|
||||
* @param array $nothing
|
||||
* @param string $formid
|
||||
* @return string HTML fragment
|
||||
*/
|
||||
public function single_select($url, $name, array $options, $selected='', $nothing=array(''=>'choosedots')) {
|
||||
public function single_select($url, $name, array $options, $selected='', $nothing=array(''=>'choosedots'), $formid=null) {
|
||||
if (!($url instanceof moodle_url)) {
|
||||
$url = new moodle_url($url);
|
||||
}
|
||||
$select = new single_select($url, $url, $name, $options, $selected, $nothing);
|
||||
$select = new single_select($url, $name, $options, $selected, $nothing, $formid);
|
||||
|
||||
return $this->render($select);
|
||||
}
|
||||
|
@ -2283,11 +2283,10 @@ function switchroles_form($courseid) {
|
||||
}
|
||||
// unset default user role - it would not work
|
||||
unset($roles[$CFG->guestroleid]);
|
||||
$popupurl = $CFG->wwwroot.'/course/view.php?id='.$courseid.'&sesskey='.sesskey();
|
||||
$select = html_select::make_popup_form($popupurl, 'switchrole', $roles, 'switchrole', '');
|
||||
$select->nothinglabel = get_string('switchroleto');
|
||||
$popupurl = new moodle_url('/course/view.php', array('id'=>$courseid, 'sesskey'=>sesskey()));
|
||||
$select = new single_select($popupurl, 'switchrole', $roles, null, array(''=>get_string('switchroleto')), 'switchrole');
|
||||
$select->set_help_icon('switchrole', get_string('switchroleto'));
|
||||
return $OUTPUT->select($select);
|
||||
return $OUTPUT->render($select);
|
||||
}
|
||||
|
||||
return '';
|
||||
|
@ -305,7 +305,7 @@ if (($mode == 'new') && (!empty($newtype)) && confirm_sesskey()) { ///
|
||||
echo '<div class="fieldadd">';
|
||||
echo '<label for="fieldform_jump">'.get_string('newfield','data').'</label>';
|
||||
$popupurl = $CFG->wwwroot.'/mod/data/field.php?d='.$data->id.'&mode=new&sesskey='. sesskey();
|
||||
echo $OUTPUT->select(html_select::make_popup_form($popupurl, 'newtype', $menufield, "fieldform"));
|
||||
echo $OUTPUT->single_select(new moodle_url($popupurl), 'newtype', $menufield, null, array(''=>'choosedots'), "fieldform");
|
||||
echo $OUTPUT->help_icon('fields', get_string('addafield','data'), 'data');
|
||||
echo '</div>';
|
||||
|
||||
|
@ -4186,16 +4186,12 @@ function forum_print_rating_menu($postid, $userid, $scale, $myrating=NULL) {
|
||||
*/
|
||||
function forum_print_mode_form($id, $mode, $forumtype='') {
|
||||
global $OUTPUT;
|
||||
$select = html_select::make_popup_form("view.php?f=$id", 'mode', forum_get_layout_modes(), "mode", $mode);
|
||||
$select->nothinglabel = false;
|
||||
$select = new single_select(new moodle_url("/mod/forum/view.php", array('f'=>$id)), 'mode', forum_get_layout_modes(), $mode, null, "mode");
|
||||
|
||||
if ($forumtype == 'single') {
|
||||
echo '<div class="forummode">';
|
||||
echo $OUTPUT->select($select);
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo $OUTPUT->select($select);
|
||||
$select->class = "forummode";
|
||||
}
|
||||
echo $OUTPUT->render($select);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1499,6 +1499,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
|
||||
echo '<td align="center" style="width:60%">';
|
||||
echo '<b>';
|
||||
|
||||
$menu = array();
|
||||
$menu[GLOSSARY_SHOW_ALL_CATEGORIES] = get_string("allcategories","glossary");
|
||||
$menu[GLOSSARY_SHOW_NOT_CATEGORISED] = get_string("notcategorised","glossary");
|
||||
|
||||
@ -1537,9 +1538,8 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
|
||||
echo '</b></td>';
|
||||
echo '<td align="center" style="width:20%">';
|
||||
|
||||
$select = html_select::make_popup_form("$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&mode=cat", 'hook', $menu, "catmenu", $selected);
|
||||
$select->nothinglabel = false;
|
||||
echo $OUTPUT->select($select);
|
||||
$select = new single_select(new moodle_url("/mod/glossary/view.php", array('id'=>$cm->id, 'mode'=>'cat')), 'hook', $menu, $selected, null, "catmenu");
|
||||
echo $OUTPUT->render($select);
|
||||
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
@ -414,9 +414,8 @@ class mod_lesson_renderer extends plugin_renderer_base {
|
||||
$options[0] = get_string('question', 'lesson');
|
||||
|
||||
$addpageurl = new moodle_url('/mod/lesson/editpage.php', array('id'=>$this->page->cm->id, 'pageid'=>$page->id, 'sesskey'=>sesskey()));
|
||||
$addpageselect = html_select::make_popup_form($addpageurl, 'qtype', $options, 'addpageafter'.$page->id);
|
||||
$addpageselect->nothinglabel = get_string('addanewpage', 'lesson').'...';
|
||||
$addpageselector = $this->output->select($addpageselect);
|
||||
$addpageselect = new single_select($addpageurl, 'qtype', $options, null, array(''=>get_string('addanewpage', 'lesson').'...'), 'addpageafter'.$page->id);
|
||||
$addpageselector = $this->output->render($addpageselect);
|
||||
}
|
||||
|
||||
foreach ($actions as $key=>$action) {
|
||||
|
@ -188,7 +188,7 @@ class quiz_grading_report extends quiz_default_report {
|
||||
if (count($gradeableqs)!=1){
|
||||
$qurl = fullclone($this->viewurl);
|
||||
$qurl->remove_params('questionid', 'attemptid', 'gradeall', 'gradeungraded', 'gradenextungraded');
|
||||
$menu = $OUTPUT->select(html_select::make_popup_form($qurl->out(), 'questionid', $qmenu, 'questionid', $questionid));
|
||||
$menu = $OUTPUT->single_select($qurl, 'questionid', $qmenu, $questionid, array(''=>'choosedots'), 'questionid');
|
||||
echo '<div class="mdl-align">'.$menu.'</div>';
|
||||
}
|
||||
if (!$questionid){
|
||||
|
@ -545,10 +545,8 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$result->toc .= html_writer::script('', $CFG->wwwroot.'/mod/scorm/datamodels/scorm_datamodels.js');
|
||||
}
|
||||
|
||||
$url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'¤torg='.$currentorg.$modestr;
|
||||
$select = html_select::make_popup_form($url, 'scoid', $tocmenus, "tocmenu", $sco->id);
|
||||
$select->nothinglabel = false;
|
||||
$result->tocmenu = $OUTPUT->select($select);
|
||||
$url = new moodle_url('/mod/scorm/player.php?a='.$scorm->id.'¤torg='.$currentorg.$modestr);
|
||||
$result->tocmenu = $OUTPUT->single_select($url, 'scoid', $tocmenus, $sco->id, null, "tocmenu");
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -324,10 +324,8 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$PAGE->requires->js('/mod/scorm/datamodels/scorm_datamodels.js');
|
||||
}
|
||||
|
||||
$url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'¤torg='.$currentorg.$modestr;
|
||||
$select = html_select::make_popup_form($url, 'scoid', $tocmenus, "tocmenu", $sco->id);
|
||||
$select->nothinglabel = false;
|
||||
$result->tocmenu = $OUTPUT->select($select);
|
||||
$url = new moodle_url('/mod/scorm/player.php?a='.$scorm->id.'¤torg='.$currentorg.$modestr);
|
||||
$result->tocmenu = $OUTPUT->single_select($url, 'scoid', $tocmenus, $sco->id, null, "tocmenu");
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -215,10 +215,8 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$PAGE->requires->js('/mod/scorm/datamodels/scorm_datamodels.js');
|
||||
}
|
||||
|
||||
$url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'¤torg='.$currentorg.$modestr;
|
||||
$select = html_select::make_popup_form($url, 'scoid', $tocmenus, "tocmenu", $sco->id);
|
||||
$select->nothinglabel = false;
|
||||
$result->tocmenu = $OUTPUT->select($select);
|
||||
$url = new moodle_url('/mod/scorm/player.php?a='.$scorm->id.'¤torg='.$currentorg.$modestr);
|
||||
$result->tocmenu = $OUTPUT->single_select($url, 'scoid', $tocmenus, $sco->id, null, "tocmenu");
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -1527,9 +1527,7 @@ function wiki_print_wikilinks_block($cmid, $binary=false, $return=false) {
|
||||
$name = $matches[1];
|
||||
}
|
||||
|
||||
$select = html_select::make_popup_form(EWIKI_SCRIPT, $name, $links, 'wikilinks');
|
||||
$select->nothinglabel = get_string("choosewikilinks", "wiki");
|
||||
echo $OUTPUT->select($select);
|
||||
echo $OUTPUT->single_select(new moodle_url(EWIKI_SCRIPT), $name, $links, null, array(''=>get_string("choosewikilinks", "wiki")), 'wikilinks');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1567,9 +1565,7 @@ function wiki_print_page_actions($cmid, $specialpages, $page, $action, $binary=f
|
||||
$name = $matches[1];
|
||||
}
|
||||
|
||||
$select = html_select::make_popup_form(EWIKI_SCRIPT, $name, $page, 'wikiactions');
|
||||
$select->nothinglabel = get_string("action", "wiki");
|
||||
echo $OUTPUT->select($select);
|
||||
echo $OUTPUT->single_select(new moodle_url(EWIKI_SCRIPT), $name, $page, null, array(''=>get_string("action", "wiki")), 'wikiactions');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1612,9 +1608,7 @@ function wiki_print_administration_actions($wiki, $cmid, $userid, $groupid, $pag
|
||||
if($noeditor) {
|
||||
$action["checklinks"]=get_string("checklinks", "wiki");
|
||||
}
|
||||
$select = html_select::make_popup_form($ewscript, 'action', $action, 'wikiadministration');
|
||||
$select->nothinglabel = get_string("chooseadministration", "wiki");
|
||||
echo $OUTPUT->select($select);
|
||||
echo $OUTPUT->single_select(new moodle_url($ewscript), 'action', $action, null, array(''=>get_string("chooseadministration", "wiki")), 'wikiadministration');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -120,13 +120,10 @@ class workshopallocation_manual_renderer extends plugin_renderer_base {
|
||||
// todo add an option to exclude users without own submission
|
||||
$options = array_diff_key($reviewers, $exclude);
|
||||
if ($options) {
|
||||
$handler = new moodle_url($this->page->url,
|
||||
array('mode' => 'new', 'of' => $allocation->userid, 'sesskey' => sesskey()));
|
||||
$select = html_select::make_popup_form($handler, 'by', $options, 'addreviewof' . $allocation->userid, '',
|
||||
get_string('addreviewer', 'workshopallocation_manual'));
|
||||
$select->nothinglabel = get_string('chooseuser', 'workshop');
|
||||
$select->set_label(get_string('addreviewer', 'workshopallocation_manual'), $select->id);
|
||||
$o .= $this->output->select($select);
|
||||
$handler = new moodle_url($this->page->url, array('mode' => 'new', 'of' => $allocation->userid, 'sesskey' => sesskey()));
|
||||
$select = new single_select($handler, 'by', $options, '', array(''=>get_string('chooseuser', 'workshop')), 'addreviewof' . $allocation->userid);
|
||||
$select->set_label(get_string('addreviewer', 'workshopallocation_manual'));
|
||||
$o .= $this->output->render($select);
|
||||
}
|
||||
}
|
||||
$o .= html_writer::start_tag('ul', array());
|
||||
@ -163,13 +160,10 @@ class workshopallocation_manual_renderer extends plugin_renderer_base {
|
||||
// todo add an option to exclude users without own submission
|
||||
$options = array_diff_key($authors, $exclude);
|
||||
if ($options) {
|
||||
$handler = new moodle_url($this->page->url,
|
||||
array('mode' => 'new', 'by' => $allocation->userid, 'sesskey' => sesskey()));
|
||||
$select = html_select::make_popup_form($handler, 'of', $options, 'addreviewby' . $allocation->userid, '',
|
||||
get_string('addreviewee', 'workshopallocation_manual'));
|
||||
$select->nothinglabel = get_string('chooseuser', 'workshop');
|
||||
$select->set_label(get_string('addreviewee', 'workshopallocation_manual'), $select->id);
|
||||
$o .= $this->output->select($select);
|
||||
$handler = new moodle_url($this->page->url, array('mode' => 'new', 'by' => $allocation->userid, 'sesskey' => sesskey()));
|
||||
$select = new single_select($handler, 'of', $options, '', array(''=>get_string('chooseuser', 'workshop')), 'addreviewby' . $allocation->userid);
|
||||
$select->set_label(get_string('addreviewee', 'workshopallocation_manual'));
|
||||
$o .= $this->output->render($select);
|
||||
} else {
|
||||
$o .= $this->output->container(get_string('nothingtoreview', 'workshop'), 'info');
|
||||
}
|
||||
|
@ -229,9 +229,9 @@
|
||||
unset($courselist[SITEID]);
|
||||
$courselist = array(SITEID => format_string($SITE->shortname)) + $courselist;
|
||||
}
|
||||
$select = html_select::make_popup_form($popupurl, 'id', $courselist, 'courseform', $course->id);
|
||||
$select = new single_select($popupurl, 'id', $courselist, $course->id, array(''=>'choosedots'), 'courseform');
|
||||
$select->set_label(get_string('mycourses'));
|
||||
$controlstable->data[0]->cells[] = $OUTPUT->select($select);
|
||||
$controlstable->data[0]->cells[] = $OUTPUT->render($select);
|
||||
}
|
||||
|
||||
$controlstable->data[0]->cells[] = groups_print_course_menu($course, $baseurl->out());
|
||||
@ -287,9 +287,9 @@
|
||||
}
|
||||
|
||||
if (count($timeoptions) > 1) {
|
||||
$select = html_select::make_popup_form($baseurl, 'accesssince', $timeoptions, 'timeoptions', $accesssince);
|
||||
$select = new single_select($baseurl, 'accesssince', $timeoptions, $accesssince, null, 'timeoptions');
|
||||
$select->set_label(get_string('usersnoaccesssince'));
|
||||
$controlstable->data[0]->cells[] = $OUTPUT->select($select);
|
||||
$controlstable->data[0]->cells[] = $OUTPUT->render($select);
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,12 +315,11 @@
|
||||
if ($allowenroldetails) {
|
||||
$formatmenu['2']= get_string('enroldetails');
|
||||
}
|
||||
$select = html_select::make_popup_form($baseurl, 'mode', $formatmenu, 'formatmenu', $mode);
|
||||
$select->nothinglabel = false;
|
||||
$select = new single_select($baseurl, 'mode', $formatmenu, $mode, null, 'formatmenu');
|
||||
$select->set_label(get_string('userlist'));
|
||||
$userlistcell = new html_table_cell();
|
||||
$userlistcell->add_class('right');
|
||||
$userlistcell->text = $OUTPUT->select($select);
|
||||
$userlistcell->text = $OUTPUT->render($select);
|
||||
$controlstable->data[0]->cells[] = $userlistcell;
|
||||
|
||||
echo $OUTPUT->table($controlstable);
|
||||
@ -604,9 +603,7 @@
|
||||
$rolenames = array('0' => get_string('userswithrole', 'role')) + $rolenames;
|
||||
}
|
||||
}
|
||||
$select = html_select::make_popup_form($rolenamesurl, 'roleid', $rolenames, 'rolesform', $roleid);
|
||||
$select->nothinglabel = false;
|
||||
echo $OUTPUT->select($select);
|
||||
echo $OUTPUT->single_select($rolenamesurl, 'roleid', $rolenames, $roleid, null, 'rolesform');
|
||||
echo '</div>';
|
||||
|
||||
} else if (count($rolenames) == 1) {
|
||||
@ -829,7 +826,7 @@
|
||||
|
||||
$links[] = html_writer::link(new moodle_url('/user/view.php?id='. $user->id .'&course='. $course->id), get_string('fullprofile') . '...');
|
||||
|
||||
$row->cells[2]->text .= implode('', $link);
|
||||
$row->cells[2]->text .= implode('', $links);
|
||||
|
||||
if (!empty($messageselect)) {
|
||||
$row->cells[2]->text .= '<br /><input type="checkbox" name="user'.$user->id.'" /> ';
|
||||
|
@ -146,8 +146,8 @@ echo '<div class="profileeditor">';
|
||||
|
||||
/// Create a new field link
|
||||
$options = profile_list_datatypes();
|
||||
$popupurl = $CFG->wwwroot.'/user/profile/index.php?id=0&action=editfield';
|
||||
echo $OUTPUT->select(html_select::make_popup_form($popupurl, 'datatype', $options, 'newfieldform', $strcreatefield));
|
||||
$popupurl = new moodle_url('/user/profile/index.php?id=0&action=editfield');
|
||||
echo $OUTPUT->single_select($popupurl, 'datatype', $options, '', array(''=>$strcreatefield), 'newfieldform');
|
||||
|
||||
/// Create a new category link
|
||||
$options = array('action'=>'editcategory');
|
||||
|
Loading…
x
Reference in New Issue
Block a user