MDL-41611 mod_forum: Display inline available when supported
authorFrederic Massart <fred@moodle.com>
Fri, 4 Oct 2013 03:19:53 +0000 (11:19 +0800)
committerFrederic Massart <fred@moodle.com>
Fri, 4 Oct 2013 10:21:14 +0000 (18:21 +0800)
mod/folder/mod_form.php

index 02ab56a..61fb49b 100644 (file)
@@ -54,6 +54,10 @@ class mod_folder_mod_form extends moodleform_mod {
                 array(FOLDER_DISPLAY_PAGE => get_string('displaypage', 'mod_folder'),
                     FOLDER_DISPLAY_INLINE => get_string('displayinline', 'mod_folder')));
         $mform->addHelpButton('display', 'display', 'mod_folder');
                 array(FOLDER_DISPLAY_PAGE => get_string('displaypage', 'mod_folder'),
                     FOLDER_DISPLAY_INLINE => get_string('displayinline', 'mod_folder')));
         $mform->addHelpButton('display', 'display', 'mod_folder');
+        if (!$this->courseformat->has_view_page()) {
+            $mform->setConstant('display', FOLDER_DISPLAY_PAGE);
+            $mform->hardFreeze('display');
+        }
         $mform->setExpanded('content');
 
         // Adding option to show sub-folders expanded or collapsed by default.
         $mform->setExpanded('content');
 
         // Adding option to show sub-folders expanded or collapsed by default.