| @@ 59-87 (lines=29) @@ | ||
| 56 | * |
|
| 57 | * @return Object |
|
| 58 | */ |
|
| 59 | function moduleUpdate() |
|
| 60 | { |
|
| 61 | $oModuleModel = getModel('module'); |
|
| 62 | $oModuleController = getController('module'); |
|
| 63 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
|
| 64 | if($oModuleModel->needUpdate($version_update_id)) |
|
| 65 | { |
|
| 66 | $config = $oModuleModel->getModuleConfig('message'); |
|
| 67 | ||
| 68 | if($config->skin) |
|
| 69 | { |
|
| 70 | $config_parse = explode('.', $config->skin); |
|
| 71 | if(count($config_parse) > 1) |
|
| 72 | { |
|
| 73 | $template_path = sprintf('./themes/%s/modules/integration_search/', $config_parse[0]); |
|
| 74 | if(is_dir($template_path)) |
|
| 75 | { |
|
| 76 | $config->skin = implode('|@|', $config_parse); |
|
| 77 | $oModuleController = getController('module'); |
|
| 78 | $oModuleController->updateModuleConfig('integration_search', $config); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | } |
|
| 82 | ||
| 83 | $oModuleController->insertUpdatedLog($version_update_id); |
|
| 84 | } |
|
| 85 | ||
| 86 | return new Object(0, 'success_updated'); |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * Re-generate the cache file |
|
| @@ 49-76 (lines=28) @@ | ||
| 46 | /** |
|
| 47 | * @brief Execute update |
|
| 48 | */ |
|
| 49 | function moduleUpdate() |
|
| 50 | { |
|
| 51 | $oModuleModel = getModel('module'); |
|
| 52 | $oModuleController = getController('module'); |
|
| 53 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
|
| 54 | if($oModuleModel->needUpdate($version_update_id)) |
|
| 55 | { |
|
| 56 | $config = $oModuleModel->getModuleConfig('message'); |
|
| 57 | ||
| 58 | if($config->skin) |
|
| 59 | { |
|
| 60 | $config_parse = explode('.', $config->skin); |
|
| 61 | if (count($config_parse) > 1) |
|
| 62 | { |
|
| 63 | $template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]); |
|
| 64 | if(is_dir($template_path)) |
|
| 65 | { |
|
| 66 | $config->skin = implode('|@|', $config_parse); |
|
| 67 | $oModuleController = getController('module'); |
|
| 68 | $oModuleController->updateModuleConfig('message', $config); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| 73 | $oModuleController->insertUpdatedLog($version_update_id); |
|
| 74 | } |
|
| 75 | return new Object(); |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @brief Re-generate the cache file |
|