function dc_check_store_update($mod, $url, $img, $icon) { $repo = new dcStore($mod, $url); $upd = $repo->get(true); if (!empty($upd)) { $icon[0] .= '<br />' . sprintf(__('An update is available', '%s updates are available.', count($upd)), count($upd)); $icon[1] .= '#update'; $icon[2] = 'images/menu/' . $img . '-b-update.png'; } }
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; }