Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-27862 Themes: replaced disabled use theme button with unset theme…

… button
  • Loading branch information...
commit 1b99f0565aeed0f6784f3184a0674f2abced601a 1 parent f5ee52a
@rajeshtaneja rajeshtaneja authored
Showing with 13 additions and 4 deletions.
  1. +13 −4 theme/index.php
View
17 theme/index.php
@@ -192,10 +192,19 @@
// Contents of the second cell.
$infocell = $OUTPUT->heading($strthemename, 3);
- // Button to choose this as the main theme
- $maintheme = new single_button(new moodle_url('/theme/index.php', array('device' => $device, 'choose' => $themename, 'sesskey' => sesskey())), get_string('usetheme'), 'get');
- $maintheme->disabled = $ischosentheme;
- $infocell .= $OUTPUT->render($maintheme);
+ // Button to choose this as the main theme or unset this theme for
+ // devices other then default
+ if (($ischosentheme) && ($device != 'default')) {
+ $unsetthemestr = get_string('unsettheme', 'admin');
+ $unsetthemeurl = new moodle_url('/theme/index.php', array('device' => $device, 'unsettheme' => true, 'sesskey' => sesskey()));
+ $unsetbutton = new single_button($unsetthemeurl, $unsetthemestr, 'get');
+ $infocell .= $OUTPUT->render($unsetbutton);
+ } else if ((!$ischosentheme)) {
+ $setthemestr = get_string('usetheme');
+ $setthemeurl = new moodle_url('/theme/index.php', array('device' => $device, 'choose' => $themename, 'sesskey' => sesskey()));
+ $setthemebutton = new single_button($setthemeurl, $setthemestr, 'get');
+ $infocell .= $OUTPUT->render($setthemebutton);
+ }
$row[] = $infocell;
Please sign in to comment.
Something went wrong with that request. Please try again.