MDL-16043: manage case when administrator set enrol_remotecoursefield or enrol_remote...
[moodle-linuxchix.git] / admin / mnet / mnet_themes.html
blob0752022a94e2a1769753e23688944a8392359355
1 <?php
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&amp;showusers=1&amp;showcourses=1&amp;host_course='.$mnet_peer->id.
8 '%2F1&amp;user='.'0'.
9 '&amp;date=0'.
10 '&amp;modid=&amp;modaction=0&amp;logformat=showashtml';
12 $tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
13 $tabs[] = new tabobject('mnetservices', 'mnet_services.php?step=list&amp;hostid='.$mnet_peer->id, $strmnetservices, $strmnetservices, false);
14 $tabs[] = new tabobject('mnetthemes', 'mnet_themes.php?step=list&amp;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\">";
25 if (count($report)) {
26 echo '<tr>';
27 echo '<td align="center" colspan="2">';
28 echo '<span class="'.$report[1].'">'.$report[0].'</span>';
29 echo '</td>';
30 echo '</tr>';
33 if (!$USER->screenreader) {
34 echo "<tr class=\"generaltableheader\"><th scope=\"col\">$strtheme</th>";
35 echo "<th scope=\"col\">$strinfo</th></tr>";
38 echo "<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">';
42 } else {
43 echo '<td valign="top">';
45 echo '<p style="font-size:1.5em;font-style:bold;">Site Theme</p>';
46 $options = null;
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);
51 echo '</td>';
52 echo "</tr>";
54 foreach ($themes as $theme) {
56 unset($THEME);
58 if (!file_exists($CFG->themedir.'/'.$theme.'/config.php')) { // bad folder
59 continue;
62 include($CFG->themedir.'/'.$theme.'/config.php');
64 $readme = '';
65 $screenshot = '';
66 $screenshotpath = '';
68 if (file_exists($CFG->themedir.'/'.$theme.'/README.html')) {
69 $readme = '<li>'.
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')) {
72 $readme = '<li>'.
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";
81 echo "<tr>";
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>";
89 } else {
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">';
96 } else {
97 echo '<td valign="top">';
100 if (isset($THEME->sheets)) {
101 echo '<p style="font-size:1.5em;font-style:bold;">'.$theme.'</p>';
102 } else {
103 echo '<p style="font-size:1.5em;font-style:bold;color:red;">'.$theme.' (Moodle 1.4)</p>';
106 if ($screenshot or $readme) {
107 echo '<ul>';
108 if (!$USER->screenreader) {
109 echo '<li><a href="'.$CFG->wwwroot.'/theme/preview.php?preview='.$theme.'">'.$strpreview.'</a></li>';
111 echo $screenshot.$readme;
112 echo '</ul>';
115 $options = null;
116 $options['choose'] = $theme;
117 $options['sesskey'] = $sesskey;
118 $options['hostid'] = $mnet_peer->id;
119 print_single_button('mnet_themes.php', $options, $strchoose);
120 echo '</td>';
121 echo "</tr>";
123 echo "</table>";
125 $THEME = $original_theme;
126 admin_externalpage_print_footer();