<?php // $Id: template.php,v 1.28 2005/05/04 08:54:48 roane Exp $
/*
==============================================================================
	Dokeos - elearning and course management software
	
	Copyright (c) 2004-2005 Dokeos S.A.
	Copyright (c) 2003-2005 Ghent University (UGent)

	Copyright (c) Sally "Example" Programmer (sally@somewhere.net)
	
	For a full list of contributors, see "credits.txt".
	The full license can be read in "license.txt".
	
	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.
	
	See the GNU General Public License for more details.
	
	Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
	Mail: info@dokeos.com
==============================================================================
*/


/**
@author Patrick Cool <patrick.cool@UGent.be>, Ghent Universtiy
@desc see readme.txt in the zip file
*/
	
/*
==============================================================================
		INIT SECTION
==============================================================================
*/ 

// The language file
$langFile = 'admin';

// global settings initialisation 
// also provides access to main, database and display API libraries
include("../inc/claro_init_global.inc.php"); 
api_protect_admin_script();
/*
-----------------------------------------------------------
	Libraries
-----------------------------------------------------------
*/ 
//the main_api.lib.php, database.lib.php and display.lib.php
//libraries are included by default

	
/*
-----------------------------------------------------------
	Header
-----------------------------------------------------------
*/ 


// title of the page (should come from the language file) 
$tool_name = "CSS Development Switcher"; 

// The breadcrumbs
$interbredcrump[] = array ("url" => "index.php", "name" => get_lang('AdministrationTools'));

Display::display_header($tool_name);

	
/*
==============================================================================
		MAIN CODE
==============================================================================
*/ 
api_display_tool_title($tool_name);

if ($_POST['Submit'])
{
	if ($_POST['style']<>"default")
	{
		$_SESSION['style']=$_POST['style'];
	}
	else 
	{
		$_SESSION['style']="";
	}
	header("Location: styles.php");
}
?>




<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<?php 
if (!isset($_SESSION['style']) OR $_SESSION['style']=="")
{
	$selected="checked";
}

echo "<input type=\"radio\" name=\"style\" value=\"default\" ".$selected.">Default Dokeos Style<br>\n";
if ($handle = opendir(api_get_path(SYS_PATH)."claroline/css/")) 
{
   while (false !== ($file = readdir($handle))) 
   {
		$dirpath=api_get_path(SYS_PATH)."claroline/css/".$file;
   		if (is_dir($dirpath))
		{
			if ($file != "." && $file != "..") 
			{
				if ($_SESSION['style']==$file)
				{
					$selected="checked";
				}
				else 
				{
					$selected="";
				}
				
				echo "<input type=\"radio\" name=\"style\" value=\"".$file."\" ".$selected.">".$file."<br>\n";
			}
		}
   }
   closedir($handle);
}
?>
<input type="submit" name="Submit" value="Submit">


<?php 
/*
==============================================================================
		FOOTER 
==============================================================================
*/ 
Display::display_footer();
?>