<?php

include_once(dirname(__FILE__).'/Model.php');

class Controller extends Module
{
  function Process()
  {
    if(array_key_exists('Action', $_GET)) $Action = $_GET['Action'];
      else $Action = 'Show';
    if(method_exists($this, $Action))
    {
      if($this->System->Modules['Permission']->Check(substr(get_class($this), 0, -10), $Action))
        return($this->$Action());
        else return('Nemáte oprávnění provést akci '.$Action.' modulu '.substr(get_class($this), 0, -10));
    } else return('Metoda '.$Action.' modulu '.get_class($this).' nenalezena.');
  }
}
