dbFields = array( 'shortname'=>'', 'enablePages'=>false, 'enablePosts'=>true, 'enableDefaultHomePage'=>false ); } function __construct() { parent::__construct(); global $Url; // Disable the plugin IF ... $this->disable = false; if( (!$this->getDbField('enablePosts')) && ($Url->whereAmI()=='post') ) { $this->disable = true; } elseif( (!$this->getDbField('enablePages')) && ($Url->whereAmI()=='page') ) { $this->disable = true; } elseif( !$this->getDbField('enableDefaultHomePage') && ($Url->whereAmI()=='page') ) { global $Page; global $Site; var_dump($Page); if( $Site->homePage()==$Page->key() ) { $this->disable = true; } } elseif( ($Url->whereAmI()!='post') && ($Url->whereAmI()!='page') ) { $this->disable = true; } } public function form() { global $Language; $html = '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= 'getDbField('enablePages')?'checked':'').'>'; $html .= ''; $html .= '
'; $html .= '
'; $html .= 'getDbField('enablePosts')?'checked':'').'>'; $html .= ''; $html .= '
'; $html .= '
'; $html .= 'getDbField('enableDefaultHomePage')?'checked':'').'>'; $html .= ''; $html .= '
'; return $html; } public function postEnd() { if( $this->disable ) { return false; } $html = '
'; return $html; } public function pageEnd() { if( $this->disable ) { return false; } $html = '
'; return $html; } public function siteHead() { if( $this->disable ) { return false; } $html = ''; return $html; } public function siteBodyEnd() { if( $this->disable ) { return false; } $html = ' '; return $html; } }