Skip to content

Commit

Permalink
MDL-12756 print save button in admin search only when there are setti…
Browse files Browse the repository at this point in the history
…ngs to save; merged from MOODLE_19_STABLE
  • Loading branch information
skodak committed Dec 29, 2007
1 parent 64874c5 commit 8bbfc1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion admin/search.php
Expand Up @@ -51,7 +51,6 @@
echo '<div class="clearer"><!-- --></div>';
if ($resultshtml != '') {
echo $resultshtml;
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
} else {
echo get_string('noresults','admin');
}
Expand Down
6 changes: 6 additions & 0 deletions lib/adminlib.php
Expand Up @@ -4177,6 +4177,7 @@ function admin_search_settings_html($query) {
$adminroot =& admin_get_root();
$findings = $adminroot->search($query);
$return = '';
$savebutton = false;

foreach ($findings as $found) {
$page = $found->page;
Expand All @@ -4193,6 +4194,7 @@ function admin_search_settings_html($query) {
continue;
}
if (!empty($settings)) {
$savebutton = true;
$return .= '<fieldset class="adminsettings">'."\n";
foreach ($settings as $setting) {
$return .= '<div class="clearer"><!-- --></div>'."\n";
Expand All @@ -4211,6 +4213,10 @@ function admin_search_settings_html($query) {
}
}

if ($savebutton) {
$return .= '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
}

return $return;
}

Expand Down

0 comments on commit 8bbfc1e

Please sign in to comment.