Issue #22 - Added setting and implemented removing elements by basic CSS selector (only simple .class and #id can be used as of now).

This commit is contained in:
Daniel Thee Roperto
2016-11-14 11:35:08 +11:00
parent 0c97b4be01
commit 27c7558e57
7 changed files with 193 additions and 20 deletions

View File

@@ -90,11 +90,9 @@ if ($hassiteconfig && is_enabled_auth('outage')) {
// Create 'Allowed IPs' settings.
$allowedips = outagelib::get_config()->allowedips;
$description = '';
if (!isset($CFG->auth_outage_check) || !$CFG->auth_outage_check) {
$description .= $OUTPUT->notification(get_string('allowedipsnoconfig', 'auth_outage'), 'notifyfailure');
}
if (trim($allowedips) == '') {
$message = 'allowedipsempty';
$type = 'notifymessage';
@@ -108,7 +106,6 @@ if ($hassiteconfig && is_enabled_auth('outage')) {
$description .= $OUTPUT->notification(get_string($message, 'auth_outage', ['ip' => getremoteaddr()]), $type);
$description .= '<p>'.get_string('ipblockersyntax', 'admin').'</p>';
$settings->add(new admin_setting_configiplist(
'auth_outage/allowedips',
get_string('allowediplist', 'admin'),
@@ -116,6 +113,14 @@ if ($hassiteconfig && is_enabled_auth('outage')) {
$defaults['allowedips']
));
// Create 'Static Page - Elements to Remove' settings.
$settings->add(new admin_setting_configtextarea(
'auth_outage/remove_selectors',
get_string('removeselectors', 'auth_outage'),
get_string('removeselectorsdescription', 'auth_outage'),
$defaults['remove_selectors']
));
// Create category for Outage.
$ADMIN->add('authsettings', new admin_category('auth_outage', get_string('pluginname', 'auth_outage')));
// Add settings page toconfigure defaults.