26 lines
		
	
	
		
			926 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			926 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php declare(strict_types=1);
 | |
| 
 | |
| class SiteDescription extends Extension
 | |
| {
 | |
|     public function onPageRequest(PageRequestEvent $event)
 | |
|     {
 | |
|         global $config, $page;
 | |
|         if (!empty($config->get_string("site_description"))) {
 | |
|             $description = $config->get_string("site_description");
 | |
|             $page->add_html_header("<meta name=\"description\" content=\"$description\">");
 | |
|         }
 | |
|         if (!empty($config->get_string("site_keywords"))) {
 | |
|             $keywords = $config->get_string("site_keywords");
 | |
|             $page->add_html_header("<meta name=\"keywords\" content=\"$keywords\">");
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     public function onSetupBuilding(SetupBuildingEvent $event)
 | |
|     {
 | |
|         $sb = new SetupBlock("Site Description");
 | |
|         $sb->add_text_option("site_description", "Description: ");
 | |
|         $sb->add_text_option("site_keywords", "<br>Keywords: ");
 | |
|         $event->panel->add_block($sb);
 | |
|     }
 | |
| }
 |