'versions', 'name' => __('Versions'), 'desc' => __('Versions registered in table "version" of Dotclear'), ]; } protected function actions(): array { return [ new ActionDescriptor([ 'id' => 'delete', 'select' => __('delete selected versions numbers'), 'query' => __('delete "%s" version number'), 'success' => __('"%s" version number deleted'), 'error' => __('Failed to delete "%s" version number'), ]), ]; } public function distributed(): array { return [ 'antispam', 'blogroll', 'blowupConfig', 'core', 'dcCKEditor', 'dcLegacyEditor', 'pages', 'pings', 'simpleMenu', 'tags', 'widgets', ]; } public function values(): array { $sql = new SelectStatement(); $rs = $sql ->from(dcCore::app()->prefix . dcCore::VERSION_TABLE_NAME) ->columns(['module', 'version']) ->select(); if (is_null($rs) || $rs->isEmpty()) { return []; } $res = []; while ($rs->fetch()) { $res[] = new ValueDescriptor( $rs->f('module'), $rs->f('version'), 1 ); } return $res; } public function execute(string $action, string $ns): bool { if ($action == 'delete') { dcCore::app()->con->execute( 'DELETE FROM ' . dcCore::app()->prefix . dcCore::VERSION_TABLE_NAME . ' ' . "WHERE module = '" . dcCore::app()->con->escapeStr((string) $ns) . "' " ); return true; } return false; } }