| [ Index ] |
PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008] |
[Summary view] [Print] [Text view]
1 <?php 2 admin_externalpage_print_header(); 3 print_heading(get_string('themes')); 4 $original_theme = fullclone($THEME); 5 6 $logurl = $CFG->wwwroot. 7 '/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&host_course='.$mnet_peer->id. 8 '%2F1&user='.'0'. 9 '&date=0'. 10 '&modid=&modaction=0&logformat=showashtml'; 11 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); 17 } 18 print_tabs(array($tabs), 'mnetthemes'); 19 20 $themes = get_list_of_plugins("theme"); 21 $sesskey = !empty($USER->id) ? $USER->sesskey : ''; 22 23 echo "<table style=\"margin-left:auto;margin-right:auto;\" cellpadding=\"7\" cellspacing=\"5\">"; 24 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>'; 31 } 32 33 if (!$USER->screenreader) { 34 echo "<tr class=\"generaltableheader\"><th scope=\"col\">$strtheme</th>"; 35 echo "<th scope=\"col\">$strinfo</th></tr>"; 36 } 37 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">'; 44 } 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>"; 53 54 foreach ($themes as $theme) { 55 56 unset($THEME); 57 58 if (!file_exists($CFG->themedir.'/'.$theme.'/config.php')) { // bad folder 59 continue; 60 } 61 62 include($CFG->themedir.'/'.$theme.'/config.php'); 63 64 $readme = ''; 65 $screenshot = ''; 66 $screenshotpath = ''; 67 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>'; 74 } 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"; 79 } 80 81 echo "<tr>"; 82 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>'; 91 } 92 } 93 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">'; 98 } 99 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>'; 104 } 105 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>'; 110 } 111 echo $screenshot.$readme; 112 echo '</ul>'; 113 } 114 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>"; 122 } 123 echo "</table>"; 124 125 $THEME = $original_theme; 126 admin_externalpage_print_footer(); 127 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 14 11:33:29 2009 | Cross-referenced by PHPXref 0.7 |