mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
administration MDL-21392 add hidesavebutton() for admin_settingpage class
This commit is contained in:
parent
0aed347fd1
commit
721312bd2c
2 changed files with 15 additions and 2 deletions
|
@ -126,7 +126,9 @@ if (empty($SITE->fullname)) {
|
||||||
|
|
||||||
echo $settingspage->output_html();
|
echo $settingspage->output_html();
|
||||||
|
|
||||||
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
|
if ($settingspage->displaysavebutton) {
|
||||||
|
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
|
||||||
|
}
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
|
@ -1005,6 +1005,9 @@ class admin_settingpage implements part_of_admin_tree {
|
||||||
public $path;
|
public $path;
|
||||||
public $visiblepath;
|
public $visiblepath;
|
||||||
|
|
||||||
|
/** display the save changes button **/
|
||||||
|
public $displaysavebutton;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* see admin_settingpage for details of this function
|
* see admin_settingpage for details of this function
|
||||||
*
|
*
|
||||||
|
@ -1026,6 +1029,7 @@ class admin_settingpage implements part_of_admin_tree {
|
||||||
}
|
}
|
||||||
$this->hidden = $hidden;
|
$this->hidden = $hidden;
|
||||||
$this->context = $context;
|
$this->context = $context;
|
||||||
|
$this->displaysavebutton = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1048,6 +1052,13 @@ class admin_settingpage implements part_of_admin_tree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the Save Changes button
|
||||||
|
*/
|
||||||
|
public function hidesavebutton() {
|
||||||
|
$this->displaysavebutton = false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search string in settings page.
|
* Search string in settings page.
|
||||||
*
|
*
|
||||||
|
@ -5253,7 +5264,7 @@ function admin_externalpage_print_header($focus='') {
|
||||||
$section = $PAGE->url->param('section');
|
$section = $PAGE->url->param('section');
|
||||||
$current = $adminroot->locate($section, true);
|
$current = $adminroot->locate($section, true);
|
||||||
$visiblepathtosection = array_reverse($current->visiblepath);
|
$visiblepathtosection = array_reverse($current->visiblepath);
|
||||||
|
|
||||||
if ($PAGE->user_allowed_editing()) {
|
if ($PAGE->user_allowed_editing()) {
|
||||||
$options = $PAGE->url->params();
|
$options = $PAGE->url->params();
|
||||||
if ($PAGE->user_is_editing()) {
|
if ($PAGE->user_is_editing()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue