From 43c741b9b4db9a3751c563c15cfb97c893c8aa06 Mon Sep 17 00:00:00 2001
From: "Eloy Lafuente (stronk7)" <stronk7@moodle.org>
Date: Tue, 27 Sep 2011 22:12:30 +0200
Subject: [PATCH] MDL-29552 themes - show the name of the picked theme when
 working with device detection enabled

---
 theme/index.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/theme/index.php b/theme/index.php
index 60cd1e666ba..17cc1c0d1ff 100644
--- a/theme/index.php
+++ b/theme/index.php
@@ -96,6 +96,7 @@ if (!empty($CFG->enabledevicedetection) && empty($device)) {
     $devices = get_device_type_list();
     foreach ($devices as $device) {
 
+        $headingthemename = ''; // To output the picked theme name when needed
         $themename = get_selected_theme_for_device_type($device);
         if (!$themename && $device == 'default') {
             $themename = theme_config::DEFAULT_THEME;
@@ -114,6 +115,8 @@ if (!empty($CFG->enabledevicedetection) && empty($device)) {
                 $screenshoturl = new moodle_url('/theme/image.php', array('theme' => $themename, 'image' => 'screenshot', 'component' => 'theme'));
                 // Contents of the screenshot/preview cell.
                 $screenshotcell = html_writer::empty_tag('img', array('src' => $screenshoturl, 'alt' => $strthemename));
+                // Show the name of the picked theme
+                $headingthemename = $OUTPUT->heading($strthemename, 3);
             }
         }
 
@@ -123,7 +126,7 @@ if (!empty($CFG->enabledevicedetection) && empty($device)) {
         $table->data[] = array(
             $device,
             $screenshotcell,
-            $OUTPUT->render($select)
+            $headingthemename . $OUTPUT->render($select)
         );
     }
 } else {