/**
  * Constructor takes care of having database connection available
  */
 function __construct($config, $lang)
 {
     parent::__construct($config, $lang);
     header('Content-type: text/html; charset=utf-8');
     $this->removeUnwantedUrl();
     // What should be done is to create one javascript file of the local files and minify it followed by gzipping.
     //$this->minify('js', $this->scripts);
     // Same thing for cascaded style sheet, in public_html/css/..
     //$this->minify('css', $this->styles);
     $this->handleUrl();
 }
 /**
  *
  */
 function __construct($config, $lang)
 {
     parent::__construct($config, $lang);
     // http://marcgrabanski.com/articles/jquery-ajax-content-type
     header('Content-type: application/json; charset=utf-8');
     if ($this->config['isdevserver']) {
         $this->out['post'] = $this->posted;
         $this->out['get'] = $this->getted;
     }
     if ($_SESSION['access'] > 0) {
         if ($this->checkPage()) {
             $this->createOutput();
         } else {
             // Failed to pass the checks
             $this->out['errorInfo'] = 'Wrong line at the passport control';
         }
         $this->out['type'] = $this->pagetype;
     } else {
         $this->out['errorInfo'] = 'Not logged in';
     }
     $this->out['created'] = date($this->config['datetime']);
     echo json_encode($this->out);
 }