header(); echo $OUTPUT->heading(get_string('themes')); $original_theme = fullclone($THEME); $currenttab = 'mnetthemes'; require_once($CFG->dirroot .'/'.$CFG->admin.'/mnet/tabs.php'); $themes = get_list_of_plugins("theme"); $sesskey = sesskey(); echo ''; if (count($report)) { echo ''; echo ''; echo ''; } if (!$USER->screenreader) { echo ""; echo ""; } echo ""; echo ''; if ($mnet_peer->theme == '') { echo ''; echo ""; foreach ($themes as $theme) { unset($THEME); if (!file_exists($CFG->themedir.'/'.$theme.'/config.php')) { // bad folder continue; } include($CFG->themedir.'/'.$theme.'/config.php'); $readme = ''; $screenshot = ''; $screenshotpath = ''; if (file_exists($CFG->themedir.'/'.$theme.'/README.html')) { $readme = '
  • '. $link = $CFG->themewww .'/'. $theme .'/README.html'; $action = new popup_action('click', $link, $theme, array('height' => 400, 'width' => 500)); echo $OUTPUT->action_link($link, strinfo, $action); } else if (file_exists($CFG->themedir.'/'.$theme.'/README.txt')) { $readme = '
  • '. $link = $CFG->themewww .'/'. $theme .'/README.txt'; $action = new popup_action('click', $link, $theme, array('height' => 400, 'width' => 500)); echo $OUTPUT->action_link($link, $strinfo, $action); } if (file_exists("$theme/screenshot.png")) { $screenshotpath = "$theme/screenshot.png"; } else if (file_exists("$theme/screenshot.jpg")) { $screenshotpath = "$theme/screenshot.jpg"; } echo "
  • "; // no point showing this if user is using screen reader if (!$USER->screenreader) { echo ""; } else { echo ''.$theme.''; } } if ($mnet_peer->theme == $theme) { echo ''; echo ""; } echo "
    '; echo ''.$report[0].''; echo '
    $strtheme$strinfo
    Choose this option to use your site\'s default theme: '.$CFG->theme.'.'; } else { echo ''; } echo '

    Site Theme

    '; $options = null; $options['choose'] = $unlikely_name;// Something unlikely to ever be a theme name... initially $unlikely_name = 'ZoqZoqZ'; $options['sesskey'] = $sesskey; $options['hostid'] = $mnet_peer->id; echo $OUTPUT->single_button(new moodle_url('mnet_themes.php', $options), $strchoose); echo '
    "; if ($screenshotpath) { $screenshot = '
  • '.$strscreenshot.'
  • '; echo "$theme
    '; } else { echo ''; } if (isset($THEME->sheets)) { echo '

    '.$theme.'

    '; } else { echo '

    '.$theme.' (Moodle 1.4)

    '; } if ($screenshot or $readme) { echo '
      '; if (!$USER->screenreader) { echo '
    • '.$strpreview.'
    • '; } echo $screenshot.$readme; echo '
    '; } $options = null; $options['choose'] = $theme; $options['sesskey'] = $sesskey; $options['hostid'] = $mnet_peer->id; echo $OUTPUT->single_button(new moodle_url('mnet_themes.php', $options), $strchoose); echo '
    "; $THEME = $original_theme; echo $OUTPUT->footer();