public static function getModuleById($core, $get, $post) { if (empty($get['id'])) { throw new Exception('No module ID'); } if (empty($get['list'])) { throw new Exception('No list ID'); } $id = $get['id']; $list = $get['list']; $module = array(); if ($list == 'plugin-activate') { $modules = $core->plugins->getModules(); if (empty($modules) || !isset($modules[$id])) { throw new Exception('Unknow module ID'); } $module = $modules[$id]; } elseif ($list == 'plugin-new') { $store = new dcStore($core->plugins, $core->blog->settings->system->store_plugin_url); $store->check(); $modules = $store->get(); if (empty($modules) || !isset($modules[$id])) { throw new Exception('Unknow module ID'); } $module = $modules[$id]; } else { // behavior not implemented yet } if (empty($module)) { throw new Exception('Unknow module ID'); } $module = adminModulesList::sanitizeModule($id, $module); $rsp = new xmlTag('module'); $rsp->id = $id; foreach ($module as $k => $v) { $rsp->{$k}((string) $v); } return $rsp; }