From 8c7754040df8de20ba59ce8ebf669fde18715a70 Mon Sep 17 00:00:00 2001 From: shish Date: Fri, 4 May 2007 22:23:16 +0000 Subject: [PATCH] site description extension, by Shish, but not worth including as standard IMHO git-svn-id: file:///home/shish/svn/shimmie2/trunk@61 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/site_description.ext.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 contrib/site_description.ext.php diff --git a/contrib/site_description.ext.php b/contrib/site_description.ext.php new file mode 100644 index 00000000..65da4f80 --- /dev/null +++ b/contrib/site_description.ext.php @@ -0,0 +1,28 @@ + + * Description: Sets the "description" meta-info in the page header, for + * eg search engines to read + */ +class SiteDescription extends Extension { + public function receive_event($event) { + if(is_a($event, 'PageRequestEvent')) { + global $page, $config; + if(strlen($config->get_string("site_description")) > 0) { + $description = $config->get_string("site_description"); + $page->add_header(""); + } + } + if(is_a($event, 'SetupBuildingEvent')) { + $sb = new SetupBlock("Site Description"); + $sb->add_longtext_option("site_description"); + $event->panel->add_main_block($sb); + } + if(is_a($event, 'ConfigSaveEvent')) { + $event->config->set_string_from_post("site_description"); + } + } +} +add_event_listener(new SiteDescription()); +?>