Files
cavepaintings/ext/system/main.php
Michael Yick 6c08ee9675 Revert "Merge tag 'v2.10.6'"
This reverts commit 122ea4ab9e, reversing
changes made to c54a11e250.
2024-02-16 23:06:09 -06:00

27 lines
656 B
PHP

<?php
declare(strict_types=1);
namespace Shimmie2;
class System extends Extension
{
public function onPageRequest(PageRequestEvent $event)
{
global $page;
if ($event->page_matches("system")) {
$e = send_event(new PageSubNavBuildingEvent("system"));
usort($e->links, "Shimmie2\sort_nav_links");
$link = $e->links[0]->link;
$page->set_redirect($link->make_link());
$page->set_mode(PageMode::REDIRECT);
}
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
{
$event->add_nav_link("system", new Link('system'), "System");
}
}