<?php

	/*
	*	Gekko - Open Source Web Development Framework
	*	------------------------------------------------------------------------
	*	Copyright (C) 2004-2005, J. Carlos Nieto <xiam@users.sourceforge.net>
	*	This program is Free Software.
	*
	*	@package	Gekko
	*	@license	http://www.gnu.org/copyleft/gpl.html GNU/GPL License 2.0
	*	@author		J. Carlos Nieto <xiam@users.sf.net>
	*	@version	CVS: $Id:$
	*	@link		http://gekkoware.sourceforge.net
	*/

	if (!defined("IN-GEKKO")) die("Get a life!");

	/*
		This file will be included by ./modules/conf/admin.inc.php.
	*/

	if (is_object($modConf)) {

		// language definitions
		include_once GEKKO_ROOT."lang/lang_db.inc.php";

		/* looking for stylesheets */
		$stylesheets = Array();
		$data = listdir(GEKKO_ROOT."templates/"._l("C_SITE.TEMPLATE")."/");
		foreach ($data as $file) {
			if (substr($file, -4) == ".css") {
				$style = substr($file, 0, -4);
				$stylesheets[$style] = ucwords($style);
			}
		}

		foreach ($stylesheets as $style => $name) {
			htdoc_attach("HEAD", "<link rel=\"alternate stylesheet\" type=\"text/css\" href=\""._l("C_SITE.REL_URL")."templates/"._l("C_SITE.TEMPLATE")."/{$style}.css\" title=\"{$style}\" />");
		}

		/* looking for templates */
		$templates = Array();
		$data = listdir(GEKKO_ROOT."templates/");
		foreach ($data as $file) {
			if (is_dir(GEKKO_ROOT."templates/".$file)) {
				$templates[$file] = ucwords($file);
			}
		}

		/* looking for smileys themes */
		$smileys = Array();
		$data = listdir(GEKKO_ROOT."media/smileys/");
		foreach ($data as $file) {
			if (is_dir(GEKKO_ROOT."media/smileys/".$file)) {
				$smileys[$file] = ucwords($file);
			}
		}

		/* looking for icon themes */
		$icons = Array();
		$data = listdir(GEKKO_ROOT."media/icons/");
		foreach ($data as $file) {
			if (is_dir(GEKKO_ROOT."media/icons/".$file)) {
				$icons[$file] = ucwords($file);
			}
		}

		$modConf->set (
			Array (
				"core:site.title" => false,
				"core:site.name" => false,
				"core:site.description" => false,
				"core:site.slogan" => false,
				"core:site.copyright" => false,
				"core:site.show_text_title" => false,
				"core:site.template" => mkSelect($templates, _l("C_SITE.TEMPLATE"), "key[%id]"),
				"core:site.smileystheme" => mkSelect($smileys, _l("C_SITE.SMILEYSTHEME"), "key[%id]"),
				"core:site.icontheme" => mkSelect($icons, _l("C_SITE.ICONTHEME"), "key[%id]"),
				"core:site.stylesheet" => mkSelect($stylesheets, _l("C_SITE.STYLESHEET"), "key[%id]", "onchange=\"useStyleSheet(this.value)\""),
				"core:site.lang" => mkSelect($lang_db, _l("C_SITE.LANG"), "key[%id]"),
				"core:site.footer" => false,
				"core:site.contact_mail" => false,
				"core:site.gzip_output" => false,
				"core:html_filter" => false,
				"core:magic_blacklist" => false,
				"core:gbbcode" => false,
				"core:gbbcode.smileys" => false,
				"core:smtp.enable" => false,
				"core:rtbeditor" => false
			)
		);

	} else {
		trigger_error("\$modConf", E_USER_ERROR);
	}

?>