modulePath($path); $this->moduleInfo(); $this->moduleClasses(); $this->moduleLanguage($locale); $this->moduleSettings($moduleName); $this->moduleName = $moduleName; if (isset($_POST['module']) && is_array($_POST['module'])) { $this->moduleSave($_POST['module']); } if (empty($language)) $language = $this->language; } function modulePath($path) { $replace = array(CC_DS.'admin', CC_DS.'classes', CC_DS.'images', CC_DS.'language'); $this->path = str_replace($replace, '', dirname($path)); $this->path = preg_replace('#/+#', '/', $this->path.'/'); } function moduleInfo() { if (file_exists($this->path.'package.conf.inc')) { $this->info = unserialize(file_get_contents($this->path.'package.conf.inc')); } } function moduleClasses() { if (is_dir($this->path.'classes')) { foreach (glob($this->path.'classes'.CC_DS.'*.inc.php') as $include) { if (!is_dir($include)) include $include; } } } function moduleSettings($moduleName) { if (!empty($moduleName)) { $this->settings = fetchDbConfig($moduleName); } } function moduleLanguage($locale) { if (file_exists($this->path.'language'.CC_DS.$locale.'.lang.php')) { include $this->path.'language'.CC_DS.$locale.'.lang.php'; } else if (file_exists($this->path.'language'.CC_DS.'default.lang.php')) { include $this->path.'language'.CC_DS.'default.lang.php'; } $this->language = ($language) ? $language : false; } function moduleSave($settingsArray) { global $glob, $db; $this->message = writeDbConf($settingsArray, $this->moduleName, $this->settings); $this->moduleSettings($this->moduleName); } } include CC_ROOT_DIR.CC_DS.'modules'.CC_DS.'status.inc.php'; ?>