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\">";
16 echo '<td align="center" colspan="2">';
17 echo '<span class="'.$report[1].'">'.$report[0].'</span>';
22 if (!$USER->screenreader
) {
23 echo "<tr class=\"generaltableheader\"><th scope=\"col\">$strtheme</th>";
24 echo "<th scope=\"col\">$strinfo</th></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">';
32 echo '<td valign="top">';
34 echo '<p style="font-size:1.5em;font-style:bold;">Site Theme</p>';
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);
43 foreach ($themes as $theme) {
47 if (!file_exists($CFG->themedir
.'/'.$theme.'/config.php')) { // bad folder
51 include($CFG->themedir
.'/'.$theme.'/config.php');
57 if (file_exists($CFG->themedir
.'/'.$theme.'/README.html')) {
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')) {
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";
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>";
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">';
86 echo '<td valign="top">';
89 if (isset($THEME->sheets
)) {
90 echo '<p style="font-size:1.5em;font-style:bold;">'.$theme.'</p>';
92 echo '<p style="font-size:1.5em;font-style:bold;color:red;">'.$theme.' (Moodle 1.4)</p>';
95 if ($screenshot or $readme) {
97 if (!$USER->screenreader
) {
98 echo '<li><a href="'.$CFG->wwwroot
.'/theme/preview.php?preview='.$theme.'">'.$strpreview.'</a></li>';
100 echo $screenshot.$readme;
105 $options['choose'] = $theme;
106 $options['sesskey'] = $sesskey;
107 $options['hostid'] = $mnet_peer->id
;
108 print_single_button('mnet_themes.php', $options, $strchoose);
114 $THEME = $original_theme;
115 admin_externalpage_print_footer();