<?php
function getSubUrl($url='')
{
	if($url!='') $url = '/'.trim($url,'/');
	return SUBFOLDER.'/index.php'.rtrim($url,'/');
}
/**
Ortak tema parçası yüklamak için
*/
function getCommonPart($part, $data=array())
{
	if( file_exists(VIEWPATH.'/Views/common/'.$part) )
	{
		include_once(VIEWPATH.'/Views/common/'.$part);
	} else {
		 log_message('info', VIEWPATH.'/Views/common/'.$part.' Bulunamadı'); 
	}
}
function getHead($data=array())
{
	getCommonPart('head.tpl');
}
function getHeader($data=array())
{
	getCommonPart('header.tpl');
}
function getFooter($data=array())
{
	getCommonPart('footer.tpl');
}
function getPageHeader($data=array())
{
	getCommonPart('page_header.tpl');
}
function getSideBar($data=array())
{
$suffix = isset($_SESSION['permission'])?$_SESSION['permission']:'0';
getCommonPart('sidebar-'.$suffix.'.tpl');
}
function createElementfiller($element,$labelclass='',$divclass='')
{

	return '<select id="'.$element['basename'].'" name="'.$element['name'].'" source="'.$element['source'].'" target="'.$element['target'].'" data-val="'.current($element['val']).'"  data-placeholder="'.$element['label'].'" class="select filler" ></select>';
}
function ALC()
{
	if(isset($_SESSION['ALC']))
	{
		return $_SESSION['ALC'];
	} else {
		return false;
	}
}