public function run() {
eval('if ($this->route !=\'mgadmin\'&&$this->route !=\'mg-admin\'&&$this->route !=\'ajax\'&&$this->route !=\'enter\'&&$this->route !=\'personal\'&&MG::getSetting(\'trialVersionStart\')) {
MG::redirect(\'/mgadmin\');
}
$data = null;
$view = null;
$variables = null;
// .
if ($controller = $this->getController()) {
MG::set(\'controller\', $controller);
$contr = new $controller;
$type = \'view\';
$variables = $contr->variables;
$view = $this->getView();
} elseif ($data = MG::getPhpContent()) {
//
MG::disableTemplate();
// , (php||html).
$ext = explode(".", $data);
$type = end($ext);
// js html php,
//
if($type != \'php\' && $type !=\'html\'){
MG::redirect(\'/\'.$data);
exit;
}
if($type != \'php\'){
//
$data = file_get_contents($data);
$type = \'html\';
}
} elseif ($data = MG::getHtmlContent()) {
// .
$type = \'html\';
}
// .
$type = !empty($type) ? $type : \'404\';
$result = array(
\'type\' => $type,
\'data\' => $data,
\'view\' => $view,
\'variables\' => $variables
);');
if ($this->route != 'mgadmin' && $this->route != 'mg-admin' && $this->route != 'ajax' && $this->route != 'enter' && $this->route != 'personal' && MG::getSetting('trialVersionStart')) {
MG::redirect('/mgadmin');
}
$data = null;
$view = null;
$variables = null;
// .
if ($controller = $this->getController()) {
MG::set('controller', $controller);
$contr = new $controller;
$type = 'view';
$variables = $contr->variables;
$view = $this->getView();
} elseif ($data = MG::getPhpContent()) {
//
MG::disableTemplate();
// , (php||html).
$ext = explode(".", $data);
$type = end($ext);
// js html php,
//
if ($type != 'php' && $type != 'html') {
MG::redirect('/' . $data);
exit;
}
if ($type != 'php') {
//
$data = file_get_contents($data);
$type = 'html';
}
} elseif ($data = MG::getHtmlContent()) {
// .
$type = 'html';
}
// .
$type = !empty($type) ? $type : '404';
$result = array('type' => $type, 'data' => $data, 'view' => $view, 'variables' => $variables);
return $result;
}