|
@@ 1363-1397 (lines=35) @@
|
| 1360 |
|
* @brief Return module configurations |
| 1361 |
|
* Global configuration is used to manage board, member and others |
| 1362 |
|
*/ |
| 1363 |
|
function getModuleConfig($module, $site_srl = 0) |
| 1364 |
|
{ |
| 1365 |
|
$config = false; |
| 1366 |
|
// cache controll |
| 1367 |
|
$oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 1368 |
|
if($oCacheHandler->isSupport()) |
| 1369 |
|
{ |
| 1370 |
|
$object_key = 'module_config:' . $module . '_' . $site_srl; |
| 1371 |
|
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); |
| 1372 |
|
$config = $oCacheHandler->get($cache_key); |
| 1373 |
|
} |
| 1374 |
|
|
| 1375 |
|
if($config === false) |
| 1376 |
|
{ |
| 1377 |
|
if(!$GLOBALS['__ModuleConfig__'][$site_srl][$module]) |
| 1378 |
|
{ |
| 1379 |
|
$args = new stdClass(); |
| 1380 |
|
$args->module = $module; |
| 1381 |
|
$args->site_srl = $site_srl; |
| 1382 |
|
$output = executeQuery('module.getModuleConfig', $args); |
| 1383 |
|
if($output->data->config) $config = unserialize($output->data->config); |
| 1384 |
|
else $config = null; |
| 1385 |
|
|
| 1386 |
|
//insert in cache |
| 1387 |
|
if($oCacheHandler->isSupport()) |
| 1388 |
|
{ |
| 1389 |
|
$oCacheHandler->put($cache_key, $config); |
| 1390 |
|
} |
| 1391 |
|
$GLOBALS['__ModuleConfig__'][$site_srl][$module] = $config; |
| 1392 |
|
} |
| 1393 |
|
return $GLOBALS['__ModuleConfig__'][$site_srl][$module]; |
| 1394 |
|
} |
| 1395 |
|
|
| 1396 |
|
return $config; |
| 1397 |
|
} |
| 1398 |
|
|
| 1399 |
|
/** |
| 1400 |
|
* @brief Return the module configuration of mid |
|
@@ 1403-1437 (lines=35) @@
|
| 1400 |
|
* @brief Return the module configuration of mid |
| 1401 |
|
* Manage mid configurations which depend on module |
| 1402 |
|
*/ |
| 1403 |
|
function getModulePartConfig($module, $module_srl) |
| 1404 |
|
{ |
| 1405 |
|
$config = false; |
| 1406 |
|
// cache controll |
| 1407 |
|
$oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 1408 |
|
if($oCacheHandler->isSupport()) |
| 1409 |
|
{ |
| 1410 |
|
$object_key = 'module_part_config:'.$module.'_'.$module_srl; |
| 1411 |
|
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); |
| 1412 |
|
$config = $oCacheHandler->get($cache_key); |
| 1413 |
|
} |
| 1414 |
|
|
| 1415 |
|
if($config === false) |
| 1416 |
|
{ |
| 1417 |
|
if(!isset($GLOBALS['__ModulePartConfig__'][$module][$module_srl])) |
| 1418 |
|
{ |
| 1419 |
|
$args = new stdClass(); |
| 1420 |
|
$args->module = $module; |
| 1421 |
|
$args->module_srl = $module_srl; |
| 1422 |
|
$output = executeQuery('module.getModulePartConfig', $args); |
| 1423 |
|
if($output->data->config) $config = unserialize($output->data->config); |
| 1424 |
|
else $config = null; |
| 1425 |
|
|
| 1426 |
|
//insert in cache |
| 1427 |
|
if($oCacheHandler->isSupport()) |
| 1428 |
|
{ |
| 1429 |
|
$oCacheHandler->put($cache_key, $config); |
| 1430 |
|
} |
| 1431 |
|
$GLOBALS['__ModulePartConfig__'][$module][$module_srl] = $config; |
| 1432 |
|
} |
| 1433 |
|
return $GLOBALS['__ModulePartConfig__'][$module][$module_srl]; |
| 1434 |
|
} |
| 1435 |
|
|
| 1436 |
|
return $config; |
| 1437 |
|
} |
| 1438 |
|
|
| 1439 |
|
/** |
| 1440 |
|
* @brief Get all of module configurations for each mid |