2 admin_externalpage_print_header();
3 print_heading(get_string('themes'));
4 $original_theme = fullclone($THEME);
6 $logurl = $CFG->wwwroot
.
7 '/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&host_course='.$mnet_peer->id
.
10 '&modid=&modaction=0&logformat=showashtml';
12 $tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&hostid='.$mnet_peer->id
, $strmnetedithost, $strmnetedithost, false);
13 $tabs[] = new tabobject('mnetservices', 'mnet_services.php?step=list&hostid='.$mnet_peer->id
, $strmnetservices, $strmnetservices, false);
14 $tabs[] = new tabobject('mnetthemes', 'mnet_themes.php?step=list&hostid='.$mnet_peer->id
, $strmnetthemes, $strmnetthemes, false);
15 if ($mnet_peer->id
!= $CFG->mnet_all_hosts_id
) {
16 $tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
18 print_tabs(array($tabs), 'mnetthemes');
20 $themes = get_list_of_plugins("theme");
21 $sesskey = !empty($USER->id
) ?
$USER->sesskey
: '';
23 echo "<table style=\"margin-left:auto;margin-right:auto;\" cellpadding=\"7\" cellspacing=\"5\">";
27 echo '<td align="center" colspan="2">';
28 echo '<span class="'.$report[1].'">'.$report[0].'</span>';
33 if (!$USER->screenreader
) {
34 echo "<tr class=\"generaltableheader\"><th scope=\"col\">$strtheme</th>";
35 echo "<th scope=\"col\">$strinfo</th></tr>";
39 echo '<td align="center"><span class="informationbox">Choose this option to use your site\'s default theme: <strong>'.$CFG->theme
.'</strong>.</span></td>';
40 if ($mnet_peer->theme
== '') {
41 echo '<td valign="top" style="border-style:solid; border-width:1px; border-color=#555555">';
43 echo '<td valign="top">';
45 echo '<p style="font-size:1.5em;font-style:bold;">Site Theme</p>';
47 $options['choose'] = $unlikely_name;// Something unlikely to ever be a theme name... initially $unlikely_name = 'ZoqZoqZ';
48 $options['sesskey'] = $sesskey;
49 $options['hostid'] = $mnet_peer->id
;
50 print_single_button('mnet_themes.php', $options, $strchoose);
54 foreach ($themes as $theme) {
58 if (!file_exists($CFG->themedir
.'/'.$theme.'/config.php')) { // bad folder
62 include($CFG->themedir
.'/'.$theme.'/config.php');
68 if (file_exists($CFG->themedir
.'/'.$theme.'/README.html')) {
70 link_to_popup_window($CFG->themewww
.'/'. $theme .'/README.html', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
71 } else if (file_exists($CFG->themedir
.'/'.$theme.'/README.txt')) {
73 link_to_popup_window($CFG->themewww
.'/'. $theme .'/README.txt', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
75 if (file_exists("$theme/screenshot.png")) {
76 $screenshotpath = "$theme/screenshot.png";
77 } else if (file_exists("$theme/screenshot.jpg")) {
78 $screenshotpath = "$theme/screenshot.jpg";
83 // no point showing this if user is using screen reader
84 if (!$USER->screenreader
) {
85 echo "<td align=\"center\">";
86 if ($screenshotpath) {
87 $screenshot = '<li><a href='.$CFG->wwwroot
.'/theme/'. $theme.'/screenshot.jpg">'.$strscreenshot.'</a></li>';
88 echo "<object type=\"text/html\" data=\"$screenshotpath\" height=\"200\" width=\"400\">$theme</object></td>";
90 echo '<object type="text/html" data="'.$CFG->wwwroot
.'/theme/preview.php?preview='.$theme.'" height="200" width="400">'.$theme.'</object></td>';
94 if ($mnet_peer->theme
== $theme) {
95 echo '<td valign="top" style="border-style:solid; border-width:1px; border-color=#555555">';
97 echo '<td valign="top">';
100 if (isset($THEME->sheets
)) {
101 echo '<p style="font-size:1.5em;font-style:bold;">'.$theme.'</p>';
103 echo '<p style="font-size:1.5em;font-style:bold;color:red;">'.$theme.' (Moodle 1.4)</p>';
106 if ($screenshot or $readme) {
108 if (!$USER->screenreader
) {
109 echo '<li><a href="'.$CFG->wwwroot
.'/theme/preview.php?preview='.$theme.'">'.$strpreview.'</a></li>';
111 echo $screenshot.$readme;
116 $options['choose'] = $theme;
117 $options['sesskey'] = $sesskey;
118 $options['hostid'] = $mnet_peer->id
;
119 print_single_button('mnet_themes.php', $options, $strchoose);
125 $THEME = $original_theme;
126 admin_externalpage_print_footer();