di = $di; } public function getDi(): ?\Pimple\Container { return $this->di; } public function getModulePermissions(): array { return [ 'can_always_access' => true, 'hide_permissions' => true, ]; } /** * @return string[] */ public function getPairs(): array { $themeService = $this->di['mod_service']('theme'); $code = $themeService->getCurrentClientAreaThemeCode(); $paths = [ PATH_THEMES . DIRECTORY_SEPARATOR . $code . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR, PATH_MODS . DIRECTORY_SEPARATOR . 'mod_page' . DIRECTORY_SEPARATOR . 'html_client' . DIRECTORY_SEPARATOR, ]; $list = []; foreach ($paths as $path) { foreach (glob($path . 'mod_page_*.html.twig') as $file) { $file = str_replace('mod_page_', '', pathinfo($file, PATHINFO_FILENAME)); $list[$file] = ucwords(strtr($file, ['-' => ' ', '_' => ' '])); } } return $list; } }