'themes', 'name' => __('Themes'), 'desc' => __('Folders from blog themes directory'), ]; } protected function actions(): array { return [ new ActionDescriptor([ 'id' => 'delete', 'select' => __('delete selected themes files and directories'), 'query' => __('delete "%s" theme files and directories'), 'success' => __('"%s" theme files and directories deleted'), 'error' => __('Failed to delete "%s" theme files and directories'), ]), ]; } public function distributed(): array { return explode(',', DC_DISTRIB_THEMES); } public function values(): array { if (($path = dcCore::app()->blog?->themes_path) === null) { return []; } $dirs = self::getDirs($path); sort($dirs); $res = []; foreach($dirs as $dir) { $res[] = new ValueDescriptor( $dir['key'], '', (int) $dir['value'] ); } return $res; } public function execute(string $action, string $ns): bool { if ($action != 'delete' || ($path = dcCore::app()->blog?->themes_path) === null) { return false; } self::delDir($path, $ns, true); return true; } }