Skip to content

Commit

Permalink
MDL-27862 Themes: replaced disabled use theme button with unset theme…
Browse files Browse the repository at this point in the history
… button
  • Loading branch information
Rajesh Taneja committed Mar 12, 2012
1 parent bff67f4 commit 36ff8d0
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions theme/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 36ff8d0

Please sign in to comment.