Subversion Repositories ALCASAR

Rev

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

<?php
#Read sql attribute map
unset($sql_attrs);
if (isset($_SESSION['sql_attrs']))
        $sql_attrs = $_SESSION["sql_attrs"];
if (!isset($sql_attrs)){
        $ARR = file($config['general_sql_attrs_file']);
        foreach($ARR as $val){
                $val=chop($val);
                if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val))
                        continue;
                
                $list_val=preg_split("/\t+/",$val);
                $key = $list_val[0];
                $desc = $list_val[1];
                $show = $list_val[2];

                $sql_attrs[strtolower($key)]['desc'] = "$desc";
                $sql_attrs[strtolower($key)]['show'] = "$show";

                if(isset($list_val[3])){
                        $func = $list_val[3];
                        $sql_attrs[strtolower($key)]['func'] = ($func == "") ? "nothing" : "$func";
                }
        }
        if ($config['general_use_session'] == 'yes')
                session_register('sql_attrs');
}
?>