From: skodak Date: Mon, 20 Apr 2009 20:08:28 +0000 (+0000) Subject: MDL-18910 normalised module intro and introformat X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9f0e60e188562d9908586e15a189ba1dd3d91028;p=moodle.git MDL-18910 normalised module intro and introformat --- diff --git a/mod/survey/db/install.xml b/mod/survey/db/install.xml index d5feeb0029..bee107fd75 100644 --- a/mod/survey/db/install.xml +++ b/mod/survey/db/install.xml @@ -1,5 +1,8 @@ - + @@ -10,11 +13,12 @@ - - + + + - + @@ -31,7 +35,7 @@ - +
@@ -69,4 +73,4 @@
-
+
\ No newline at end of file diff --git a/mod/survey/db/upgrade.php b/mod/survey/db/upgrade.php index 18dde0c636..d85ae54c4f 100644 --- a/mod/survey/db/upgrade.php +++ b/mod/survey/db/upgrade.php @@ -28,6 +28,19 @@ function xmldb_survey_upgrade($oldversion) { //===== 1.9.0 upgrade line ======// + if ($result && $oldversion < 2009042002) { + + /// Define field introformat to be added to survey + $table = new xmldb_table('survey'); + $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro'); + + /// Conditionally launch add field introformat + $dbman->add_field($table, $field); + + /// survey savepoint reached + upgrade_mod_savepoint($result, 2009042002, 'survey'); + } + return $result; } diff --git a/mod/survey/version.php b/mod/survey/version.php index 51a67c370c..662eadcac8 100644 --- a/mod/survey/version.php +++ b/mod/survey/version.php @@ -5,8 +5,8 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2007101509; -$module->requires = 2007101509; // Requires this Moodle version +$module->version = 2009042002; +$module->requires = 2009041700; // Requires this Moodle version $module->cron = 0; ?> diff --git a/mod/survey/view.php b/mod/survey/view.php index 4fa6b05eee..e0f4558588 100644 --- a/mod/survey/view.php +++ b/mod/survey/view.php @@ -80,7 +80,8 @@ } else { - print_box(format_text($survey->intro), 'generalbox', 'intro'); + $options = (object)array('noclean'=>true); + print_box(format_text($survey->intro, $survey->introformat, $options), 'generalbox', 'intro'); print_spacer(30); $questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions));