This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/help_pages/theme.php

38 lines
916 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
class HelpPagesTheme extends Themelet
{
/**
* @param array<string,string> $pages
*/
public function display_list_page(array $pages): void
{
global $page;
$page->set_title("Help Pages");
$page->set_heading("Help Pages");
$nav_block = new Block("Help", "", "left", 0);
2023-11-11 21:49:12 +00:00
foreach ($pages as $link => $desc) {
$link = make_link("help/{$link}");
$nav_block->body .= "<a href='{$link}'>".html_escape($desc)."</a><br/>";
}
$page->add_block($nav_block);
$page->add_block(new Block("Help Pages", "See list of pages to left"));
}
public function display_help_page(string $title): void
{
global $page;
$page->set_title("Help - $title");
$page->set_heading("Help - $title");
2023-03-20 16:47:59 +00:00
$page->add_block(new NavBlock());
}
}