* @since Version 2.0 */ class sysApcOverview { public $DIR; public $uriData; public $controller; /** * Class constructor */ public function __construct($uriData) { $this->uriData = $uriData; $this->DIR = __DIR__ ? __DIR__ : dirname(__FILE__); $this->controller = new sysApcOverviewController($this->uriData, $this->DIR, basename($this->DIR)); } /** * Default function to run * Skip if other callback defined */ public function run() { $action = getV('action'); if($action){ switch ($action) { case 'edit': $this->controller->run(true); break; case 'filter_table': cJSON::sendOk($this->controller->createCmsTable(getP('page'), getP('filter'), getP('headers'))); break; case 'selfLoad': cJSON::sendOk($this->controller->editCmsTableRecord(getV('id'))); break; case 'deleteRecords': if($this->controller->oUser->chkPermission('SYS_APC_OVERVIEW_DELETE')){ cJSON::sendOk($this->controller->delete(getP('fields'))); } break; case 'clearAll': if($this->controller->oUser->chkPermission('SYS_APC_OVERVIEW_DELETE_ALL')){ cJSON::sendOk($this->controller->deleteAll(getP('fields'))); } break; case 'idisable': if($this->controller->oUser->chkPermission('SYS_APC_OVERVIEW_DISABLE')){ cJSON::sendOk($this->controller->changeApcStatus(false)); } break; case 'ienable': if($this->controller->oUser->chkPermission('SYS_APC_OVERVIEW_DISABLE')){ cJSON::sendOk($this->controller->changeApcStatus()); } break; default: $this->controller->run(); break; } }else{ $this->controller->run(); } } }