Exemplo n.º 1
0
 public function testSetStatus()
 {
     $c = new ae_CommentModel();
     $this->assertTrue(ae_CommentModel::isValidStatus($c->getStatus()));
     $c->setStatus(ae_CommentModel::STATUS_APPROVED);
     $this->assertEquals($c->getStatus(), ae_CommentModel::STATUS_APPROVED);
     $this->setExpectedException('Exception');
     $c->setStatus('bogus');
 }
Exemplo n.º 2
0
            } 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';
                $areaName = 'Comments';
                if (ae_CommentModel::isValidStatus($status)) {
                    $filter['WHERE'] = 'co_status = "' . $status . '"';
                } else {
                    $filter['WHERE'] = 'co_status != "trash" AND co_status != "spam"';
                }
                $list = new ae_CommentList($filter);
            }
        }
    }
}
$urlBasis = '?area=manage&offset=' . $pageOffset . '&' . $area;
// pagination
$numPages = ceil($list->getTotalNumItems() / $itemsPerPage);
$queryStr = preg_replace('/[?&]offset=?[0-9]*/i', '', $_SERVER['QUERY_STRING']);
$linkBase = 'admin.php?' . htmlspecialchars($queryStr) . '&offset=';
?>
Exemplo n.º 3
0
$status = $_POST['bulk-status-change'];
$mainArea = 'manage';
switch ($_POST['area']) {
    case 'category':
        $isValidStatus = $status == 'delete' ? TRUE : ae_CategoryModel::isValidStatus($status);
        $modelName = 'ae_CategoryModel';
        $preDelete = ae_CategoryModel::STATUS_TRASH;
        break;
    case 'cofilter':
        $isValidStatus = $status == 'delete' ? TRUE : ae_CommentfilterModel::isValidStatus($status);
        $mainArea = 'settings';
        $modelName = 'ae_CommentfilterModel';
        $preDelete = ae_CommentfilterModel::STATUS_INACTIVE;
        break;
    case 'comment':
        $isValidStatus = $status == 'delete' ? TRUE : ae_CommentModel::isValidStatus($status);
        $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':