Subversion Repositories ALCASAR

Rev

Rev 1805 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

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