<?php
	FNTH_class( "Widget" );
	require_once( $GLOBALS["site_root"]."/includes/models/AdminIp.inc.php" );

	class Widget extends FNTHWidgetTop {

		protected function generateSubId( $id ) {
			return $this->getId() . "_" . $id;
		}

		public function __construct( $id = "Widget" , $parent = null ) {
			$this->addMediaDirectory( $GLOBALS["site_root"] , $GLOBALS["site_www"] , "design/rp/","widgets/");
			parent::__construct( $id , $parent );
			$this->setParam( "language",$GLOBALS["language"]);
			$this->setParam( "amp_url_self" , str_replace( "&" , "&amp;" , $_SERVER["REQUEST_URI"] ) );
			$this->setParam( "url_self" , $_SERVER["REQUEST_URI"] );
			$this->setParam( "site_root" , $GLOBALS["site_root"] );
			$this->setParam( "site_www" , $GLOBALS["site_www"] );
		}

		public function featureLockHandleEvents( $feature ) {
			if (!AdminIpModel::isLockedFeature( $feature )) return false;
			return true;
		}

		public function featureLockRender( $feature , $fp = array() ) {
			if (!AdminIpModel::isLockedFeature( $feature )) return false;
			require_once( $GLOBALS["site_root"]."/includes/widgets/SystemArticle.inc.php" );
			$locked_feature_title = __("locked_feature" , "attr" );
			if (isset( $fp["title"] )) $locked_feature_title = $fp["title"];

			$sa = new SystemArticle( "feature_lock_sa" , $this , "sys_locked_feature" );
			$sa->setParam( "locked_feature_title" , $locked_feature_title );
			$sa->passGetPost( $this->aG , $this->aP );
			$sa->handleEvents();
			return $sa->render();
		}


		protected function sendAjaxRefresh() {
			FNTH_direct_echo( "document.location.href=document.location.href;" );
			fo3_exit();
		}
	}

?>
