MDL-9469 mod_forum: add export node to settings menu
authorSimey Lameze <simey@moodle.com>
Mon, 5 Aug 2019 23:59:29 +0000 (07:59 +0800)
committerSimey Lameze <simey@moodle.com>
Fri, 20 Sep 2019 00:19:01 +0000 (08:19 +0800)
Part of MDL-66075

mod/forum/lang/en/forum.php
mod/forum/lib.php

index ddab9f8..ad44b4b 100644 (file)
@@ -242,6 +242,7 @@ $string['everyonecannowchoose'] = 'Everyone can now choose to be subscribed';
 $string['everyoneisnowsubscribed'] = 'Everyone is now subscribed to this forum';
 $string['everyoneissubscribed'] = 'Everyone is subscribed to this forum';
 $string['existingsubscribers'] = 'Existing subscribers';
+$string['export'] = 'Export';
 $string['exportdiscussion'] = 'Export whole discussion to portfolio';
 $string['exportattachmentname'] = 'Export attachment {$a} to portfolio';
 $string['firstpost'] = 'First post';
index 62f2423..b83c3f0 100644 (file)
@@ -5379,6 +5379,9 @@ function forum_extend_settings_navigation(settings_navigation $settingsnav, navi
         $url = new moodle_url(rss_get_url($PAGE->cm->context->id, $userid, "mod_forum", $forumobject->id));
         $forumnode->add($string, $url, settings_navigation::TYPE_SETTING, null, null, new pix_icon('i/rss', ''));
     }
+
+    $url = new moodle_url('/mod/forum/export.php', ['id' => $forumobject->id]);
+    $forumnode->add(get_string('export', 'mod_forum'), $url, navigation_node::TYPE_SETTING);
 }
 
 /**