Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… button
  • Loading branch information...
commit 36ff8d05de34e39c7c92517689dd2a8243097fa4 1 parent bff67f4
Rajesh Taneja rajeshtaneja authored

Showing 1 changed file with 13 additions and 4 deletions. Show diff stats Hide diff stats

  1. +13 4 theme/index.php
17 theme/index.php
@@ -192,10 +192,19 @@
192 192 // Contents of the second cell.
193 193 $infocell = $OUTPUT->heading($strthemename, 3);
194 194
195   - // Button to choose this as the main theme
196   - $maintheme = new single_button(new moodle_url('/theme/index.php', array('device' => $device, 'choose' => $themename, 'sesskey' => sesskey())), get_string('usetheme'), 'get');
197   - $maintheme->disabled = $ischosentheme;
198   - $infocell .= $OUTPUT->render($maintheme);
  195 + // Button to choose this as the main theme or unset this theme for
  196 + // devices other then default
  197 + if (($ischosentheme) && ($device != 'default')) {
  198 + $unsetthemestr = get_string('unsettheme', 'admin');
  199 + $unsetthemeurl = new moodle_url('/theme/index.php', array('device' => $device, 'unsettheme' => true, 'sesskey' => sesskey()));
  200 + $unsetbutton = new single_button($unsetthemeurl, $unsetthemestr, 'get');
  201 + $infocell .= $OUTPUT->render($unsetbutton);
  202 + } else if ((!$ischosentheme)) {
  203 + $setthemestr = get_string('usetheme');
  204 + $setthemeurl = new moodle_url('/theme/index.php', array('device' => $device, 'choose' => $themename, 'sesskey' => sesskey()));
  205 + $setthemebutton = new single_button($setthemeurl, $setthemestr, 'get');
  206 + $infocell .= $OUTPUT->render($setthemebutton);
  207 + }
199 208
200 209 $row[] = $infocell;
201 210

0 comments on commit 36ff8d0

Please sign in to comment.
Something went wrong with that request. Please try again.