function _run() { $id = Request::post('id'); if ($id) { $feature = Features::getInstance()->getByIdLoaded($id); list($success, $description) = $feature->_run(); $this->setWriteParameter('features_module', 'run_result', implode("\n", $description)); } }
function setCollectionClass() { $this->Collection = Features::getInstance(); }
function _update($data) { $tableName = Features::getInstance()->tableName; $this->dropCache(); return parent::_update($data, $tableName); }
function checkTest() { global $current_user; $this->data['success'] = 0; if (!$current_user->authorized) { $this->error('Auth'); return; } if ($current_user->getRole() < User::ROLE_SITE_ADMIN) { $this->error('Must be admin'); return; } $id = isset($_POST['id']) ? (int) $_POST['id'] : false; if (!$id) { $this->error('Illegal id'); return; } $feature = Features::getInstance()->getByIdLoaded($id); /* @var $feature Feature */ $this->data = array('id' => $id, 'status_description' => $feature->getStatusDescription(), 'last_run' => date('Y/m/d H:i', $feature->getLastRun()), 'last_message' => $feature->getLastMessage(), 'success' => 1); }