<?php
/*
* @package LabCMS
* @copyright (c) 2006 Alexander Levin aka Loki (loki_angel@mail.ru)
* @support http://labcms.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
function core_config_skin()
{
	$skins=glob(LAB_PATH_TEMPLATE.'/*', GLOB_ONLYDIR);
	$skins=array_map("basename", $skins);
	return array_combine($skins, $skins);
}

function core_config_url_type()
{
	$url=glob(LAB_PATH_KERNEL.'/classes/Url/*.php');
	foreach($url as $k=>$v)
	{
		$url[$k]=basename($v, '.php');
	}
	return array_combine($url, $url);
}

function core_config_default_lang()
{
	return Db::i()->selectCol("SELECT `key` AS ARRAY_KEY, `key` FROM ?_langs");
}

function core_config_auth_module()
{
	$modules=Db::i()->selectCol("SELECT module AS ARRAY_KEY, name FROM ?_modules m JOIN ?_includes i ON m.module_id=i.module_id JOIN ?_tree t ON i.tree_id=t.tree_id WHERE disable=0 AND component=1 AND symlink=0 AND path IS NOT NULL AND `show`=1 ORDER BY name");
	if ($modules) foreach($modules as $module=>$name)
	{
		if (!file_exists(LAB_PATH_MODULES.'/'.$module.'/lc.auth.class.php')) unset($modules[$module]);
	}
	return $modules;
}