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($attrmap);
4
unset($rev_attrmap);
5
unset($attr_type);
6
if (isset($_SESSION['attrmap'])){
7
	#If attrmap is set then the rest will also be set
8
        $attrmap = $_SESSION['attrmap'];
9
	$rev_attrmap =$_SESSION['rev_attrmap'];
10
	$attr_type = $_SESSION['attr_type'];
11
}
12
else{
13
	$ARR = file("$config[general_sql_attrmap]");
14
	foreach($ARR as $val){
15
		$val=chop($val);
16
		if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val))
17
			continue;
18
		list($type,$key,$v)=preg_split('/[[:space:]]+/',$val);
19
		$attrmap["$key"]=$v;
20
		$rev_attrmap["$v"] = $key;
21
		$attr_type["$key"]=$type;
22
	}
23
	if (isset($show_attrs)){
24
		foreach($show_attrs as $key => $desc){
25
			if (!isset($attrmap["$key"]) || $attrmap["$key"] == ''){
26
				$attrmap["$key"] = $key;
2511 tom.houday 27
				$attr_type["$key"] = 'replyItem';
1805 clement.si 28
				$rev_attrmap["$key"] = $key;
29
			}
30
		}
31
	}
32
	if ($config['general_use_session'] == 'yes'){
33
		session_register('attrmap');
34
		session_register('rev_attrmap');
35
		session_register('attr_type');
36
	}
37
}