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

37 lines
916 B
PHP

<?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);
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");
$page->add_block(new NavBlock());
}
}