00001 <?PHP
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 $page_author = $creator_name;
00018 $page_author_email = $creator_email;
00019 $page_menu = 1;
00020 $page_date = formatTime( time() );
00021 $page_title = i18n("Theme setup");
00022
00023 if( !auth($_REQUEST["username"], $_REQUEST["password"]) )
00024 $page_content = loginform($language, globalIDtoURL("setup/themes"), $auth_messages);
00025 else if( isauth() )
00026 {
00027 $setupPage = new setupPage;
00028 $setupPage->addBreadcrumb( i18n("Themes"), globalIDtoURL("setup/themesetup") );
00029 $setupPage->addCommand( i18n("Options"), i18n("Edit the options for themes"), globalIDtoURL("setup/themesetup/options") );
00030
00031
00032 $setupPage->contents = "
00033 <form enctype=\"multipart/form-data\" action=\"" . thisPageURL() . "\" method=\"post\">";
00034
00035 if( $setupAction == "options" )
00036 {
00037 if( $_POST["save_options"] )
00038 {
00039 $theme_options["theme_follows_menu"] = $_POST["theme"]["theme_follows_menu"] ? 1 : 0;
00040 $theme_options["force_follow"] = $_POST["theme"]["force_follow"] ? 1 : 0;
00041
00042 if( file_exists($theme_options_file) )
00043 unlink($theme_options_file);
00044
00045 file_put_contents($theme_options_file, array_export($theme_options, "theme_options"));
00046 }
00047
00048 $themeOptionsPanel = new optionsPanel("theme");
00049
00050 $themeOptionsPanel->addOption(
00051 i18n("Theme follows menu"),
00052 i18n("Enabling this will make the theme follow the menu. Set which theme the menu will cause the site to use by editing the menu. Default is to inherit the theme from last page (e.g. no change from normal behaviour)"),
00053 $theme_options["theme_follows_menu"],
00054 "theme_follows_menu",
00055 "checkbox"
00056 );
00057 $themeOptionsPanel->addOption(
00058 i18n("Force theme follows menu"),
00059 i18n("If the above is turned on, and this is turned on as well, the theme will be set even if the user has set a custom theme. It will not reset the user's chosen theme, it will just set the theme for the current menu (inheritance will switch back to the user's chosen theme in stead of using the theme from the previous page)"),
00060 $theme_options["force_follow"],
00061 "force_follow",
00062 "checkbox"
00063 );
00064
00065 $setupPage->contents .= $themeOptionsPanel->render();
00066 }
00067 else if( $setupAction == "delete" )
00068 {
00069 $setupPage->contents .= "Delete the theme named $themeDelete";
00070 }
00071 else
00072 {
00073 $setupPage->contents .= "
00074 <table class=\"setup\">
00075 <tr class=\"setup\">
00076 <th class=\"setup\" width=\"50%\">" . i18n("Theme") . "</th>
00077 <th class=\"setup\">" . i18n("Functions") . "</th>
00078 </tr>";
00079
00080 $bgarray[1] = "transparent";
00081 $bgarray[2] = "#e0e0e0";
00082 $fp = opendir($files_folder);
00083 $array_index = 0;
00084
00085 closedir($fp);
00086 foreach( $theme_name as $key => $value )
00087 {
00088 $bgarray = array_reverse($bgarray);
00089 $setupPage->contents .= "
00090 <tr class=\"setup\">
00091 <td class=\"setup\" style=\"background-color: {$bgarray[1]}\"><div>$value</div></td>
00092 <td class=\"setup\" style=\"background-color: {$bgarray[1]}\"><div align=\"right\">";
00093 if( $theme_folder[$key] != "default" )
00094 $setupPage->contents .= "<a class=\"command\" href=\"" . globalIDtoURL("setup/themesetup/delete/" . $theme_folders[$key]) . "\">[" . i18n("Delete") . "]</a>";
00095 else
00096 $setupPage->contents .= i18n("(the default theme cannot be deleted)");
00097
00098 $setupPage->contents .= "</div></td>
00099 </tr>";
00100 }
00101 $setupPage->contents .= "
00102 </table>";
00103 }
00104 $setupPage->contents .= "
00105 </form>";
00106 $page_content = $setupPage->render();
00107 }
00108 ?>