mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
More multilang support for site fullname, plus a couple extra comments.
This commit is contained in:
parent
ca31757ba3
commit
3af559d414
5 changed files with 10 additions and 4 deletions
|
@ -72,7 +72,7 @@
|
||||||
echo '<div class="fitem">';
|
echo '<div class="fitem">';
|
||||||
echo '<div class="fitemtitle"><label for="sitename">'.get_string("fullsitename").'</label></div>';
|
echo '<div class="fitemtitle"><label for="sitename">'.get_string("fullsitename").'</label></div>';
|
||||||
echo '<div class="felement ftext">';
|
echo '<div class="felement ftext">';
|
||||||
echo '<input size="50" id="sitename" type="text" name="sitename" value="'.$site->fullname.'" />';
|
echo '<input size="50" id="sitename" type="text" name="sitename" value="'.format_string($site->fullname).'" />';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
|
|
||||||
function emailprotect_filter($courseid, $text) {
|
function emailprotect_filter($courseid, $text) {
|
||||||
|
|
||||||
|
|
||||||
|
if (!empty($CFG->formatstring)) {
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
/// Do a quick check using stripos to avoid unnecessary work
|
/// Do a quick check using stripos to avoid unnecessary work
|
||||||
if (strpos($text, '@') === false) {
|
if (strpos($text, '@') === false) {
|
||||||
return $text;
|
return $text;
|
||||||
|
|
|
@ -41,6 +41,7 @@ function multilang_filter($courseid, $text) {
|
||||||
|
|
||||||
// [pj] I don't know about you but I find this new implementation funny :P
|
// [pj] I don't know about you but I find this new implementation funny :P
|
||||||
// [skodak] I was laughing while rewriting it ;-)
|
// [skodak] I was laughing while rewriting it ;-)
|
||||||
|
// [nicolasconnault] Should support inverted attributes: <span class="multilang" lang="en"> (Doesn't work curently)
|
||||||
|
|
||||||
if (empty($CFG->filter_multilang_force_old) and !empty($CFG->filter_multilang_converted)) {
|
if (empty($CFG->filter_multilang_force_old) and !empty($CFG->filter_multilang_converted)) {
|
||||||
// new syntax
|
// new syntax
|
||||||
|
|
|
@ -1760,11 +1760,11 @@ class admin_setting_sitesettext extends admin_setting_configtext {
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate($data) {
|
function validate($data) {
|
||||||
$cleaned = clean_param($data, PARAM_NOTAGS);
|
$cleaned = stripslashes(clean_param($data, PARAM_MULTILANG));
|
||||||
if ($cleaned == '') {
|
if ($cleaned == '') {
|
||||||
return false; // can not be empty
|
return false; // can not be empty
|
||||||
}
|
}
|
||||||
return ("$data" == "$cleaned"); // implicit conversion to string is needed to do exact comparison
|
return ($data == $cleaned); // implicit conversion to string is needed to do exact comparison
|
||||||
}
|
}
|
||||||
|
|
||||||
function write_setting($data) {
|
function write_setting($data) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ function set_parameters() {
|
||||||
'lang' => array('langstr' => get_string('preferredlanguage'),
|
'lang' => array('langstr' => get_string('preferredlanguage'),
|
||||||
'value' => current_language()),
|
'value' => current_language()),
|
||||||
'sitename' => array('langstr' => get_string('fullsitename'),
|
'sitename' => array('langstr' => get_string('fullsitename'),
|
||||||
'value' => $site->fullname),
|
'value' => format_string($site->fullname)),
|
||||||
'serverurl' => array('langstr' => get_string('serverurl', 'resource', $CFG),
|
'serverurl' => array('langstr' => get_string('serverurl', 'resource', $CFG),
|
||||||
'value' => $CFG->wwwroot),
|
'value' => $CFG->wwwroot),
|
||||||
'currenttime' => array('langstr' => get_string('time'),
|
'currenttime' => array('langstr' => get_string('time'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue