<?php

	/*
	*	Gekko - Open Source Web Development Framework
	*	------------------------------------------------------------------------
	*	Copyright (C) 2004-2006, 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.sourceforge.net>
	*	@link		http://www.gekkoware.org
	*/

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

	/**
	* This script is loaded by ./modules/conf/admin.inc.php->setup
	*
	* The main pourpose of this file is to display the most important
	* configuration keys with a description and some posible values (A.K.A
	* to make configuration easy for human beings)
	*/
	if (is_object($modConf)) {

		// first of all, we're going to recolect data for a posterior use.

		// fetching languages
		include_once GEKKO_SOURCE_DIR."lang/lang_db.inc.php"; // (available languages are stored in $lang_db variable)

		// fetching stylesheets
		$stylesheets = Array();
		$data = listdir(GEKKO_TEMPLATE_DIR._l("C_SITE.TEMPLATE")."/");
		foreach ($data as $file) {
			if (substr($file, -4) == ".css") {
				$style = substr($file, 0, -4);
				// beautifying stylesheet name
				$stylesheets[$style] = ucwords($style);
			}
		}

		foreach ($stylesheets as $style => $name) {
			// this is part of a nice script to change Gekko's current stylesheet on-the-fly
			pageSetMarkContent("HEAD", "<link rel=\"alternate stylesheet\" type=\"text/css\" href=\""._l("C_SITE.REL_URL")."templates/"._l("C_SITE.TEMPLATE")."/{$style}.css\" title=\"{$style}\" />");
		}

		// fetching templates (templates are not equal to stylesheets)
		$templates = Array();
		$data = listdir(GEKKO_TEMPLATE_DIR);
		foreach ($data as $file) {
			if (is_dir(GEKKO_TEMPLATE_DIR.$file)) {
				// beautifying this name too
				$templates[$file] = ucwords($file);
			}
		}

		// fetching smiley themes
		$smileys = Array();
		$data = listdir(GEKKO_SOURCE_DIR."media/smileys/");
		foreach ($data as $file) {
			if (is_dir(GEKKO_SOURCE_DIR."media/smileys/".$file)) {
				$smileys[$file] = ucwords($file);
			}
		}

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

		// now is time to use all the information we've recolected

		/**
			$modConf->set(
				Array (
					"module:keyname1" => false,
					"module:keyname2" => "some alternate html"
				)
			);

			As you can see in the above example $modConf->set() function requires
			an array as parameter, this array must have at least one element and
			with key "your_module:your_key_name_here" (You should only list the most
			important keys). If your array element value is setted to _false_ you
			don't need to specify posible values, it will be showed as a normal
			inputbox or checkbox (according to its type). In the other hand, if you
			specify other value than _false_ for that element it will be showed
			"as is". this is very useful if you want to specify a limited range
			of posible values for a key.
		*/
		$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:site.hour_difference"		=> false,
				"core:plugins.msiepngfix.disable" => 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);
	}
?>