@@ -632,17 +632,6 @@ public function edit_menu_actions(structure $structure, $page,
632
632
// Get section, page, slotnumber and maxmark.
633
633
$ actions = array ();
634
634
635
- // Add a new section to the add_menu if possible. This is always added to the HTML
636
- // then hidden with CSS when no needed, so that as things are re-ordered, etc. with
637
- // Ajax it can be relevaled again when necessary.
638
- $ params = array ('cmid ' => $ structure ->get_cmid (), 'addsectionatpage ' => $ page );
639
-
640
- $ actions ['addasection ' ] = new \action_menu_link_secondary (
641
- new \moodle_url ($ pageurl , $ params ),
642
- new \pix_icon ('t/add ' , $ str ->addasection , 'moodle ' , array ('class ' => 'iconsmall ' , 'title ' => '' )),
643
- $ str ->addasection , array ('class ' => 'cm-edit-action addasection ' , 'data-action ' => 'addasection ' )
644
- );
645
-
646
635
// Add a new question to the quiz.
647
636
$ returnurl = new \moodle_url ($ pageurl , array ('addonpage ' => $ page ));
648
637
$ params = array ('returnurl ' => $ returnurl ->out_as_local_url (false ),
@@ -680,6 +669,17 @@ public function edit_menu_actions(structure $structure, $page,
680
669
$ attributes = array_merge (array ('data-header ' => $ title , 'data-addonpage ' => $ page ), $ attributes );
681
670
$ actions ['addarandomquestion ' ] = new \action_menu_link_secondary ($ url , $ icon , $ str ->addarandomquestion , $ attributes );
682
671
672
+ // Add a new section to the add_menu if possible. This is always added to the HTML
673
+ // then hidden with CSS when no needed, so that as things are re-ordered, etc. with
674
+ // Ajax it can be relevaled again when necessary.
675
+ $ params = array ('cmid ' => $ structure ->get_cmid (), 'addsectionatpage ' => $ page );
676
+
677
+ $ actions ['addasection ' ] = new \action_menu_link_secondary (
678
+ new \moodle_url ($ pageurl , $ params ),
679
+ new \pix_icon ('t/add ' , $ str ->addasection , 'moodle ' , array ('class ' => 'iconsmall ' , 'title ' => '' )),
680
+ $ str ->addasection , array ('class ' => 'cm-edit-action addasection ' , 'data-action ' => 'addasection ' )
681
+ );
682
+
683
683
return $ actions ;
684
684
}
685
685
0 commit comments