MDL-21695 Regression mod/forum/ratings.html was used for a default scale description

I added a new string describing the Separated and Connected ways of
knowing which will be used as the default description for fresh
installations. Thanks Dan Marsden for reporting and testing.
This commit is contained in:
David Mudrak
2010-04-27 23:50:06 +00:00
parent 69c14bbd3e
commit 2d0f7da8f8
2 changed files with 3 additions and 21 deletions
+1
View File
@@ -1487,6 +1487,7 @@ $string['selectperiod'] = 'Select period';
$string['senddetails'] = 'Send my details via email';
$string['separate'] = 'Separate';
$string['separateandconnected'] = 'Separate and Connected ways of knowing';
$string['separateandconnectedinfo'] = 'The scale based on the theory of separate and connected knowing. This theory describes two different ways that we can evaluate and learn about the things we see and hear.<ul><li><strong>Separate knowers</strong> remain as objective as possible without including feelings and emotions. In a discussion with other people, they like to defend their own ideas, using logic to find holes in opponent\'s ideas.</li><li><strong>Connected knowers</strong> are more sensitive to other people. They are skilled at empathy and tends to listen and ask questions until they feel they can connect and "understand things from their point of view". They learn by trying to share the experiences that led to the knowledge they find in other people.</li></ul>';
$string['serverlocaltime'] = 'Server\'s local time';
$string['setcategorytheme'] = 'Set Category Theme';
$string['settings'] = 'Settings';
+2 -21
View File
@@ -1573,40 +1573,21 @@ function get_my_remotehosts() {
* existing language translations and older sites.
*
* @global object
* @global object
* @return void
*/
function make_default_scale() {
global $CFG, $DB;
global $DB;
$defaultscale = NULL;
$defaultscale->courseid = 0;
$defaultscale->userid = 0;
$defaultscale->name = get_string('separateandconnected');
$defaultscale->description = get_string('separateandconnectedinfo');
$defaultscale->scale = get_string('postrating1', 'forum').','.
get_string('postrating2', 'forum').','.
get_string('postrating3', 'forum');
$defaultscale->timemodified = time();
/// Read in the big description from the file. Note this is not
/// HTML (despite the file extension) but Moodle format text.
$parentlang = get_parent_language();
if (is_readable($CFG->dataroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html')) {
$file = file($CFG->dataroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html');
} else if (is_readable($CFG->dirroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html')) {
$file = file($CFG->dirroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html');
} else if ($parentlang and is_readable($CFG->dataroot .'/lang/'. $parentlang .'/help/forum/ratings.html')) {
$file = file($CFG->dataroot .'/lang/'. $parentlang .'/help/forum/ratings.html');
} else if ($parentlang and is_readable($CFG->dirroot .'/lang/'. $parentlang .'/help/forum/ratings.html')) {
$file = file($CFG->dirroot .'/lang/'. $parentlang .'/help/forum/ratings.html');
} else if (is_readable($CFG->dirroot .'/lang/en/help/forum/ratings.html')) {
$file = file($CFG->dirroot .'/lang/en/help/forum/ratings.html');
} else {
$file = '';
}
$defaultscale->description = implode('', $file);
if ($defaultscale->id = $DB->insert_record('scale', $defaultscale)) {
$DB->execute("UPDATE {forum} SET scale = ?", array($defaultscale->id));
}