<?php
	require_once( $GLOBALS["site_root"]."/includes/pages/DefaultFrontend.inc.php" );
	require_once( $GLOBALS["site_root"]."/includes/widgets/MyProfilePane.inc.php" );
	require_once( $GLOBALS["site_root"]."/includes/widgets/SystemArticle.inc.php" );

	require_once( $GLOBALS["site_root"] . "/includes/models/MyUser.inc.php" );
	
	class MyProfilePage extends DefaultFrontend {
		protected $oMyProfilePane;

		public function __construct( $id = "MyProfilePage" , $parent = null , $pagetype = "my_profile"  ) {
			$user = new MyUserModel();
			if ($user->isUserLoggedIn()) {
				$member_id = $user->getUserMember( $user->getLoggedinUserId() );
				$pagetype = ($member_id) ? "my_member_my_profile" : "my_user_my_profile";
			}
			parent::__construct( $id , $parent , $pagetype );
			if ($user->isUserLoggedIn()) {
				$this->oMyProfilePane = new MyProfilePane( "content_widget" , $this );
			} else {
				$this->oMyProfilePane = new SystemArticle( "content_widget" , $this , "sys_error_user_has_to_login" );
			}
		}
	}
?>
