$list = new ae_CategoryList($filter); } else { if (isset($_GET['page'])) { $area = 'page'; $areaName = 'Pages'; if (ae_PageModel::isValidStatus($status)) { $filter['WHERE'] = 'pa_status = "' . $status . '"'; } else { $filter['WHERE'] = 'pa_status != "trash"'; } $list = new ae_PageList($filter); } else { if (isset($_GET['post'])) { $area = 'post'; $areaName = 'Posts'; if (ae_PostModel::isValidStatus($status)) { $filter['WHERE'] = 'po_status = "' . $status . '"'; } else { $filter['WHERE'] = 'po_status != "trash"'; } $list = new ae_PostList($filter); } else { if (isset($_GET['user'])) { $area = 'user'; $areaName = 'Users'; if (ae_UserModel::isValidStatus($status)) { $filter['WHERE'] = 'u_status = "' . $status . '"'; } $list = new ae_UserList($filter); } else { $area = 'comment';
public function testSetStatus() { $p = new ae_PostModel(); $this->assertTrue(ae_PostModel::isValidStatus($p->getStatus())); $p->setStatus(ae_PostModel::STATUS_PUBLISHED); $this->assertEquals($p->getStatus(), ae_PostModel::STATUS_PUBLISHED); $this->setExpectedException('Exception'); $p->setStatus('bogus'); }
$modelName = 'ae_CommentModel'; $preDelete = ae_CommentModel::STATUS_TRASH; break; case 'media': $isValidStatus = $status == 'delete' ? TRUE : ae_MediaModel::isValidStatus($status); $mainArea = 'media'; $modelName = 'ae_MediaModel'; $preDelete = ae_MediaModel::STATUS_TRASH; break; case 'page': $isValidStatus = $status == 'delete' ? TRUE : ae_PageModel::isValidStatus($status); $modelName = 'ae_PageModel'; $preDelete = ae_PageModel::STATUS_TRASH; break; case 'post': $isValidStatus = $status == 'delete' ? TRUE : ae_PostModel::isValidStatus($status); $modelName = 'ae_PostModel'; $preDelete = ae_PostModel::STATUS_TRASH; break; case 'user': $isValidStatus = $status == 'delete' ? TRUE : ae_UserModel::isValidStatus($status); $modelName = 'ae_UserModel'; $preDelete = ae_UserModel::STATUS_SUSPENDED; break; default: $isValidStatus = FALSE; } $table = constant($modelName . '::TABLE'); $idField = constant($modelName . '::TABLE_ID_FIELD'); if (!$isValidStatus) { header('Location: ../admin.php?error=invalid_status');