class_mcPUIX_CONFIG.inc.php
1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
class mcPUIX_CONFIG {
//'KINDOF' => 'DATASET',
protected static $Tables = array();
public static function setTableConfig($param_tablename, array $param_TableValues) {
mcPUIX_CONFIG::$Tables[$param_tablename] = $param_TableValues;
}
/**
* return the table config
*
* @param string $param_tablename
* @param array $param_ManipulateTableConfig
* @return array( mcPUIX::DBUIArray => array( mcPUIX::DBUIConfig => array( $param_tablename => array()) ) ) || FALSE
*/
public static function getTableConfig($param_tablename, array $param_ManipulateTableConfig=null) {
if(array_key_exists($param_tablename, mcPUIX_CONFIG::$Tables) && is_array(mcPUIX_CONFIG::$Tables[$param_tablename])) {
$Config = mcPUIX_CONFIG::$Tables[$param_tablename];
if(is_array($param_ManipulateTableConfig)) {
if(!array_key_exists('TABLE', $Config) || !is_array($Config['TABLE'])) {
$Config['TABLE'] = array();
}
foreach($param_ManipulateTableConfig as $key => $value) {
$Config['TABLE'][$key] = $value;
}
}
$result = array(
mcPUIX::DBUIArray => array( mcPUIX::DBUIConfig => array( $param_tablename => $Config) )
);
return $result;
} else {
return false;
}
}
public static function getReferenceTableName($param_tablename) {
if(mcArray::checkKeyHasFullArray(mcPUIX_CONFIG::$Tables[$param_tablename], 'TABLE', 'LIST_TABLE')) {
if(mcPUIX_CONFIG::$Tables[$param_tablename]['TABLE']['LIST_TABLE']['TABLENAME']) {
$Tablename_LIST = mcPUIX_CONFIG::$Tables[$param_tablename]['TABLE']['LIST_TABLE']['TABLENAME'];
} else {
return false;
}
} else {
return false;
}
return $Tablename_LIST;
}
}
?>