forked from Cavemanon/cavepaintings
PSR-2. I'm not a huge fan, but ugly consistency beats no consistency...
This commit is contained in:
@@ -10,24 +10,26 @@
|
||||
* This extension sets the "description" meta tag in the header
|
||||
* of pages so that search engines can pick it up
|
||||
*/
|
||||
class SiteDescription extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $config, $page;
|
||||
if(strlen($config->get_string("site_description")) > 0) {
|
||||
$description = $config->get_string("site_description");
|
||||
$page->add_html_header("<meta name=\"description\" content=\"$description\">");
|
||||
}
|
||||
if(strlen($config->get_string("site_keywords")) > 0) {
|
||||
$keywords = $config->get_string("site_keywords");
|
||||
$page->add_html_header("<meta name=\"keywords\" content=\"$keywords\">");
|
||||
}
|
||||
}
|
||||
class SiteDescription extends Extension
|
||||
{
|
||||
public function onPageRequest(PageRequestEvent $event)
|
||||
{
|
||||
global $config, $page;
|
||||
if (strlen($config->get_string("site_description")) > 0) {
|
||||
$description = $config->get_string("site_description");
|
||||
$page->add_html_header("<meta name=\"description\" content=\"$description\">");
|
||||
}
|
||||
if (strlen($config->get_string("site_keywords")) > 0) {
|
||||
$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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user