Skip to content

Commit

Permalink
MDL-77370 admin: Add a new setting for Support contact
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Bravo committed Mar 2, 2023
1 parent 9ee4f8d commit 25c2d17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion admin/settings/server.php
Expand Up @@ -69,7 +69,8 @@
CONTACT_SUPPORT_DISABLED => new lang_string('disabled', 'admin'),
]
));

$temp->add(new admin_setting_configtext('servicespage', new lang_string('servicespage', 'admin'),
new lang_string('configservicespage', 'admin'), '', PARAM_URL));

$ADMIN->add('server', $temp);

Expand Down
2 changes: 2 additions & 0 deletions lang/en/admin.php
Expand Up @@ -348,6 +348,7 @@
$string['configsectionstats'] = 'Statistics';
$string['configsectionuser'] = 'User';
$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['configservicespage'] = 'Users will be sent to this URL when clicking on \'Services and support\'. If the field is left blank the user will be redirect to the \'Find your Moodle partner\' official page.';
$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.';
$string['configsessioncookiedomain'] = 'This allows you to change the domain that the Moodle cookies are available from. This is useful for Moodle customisations (e.g. authentication or enrolment plugins) that need to share Moodle session information with a web application on another subdomain. <strong>WARNING: it is strongly recommended to leave this setting at the default (empty) - an incorrect value will prevent all logins to the site.</strong>';
$string['configsessioncookiepath'] = 'If you need to change where browsers send the Moodle cookies, you can change this setting to specify a subdirectory of your web site. Otherwise the default \'/\' should be fine.';
Expand Down Expand Up @@ -1221,6 +1222,7 @@
$string['server'] = 'Server';
$string['serverchecks'] = 'Server checks';
$string['serverlimit'] = 'Server limit';
$string['servicespage'] = 'Link to \'Services and support\'';
$string['sessionautostartwarning'] = '<p>Serious configuration error detected, please notify server administrator.</p><p> To operate properly, Moodle requires that administrator changes PHP settings.</p><p><code>session.auto_start</code> must be set to <code>off</code>.</p><p>This setting is controlled by editing <code>php.ini</code>, Apache/IIS <br />configuration or <code>.htaccess</code> file on the server.</p>';
$string['sessioncookie'] = 'Cookie prefix';
$string['sessioncookiedomain'] = 'Cookie domain';
Expand Down
4 changes: 3 additions & 1 deletion lib/outputrenderers.php
Expand Up @@ -4244,7 +4244,9 @@ public function services_support_link(): string {

$liferingicon = $this->pix_icon('t/life-ring', '', 'moodle', ['class' => 'fa fa-life-ring']);
$newwindowicon = $this->pix_icon('i/externallink', get_string('opensinnewwindow'), 'moodle', ['class' => 'ml-1']);
$link = 'https://moodle.com/help/?utm_source=CTA-banner&utm_medium=platform&utm_campaign=name~Moodle4+cat~lms+mp~no';
$link = !empty($CFG->servicespage)
? $CFG->servicespage
: 'https://moodle.com/help/?utm_source=CTA-banner&utm_medium=platform&utm_campaign=name~Moodle4+cat~lms+mp~no';
$content = $liferingicon . get_string('moodleservicesandsupport') . $newwindowicon;

return html_writer::tag('a', $content, ['target' => '_blank', 'href' => $link]);
Expand Down

0 comments on commit 25c2d17

Please sign in to comment.