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/site_description/main.php

27 lines
905 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
class SiteDescription extends Extension
{
public function onPageRequest(PageRequestEvent $event)
{
global $config, $page;
2020-01-26 13:19:35 +00:00
if (!empty($config->get_string("site_description"))) {
$description = $config->get_string("site_description");
$page->add_html_header("<meta name=\"description\" content=\"$description\">");
}
2020-01-26 13:19:35 +00:00
if (!empty($config->get_string("site_keywords"))) {
$keywords = $config->get_string("site_keywords");
$page->add_html_header("<meta name=\"keywords\" content=\"$keywords\">");
}
}
2009-01-04 16:37:08 +00:00
public function onSetupBuilding(SetupBuildingEvent $event)
{
$sb = $event->panel->create_new_block("Site Description");
$sb->add_text_option("site_description", "Description: ");
$sb->add_text_option("site_keywords", "<br>Keywords: ");
}
}