Exemplo n.º 1
0
	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));
		}
	}
Exemplo n.º 2
0
	function setCollectionClass() {
		$this->Collection = Features::getInstance();
	}
Exemplo n.º 3
0
	function _update($data) {
		$tableName = Features::getInstance()->tableName;
		$this->dropCache();
		return parent::_update($data, $tableName);
	}
Exemplo n.º 4
0
 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);
 }