mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-51948 admin: Make admin settings RTL friendly
Part of MDL-55071
This commit is contained in:
parent
a47e73ff7c
commit
113efed5b0
@ -8,7 +8,7 @@
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
echo '<div class="phpinfo">';
|
||||
echo '<div class="phpinfo text-ltr">';
|
||||
|
||||
ob_start();
|
||||
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES + INFO_VARIABLES);
|
||||
|
@ -12,7 +12,10 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
|
||||
// "themesettings" settingpage
|
||||
$temp = new admin_settingpage('themesettings', new lang_string('themesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configtext('themelist', new lang_string('themelist', 'admin'), new lang_string('configthemelist','admin'), '', PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configtext('themelist', new lang_string('themelist', 'admin'),
|
||||
new lang_string('configthemelist','admin'), '', PARAM_NOTAGS);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$setting = new admin_setting_configcheckbox('themedesignermode', new lang_string('themedesignermode', 'admin'), new lang_string('configthemedesignermode', 'admin'), 0);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($setting);
|
||||
@ -22,7 +25,8 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', new lang_string('allowthemechangeonurl', 'admin'), new lang_string('configallowthemechangeonurl', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('allowblockstodock', new lang_string('allowblockstodock', 'admin'), new lang_string('configallowblockstodock', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'), new lang_string('configcustommenuitems', 'admin'), '', PARAM_TEXT, '50', '10'));
|
||||
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'),
|
||||
new lang_string('configcustommenuitems', 'admin'), '', PARAM_RAW, '50', '10'));
|
||||
$temp->add(new admin_setting_configtextarea(
|
||||
'customusermenuitems',
|
||||
new lang_string('customusermenuitems', 'admin'),
|
||||
@ -30,7 +34,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
'grades,grades|/grade/report/mygrades.php|grades
|
||||
messages,message|/message/index.php|message
|
||||
preferences,moodle|/user/preferences.php|preferences',
|
||||
PARAM_TEXT,
|
||||
PARAM_RAW,
|
||||
'50',
|
||||
'10'
|
||||
));
|
||||
|
@ -58,9 +58,18 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
GRADE_NAVMETHOD_TABS => new lang_string('tabs', 'grades'),
|
||||
GRADE_NAVMETHOD_COMBO => new lang_string('combo', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_configtext('grade_export_userprofilefields', new lang_string('gradeexportuserprofilefields', 'grades'), new lang_string('gradeexportuserprofilefields_desc', 'grades'), 'firstname,lastname,idnumber,institution,department,email', PARAM_TEXT));
|
||||
$setting = new admin_setting_configtext('grade_export_userprofilefields',
|
||||
new lang_string('gradeexportuserprofilefields', 'grades'),
|
||||
new lang_string('gradeexportuserprofilefields_desc', 'grades'),
|
||||
'firstname,lastname,idnumber,institution,department,email', PARAM_TEXT);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
|
||||
$temp->add(new admin_setting_configtext('grade_export_customprofilefields', new lang_string('gradeexportcustomprofilefields', 'grades'), new lang_string('gradeexportcustomprofilefields_desc', 'grades'), '', PARAM_TEXT));
|
||||
$setting = new admin_setting_configtext('grade_export_customprofilefields',
|
||||
new lang_string('gradeexportcustomprofilefields', 'grades'),
|
||||
new lang_string('gradeexportcustomprofilefields_desc', 'grades'), '', PARAM_TEXT);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('recovergradesdefault', new lang_string('recovergradesdefault', 'grades'), new lang_string('recovergradesdefault_help', 'grades'), 0));
|
||||
|
||||
|
@ -105,12 +105,22 @@ if ($hassiteconfig) {
|
||||
new lang_string('forgottenpassword', 'auth'), ''));
|
||||
$temp->add(new admin_setting_confightmleditor('auth_instructions', new lang_string('instructions', 'auth'),
|
||||
new lang_string('authinstructions', 'auth'), ''));
|
||||
$temp->add(new admin_setting_configtext('allowemailaddresses', new lang_string('allowemailaddresses', 'admin'), new lang_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('denyemailaddresses', new lang_string('denyemailaddresses', 'admin'), new lang_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configtext('allowemailaddresses', new lang_string('allowemailaddresses', 'admin'),
|
||||
new lang_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$setting = new admin_setting_configtext('denyemailaddresses', new lang_string('denyemailaddresses', 'admin'),
|
||||
new lang_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configcheckbox('verifychangedemail', new lang_string('verifychangedemail', 'admin'), new lang_string('configverifychangedemail', 'admin'), 1));
|
||||
|
||||
$temp->add(new admin_setting_configtext('recaptchapublickey', new lang_string('recaptchapublickey', 'admin'), new lang_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchaprivatekey', new lang_string('recaptchaprivatekey', 'admin'), new lang_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configtext('recaptchapublickey', new lang_string('recaptchapublickey', 'admin'), new lang_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$setting = new admin_setting_configtext('recaptchaprivatekey', new lang_string('recaptchaprivatekey', 'admin'), new lang_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$ADMIN->add('authsettings', $temp);
|
||||
|
||||
$temp = new admin_externalpage('authtestsettings', get_string('testsettings', 'core_auth'), new moodle_url("/auth/test_settings.php"), 'moodle/site:config', true);
|
||||
|
@ -28,8 +28,12 @@ if ($primaryadmin) {
|
||||
$primaryadminemail = NULL;
|
||||
$primaryadminname = NULL;
|
||||
}
|
||||
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'), new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'), new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'),
|
||||
new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'),
|
||||
new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'), new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
@ -190,7 +190,10 @@ if ($hassiteconfig
|
||||
'department' => new lang_string('department'),
|
||||
'institution' => new lang_string('institution'),
|
||||
)));
|
||||
$temp->add(new admin_setting_configtext('fullnamedisplay', new lang_string('fullnamedisplay', 'admin'), new lang_string('configfullnamedisplay', 'admin'), 'language', PARAM_TEXT, 50));
|
||||
$setting = new admin_setting_configtext('fullnamedisplay', new lang_string('fullnamedisplay', 'admin'),
|
||||
new lang_string('configfullnamedisplay', 'admin'), 'language', PARAM_TEXT, 50);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configtext('alternativefullnameformat', new lang_string('alternativefullnameformat', 'admin'),
|
||||
new lang_string('alternativefullnameformat_desc', 'admin'),
|
||||
'language', PARAM_RAW, 50));
|
||||
|
@ -36,7 +36,7 @@
|
||||
{{/error}}
|
||||
{{{element}}}
|
||||
{{#default}}
|
||||
<div class="form-defaultinfo">{{{default}}}</div>
|
||||
<div class="form-defaultinfo {{#forceltr}}text-ltr{{/forceltr}}">{{{default}}}</div>
|
||||
{{/default}}
|
||||
</div>
|
||||
<div class="form-description">{{{description}}}</div>
|
||||
|
@ -23,7 +23,7 @@
|
||||
{{>core/pix_icon}}
|
||||
{{/icon}}
|
||||
</div>
|
||||
<input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12">
|
||||
<input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="text-ltr">
|
||||
{{#haspreviewconfig}}
|
||||
<input type="button" id="{{id}}_preview" value={{#quote}}{{#str}}preview{{/str}}{{/quote}} class="admin_colourpicker_preview">
|
||||
{{/haspreviewconfig}}
|
||||
|
@ -18,7 +18,7 @@
|
||||
Setting configduration.
|
||||
}}
|
||||
<div class="form-duration defaultsnext">
|
||||
<input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}">
|
||||
<input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="text-ltr">
|
||||
<label class="accesshide" for="{{id}}u">{{#str}}durationunits, admin{{/str}}</label>
|
||||
<select id="{{id}}u" name="{{name}}[u]">
|
||||
{{#options}}
|
||||
|
@ -18,7 +18,7 @@
|
||||
Setting configfile.
|
||||
}}
|
||||
<div class="form-file defaultsnext">
|
||||
<input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" {{#readonly}}readonly{{/readonly}}>
|
||||
<input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="text-ltr" {{#readonly}}readonly{{/readonly}}>
|
||||
{{#showvalidity}}
|
||||
{{#valid}}
|
||||
<span class="pathok">✔</span>
|
||||
|
@ -18,5 +18,5 @@
|
||||
Setting configtext.
|
||||
}}
|
||||
<div class="form-text defaultsnext">
|
||||
<input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" {{#attributes}} {{name}}="{{value}}"{{/attributes}}>
|
||||
<input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="{{#forceltr}}text-ltr{{/forceltr}}" {{#attributes}} {{name}}="{{value}}"{{/attributes}}>
|
||||
</div>
|
||||
|
@ -18,5 +18,5 @@
|
||||
Setting configtextarea.
|
||||
}}
|
||||
<div class="form-textarea">
|
||||
<textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true">{{value}}</textarea>
|
||||
<textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="{{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
|
||||
</div>
|
||||
|
@ -17,7 +17,7 @@
|
||||
{{!
|
||||
Setting configtime.
|
||||
}}
|
||||
<div class="form-time defaultsnext">
|
||||
<div class="form-time defaultsnext text-ltr">
|
||||
<label class="accesshide" for="{{id}}h">{{#str}}hours{{/str}}</label>
|
||||
<select id="{{id}}h" name="{{name}}[h]">
|
||||
{{#hours}}
|
||||
|
@ -28,10 +28,10 @@
|
||||
{{#expressions}}
|
||||
<tr>
|
||||
<td class="c{{index}}">
|
||||
<input type="text" name="{{name}}[expression{{index}}]" class="form-text" value="{{expression}}">
|
||||
<input type="text" name="{{name}}[expression{{index}}]" class="form-text text-ltr" value="{{expression}}">
|
||||
</td>
|
||||
<td class="c{{index}}">
|
||||
<input type="text" name="{{name}}[value{{index}}]" class="form-text" value="{{value}}">
|
||||
<input type="text" name="{{name}}[value{{index}}]" class="form-text text-ltr" value="{{value}}">
|
||||
</td>
|
||||
</tr>
|
||||
{{/expressions}}
|
||||
|
@ -33,7 +33,7 @@
|
||||
<tr>
|
||||
{{#fields}}
|
||||
<td class="c{{index}}">
|
||||
<input type="text" name="{{name}}[{{field}}]" class="form-text" value="{{value}}">
|
||||
<input type="text" name="{{name}}[{{field}}]" class="form-text text-ltr" value="{{value}}">
|
||||
</td>
|
||||
{{/fields}}
|
||||
<td>
|
||||
|
@ -71,7 +71,8 @@ class tool_task_renderer extends plugin_renderer_base {
|
||||
$editlink = $this->render(new pix_icon('t/locked', get_string('scheduledtaskchangesdisabled', 'tool_task')));
|
||||
}
|
||||
|
||||
$namecell = new html_table_cell($task->get_name() . "\n" . html_writer::tag('span', '\\'.get_class($task), array('class' => 'task-class')));
|
||||
$namecell = new html_table_cell($task->get_name() . "\n" . html_writer::tag('span', '\\'.get_class($task),
|
||||
array('class' => 'task-class text-ltr')));
|
||||
$namecell->header = true;
|
||||
|
||||
$component = $task->get_component();
|
||||
@ -117,6 +118,13 @@ class tool_task_renderer extends plugin_renderer_base {
|
||||
new html_table_cell($task->get_fail_delay()),
|
||||
new html_table_cell($customised)));
|
||||
|
||||
// Cron-style values must always be LTR.
|
||||
$row->cells[5]->attributes['class'] = 'text-ltr';
|
||||
$row->cells[6]->attributes['class'] = 'text-ltr';
|
||||
$row->cells[7]->attributes['class'] = 'text-ltr';
|
||||
$row->cells[8]->attributes['class'] = 'text-ltr';
|
||||
$row->cells[9]->attributes['class'] = 'text-ltr';
|
||||
|
||||
if ($disabled) {
|
||||
$row->attributes['class'] = 'disabled';
|
||||
}
|
||||
|
@ -4,3 +4,8 @@
|
||||
color: #888;
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
#page-admin-tool-task-scheduledtasks input[type=text]
|
||||
/*rtl:ignore*/
|
||||
direction: ltr;
|
||||
}
|
||||
|
11
admin/upgrade.txt
Normal file
11
admin/upgrade.txt
Normal file
@ -0,0 +1,11 @@
|
||||
This files describes API changes in /admin/*.
|
||||
|
||||
=== 3.2 ===
|
||||
|
||||
* Admin settings have been refined to better support right-to-left languages. In RTL,
|
||||
most fields should not have their direction flipped, a URL, a path to a file, ...
|
||||
are always displayed LTR. Most of the admin_setting classes will now prefer LTR.
|
||||
If you must not force left-to-right, here are a few options:
|
||||
* Call admin_setting::set_force_ltr(false) on your setting;
|
||||
* Use the class admin_setting_localisedtext for text inputs;
|
||||
* Use the class admin_setting_localisedtextarea for larger text inputs.
|
@ -55,7 +55,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right"><label for="host"><?php print_string("auth_dbhost_key", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="host" name="host" type="text" size="30" value="<?php echo $config->host?>" />
|
||||
<input id="host" name="host" type="text" class="text-ltr" size="30" value="<?php echo $config->host?>" />
|
||||
<?php
|
||||
|
||||
if (isset($err["host"])) {
|
||||
@ -94,7 +94,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right"><label for="name"><?php print_string("auth_dbname_key", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="name" name="name" type="text" size="30" value="<?php echo $config->name?>" />
|
||||
<input id="name" name="name" type="text" class="text-ltr" size="30" value="<?php echo $config->name?>" />
|
||||
<?php
|
||||
|
||||
if (isset($err["name"])) {
|
||||
@ -109,7 +109,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right"><label for="user"><?php print_string("auth_dbuser_key", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="user" name="user" type="text" size="30" value="<?php echo $config->user?>" />
|
||||
<input id="user" name="user" type="text" class="text-ltr" size="30" value="<?php echo $config->user?>" />
|
||||
<?php
|
||||
|
||||
if (isset($err["user"])) {
|
||||
@ -124,7 +124,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right"><label for="pass"><?php print_string("auth_dbpass_key", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="pass" name="pass" type="password" size="30" value="<?php p($config->pass)?>" autocomplete="off"/>
|
||||
<input id="pass" name="pass" type="password" class="text-ltr" size="30" value="<?php p($config->pass)?>" autocomplete="off"/>
|
||||
<?php
|
||||
|
||||
if (isset($err["pass"])) {
|
||||
@ -141,7 +141,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right"><label for="table"><?php print_string("auth_dbtable_key", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="table" name="table" type="text" size="30" value="<?php echo $config->table?>" />
|
||||
<input id="table" name="table" type="text" class="text-ltr" size="30" value="<?php echo $config->table?>" />
|
||||
<?php
|
||||
|
||||
if (isset($err["table"])) {
|
||||
@ -156,7 +156,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right"><label for="fielduser"><?php print_string("auth_dbfielduser_key", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="fielduser" name="fielduser" type="text" size="30" value="<?php echo $config->fielduser?>" />
|
||||
<input id="fielduser" name="fielduser" type="text" class="text-ltr" size="30" value="<?php echo $config->fielduser?>" />
|
||||
<?php
|
||||
|
||||
if (isset($err["fielduser"])) {
|
||||
@ -171,7 +171,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right"><label for="fieldpass"><?php print_string("auth_dbfieldpass_key", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="fieldpass" name="fieldpass" type="text" size="30" value="<?php echo $config->fieldpass?>" />
|
||||
<input id="fieldpass" name="fieldpass" type="text" class="text-ltr" size="30" value="<?php echo $config->fieldpass?>" />
|
||||
<?php
|
||||
|
||||
if (isset($err["fieldpass"])) {
|
||||
@ -203,7 +203,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right"><label for="extencoding"><?php print_string("auth_dbextencoding", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="extencoding" name="extencoding" type="text" value="<?php echo $config->extencoding ?>" />
|
||||
<input id="extencoding" name="extencoding" type="text" class="text-ltr" value="<?php echo $config->extencoding ?>" />
|
||||
<?php
|
||||
|
||||
if (isset($err['extencoding'])) {
|
||||
@ -218,7 +218,7 @@
|
||||
<tr valign="top">
|
||||
<td align="right"><label for="setupsql"><?php print_string("auth_dbsetupsql", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="setupsql" name="setupsql" type="text" value="<?php echo $config->setupsql ?>" />
|
||||
<input id="setupsql" name="setupsql" type="text" class="text-ltr" value="<?php echo $config->setupsql ?>" />
|
||||
</td>
|
||||
<td><?php print_string('auth_dbsetupsqlhelp', 'auth_db') ?></td>
|
||||
</tr>
|
||||
@ -234,7 +234,7 @@
|
||||
<tr valign="top">
|
||||
<td align="right"><label for="changepasswordurl"><?php print_string("auth_dbchangepasswordurl_key", "auth_db") ?></label></td>
|
||||
<td>
|
||||
<input id="changepasswordurl" name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
|
||||
<input id="changepasswordurl" name="changepasswordurl" type="text" class="text-ltr" value="<?php echo $config->changepasswordurl ?>" />
|
||||
<?php
|
||||
|
||||
if (isset($err['changepasswordurl'])) {
|
||||
|
@ -134,7 +134,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="host_url"><?php print_string('auth_ldap_host_url_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="host_url" id="host_url" type="text" size="30" value="<?php echo $config->host_url?>" />
|
||||
<input name="host_url" id="host_url" type="text" class="text-ltr" size="30" value="<?php echo $config->host_url?>" />
|
||||
<?php if (isset($err['host_url'])) { echo $OUTPUT->error_text($err['host_url']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -174,7 +174,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="ldapencoding"><?php print_string('auth_ldap_ldap_encoding_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="ldapencoding" name="ldapencoding" type="text" value="<?php echo $config->ldapencoding ?>" />
|
||||
<input id="ldapencoding" name="ldapencoding" type="text" class="text-ltr" value="<?php echo $config->ldapencoding ?>" />
|
||||
<?php if (isset($err['ldapencoding'])) { echo $OUTPUT->error_text($err['ldapencoding']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -186,7 +186,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="pagesize"><?php print_string('pagesize_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="pagesize" name="pagesize" type="text" value="<?php echo $config->pagesize ?>" <?php echo $disabled ?>/>
|
||||
<input id="pagesize" name="pagesize" type="text" class="text-ltr" value="<?php echo $config->pagesize ?>" <?php echo $disabled ?>/>
|
||||
<?php
|
||||
if (isset($err['pagesize'])) { echo $OUTPUT->error_text($err['pagesize']); }
|
||||
if ($disabled) {
|
||||
@ -221,7 +221,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="bind_dn"><?php print_string('auth_ldap_bind_dn_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="bind_dn" id="bind_dn" type="text" size="30" value="<?php echo $config->bind_dn?>" />
|
||||
<input name="bind_dn" id="bind_dn" type="text" class="text-ltr" size="30" value="<?php echo $config->bind_dn?>" />
|
||||
<?php if (isset($err['bind_dn'])) { echo $OUTPUT->error_text($err['bind_dn']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -233,7 +233,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" autocomplete="off"/>
|
||||
<input name="bind_pw" id="bind_pw" type="password" class="text-ltr" size="30" value="<?php echo $config->bind_pw?>" autocomplete="off"/>
|
||||
<?php if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -264,7 +264,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="contexts"><?php print_string('auth_ldap_contexts_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="contexts" id="contexts" type="text" size="30" value="<?php echo $config->contexts?>" />
|
||||
<input name="contexts" id="contexts" type="text" class="text-ltr" size="30" value="<?php echo $config->contexts?>" />
|
||||
<?php if (isset($err['contexts'])) { echo $OUTPUT->error_text($err['contexts']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -304,7 +304,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="user_attribute"><?php print_string('auth_ldap_user_attribute_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="user_attribute" id="user_attribute" type="text" size="30" value="<?php echo $config->user_attribute?>" />
|
||||
<input name="user_attribute" id="user_attribute" type="text" class="text-ltr" size="30" value="<?php echo $config->user_attribute?>" />
|
||||
<?php if (isset($err['user_attribute'])) { echo $OUTPUT->error_text($err['user_attribute']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -316,7 +316,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="suspended_attribute"><?php print_string('auth_ldap_suspended_attribute_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="suspended_attribute" id="suspended_attribute" type="text" size="30" value="<?php echo $config->suspended_attribute?>" />
|
||||
<input name="suspended_attribute" id="suspended_attribute" type="text" class="text-ltr" size="30" value="<?php echo $config->suspended_attribute?>" />
|
||||
<?php if (isset($err['suspended_attribute'])) { echo $OUTPUT->error_text($err['suspended_attribute']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -328,7 +328,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="memberattribute"><?php print_string('auth_ldap_memberattribute_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="memberattribute" id="memberattribute" type="text" size="30" value="<?php echo $config->memberattribute?>" />
|
||||
<input name="memberattribute" id="memberattribute" type="text" class="text-ltr" size="30" value="<?php echo $config->memberattribute?>" />
|
||||
<?php if (isset($err['memberattribute'])) { echo $OUTPUT->error_text($err['memberattribute']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -340,7 +340,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="memberattribute_isdn" id="memberattribute_isdn" type="text" size="30" value="<?php echo $config->memberattribute_isdn?>" />
|
||||
<input name="memberattribute_isdn" id="memberattribute_isdn" type="text" class="text-ltr" size="30" value="<?php echo $config->memberattribute_isdn?>" />
|
||||
<?php if (isset($err['memberattribute_isdn'])) { echo $OUTPUT->error_text($err['memberattribute_isdn']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -352,7 +352,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="objectclass"><?php print_string('auth_ldap_objectclass_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="objectclass" id="objectclass" type="text" size="30" value="<?php echo $config->objectclass?>" />
|
||||
<input name="objectclass" id="objectclass" type="text" class="text-ltr" size="30" value="<?php echo $config->objectclass?>" />
|
||||
<?php if (isset($err['objectclass'])) { echo $OUTPUT->error_text($err['objectclass']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -409,7 +409,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="changepasswordurl"><?php print_string('auth_ldap_changepasswordurl_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="changepasswordurl" id="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
|
||||
<input name="changepasswordurl" id="changepasswordurl" type="text" class="text-ltr" value="<?php echo $config->changepasswordurl ?>" />
|
||||
<?php if (isset($err['changepasswordurl'])) { echo $OUTPUT->error_text($err['changepasswordurl']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -443,7 +443,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="expiration_warning"><?php print_string('auth_ldap_expiration_warning_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="expiration_warning" id="expiration_warning" type="text" size="2" value="<?php echo $config->expiration_warning?>" />
|
||||
<input name="expiration_warning" id="expiration_warning" type="text" class="text-ltr" size="2" value="<?php echo $config->expiration_warning?>" />
|
||||
<?php if (isset($err['expiration_warning'])) { echo $OUTPUT->error_text($err['expiration_warning']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -455,7 +455,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="expireattr"><?php print_string('auth_ldap_expireattr_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="expireattr" id="expireattr" type="text" size="30" value="<?php echo $config->expireattr?>" />
|
||||
<input name="expireattr" id="expireattr" type="text" class="text-ltr" size="30" value="<?php echo $config->expireattr?>" />
|
||||
<?php if (isset($err['expireattr'])) { echo $OUTPUT->error_text($err['expireattr']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -478,7 +478,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="graceattr"><?php print_string('auth_ldap_gracelogin_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="graceattr" id="graceattr" type="text" size="30" value="<?php echo $config->graceattr?>" />
|
||||
<input name="graceattr" id="graceattr" type="text" class="text-ltr" size="30" value="<?php echo $config->graceattr?>" />
|
||||
<?php if (isset($err['graceattr'])) { echo $OUTPUT->error_text($err['graceattr']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -506,7 +506,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="create_context"><?php print_string('auth_ldap_create_context_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="create_context" id="create_context" type="text" size="30" value="<?php echo $config->create_context?>" />
|
||||
<input name="create_context" id="create_context" type="text" class="text-ltr" size="30" value="<?php echo $config->create_context?>" />
|
||||
<?php if (isset($err['create_context'])) { echo $OUTPUT->error_text($err['create_context']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -523,7 +523,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="creators"><?php print_string('auth_ldap_creators_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="creators" id="creators" type="text" size="30" value="<?php echo $config->creators?>" />
|
||||
<input name="creators" id="creators" type="text" class="text-ltr" size="30" value="<?php echo $config->creators?>" />
|
||||
<?php if (isset($err['creators'])) { echo $OUTPUT->error_text($err['creators']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -584,7 +584,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="ntlmsso_subnet"><?php print_string('auth_ntlmsso_subnet_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="ntlmsso_subnet" id="ntlmsso_subnet" type="text" size="30" value="<?php p($config->ntlmsso_subnet) ?>" />
|
||||
<input name="ntlmsso_subnet" id="ntlmsso_subnet" type="text" class="text-ltr" size="30" value="<?php p($config->ntlmsso_subnet) ?>" />
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string('auth_ntlmsso_subnet', 'auth_ldap') ?>
|
||||
@ -622,7 +622,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
<label for="ntlmsso_remoteuserformat"><?php print_string('auth_ntlmsso_remoteuserformat_key', 'auth_ldap') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="ntlmsso_remoteuserformat" id="ntlmsso_remoteuserformat" type="text" size="30" value="<?php echo $config->ntlmsso_remoteuserformat?>" />
|
||||
<input name="ntlmsso_remoteuserformat" id="ntlmsso_remoteuserformat" type="text" class="text-ltr" size="30" value="<?php echo $config->ntlmsso_remoteuserformat?>" />
|
||||
<?php if (isset($err['ntlmsso_remoteuserformat'])) { echo $OUTPUT->error_text($err['ntlmsso_remoteuserformat']); } ?>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -71,18 +71,6 @@ class admin_setting_configtext_trim_lower extends admin_setting_configtext {
|
||||
return ($this->config_write($this->name, trim($data)) ? '' : get_string('errorsetting', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an XHTML string for the setting
|
||||
* @return string Returns an XHTML string
|
||||
*/
|
||||
public function output_html($data, $query='') {
|
||||
$default = $this->get_defaultsetting();
|
||||
$disabled = $this->enabled ? '': ' disabled="disabled"';
|
||||
return format_admin_setting($this, $this->visiblename,
|
||||
'<div class="form-text defaultsnext"><input type="text" size="'.$this->size.'" id="'.$this->get_id().'" name="'.$this->get_full_name().'" value="'.s($data).'" '.$disabled.' /></div>',
|
||||
$this->description, true, '', $default, $query);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class admin_setting_ldap_rolemapping extends admin_setting {
|
||||
@ -169,7 +157,8 @@ class admin_setting_ldap_rolemapping extends admin_setting {
|
||||
$contextname = $this->get_full_name().'['.$role['id'].'][contexts]';
|
||||
$return .= html_writer::start_tag('div', array('style' => 'height: 2em;'));
|
||||
$return .= html_writer::label(get_string('role_mapping_context', 'enrol_ldap', $role['name']), $contextid, false, array('class' => 'accesshide'));
|
||||
$attrs = array('type' => 'text', 'size' => '40', 'id' => $contextid, 'name' => $contextname, 'value' => s($role['contexts']));
|
||||
$attrs = array('type' => 'text', 'size' => '40', 'id' => $contextid, 'name' => $contextname,
|
||||
'value' => s($role['contexts']), 'class' => 'text-ltr');
|
||||
$return .= html_writer::empty_tag('input', $attrs);
|
||||
$return .= html_writer::end_tag('div');
|
||||
}
|
||||
@ -182,7 +171,8 @@ class admin_setting_ldap_rolemapping extends admin_setting {
|
||||
$memberattrname = $this->get_full_name().'['.$role['id'].'][memberattribute]';
|
||||
$return .= html_writer::start_tag('div', array('style' => 'height: 2em;'));
|
||||
$return .= html_writer::label(get_string('role_mapping_attribute', 'enrol_ldap', $role['name']), $memberattrid, false, array('class' => 'accesshide'));
|
||||
$attrs = array('type' => 'text', 'size' => '15', 'id' => $memberattrid, 'name' => $memberattrname, 'value' => s($role['memberattribute']));
|
||||
$attrs = array('type' => 'text', 'size' => '15', 'id' => $memberattrid, 'name' => $memberattrname,
|
||||
'value' => s($role['memberattribute']), 'class' => 'text-ltr');
|
||||
$return .= html_writer::empty_tag('input', $attrs);
|
||||
$return .= html_writer::end_tag('div');
|
||||
}
|
||||
|
133
lib/adminlib.php
133
lib/adminlib.php
@ -1552,6 +1552,8 @@ abstract class admin_setting {
|
||||
public $affectsmodinfo = false;
|
||||
/** @var array of admin_setting_flag - These are extra checkboxes attached to a setting. */
|
||||
private $flags = array();
|
||||
/** @var bool Whether this field must be forced LTR. */
|
||||
protected $forceltr = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -1903,6 +1905,30 @@ abstract class admin_setting {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether this should be displayed in LTR mode.
|
||||
*
|
||||
* For more information on this setting, please check the documentation
|
||||
* provided with {@link admin_setting_localisedtext}.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function get_force_ltr() {
|
||||
return $this->forceltr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether to force LTR or not.
|
||||
*
|
||||
* For more information on this option, please read the documentation
|
||||
* provided with the class {@link admin_setting_localisedtext}.
|
||||
*
|
||||
* @param bool $value True when forced, else false.
|
||||
*/
|
||||
public function set_force_ltr($value) {
|
||||
$this->forceltr = (bool) $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2092,7 +2118,13 @@ class admin_setting_heading extends admin_setting {
|
||||
|
||||
|
||||
/**
|
||||
* The most flexibly setting, user is typing text
|
||||
* The most flexible setting, the user enters text.
|
||||
*
|
||||
* This type of field should be used for config settings which are using
|
||||
* English words and are not localised (passwords, database name, list of values, ...).
|
||||
*
|
||||
* For localised strings such as a person's name, text to display to the users, etc...
|
||||
* please refer to {@link admin_setting_localisedtext}.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
@ -2102,6 +2134,8 @@ class admin_setting_configtext extends admin_setting {
|
||||
public $paramtype;
|
||||
/** @var int default field size */
|
||||
public $size;
|
||||
/** @var bool Whether this field must be forced LTR. */
|
||||
protected $forceltr = true;
|
||||
|
||||
/**
|
||||
* Config text constructor
|
||||
@ -2184,7 +2218,8 @@ class admin_setting_configtext extends admin_setting {
|
||||
'size' => $this->size,
|
||||
'id' => $this->get_id(),
|
||||
'name' => $this->get_full_name(),
|
||||
'value' => $data
|
||||
'value' => $data,
|
||||
'forceltr' => $this->forceltr,
|
||||
];
|
||||
$element = $OUTPUT->render_from_template('core_admin/setting_configtext', $context);
|
||||
|
||||
@ -2192,6 +2227,29 @@ class admin_setting_configtext extends admin_setting {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Override configtext to provide a localised setting.
|
||||
*
|
||||
* The main purpose of this setting is to not force left-to-right as we would
|
||||
* typically do for configuration settings. In the case of a localised string we
|
||||
* will let the natural direction of the page act on the field.
|
||||
*
|
||||
* Why? Because a database name will always be expressed in English, and thus needs
|
||||
* to be left-aligned and LTR. But, the name of your site, for instance, should follow
|
||||
* the language of your site and become right-aligned and RTL if need be.
|
||||
*
|
||||
* @copyright 2016 Frédéric Massart - FMCorz.net
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_localisedtext extends admin_setting_configtext {
|
||||
|
||||
public function __construct($name, $visiblename, $description, $defaultsetting, $paramtype = PARAM_RAW, $size = null) {
|
||||
parent::__construct($name, $visiblename, $description, $defaultsetting, $paramtype, $size);
|
||||
$this->set_force_ltr(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Text input with a maximum length constraint.
|
||||
*
|
||||
@ -2291,7 +2349,8 @@ class admin_setting_configtextarea extends admin_setting_configtext {
|
||||
'rows' => $this->rows,
|
||||
'id' => $this->get_id(),
|
||||
'name' => $this->get_full_name(),
|
||||
'value' => $data
|
||||
'value' => $data,
|
||||
'forceltr' => $this->forceltr,
|
||||
];
|
||||
$element = $OUTPUT->render_from_template('core_admin/setting_configtextarea', $context);
|
||||
|
||||
@ -2299,11 +2358,30 @@ class admin_setting_configtextarea extends admin_setting_configtext {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Override configtextarea to provide a localised setting.
|
||||
*
|
||||
* The main purpose of this setting is to not force left-to-right as we would
|
||||
* typically do for configuration settings. In the case of a localised string we
|
||||
* will let the natural direction of the page act on the field.
|
||||
*
|
||||
* @copyright 2016 Frédéric Massart - FMCorz.net
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_localisedtextarea extends admin_setting_configtextarea {
|
||||
|
||||
public function __construct($name, $visiblename, $description, $defaultsetting, $paramtype = PARAM_RAW,
|
||||
$cols = '60', $rows = '8') {
|
||||
parent::__construct($name, $visiblename, $description, $defaultsetting, $paramtype, $cols, $rows);
|
||||
$this->set_force_ltr(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* General text area with html editor.
|
||||
*/
|
||||
class admin_setting_confightmleditor extends admin_setting_configtextarea {
|
||||
class admin_setting_confightmleditor extends admin_setting_localisedtextarea {
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
@ -2339,6 +2417,9 @@ class admin_setting_confightmleditor extends admin_setting_configtextarea {
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_configpasswordunmask extends admin_setting_configtext {
|
||||
|
||||
protected $forceltr = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
|
||||
@ -2381,11 +2462,16 @@ class admin_setting_configpasswordunmask extends admin_setting_configtext {
|
||||
'id' => $this->get_id(),
|
||||
'name' => $this->get_full_name(),
|
||||
'size' => $this->size,
|
||||
'value' => $data
|
||||
'value' => $data,
|
||||
'forceltr' => false,
|
||||
];
|
||||
$element = $OUTPUT->render_from_template('core_admin/setting_configpasswordunmask', $context);
|
||||
return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', null, $query);
|
||||
}
|
||||
|
||||
public function set_force_ltr($value) {
|
||||
throw new coding_exception('This must always be in LTR more.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2464,7 +2550,8 @@ class admin_setting_configfile extends admin_setting_configtext {
|
||||
'value' => $data,
|
||||
'showvalidity' => !empty($data),
|
||||
'valid' => $data && file_exists($data),
|
||||
'readonly' => !empty($CFG->preventexecpath)
|
||||
'readonly' => !empty($CFG->preventexecpath),
|
||||
'forceltr' => true,
|
||||
];
|
||||
|
||||
if ($context->readonly) {
|
||||
@ -2494,6 +2581,10 @@ class admin_setting_configfile extends admin_setting_configtext {
|
||||
}
|
||||
return parent::write_setting($data);
|
||||
}
|
||||
|
||||
public function set_force_ltr($value) {
|
||||
throw new coding_exception('This must always be in LTR more.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2523,7 +2614,8 @@ class admin_setting_configexecutable extends admin_setting_configfile {
|
||||
'value' => $data,
|
||||
'showvalidity' => !empty($data),
|
||||
'valid' => $data && file_exists($data) && !is_dir($data) && file_is_executable($data),
|
||||
'readonly' => !empty($CFG->preventexecpath)
|
||||
'readonly' => !empty($CFG->preventexecpath),
|
||||
'forceltr' => true
|
||||
];
|
||||
|
||||
if (!empty($CFG->preventexecpath)) {
|
||||
@ -2562,14 +2654,15 @@ class admin_setting_configdirectory extends admin_setting_configfile {
|
||||
'value' => $data,
|
||||
'showvalidity' => !empty($data),
|
||||
'valid' => $data && file_exists($data) && is_dir($data),
|
||||
'readonly' => !empty($CFG->preventexecpath)
|
||||
'readonly' => !empty($CFG->preventexecpath),
|
||||
'forceltr' => true
|
||||
];
|
||||
|
||||
if (!empty($CFG->preventexecpath)) {
|
||||
$this->visiblename .= '<div class="form-overridden">'.get_string('execpathnotallowed', 'admin').'</div>';
|
||||
}
|
||||
|
||||
$element = $OUTPUT->render_from_template('core_admin/setting_configexecutable', $context);
|
||||
$element = $OUTPUT->render_from_template('core_admin/setting_configdirectory', $context);
|
||||
|
||||
return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $default, $query);
|
||||
}
|
||||
@ -3994,7 +4087,7 @@ class admin_setting_sitesetcheckbox extends admin_setting_configcheckbox {
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_sitesettext extends admin_setting_configtext {
|
||||
class admin_setting_sitesettext extends admin_setting_localisedtext {
|
||||
/**
|
||||
* Return the current setting
|
||||
*
|
||||
@ -4189,6 +4282,7 @@ class admin_setting_emoticons extends admin_setting {
|
||||
$context = (object) [
|
||||
'name' => $this->get_full_name(),
|
||||
'emoticons' => [],
|
||||
'forceltr' => true,
|
||||
];
|
||||
|
||||
$i = 0;
|
||||
@ -4306,6 +4400,10 @@ class admin_setting_emoticons extends admin_setting {
|
||||
}
|
||||
return $emoticons;
|
||||
}
|
||||
|
||||
public function set_force_ltr($value) {
|
||||
throw new coding_exception('This must always be in LTR more.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5156,7 +5254,8 @@ class admin_setting_special_gradepointmax extends admin_setting_configtext {
|
||||
'value' => $data,
|
||||
'attributes' => [
|
||||
'maxlength' => 5
|
||||
]
|
||||
],
|
||||
'forceltr' => $this->forceltr
|
||||
];
|
||||
$element = $OUTPUT->render_from_template('core_admin/setting_configtext', $context);
|
||||
|
||||
@ -7572,6 +7671,7 @@ function format_admin_setting($setting, $title='', $form='', $description='', $l
|
||||
$context->name = highlightfast($query, $context->name);
|
||||
$context->description = highlight($query, markdown_to_html($description));
|
||||
$context->element = $form;
|
||||
$context->forceltr = $setting->get_force_ltr();
|
||||
|
||||
return $OUTPUT->render_from_template('core_admin/setting', $context);
|
||||
}
|
||||
@ -9011,7 +9111,8 @@ class admin_setting_configcolourpicker extends admin_setting {
|
||||
'id' => $this->get_id(),
|
||||
'name' => $this->get_full_name(),
|
||||
'icon' => $icon->export_for_template($OUTPUT),
|
||||
'haspreviewconfig' => !empty($this->previewconfig)
|
||||
'haspreviewconfig' => !empty($this->previewconfig),
|
||||
'forceltr' => true
|
||||
];
|
||||
|
||||
$element = $OUTPUT->render_from_template('core_admin/setting_configcolourpicker', $context);
|
||||
@ -9020,6 +9121,10 @@ class admin_setting_configcolourpicker extends admin_setting {
|
||||
return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '',
|
||||
$this->get_defaultsetting(), $query);
|
||||
}
|
||||
|
||||
public function set_force_ltr($value) {
|
||||
throw new coding_exception('This must always be in LTR more.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9367,6 +9472,10 @@ class admin_setting_devicedetectregex extends admin_setting {
|
||||
|
||||
return $regexes;
|
||||
}
|
||||
|
||||
public function set_force_ltr($value) {
|
||||
throw new coding_exception('This must always be in LTR more.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,10 +65,12 @@ if ($ADMIN->fulltree) {
|
||||
$name = new lang_string('submissionstatement', 'mod_assign');
|
||||
$description = new lang_string('submissionstatement_help', 'mod_assign');
|
||||
$default = get_string('submissionstatementdefault', 'mod_assign');
|
||||
$settings->add(new admin_setting_configtextarea('assign/submissionstatement',
|
||||
$setting = new admin_setting_configtextarea('assign/submissionstatement',
|
||||
$name,
|
||||
$description,
|
||||
$default));
|
||||
$default);
|
||||
$setting->set_force_ltr(false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('maxperpage', 'mod_assign');
|
||||
$options = array(
|
||||
|
@ -396,6 +396,15 @@ img.iconsmall {
|
||||
clear: right;
|
||||
}
|
||||
|
||||
.form-description,
|
||||
.formsettingheading {
|
||||
pre {
|
||||
/* Code examples should be left aligned. */
|
||||
/*rtl:ignore*/
|
||||
direction: ltr;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item .form-setting .form-htmlarea {
|
||||
width: 640px;
|
||||
display: inline;
|
||||
|
@ -103,6 +103,12 @@
|
||||
.mdl-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/*rtl:ignore*/
|
||||
.text-ltr {
|
||||
direction: ltr !important;
|
||||
}
|
||||
|
||||
#add,
|
||||
#remove,
|
||||
.centerpara,
|
||||
|
@ -11,7 +11,6 @@ body.behat-site {
|
||||
.phpinfo th,
|
||||
.phpinfo h2 {
|
||||
margin: auto;
|
||||
text-align: left;
|
||||
}
|
||||
.phpinfo h2 {
|
||||
width: 600px;
|
||||
|
@ -228,59 +228,7 @@ div.backup-section + form,
|
||||
text-align: left;
|
||||
direction: ltr;
|
||||
}
|
||||
#id_s__pathtodu,
|
||||
#id_s__aspellpath,
|
||||
#id_s__pathtodot,
|
||||
#id_s__supportemail,
|
||||
#id_s__supportpage,
|
||||
#id_s__sessioncookie,
|
||||
#id_s__sessioncookiepath,
|
||||
#id_s__sessioncookiedomain,
|
||||
#id_s__proxyhost,
|
||||
#id_s__proxyuser,
|
||||
#id_s__proxypassword,
|
||||
#id_s__proxybypass,
|
||||
#id_s__jabberhost,
|
||||
#id_s__jabberserver,
|
||||
#id_s__jabberusername,
|
||||
#id_s__jabberpassword,
|
||||
#id_s__additionalhtmlhead,
|
||||
#id_s__additionalhtmltopofbody,
|
||||
#id_s__additionalhtmlfooter,
|
||||
#id_s__docroot,
|
||||
#id_s__filter_tex_latexpreamble,
|
||||
#id_s__filter_tex_latexbackground,
|
||||
#id_s__filter_tex_pathlatex,
|
||||
#id_s__filter_tex_pathdvips,
|
||||
#id_s__filter_tex_pathconvert,
|
||||
#id_s__blockedip,
|
||||
#id_s__pathtoclam,
|
||||
#id_s__quarantinedir,
|
||||
#id_s__sitepolicy,
|
||||
#id_s__sitepolicyguest,
|
||||
#id_s__cronremotepassword,
|
||||
#id_s__allowedip,
|
||||
#id_s__blockedip,
|
||||
#id_s_enrol_meta_nosyncroleids,
|
||||
#id_s_enrol_ldap_host_url,
|
||||
#id_s_enrol_ldap_ldapencoding,
|
||||
#id_s_enrol_ldap_bind_dn,
|
||||
#id_s_enrol_ldap_bind_pw,
|
||||
#admin-emoticons .form-text,
|
||||
#admin-role_mapping input[type=text],
|
||||
#id_s_enrol_paypal_paypalbusiness,
|
||||
#id_s_enrol_flatfile_location,
|
||||
#page-admin-setting-enrolsettingsflatfile input[type=text],
|
||||
#page-admin-setting-enrolsettingsdatabase input[type=text],
|
||||
#page-admin-auth-db input[type=text] {
|
||||
/*rtl:ignore*/
|
||||
direction: ltr;
|
||||
}
|
||||
/*rtl:ignore*/
|
||||
#page-admin-setting-enrolsettingsflatfile .informationbox {
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#page-grade-edit-outcome-course .courseoutcomes {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
@ -70,6 +70,10 @@
|
||||
.mdl-right {
|
||||
text-align: right;
|
||||
}
|
||||
/*rtl:ignore*/
|
||||
.text-ltr {
|
||||
direction: ltr !important;
|
||||
}
|
||||
#add,
|
||||
#remove,
|
||||
.centerpara,
|
||||
@ -2919,6 +2923,12 @@ img.iconsmall {
|
||||
.form-description {
|
||||
clear: right;
|
||||
}
|
||||
.form-description pre,
|
||||
.formsettingheading pre {
|
||||
/* Code examples should be left aligned. */
|
||||
/*rtl:ignore*/
|
||||
direction: ltr;
|
||||
}
|
||||
.form-item .form-setting .form-htmlarea {
|
||||
width: 640px;
|
||||
display: inline;
|
||||
@ -13036,59 +13046,6 @@ div.backup-section + form:after,
|
||||
text-align: left;
|
||||
direction: ltr;
|
||||
}
|
||||
#id_s__pathtodu,
|
||||
#id_s__aspellpath,
|
||||
#id_s__pathtodot,
|
||||
#id_s__supportemail,
|
||||
#id_s__supportpage,
|
||||
#id_s__sessioncookie,
|
||||
#id_s__sessioncookiepath,
|
||||
#id_s__sessioncookiedomain,
|
||||
#id_s__proxyhost,
|
||||
#id_s__proxyuser,
|
||||
#id_s__proxypassword,
|
||||
#id_s__proxybypass,
|
||||
#id_s__jabberhost,
|
||||
#id_s__jabberserver,
|
||||
#id_s__jabberusername,
|
||||
#id_s__jabberpassword,
|
||||
#id_s__additionalhtmlhead,
|
||||
#id_s__additionalhtmltopofbody,
|
||||
#id_s__additionalhtmlfooter,
|
||||
#id_s__docroot,
|
||||
#id_s__filter_tex_latexpreamble,
|
||||
#id_s__filter_tex_latexbackground,
|
||||
#id_s__filter_tex_pathlatex,
|
||||
#id_s__filter_tex_pathdvips,
|
||||
#id_s__filter_tex_pathconvert,
|
||||
#id_s__blockedip,
|
||||
#id_s__pathtoclam,
|
||||
#id_s__quarantinedir,
|
||||
#id_s__sitepolicy,
|
||||
#id_s__sitepolicyguest,
|
||||
#id_s__cronremotepassword,
|
||||
#id_s__allowedip,
|
||||
#id_s__blockedip,
|
||||
#id_s_enrol_meta_nosyncroleids,
|
||||
#id_s_enrol_ldap_host_url,
|
||||
#id_s_enrol_ldap_ldapencoding,
|
||||
#id_s_enrol_ldap_bind_dn,
|
||||
#id_s_enrol_ldap_bind_pw,
|
||||
#admin-emoticons .form-text,
|
||||
#admin-role_mapping input[type=text],
|
||||
#id_s_enrol_paypal_paypalbusiness,
|
||||
#id_s_enrol_flatfile_location,
|
||||
#page-admin-setting-enrolsettingsflatfile input[type=text],
|
||||
#page-admin-setting-enrolsettingsdatabase input[type=text],
|
||||
#page-admin-auth-db input[type=text] {
|
||||
/*rtl:ignore*/
|
||||
direction: ltr;
|
||||
}
|
||||
/*rtl:ignore*/
|
||||
#page-admin-setting-enrolsettingsflatfile .informationbox {
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
#page-grade-edit-outcome-course .courseoutcomes {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
@ -17250,7 +17207,6 @@ body.behat-site .navbar-fixed-top {
|
||||
.phpinfo th,
|
||||
.phpinfo h2 {
|
||||
margin: auto;
|
||||
text-align: left;
|
||||
}
|
||||
.phpinfo h2 {
|
||||
width: 600px;
|
||||
|
@ -366,6 +366,12 @@
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.form-description pre,
|
||||
.formsettingheading pre {
|
||||
/*rtl:ignore*/
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.form-item .form-setting .form-htmlarea {
|
||||
display: inline;
|
||||
}
|
||||
|
@ -17,6 +17,12 @@
|
||||
.mdl-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/*rtl:ignore*/
|
||||
.text-ltr {
|
||||
direction: ltr !important;
|
||||
}
|
||||
|
||||
#add,
|
||||
#remove,
|
||||
.centerpara,
|
||||
|
@ -11,7 +11,6 @@ body.behat-site {
|
||||
.phpinfo th,
|
||||
.phpinfo h2 {
|
||||
margin: auto;
|
||||
text-align: left;
|
||||
}
|
||||
.phpinfo h2 {
|
||||
width: 600px;
|
||||
|
@ -132,59 +132,7 @@ div.backup-section + form,
|
||||
text-align: left;
|
||||
direction: ltr;
|
||||
}
|
||||
/* rtl:ignore */
|
||||
#id_s__pathtodu,
|
||||
#id_s__aspellpath,
|
||||
#id_s__pathtodot,
|
||||
#id_s__supportemail,
|
||||
#id_s__supportpage,
|
||||
#id_s__sessioncookie,
|
||||
#id_s__sessioncookiepath,
|
||||
#id_s__sessioncookiedomain,
|
||||
#id_s__proxyhost,
|
||||
#id_s__proxyuser,
|
||||
#id_s__proxypassword,
|
||||
#id_s__proxybypass,
|
||||
#id_s__jabberhost,
|
||||
#id_s__jabberserver,
|
||||
#id_s__jabberusername,
|
||||
#id_s__jabberpassword,
|
||||
#id_s__additionalhtmlhead,
|
||||
#id_s__additionalhtmltopofbody,
|
||||
#id_s__additionalhtmlfooter,
|
||||
#id_s__docroot,
|
||||
#id_s__filter_tex_latexpreamble,
|
||||
#id_s__filter_tex_latexbackground,
|
||||
#id_s__filter_tex_pathlatex,
|
||||
#id_s__filter_tex_pathdvips,
|
||||
#id_s__filter_tex_pathconvert,
|
||||
#id_s__blockedip,
|
||||
#id_s__pathtoclam,
|
||||
#id_s__quarantinedir,
|
||||
#id_s__sitepolicy,
|
||||
#id_s__sitepolicyguest,
|
||||
#id_s__cronremotepassword,
|
||||
#id_s__allowedip,
|
||||
#id_s__blockedip,
|
||||
#id_s_enrol_meta_nosyncroleids,
|
||||
#id_s_enrol_ldap_host_url,
|
||||
#id_s_enrol_ldap_ldapencoding,
|
||||
#id_s_enrol_ldap_bind_dn,
|
||||
#id_s_enrol_ldap_bind_pw,
|
||||
#admin-emoticons .form-text,
|
||||
#admin-role_mapping input[type=text],
|
||||
#id_s_enrol_paypal_paypalbusiness,
|
||||
#id_s_enrol_flatfile_location,
|
||||
#page-admin-setting-enrolsettingsflatfile input[type=text],
|
||||
#page-admin-setting-enrolsettingsdatabase input[type=text],
|
||||
#page-admin-auth-db input[type=text] {
|
||||
direction: ltr;
|
||||
}
|
||||
/* rtl:ignore */
|
||||
#page-admin-setting-enrolsettingsflatfile .informationbox {
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* rtl:ignore */
|
||||
#page-admin-grade-edit-scale-edit .error input#id_name {
|
||||
margin-right: 170px;
|
||||
|
@ -36,7 +36,7 @@
|
||||
{{/error}}
|
||||
{{{element}}}
|
||||
{{#default}}
|
||||
<div class="form-defaultinfo text-muted">{{{default}}}</div>
|
||||
<div class="form-defaultinfo text-muted {{#forceltr}}text-ltr{{/forceltr}}">{{{default}}}</div>
|
||||
{{/default}}
|
||||
<div class="form-description m-t-1">{{{description}}}</div>
|
||||
</div>
|
||||
|
@ -23,7 +23,7 @@
|
||||
{{>core/pix_icon}}
|
||||
{{/icon}}
|
||||
</div>
|
||||
<input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="form-control">
|
||||
<input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="form-control text-ltr">
|
||||
{{#haspreviewconfig}}
|
||||
<input type="button" id="{{id}}_preview" value={{#quote}}{{#str}}preview{{/str}}{{/quote}} class="admin_colourpicker_preview">
|
||||
{{/haspreviewconfig}}
|
||||
|
@ -19,7 +19,7 @@
|
||||
}}
|
||||
<div class="form-duration defaultsnext">
|
||||
<div class="form-inline">
|
||||
<input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control">
|
||||
<input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr">
|
||||
<label class="sr-only" for="{{id}}u">{{#str}}durationunits, admin{{/str}}</label>
|
||||
<select id="{{id}}u" name="{{name}}[u]" class="form-control">
|
||||
{{#options}}
|
||||
|
@ -19,7 +19,7 @@
|
||||
}}
|
||||
<div class="form-file defaultsnext">
|
||||
<div class="form-inline">
|
||||
<input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="form-control" {{#readonly}}readonly{{/readonly}}>
|
||||
<input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="form-control text-ltr" {{#readonly}}readonly{{/readonly}}>
|
||||
{{#showvalidity}}
|
||||
{{#valid}}
|
||||
<span class="text-success">✔</span>
|
||||
|
@ -18,5 +18,5 @@
|
||||
Setting configtext.
|
||||
}}
|
||||
<div class="form-text defaultsnext">
|
||||
<input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="form-control">
|
||||
<input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">
|
||||
</div>
|
||||
|
@ -18,5 +18,5 @@
|
||||
Setting configtextarea.
|
||||
}}
|
||||
<div class="form-textarea">
|
||||
<textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="form-control">{{value}}</textarea>
|
||||
<textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
|
||||
</div>
|
||||
|
@ -18,7 +18,7 @@
|
||||
Setting configtime.
|
||||
}}
|
||||
<div class="form-time defaultsnext">
|
||||
<div class="form-inline">
|
||||
<div class="form-inline text-ltr">
|
||||
<label class="sr-only" for="{{id}}h">{{#str}}hours{{/str}}</label>
|
||||
<select id="{{id}}h" name="{{name}}[h]" class="custom-select">
|
||||
{{#hours}}
|
||||
|
@ -33,7 +33,7 @@
|
||||
<tr>
|
||||
{{#fields}}
|
||||
<td class="c{{index}}">
|
||||
<input type="text" name="{{name}}[{{field}}]" class="form-text form-control" value="{{value}}">
|
||||
<input type="text" name="{{name}}[{{field}}]" class="form-text form-control text-ltr" value="{{value}}">
|
||||
</td>
|
||||
{{/fields}}
|
||||
<td>
|
||||
|
@ -23,6 +23,9 @@ Removed themes:
|
||||
of the tool RTLCSS-PHP for more information: https://github.com/moodlehq/rtlcss-php
|
||||
* The class .dir-ltr should not be used any more. To force LTR styles use the directive
|
||||
to remove the rule when the language is RTL. See RTLCSS-PHP for more information.
|
||||
* A new class .text-ltr may be used to force the direction to LTR. This is especially useful
|
||||
for forms fields (numbers, emails, URLs must not be RTL'd), and for displaying code
|
||||
snippets or configuration samples.
|
||||
* A new callback can be defined to post process the CSS using an object representation
|
||||
of the CSS tree ($THEME->csstreepostprocess). This gives a lot more flexibility than a
|
||||
simplel find and replace. Refer to 'noname' for an example, and to PHP-CSS-Parser
|
||||
|
Loading…
x
Reference in New Issue
Block a user