<?php

include_once(dirname(__FILE__).'/../../Base/Controller.php');
include_once(dirname(__FILE__).'/../../Application/View/Page.php');
include_once(dirname(__FILE__).'/View.php');

class HomePageController extends Controller
{
  function Show()
  {
    $Page = new PageView($this->System);
    if($this->System->Modules['Permission']->Check('HomePage', 'Show')) 
    {
      $View = new HomePageView($this->System);
      return($Page->GetOutput($View->Welcome()));
    } else return($Page->AccessDenied());
  }
  
  function Info()
  {
    $Page = new PageView($this->System);
    if($this->System->Modules['Permission']->Check('HomePage', 'Info')) 
    {
      $View = new HomePageView($this->System);
      return($Page->GetOutput($View->Info()));
    } else return($Page->AccessDenied());
  }

  function State()
  {
    $Page = new PageView($this->System);
    if($this->System->Modules['Permission']->Check('HomePage', 'State')) 
    {
      $View = new HomePageView($this->System);
      return($Page->GetOutput($View->State()));
    } else return($Page->AccessDenied());
  }
}
