]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10969
authornicolasconnault <nicolasconnault>
Thu, 23 Aug 2007 18:01:27 +0000 (18:01 +0000)
committernicolasconnault <nicolasconnault>
Thu, 23 Aug 2007 18:01:27 +0000 (18:01 +0000)
theme/index.php

index ac6d6fd552b4e1426a10b36eaae4d77b8d40f9eb..d38dc6f436a1ddf8958d4a1896da000c4440d646 100644 (file)
     $themes = get_list_of_plugins("theme");
     $sesskey = !empty($USER->id) ? $USER->sesskey : '';
 
-    echo "<table style=\"margin-left:auto;margin-right:auto;\" cellpadding=\"7\" cellspacing=\"5\">";
+    echo "<table style=\"margin-left:auto;margin-right:auto;\" cellpadding=\"7\" cellspacing=\"5\">\n";
 
     if (!$USER->screenreader) {
-        echo "<tr class=\"generaltableheader\"><th scope=\"col\">$strtheme</th>";
-        echo "<th scope=\"col\">$strinfo</th></tr>";
+        echo "\t<tr class=\"generaltableheader\">\n\t\t<th scope=\"col\">$strtheme</th>\n";
+        echo "\t\t<th scope=\"col\">$strinfo</th>\n\t</tr>\n";
     }
+
+    $original_theme = fullclone($THEME);
+
     foreach ($themes as $theme) {
 
         unset($THEME);
         $screenshotpath = '';
 
         if (file_exists("$theme/README.html")) {
-            $readme =  '<li>'.
-            link_to_popup_window($CFG->themewww .'/'. $theme .'/README.html', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
+            $readme =  "\t\t\t\t<li>".
+            link_to_popup_window($CFG->themewww .'/'. $theme .'/README.html', $theme, $strinfo, 400, 500, '', 'none', true)."</li>\n";
         } else if (file_exists("$theme/README.txt")) {
-            $readme =  '<li>'.
-            link_to_popup_window($CFG->themewww .'/'. $theme .'/README.txt', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
+            $readme =  "\t\t\t\t<li>".
+            link_to_popup_window($CFG->themewww .'/'. $theme .'/README.txt', $theme, $strinfo, 400, 500, '', 'none', true)."</li>\n";
         }
         if (file_exists("$theme/screenshot.png")) {
             $screenshotpath = "$theme/screenshot.png";
             $screenshotpath = "$theme/screenshot.jpg";
         }
 
-        echo "<tr>";
+        echo "\t<tr>\n";
 
         // no point showing this if user is using screen reader
         if (!$USER->screenreader) {
-            echo "<td align=\"center\">";
+            echo "\t\t<td align=\"center\">\n";
             if ($screenshotpath) {
-                $screenshot = "<li><a href=\"$theme/screenshot.jpg\">$strscreenshot</a></li>";
-                echo "<object type=\"text/html\" data=\"$screenshotpath\" height=\"200\" width=\"400\">$theme</object></td>";
+                $screenshot = "\t\t\t\t<li><a href=\"$theme/screenshot.jpg\">$strscreenshot</a></li>\n";
+                echo "\t\t\t<object type=\"text/html\" data=\"$screenshotpath\" height=\"200\" width=\"400\">$theme</object>\n\t\t</td>\n";
             } else {
-                echo "<object type=\"text/html\" data=\"preview.php?preview=$theme\" height=\"200\" width=\"400\">$theme</object></td>";
+                echo "\t\t\t<object type=\"text/html\" data=\"preview.php?preview=$theme\" height=\"200\" width=\"400\">$theme</object>\n\t\t</td>\n";
             }
         }
 
         if ($CFG->theme == $theme) {
-            echo '<td valign="top" style="border-style:solid; border-width:1px; border-color=#555555">';
+            echo "\t\t" . '<td valign="top" style="border-style:solid; border-width:1px; border-color=#555555">'."\n";
         } else {
-            echo '<td valign="top">';
+            echo "\t\t" . '<td valign="top">'."\n";
         }
 
         if (isset($THEME->sheets)) {
-            echo '<p style="font-size:1.5em;font-style:bold;">'.$theme.'</p>';
+            echo "\t\t\t" . '<p style="font-size:1.5em;font-style:bold;">'.$theme.'</p>'."\n";
         } else {
-            echo '<p style="font-size:1.5em;font-style:bold;color:red;">'.$theme.' (Moodle 1.4)</p>';
+            echo "\t\t\t" . '<p style="font-size:1.5em;font-style:bold;color:red;">'.$theme.' (Moodle 1.4)</p>'."\n";
         }
 
         if ($screenshot or $readme) {
-            echo '<ul>';
+            echo "\t\t\t<ul>\n";
             if (!$USER->screenreader) {
-                echo "<li><a href=\"preview.php?preview=$theme\">$strpreview</a></li>";
+                echo "\t\t\t\t<li><a href=\"preview.php?preview=$theme\">$strpreview</a></li>\n";
             }
             echo $screenshot.$readme;
-            echo '</ul>';
+            echo "\t\t\t</ul>\n";
         }
 
         $options = null;
         $options['choose'] = $theme;
         $options['sesskey'] = $sesskey;
-        print_single_button('index.php', $options, $strchoose);
-        echo '</td>';
-        echo "</tr>";
+        echo "\t\t\t" . print_single_button('index.php', $options, $strchoose, 'get', null, true) . "\n";
+        echo "\t\t</td>\n";
+        echo "\t</tr>\n";
     }
-    echo "</table>";
+    echo "</table>\n";
+
+    $THEME = $original_theme;
 
     admin_externalpage_print_footer();
 ?>