Merge branch 's7_MDL-9376_qaforum_m19' of git://github.com/dongsheng/moodle into...
[moodle.git] / theme / preview.php
blobb0be6caa8ee46ef96321f2f21713a289b4f52ab8
1 <?php // $Id$
3 require_once("../config.php");
5 $preview = optional_param('preview','standard',PARAM_FILE); // which theme to show
7 if (!file_exists($CFG->themedir .'/'. $preview)) {
8 $preview = 'standard';
11 if (! $site = get_site()) {
12 error("Site doesn't exist!");
15 require_login();
17 require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
19 $CFG->theme = $preview;
21 theme_setup($CFG->theme, array('forceconfig='.$CFG->theme));
23 $stradministration = get_string("administration");
24 $strconfiguration = get_string("configuration");
25 $strthemes = get_string("themes");
26 $strpreview = get_string("preview");
27 $strsavechanges = get_string("savechanges");
28 $strtheme = get_string("theme");
29 $strthemesaved = get_string("themesaved");
31 $navlinks = array();
32 $navlinks[] = array('name' => $strthemes, 'link' => null, 'type' => 'misc');
33 $navlinks[] = array('name' => $strpreview, 'link' => null, 'type' => 'misc');
34 $navigation = build_navigation($navlinks);
35 print_header("$site->shortname: $strpreview", $site->fullname, $navigation);
37 print_simple_box_start('center', '80%');
38 print_heading($preview);
39 print_simple_box_end();
41 print_footer();