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/biography/theme.php

27 lines
658 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
2021-02-12 21:02:20 +00:00
use function MicroHTML\TEXTAREA;
class BiographyTheme extends Themelet
{
public function display_biography(Page $page, string $bio): void
2021-02-12 21:02:20 +00:00
{
$page->add_block(new Block("About Me", format_text($bio), "main", 30, "about-me"));
}
public function display_composer(Page $page, string $bio): void
2021-02-12 21:02:20 +00:00
{
$html = SHM_SIMPLE_FORM(
2023-01-11 18:28:43 +00:00
make_link("biography"),
2023-11-11 21:49:12 +00:00
TEXTAREA(["style" => "width: 100%", "rows" => "6", "name" => "biography"], $bio),
2021-02-12 21:02:20 +00:00
SHM_SUBMIT("Save")
);
2023-01-11 18:28:43 +00:00
$page->add_block(new Block("About Me", $html, "main", 30));
2021-02-12 21:02:20 +00:00
}
}