make_categories_list($displaylist, $notused);
echo '<div class="categorypicker">';
- popup_form('category.php?id=', $displaylist, 'switchcategory', $category->id, '', '', '', false, 'self', $strcategories.':');
+ $popupurl = 'category.php?id=';
+ foreach ($displaylist as $key => $val) {
+ $displaylist[$popupurl.$key] = $val;
+ unset($displaylist[$key]);
+ }
+ $select = moodle_select::make_popup_form($displaylist, 'switchcategory', $popupurl.$category->id);
+ $select->set_label($strcategories.':');
+ echo $OUTPUT->select($select);
echo '</div>';
/// Print current category description
$timenow = time();
$section = 1;
$sectionmenu = array();
+
+ $popupurl = $CFG->wwwroot.'/course/view.php?id='.$course->id.'&topic=';
while ($section <= $course->numsections) {
} else {
$strsummary = ' - '.substr($strsummary, 0, 60).'...';
}
- $sectionmenu[$section] = s($section.$strsummary);
+ $sectionmenu[$popupurl.$section] = s($section.$strsummary);
}
$section++;
continue;
if (!empty($sectionmenu)) {
echo '<div class="jumpmenu">';
- echo popup_form($CFG->wwwroot.'/course/view.php?id='.$course->id.'&topic=', $sectionmenu,
- 'sectionmenu', '', get_string('jumpto'), '', '', true);
+ $select = moodle_select::make_popup_form($sectionmenu, 'sectionmenu');
+ $select->set_label(get_string('jumpto'));
+ echo $OUTPUT->select($select);
echo '</div>';
}
$weekofseconds = 604800;
$course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
+ $popupurl = $CFG->wwwroot.'/course/view.php?id='.$course->id.'&week=';
+
$strftimedateshort = ' '.get_string('strftimedateshort');
while ($weekdate < $course->enddate) {
if (!empty($displaysection) and $displaysection != $section) { // Check this week is visible
if ($showsection) {
- $sectionmenu[$section] = s("$strweek $section | $weekday - $endweekday");
+ $sectionmenu[$popupurl.$section] = s("$strweek $section | $weekday - $endweekday");
}
$section++;
$weekdate = $nextweekdate;
if (!empty($sectionmenu)) {
echo '<div class="jumpmenu">';
- echo popup_form($CFG->wwwroot.'/course/view.php?id='.$course->id.'&week=', $sectionmenu,
- 'sectionmenu', '', get_string('jumpto'), '', '', true);
+ $select = moodle_select::make_popup_form($sectionmenu, 'sectionmenu');
+ $select->set_label(get_string('jumpto'));
+ echo $OUTPUT->select($select);
echo '</div>';
}
echo '<td align="left">';
if (has_capability('moodle/category:manage', $category->context)) {
$tempdisplaylist = $displaylist;
+ $popupurl = "index.php?move=$category->id&sesskey=".sesskey()."&moveto=";
unset($tempdisplaylist[$category->id]);
foreach ($parentslist as $key => $parents) {
if (in_array($category->id, $parents)) {
unset($tempdisplaylist[$key]);
}
}
- popup_form ("index.php?move=$category->id&sesskey=".sesskey()."&moveto=", $tempdisplaylist, "moveform$category->id", $category->parent, '', '', '', false);
+ foreach ($tempdisplaylist as $key => $val) {
+ $tempdisplaylist[$popupurl.$key] = $val;
+ unset($tempdisplaylist[$key]);
+ }
+ echo $OUTPUT->select(moodle_select::make_popup_form($tempdisplaylist, "moveform$category->id", $popupurl.$category->parent));
}
echo '</td>';
echo '</tr>';
* Prints the menus to add activities and resources.
*/
function print_section_add_menus($course, $section, $modnames, $vertical=false, $return=false) {
- global $CFG;
+ global $CFG, $OUTPUT;
// check to see if user can add menus
if (!has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id))) {
static $resources = false;
static $activities = false;
+ $popupurl = "$CFG->wwwroot/course/mod.php?id=$course->id§ion=$section&sesskey=".sesskey()."&add=";
+
if ($resources === false) {
$resources = array();
$activities = array();
$gettypesfunc = $modname.'_get_types';
if (function_exists($gettypesfunc)) {
$types = $gettypesfunc();
+
foreach($types as $type) {
+ $type->type = str_replace('&', '&', $type->type);
if (!isset($type->modclass) or !isset($type->typestr)) {
debugging('Incorrect activity type in '.$modname);
continue;
}
if ($type->modclass == MOD_CLASS_RESOURCE) {
- $resources[$type->type] = $type->typestr;
+ $resources[$popupurl.$type->type] = $type->typestr;
} else {
- $activities[$type->type] = $type->typestr;
+ $activities[$popupurl.$type->type] = $type->typestr;
}
}
} else {
// all mods without type are considered activity
- $activities[$modname] = $modnamestr;
+ $activities[$popupurl.$modname] = $modnamestr;
}
}
}
if (!$vertical) {
$output .= '<div class="horizontal">';
}
-
+
if (!empty($resources)) {
- $output .= popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$section&sesskey=".sesskey()."&add=",
- $resources, "ressection$section", "", $straddresource, 'resource/types', $straddresource, true);
+ $select = moodle_select::make_popup_form($resources, "ressection$section", null);
+ $select->nothinglabel = $straddresource;
+ $select->set_help_icon('resource/types', $straddresource);
+ $output .= $OUTPUT->select($select);
}
if (!empty($activities)) {
- $output .= ' ';
- $output .= popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$section&sesskey=".sesskey()."&add=",
- $activities, "section$section", "", $straddactivity, 'mods', $straddactivity, true);
+ $select = moodle_select::make_popup_form($activities, "section$section", null);
+ $select->nothinglabel = $straddactivity;
+ $select->set_help_icon('mods', $straddactivity);
+ $output .= $OUTPUT->select($select);
}
if (!$vertical) {
function report_stats_mode_menu($course, $mode, $time, $url) {
- global $CFG;
+ global $CFG, $OUTPUT;
/*
$reportoptions = stats_get_report_options($course->id, $mode);
$timeoptions = report_stats_timeoptions($mode);
*/
$options = array();
- $options[STATS_MODE_GENERAL] = get_string('statsmodegeneral');
- $options[STATS_MODE_DETAILED] = get_string('statsmodedetailed');
+ $popupurl = $url."?course=$course->id&time=$time&mode=";
+ $options[$popupurl.STATS_MODE_GENERAL] = get_string('statsmodegeneral');
+ $options[$popupurl.STATS_MODE_DETAILED] = get_string('statsmodedetailed');
if (has_capability('coursereport/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
- $options[STATS_MODE_RANKED] = get_string('reports');
+ $options[$popupurl.STATS_MODE_RANKED] = get_string('reports');
}
-
- return popup_form($url."?course=$course->id&time=$time&mode=", $options, 'switchmode', $mode, '', '', '', true);
+ return $OUTPUT->select(moodle_select::make_popup_form($options, 'switchmode', $popupurl.$mode));
}