From: moodler Date: Tue, 10 Feb 2004 05:05:28 +0000 (+0000) Subject: Some configuration options now added to the Configuration page. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d523d2ead144a2572ee0ff08bf04bc38e51ae453;p=moodle.git Some configuration options now added to the Configuration page. opentogoogle textfilters cachetext They should upgrade cleanly from anything you may have in config.php --- diff --git a/admin/config.html b/admin/config.html index 5f17921703..eca0a77182 100644 --- a/admin/config.html +++ b/admin/config.html @@ -368,6 +368,64 @@ + +

opentogoogle: + + opentogoogle, "", "", ""); + ?> + + + + + + +

textfilters: + + textfilters = str_replace(',',"\n", $config->textfilters); + ?> + + + + + + + +

cachetext: + + cachetext, "", "", ""); + ?> + + + + + diff --git a/lang/en/moodle.php b/lang/en/moodle.php index f1952ecaf9..351ab7ee6c 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -121,6 +121,7 @@ $string['closewindow'] = 'Close this window'; $string['comparelanguage'] = 'Compare and edit current language'; $string['complete'] = 'Complete'; $string['configallowunenroll'] = 'If this is set \'Yes\', then students are allowed to unenroll themselves from courses whenever they like. Otherwise they are not allowed, and this process will be solely controlled by the teachers and administrators.'; +$string['configcachetext'] = 'For larger sites or sites that use text filters, this setting can really speed things up. Copies of texts will be retained in their processed form for the time specified here. Setting this too small may actually slow things down slightly, but setting it too large may mean texts take too long to refresh (with new links, for example).'; $string['configcountry'] = 'If you set a country here, then this country will be selected by default on new user accounts. To force users to choose a country, just leave this unset.'; $string['configdebug'] = 'If you turn this on, then PHP\'s error_reporting will be increased so that more warnings are printed. This is only useful for developers.'; $string['configerrorlevel'] = 'Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.'; @@ -128,7 +129,7 @@ $string['configforcelogin'] = 'Normally, the front page of the site and the cour $string['configframename'] = 'If you are embedding Moodle within a web frame, then put the name of this frame here. Otherwise this value should remain as \'_top\''; $string['configfullnamedisplay'] = 'This defines how names are shown when they are displayed in full. For most mono-lingual sites the most efficient setting is the default \"Given names + Surname\", but you may choose to hide surnames altogether, or to leave it up to the current language pack to decide (some languages have different conventions).'; $string['configgdversion'] = 'Indicate the version of GD that is installed. The version shown by default is the one that has been auto-detected. Don\'t change this unless you really know what you\'re doing.'; -$string['confightmleditor'] = 'Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible browser (IE 5.5 or later). Users can also choose not to use it.'; +$string['confightmleditor'] = 'Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible web browser. Users can also choose not to use it.'; $string['configidnumber'] = 'This option specifies whether (a) Users are not be asked for an ID number at all, (b) Users are asked for an ID number but can leave it blank or (c) Users are asked for an ID Number and cannot leave it blank. If given the User\'s ID number is displayed in their Profile.'; $string['configintro'] = 'On this page you can specify a number of configuration variables that help make Moodle work properly on your server. Don\'t worry too much about it - the defaults will usually work fine and you can always come back to this page later and change these settings.'; $string['configintroadmin'] = 'On this page you should configure your main administrator account which will have complete control over the site. Make sure you give it a secure username and password as well as a valid email address. You can create more admin accounts later on.'; @@ -142,6 +143,7 @@ $string['configloglifetime'] = 'This specifies the length of time you want to ke $string['configlongtimenosee'] = 'If students haven\'t logged in for a very long time, then they are automatically unsubscribed from courses. This parameter specifies that time limit.'; $string['configmaxbytes'] = 'This specifies a maximum size that uploaded files can be throughout the whole site. This setting is limited by the PHP setting upload_max_filesize and the Apache setting LimitRequestBody. In turn, maxbytes limits the range of sizes that can be chosen at course level or module level.'; $string['configmaxeditingtime'] = 'This specifies the amount of time people have to re-edit forum postings, journal feedback etc. Usually 30 minutes is a good value.'; +$string['configopentogoogle'] = 'If you enable this setting, then Google will be allowed to enter your site as a Guest. In addition, people coming in to your site via a Google search will automatically be logged in as a Guest. Note that this only provides transparent access to courses that already allow guest access.'; $string['configproxyhost'] = 'If this server needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here. Otherwise leave it blank.'; $string['configsecureforms'] = 'Moodle can use an additional level of security when accepting data from web forms. If this is enabled, then the browser\'s HTTP_REFERER variable is checked against the current form address. In a very few cases this can cause problems if the user is using a firewall (eg Zonealarm) configured to strip HTTP_REFERER from their web traffic. Symptoms are getting \'stuck\' on a form. If your users are having problems with the login page (for example) you might want to disable this setting, although it might leave your site more open to brute-force password attacks. If in doubt, leave this set to \'Yes\'.'; $string['configsessioncookie'] = 'This setting customises the name of the cookie used for Moodle sessions. This is optional, and only useful to avoid cookies being confused when there is more than one copy of Moodle running within the same web site.'; @@ -150,6 +152,7 @@ $string['configslasharguments'] = 'Files (images, uploads etc) are provided via $string['configsmtphosts'] = 'Give the full name of one or more local SMTP servers that Moodle should use to send mail (eg \'mail.a.com\' or \'mail.a.com;mail.b.com\'). If you leave it blank, Moodle will use the PHP default method of sending mail.'; $string['configsmtpuser'] = 'If you have specified an SMTP server above, and the server requires authentication, then enter the username and password here.'; $string['configteacherassignteachers'] = 'Should ordinary teachers be allowed to assign other teachers within courses they teach? If \'No\', then only course creators and admins can assign teachers.'; +$string['configtextfilters'] = 'Text filters process text in various ways. Specify the relative paths to text filters you want to use in the order they should be applied to texts, separated by commas. (For example, mod/glossary/dynalink.php, filter/censor/censor.php)'; $string['configunzip'] = 'Indicate the location of your unzip program (Unix only, optional). If specified, this will be used to unpack zip archives on the server. If you leave this blank, then Moodle will use internal routines.'; $string['configuration'] = 'Configuration'; $string['configvariables'] = 'Variables'; @@ -629,6 +632,7 @@ $string['numberweeks'] = 'Number of weeks/topics'; $string['numdays'] = '$a days'; $string['numhours'] = '$a hours'; $string['numminutes'] = '$a minutes'; +$string['numseconds'] = '$a seconds'; $string['numviews'] = '$a views'; $string['numweeks'] = '$a weeks'; $string['numwords'] = '$a words'; diff --git a/lib/db/mysql.php b/lib/db/mysql.php index db4f9d4ddd..de2855d04b 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -654,6 +654,24 @@ function main_upgrade($oldversion=0) { ) TYPE=MyISAM COMMENT='For storing temporary copies of processed texts';"); } + if ($oldversion < 2004021000) { + $textfilters = array(); + for ($i=1; $i<=10; $i++) { + $variable = "textfilter$i"; + if (!empty($CFG->$variable)) { /// No more filters + if (is_readable("$CFG->dirroot/".$CFG->$variable)) { + $textfilters[] = $CFG->$variable; + } + } + } + $textfilters = implode(',', $textfilters); + if (empty($textfilters)) { + $textfilters = 'mod/glossary/dynalink.php'; + } + set_config('textfilters', $textfilters); + } + + return $result; } diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 4f10dcc306..9f337c3696 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -398,6 +398,24 @@ function main_upgrade($oldversion=0) { );"); } + if ($oldversion < 2004021000) { + $textfilters = array(); + for ($i=1; $i<=10; $i++) { + $variable = "textfilter$i"; + if (!empty($CFG->$variable)) { /// No more filters + if (is_readable("$CFG->dirroot/".$CFG->$variable)) { + $textfilters[] = $CFG->$variable; + } + } + } + $textfilters = implode(',', $textfilters); + if (empty($textfilters)) { + $textfilters = 'mod/glossary/dynalink.php'; + } + set_config('textfilters', $textfilters); + } + + return $result; } diff --git a/lib/defaults.php b/lib/defaults.php index 968b552e88..2cc140bd17 100644 --- a/lib/defaults.php +++ b/lib/defaults.php @@ -6,6 +6,7 @@ $defaults = array ( "auth" => "email", "allowunenroll" => true, + "cachetext" => 60, "changepassword" => true, "country" => "", "debug" => 7, @@ -24,6 +25,7 @@ "longtimenosee" => 100, "maxbytes" => 0, "maxeditingtime" => 1800, + "opentogoogle" => false, "prefix" => "", "proxyhost" => "", "proxyport" => "", @@ -35,6 +37,7 @@ "smtppass" => "", "smtpuser" => "", "teacherassignteachers" => true, + "textfilters" => "mod/glossary/dynalink.php", "theme" => "standard", "unzip" => "", "zip" => "" diff --git a/lib/weblib.php b/lib/weblib.php index 301e5df4a4..31f230d0f8 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -588,16 +588,17 @@ function filter_text($text, $courseid=NULL) { global $CFG; - for ($i=1; $i<=10; $i++) { - $variable = "textfilter$i"; - if (empty($CFG->$variable)) { /// No more filters - return $text; - } - if (is_readable("$CFG->dirroot/".$CFG->$variable)) { - include("$CFG->dirroot/".$CFG->$variable); - $text = $textfilter_function($courseid, $text); + if (!empty($CFG->textfilters)) { + $textfilters = explode(',', $CFG->textfilters); + foreach ($textfilters as $textfilter) { + $textfilter = trim($textfilter); + if (is_readable($CFG->dirroot.'/'.$textfilter)) { + include($CFG->dirroot.'/'.$textfilter); + $text = $textfilter_function($courseid, $text); + } } } + return $text; } diff --git a/version.php b/version.php index e6683c20c6..3f378e49b9 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2004020903; // The current version is a date (YYYYMMDDXX) +$version = 2004021000; // The current version is a date (YYYYMMDDXX) $release = "1.2 development"; // User-friendly version number