Example #1
0
     echo json_encode(array("success" => 0, "message" => urlencode($req)));
     exit;
 }
 if (!isset($val['title']) || empty($val['title']) || !isset($val['content']) || empty($val['content']) || !isset($val['visibility']) || !isset($val['parent']) || $val['visibility'] != 0 && $val['visibility'] != 1 || !is_numeric($val['parent'])) {
     $_GET['id'] = 6;
     ob_start();
     include 'pages/error.php';
     $req = ob_get_contents();
     ob_end_clean();
     echo json_encode(array("success" => 0, "message" => urlencode($req)));
     exit;
 }
 // Check if parent exists
 $parent = null;
 if ($val['parent'] != -1) {
     foreach (Page::getList() as $page) {
         if ($page->getID() == $val['parent']) {
             $parent = $page;
             break;
         }
     }
     // Parent not found
     if ($parent == null) {
         $_GET['id'] = 7;
         ob_start();
         include 'pages/error.php';
         $req = ob_get_contents();
         ob_end_clean();
         echo json_encode(array("success" => 0, "message" => urlencode($req)));
         exit;
     }
Example #2
0
function listPages()
{
    $results = array();
    $data = Page::getList();
    $results['pages'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    include '_adminListPages.inc';
}
Example #3
0
 /**
  * @codeCoverageIgnore
  */
 public function getParent()
 {
     foreach (Page::getList() as $page) {
         if ($page->getID() == $this->parentPage) {
             return $page;
         }
     }
     return null;
 }
Example #4
0
    switch ($page->getVisibility()) {
        case PostVisibility::P_PRIVATE:
            echo "Private";
            break;
        case PostVisibility::P_PUBLIC:
            echo "Public for anyone";
            break;
        case PostVisibility::P_MEMBERONLY:
            echo "Public for members";
            break;
    }
    ?>
</td>
        </tr>
        <?php 
    foreach (Page::getList($page->getID()) as $sub) {
        ?>
            <tr class="sub<?php 
        echo $page->getID();
        ?>
">
                <td></td>
                <td><input type="checkbox" id="check<?php 
        echo $sub->getID();
        ?>
"/>
                    <?php 
        echo $sub->getTitle();
        ?>
                    <span><a href="#pageedit?id=<?php 
        echo $sub->getID();
Example #5
0
            <tr>
                <td>Posts:</td>
                <td><?php 
echo Post::getList()->count();
?>
</td>
                <td>My posts:</td>
                <td><?php 
echo $myposts;
?>
</td>
            </tr>
            <tr>
                <td>Pages:</td>
                <td><?php 
echo Page::getList()->count();
?>
</td>
                <td>My pages:</td>
                <td><?php 
echo $mypages;
?>
</td>
            </tr>
            <tr>
                <td>Comments:</td>
                <td><?php 
echo $comments;
?>
</td>
                <td>My comments:</td>
Example #6
0
}
if ($user->getPower() != 0) {
    redirect("Location: status.php?action=login");
}
if (isset($_GET['action']) || isset($_GET['name'])) {
    if ($_GET['action'] == "delete") {
        if (!$user->str_check($_GET['name'])) {
            redirect("Location: error.php");
        }
        $page->deletePage($_GET['name']);
        echo "<script language=\"javascript\">alert('删除成功!');history.back(-1);</script>";
        die;
    }
}
$limit = isset($_GET['page']) ? (intval($_GET['page']) - 1) * 20 : "0";
$list = $page->getList($limit, 20);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>页面管理 > 页面列表</title>
        <link rel="stylesheet" href="css/frame.css" type="text/css" />
    </head>
    <body>
    	<center>
        	<br />
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="150">
                        名称