forked from Cavemanon/cavepaintings
lots of docs, and some internal changes
This commit is contained in:
@@ -8,22 +8,19 @@
|
||||
* This extension sets the "description" meta tag in the header
|
||||
* of pages so that search engines can pick it up
|
||||
*/
|
||||
class SiteDescription implements Extension {
|
||||
public function receive_event(Event $event) {
|
||||
global $config, $database, $page, $user;
|
||||
if($event instanceof PageRequestEvent) {
|
||||
if(strlen($config->get_string("site_description")) > 0) {
|
||||
$description = $config->get_string("site_description");
|
||||
$page->add_header("<meta name=\"description\" content=\"$description\">");
|
||||
}
|
||||
}
|
||||
|
||||
if($event instanceof SetupBuildingEvent) {
|
||||
$sb = new SetupBlock("Site Description");
|
||||
$sb->add_longtext_option("site_description");
|
||||
$event->panel->add_block($sb);
|
||||
class SiteDescription extends SimpleExtension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $config, $page;
|
||||
if(strlen($config->get_string("site_description")) > 0) {
|
||||
$description = $config->get_string("site_description");
|
||||
$page->add_header("<meta name=\"description\" content=\"$description\">");
|
||||
}
|
||||
}
|
||||
|
||||
public function onSetupBuilding(SetupBuildingEvent $event) {
|
||||
$sb = new SetupBlock("Site Description");
|
||||
$sb->add_longtext_option("site_description");
|
||||
$event->panel->add_block($sb);
|
||||
}
|
||||
}
|
||||
add_event_listener(new SiteDescription());
|
||||
?>
|
||||
|
Reference in New Issue
Block a user