diff --git a/course/format/renderer.php b/course/format/renderer.php index 9944a75a4e9..d557d769ef1 100644 --- a/course/format/renderer.php +++ b/course/format/renderer.php @@ -98,11 +98,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $o = ""; if (!empty($controls)) { $menu = new action_menu(); - if ($section->section && get_string_manager()->string_exists('sectionmenu', 'format_'.$course->format)) { - $menu->set_menu_trigger(get_string('sectionmenu', 'format_'.$course->format)); - } else { - $menu->set_menu_trigger(get_string('sectionmenu')); - } + $menu->set_menu_trigger(get_string('edit')); $menu->attributes['class'] .= ' section-actions'; foreach ($controls as $value) { $url = empty($value['url']) ? '' : $value['url']; diff --git a/course/format/topics/lang/en/format_topics.php b/course/format/topics/lang/en/format_topics.php index c24e68a2317..6518d5b92c9 100644 --- a/course/format/topics/lang/en/format_topics.php +++ b/course/format/topics/lang/en/format_topics.php @@ -28,7 +28,6 @@ $string['editsection'] = 'Edit topic'; $string['deletesection'] = 'Delete topic'; $string['sectionname'] = 'Topic'; $string['pluginname'] = 'Topics format'; -$string['sectionmenu'] = 'Topic menu'; $string['section0name'] = 'General'; $string['page-course-view-topics'] = 'Any course main page in topics format'; $string['page-course-view-topics-x'] = 'Any course page in topics format'; diff --git a/course/format/topics/renderer.php b/course/format/topics/renderer.php index 45d06843c74..c23bd0c6a09 100644 --- a/course/format/topics/renderer.php +++ b/course/format/topics/renderer.php @@ -104,21 +104,39 @@ class format_topics_renderer extends format_section_renderer_base { $url->param('marker', 0); $markedthistopic = get_string('markedthistopic'); $highlightoff = get_string('highlightoff'); - $controls[] = array("url" => $url, "icon" => 'i/marked', - "name" => $highlightoff, - 'pixattr' => array('class' => '', 'alt' => $markedthistopic), - "attr" => array('class' => 'editing_highlight', 'title' => $markedthistopic)); + $controls['highlight'] = array('url' => $url, "icon" => 'i/marked', + 'name' => $highlightoff, + 'pixattr' => array('class' => '', 'alt' => $markedthistopic), + 'attr' => array('class' => 'editing_highlight', 'title' => $markedthistopic)); } else { $url->param('marker', $section->section); $markthistopic = get_string('markthistopic'); $highlight = get_string('highlight'); - $controls[] = array("url" => $url, "icon" => 'i/marker', - "name" => $highlight, - 'pixattr' => array('class' => '', 'alt' => $markthistopic), - "attr" => array('class' => 'editing_highlight', 'title' => $markthistopic)); + $controls['highlight'] = array('url' => $url, "icon" => 'i/marker', + 'name' => $highlight, + 'pixattr' => array('class' => '', 'alt' => $markthistopic), + 'attr' => array('class' => 'editing_highlight', 'title' => $markthistopic)); } } - return array_merge($controls, parent::section_edit_control_items($course, $section, $onsectionpage)); + $parentcontrols = parent::section_edit_control_items($course, $section, $onsectionpage); + + // If the edit key exists, we are going to insert our controls after it. + if (array_key_exists("edit", $parentcontrols)) { + $merged = array(); + // We can't use splice because we are using associative arrays. + // Step through the array and merge the arrays. + foreach ($parentcontrols as $key => $action) { + $merged[$key] = $action; + if ($key == "edit") { + // If we have come to the edit key, merge these controls here. + $merged = array_merge($merged, $controls); + } + } + + return $merged; + } else { + return array_merge($controls, $parentcontrols); + } } } diff --git a/course/format/weeks/lang/en/format_weeks.php b/course/format/weeks/lang/en/format_weeks.php index 22945746144..905e71a43b6 100644 --- a/course/format/weeks/lang/en/format_weeks.php +++ b/course/format/weeks/lang/en/format_weeks.php @@ -28,7 +28,6 @@ $string['editsection'] = 'Edit week'; $string['deletesection'] = 'Delete week'; $string['sectionname'] = 'Week'; $string['pluginname'] = 'Weekly format'; -$string['sectionmenu'] = 'Week menu'; $string['section0name'] = 'General'; $string['page-course-view-weeks'] = 'Any course main page in weeks format'; $string['page-course-view-weeks-x'] = 'Any course page in weeks format'; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 1cbc8edda28..01854927440 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -1633,7 +1633,6 @@ $string['secondstotime86400'] = '1 day'; $string['secretalreadyused'] = 'Change password confirmation link was already used, password was not changed.'; $string['secs'] = 'secs'; $string['section'] = 'Section'; -$string['sectionmenu'] = 'Section menu'; $string['sectionname'] = 'Section name'; $string['sections'] = 'Sections'; $string['sectionusedefaultname'] = 'Use default section name';