dbFields = array( 'shortname'=>'', 'enablePages'=>0, 'enablePosts'=>0, 'enableDefaultHomePage'=>1 ); } function __construct() { parent::__construct(); global $Url; $this->enable = false; if( $this->getDbField('enablePosts') && ($Url->whereAmI()=='post') ) { $this->enable = true; } elseif( $this->getDbField('enablePages') && ($Url->whereAmI()=='page') ) { $this->enable = true; } elseif( $this->getDbField('enableDefaultHomePage') && ($Url->whereAmI()=='home') ) { $this->enable = true; } } public function form() { $html = '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= 'getDbField('enablePages')?'checked':'').'>'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= 'getDbField('enablePosts')?'checked':'').'>'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= 'getDbField('enableDefaultHomePage')?'checked':'').'>'; $html .= ''; $html .= '
'; return $html; } public function postEnd() { if( $this->enable ) { return '
'; } return false; } public function pageEnd() { global $Url; // Bludit check not-found page after the plugin method construct. // It's necesary check here the page not-found. if( $this->enable && !$Url->notFound()) { return '
'; } return false; } public function siteHead() { if( $this->enable ) { return ''; } return false; } public function siteBodyEnd() { if( $this->enable ) { $html = ' '; return $html; } return false; } }