Subversion Repositories ALCASAR

Rev

Rev 1805 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
1805 clement.si 1
<?php
2
#Read sql attribute map
3
unset($sql_attrs);
4
if (isset($_SESSION['sql_attrs']))
5
	$sql_attrs = $_SESSION["sql_attrs"];
6
if (!isset($sql_attrs)){
1831 raphael.pi 7
	$ARR = file($config['general_sql_attrs_file']);
1805 clement.si 8
	foreach($ARR as $val){
9
		$val=chop($val);
10
		if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val))
11
			continue;
1831 raphael.pi 12
 
13
		$list_val=preg_split("/\t+/",$val);
14
		$key = $list_val[0];
15
		$desc = $list_val[1];
16
		$show = $list_val[2];
17
 
18
		$sql_attrs[strtolower($key)]['desc'] = "$desc";
19
		$sql_attrs[strtolower($key)]['show'] = "$show";
20
 
21
		if(isset($list_val[3])){
22
			$func = $list_val[3];
23
			$sql_attrs[strtolower($key)]['func'] = ($func == "") ? "nothing" : "$func";
24
		}
1805 clement.si 25
	}
1831 raphael.pi 26
	if ($config['general_use_session'] == 'yes')
1805 clement.si 27
		session_register('sql_attrs');
28
}
29
?>