git-svn-id: file:///home/shish/svn/shimmie2/trunk@1003 7f39781d-f577-437e-ae19-be835c7a54ca
		
			
				
	
	
		
			27 lines
		
	
	
		
			813 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			813 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?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) {
 | |
| 			global $config;
 | |
| 			if(strlen($config->get_string("site_description")) > 0) {
 | |
| 				$description = $config->get_string("site_description");
 | |
| 				$event->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);
 | |
| 		}
 | |
| 	}
 | |
| }
 | |
| add_event_listener(new SiteDescription());
 | |
| ?>
 |