/** * Scan controller directories for updates * * @view views/scripts/controller/scan.phtml * @access public */ public function scanAction() { $all = array(); foreach ($this->dbCtrl->fetchAll() as $row) { $all[] = new Admin_Model_DbRow_Controller($row); } $scanned = $this->ctrlModel->getControllers(); $new = $this->dbCtrl->filterExistingControllers($scanned); $vanished = $this->ctrlModel->filterVanishedControllers($all, $scanned); $this->view->vanished = $vanished; $this->view->new = $new; }
/** * Load all Controllers and informations for each controller for a listing grid * * @return array */ public function loadControllerControllersAction() { $controllerModel = new Admin_Model_Acl_ControllersActions(); $controllerDbModel = new Admin_Model_DbTable_Acl_ModuleController(); $return = array(); $dbControllers = array(); foreach ($controllerDbModel->fetchAll() as $controllerRow) { $dbControllers[] = new Admin_Model_DbRow_Controller($controllerRow); } $scannedControllers = $controllerModel->getControllers(); $newControllers = $controllerDbModel->filterExistingControllers($scannedControllers); $deletedControllers = $controllerModel->filterVanishedControllers($dbControllers, $scannedControllers); foreach ($dbControllers as $controller) { $return[] = $controller->set('status', 0)->toJsonArray(); } foreach ($newControllers as $controller) { $controller->fromArray(array('enabled' => 0, 'status' => 1, 'description' => $controller->get('description', ''))); $return[] = $controller->toJsonArray(); } foreach ($deletedControllers as $controller) { $controller->fromArray(array('status' => 2, 'description' => $controller->get('description', ''))); $return[] = $controller->toJsonArray(); } return $this->responseSuccess(array('controllers' => $return)); }