Updated the 19 build version to 20101023
[moodle.git] / admin / mnet / mnet_themes.html
blob36a21186bdd84218b20ec83065fca04c6fcede69
1 <?php
2 admin_externalpage_print_header();
3 print_heading(get_string('themes'));
4 $original_theme = fullclone($THEME);
6 $currenttab = 'mnetthemes';
7 require_once($CFG->dirroot .'/admin/mnet/tabs.php');
9 $themes = get_list_of_plugins("theme");
10 $sesskey = !empty($USER->id) ? $USER->sesskey : '';
12 echo "<table style=\"margin-left:auto;margin-right:auto;\" cellpadding=\"7\" cellspacing=\"5\">";
14 if (count($report)) {
15 echo '<tr>';
16 echo '<td align="center" colspan="2">';
17 echo '<span class="'.$report[1].'">'.$report[0].'</span>';
18 echo '</td>';
19 echo '</tr>';
22 if (!$USER->screenreader) {
23 echo "<tr class=\"generaltableheader\"><th scope=\"col\">$strtheme</th>";
24 echo "<th scope=\"col\">$strinfo</th></tr>";
27 echo "<tr>";
28 echo '<td align="center"><span class="informationbox">Choose this option to use your site\'s default theme: <strong>'.$CFG->theme.'</strong>.</span></td>';
29 if ($mnet_peer->theme == '') {
30 echo '<td valign="top" style="border-style:solid; border-width:1px; border-color=#555555">';
31 } else {
32 echo '<td valign="top">';
34 echo '<p style="font-size:1.5em;font-style:bold;">Site Theme</p>';
35 $options = null;
36 $options['choose'] = $unlikely_name;// Something unlikely to ever be a theme name... initially $unlikely_name = 'ZoqZoqZ';
37 $options['sesskey'] = $sesskey;
38 $options['hostid'] = $mnet_peer->id;
39 print_single_button('mnet_themes.php', $options, $strchoose);
40 echo '</td>';
41 echo "</tr>";
43 foreach ($themes as $theme) {
45 unset($THEME);
47 if (!file_exists($CFG->themedir.'/'.$theme.'/config.php')) { // bad folder
48 continue;
51 include($CFG->themedir.'/'.$theme.'/config.php');
53 $readme = '';
54 $screenshot = '';
55 $screenshotpath = '';
57 if (file_exists($CFG->themedir.'/'.$theme.'/README.html')) {
58 $readme = '<li>'.
59 link_to_popup_window($CFG->themewww .'/'. $theme .'/README.html', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
60 } else if (file_exists($CFG->themedir.'/'.$theme.'/README.txt')) {
61 $readme = '<li>'.
62 link_to_popup_window($CFG->themewww .'/'. $theme .'/README.txt', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
64 if (file_exists("$theme/screenshot.png")) {
65 $screenshotpath = "$theme/screenshot.png";
66 } else if (file_exists("$theme/screenshot.jpg")) {
67 $screenshotpath = "$theme/screenshot.jpg";
70 echo "<tr>";
72 // no point showing this if user is using screen reader
73 if (!$USER->screenreader) {
74 echo "<td align=\"center\">";
75 if ($screenshotpath) {
76 $screenshot = '<li><a href='.$CFG->wwwroot .'/theme/'. $theme.'/screenshot.jpg">'.$strscreenshot.'</a></li>';
77 echo "<object type=\"text/html\" data=\"$screenshotpath\" height=\"200\" width=\"400\">$theme</object></td>";
78 } else {
79 echo '<object type="text/html" data="'.$CFG->wwwroot.'/theme/preview.php?preview='.$theme.'" height="200" width="400">'.$theme.'</object></td>';
83 if ($mnet_peer->theme == $theme) {
84 echo '<td valign="top" style="border-style:solid; border-width:1px; border-color=#555555">';
85 } else {
86 echo '<td valign="top">';
89 if (isset($THEME->sheets)) {
90 echo '<p style="font-size:1.5em;font-style:bold;">'.$theme.'</p>';
91 } else {
92 echo '<p style="font-size:1.5em;font-style:bold;color:red;">'.$theme.' (Moodle 1.4)</p>';
95 if ($screenshot or $readme) {
96 echo '<ul>';
97 if (!$USER->screenreader) {
98 echo '<li><a href="'.$CFG->wwwroot.'/theme/preview.php?preview='.$theme.'">'.$strpreview.'</a></li>';
100 echo $screenshot.$readme;
101 echo '</ul>';
104 $options = null;
105 $options['choose'] = $theme;
106 $options['sesskey'] = $sesskey;
107 $options['hostid'] = $mnet_peer->id;
108 print_single_button('mnet_themes.php', $options, $strchoose);
109 echo '</td>';
110 echo "</tr>";
112 echo "</table>";
114 $THEME = $original_theme;
115 admin_externalpage_print_footer();