Files
opensourcepos/application/hooks/load_config.php
pappastech b089d5b73f Initial commit of release 1.0.
~ Tom

git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@5 c3eb156b-1dc0-44e1-88ae-e38439141b53
2011-06-08 13:21:52 +00:00

25 lines
510 B
PHP

<?php
//Loads configuration from database into global CI config
function load_config()
{
$CI =& get_instance();
foreach($CI->Appconfig->get_all()->result() as $app_config)
{
$CI->config->set_item($app_config->key,$app_config->value);
}
if ($CI->config->item('language'))
{
$CI->lang->switch_to($CI->config->item('language'));
}
if ($CI->config->item('timezone'))
{
date_default_timezone_set($CI->config->item('timezone'));
}
else
{
date_default_timezone_set('America/New_York');
}
}
?>