Subversion Repositories travelsized

Rev

Rev 418 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?PHP
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * This file is part of Travelsized CMS
 *              A content management system with modules, based on wiki syntax
 *
 * Author: Dan Jensen <admin@leinir.dk>
 * Copyright 2003/2004
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * The GNU General Public License is available at: http://www.gnu.org/copyleft/
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


$page_author = $creator_name;
$page_author_email = $creator_email;
$page_menu = 1;
$page_date = formatTime( time() );
$page_title = i18n("Theme setup");

if( !auth($_REQUEST["username"], $_REQUEST["password"]) )
        $page_content = loginform($language, globalIDtoURL("setup/themes"), $auth_messages);
else if( isauth() )
{
        $setupPage = new setupPage;
        $setupPage->addBreadcrumb( i18n("Themes"), globalIDtoURL("setup/themesetup") );
        $setupPage->addCommand( i18n("Options"), i18n("Edit the options for themes"), globalIDtoURL("setup/themesetup/options") );
        //Manage themes

        $setupPage->contents = "
        <form enctype=\"multipart/form-data\" action=\""
. thisPageURL() . "\" method=\"post\">";
       
        if( $setupAction == "options" )
        {
                $themeOptionsPanel = new optionsPanel("theme");
               
                $themeOptionsPanel->addOption(
                        i18n("Theme follows menu"),
                        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)"),
                        $theme_options["theme_follows_menu"],
                        "theme_follows_menu",
                        "checkbox"
                );
                $themeOptionsPanel->addOption(
                        i18n("Force theme follows menu"),
                        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)"),
                        $theme_options["force_follow"],
                        "force_follow",
                        "checkbox"
                );
               
                $themeOptionsPanel->addOption(
                        i18n("Use setup theme"),
                        i18n("Enable this option to use a specific theme in site setup. If your normal site theme is incapable of rendering the information density required for using the setup system, you can choose another theme below which will them be used in site setup."),
                        $theme_options["use_setup_theme"],
                        "use_setup_theme",
                        "checkbox"
                );
               
                $themeOptionsPanel->addOption(
                        i18n("Setup theme"),
                        i18n(""),
                        $theme_options["setup_theme"],
                        "setup_theme",
                        "select",
                        $theme_name
                );
               
                if( $themeOptionsPanel->submitted )
                {
                        $theme_options["theme_follows_menu"] = $themeOptionsPanel->options["theme_follows_menu"]["current"];
                        $theme_options["force_follow"] = $themeOptionsPanel->options["force_follow"]["current"];
                        $theme_options["use_setup_theme"] = $themeOptionsPanel->options["use_setup_theme"]["current"];
                        $theme_options["setup_theme"] = $themeOptionsPanel->options["setup_theme"]["current"];
                       
                        if( file_exists($theme_options_file) )
                                unlink($theme_options_file);
                       
                        fileSave($theme_options_file, array_export($theme_options, "theme_options"));
                }
               
                $setupPage->contents .= $themeOptionsPanel->render();
        }
        else if( $setupAction == "delete" )
        {
                $setupPage->contents .= "Delete the theme named $themeDelete";
        }
        else
        {
                $alternateRow = false;
               
                $table = new Table( "setup", "setup", "setup" );
                $table->newRow( null, true );
                $table->newCell( "Theme" );
                $table->newCell( "Functions" );
       
                foreach( $theme_name as $key => $value )
                {
                        $table->newRow();
                        $table->newCell( $value );
                        if( $theme_folder[$key] != "default" )
                                $table->newCell( drawCommand( i18n("Delete"), i18n("Delete this theme"), globalIDtoURL( "setup/themesetup/delete/" . $theme_folders[$key] ) ) );
                        else
                                $table->newCell( i18n("(the default theme cannot be deleted)") );
                }
                $setupPage->contents .= $table->render();
        }
        $setupPage->contents .= "
        </form>"
;
        $page_content = $setupPage->render();
}
?>