plugins = $plugins; } /** * Index action * * @return string */ public function index(): string { include ROOT_PATH . 'libraries/server_common.inc.php'; $header = $this->response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('vendor/jquery/jquery.tablesorter.js'); $scripts->addFile('server/plugins.js'); $plugins = []; $serverPlugins = $this->plugins->getAll(); foreach ($serverPlugins as $plugin) { $plugins[$plugin->getType()][] = $plugin->toArray(); } ksort($plugins); $cleanTypes = []; foreach (array_keys($plugins) as $type) { $cleanTypes[$type] = preg_replace( '/[^a-z]/', '', mb_strtolower($type) ); } return $this->template->render('server/plugins/index', [ 'plugins' => $plugins, 'clean_types' => $cleanTypes, ]); } }