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

27 lines
836 B
PHP
Raw Normal View History

<?php
/**
* Name: Site Description
* Author: Shish <webmaster@shishnet.org>
* License: GPLv2
* Description: Sets the "description" meta-info in the page header, for
* eg search engines to read
*/
class SiteDescription implements Extension {
public function receive_event(Event $event) {
if($event instanceof PageRequestEvent) {
2009-01-04 16:37:08 +00:00
if(strlen($event->context->config->get_string("site_description")) > 0) {
$description = $event->context->config->get_string("site_description");
$event->context->page->add_header("<meta name=\"description\" content=\"$description\">");
}
}
2009-01-04 16:37:08 +00:00
if($event instanceof SetupBuildingEvent) {
$sb = new SetupBlock("Site Description");
$sb->add_longtext_option("site_description");
$event->panel->add_block($sb);
}
}
}
add_event_listener(new SiteDescription());
?>