Example #1
0
 static function update($newPages)
 {
     $pages = pages::get(true);
     pages::sanity_check($pages, $newPages);
     $pages = $pages['pages'];
     $navPages = pages::nav_pages($newPages);
     pages::update_pages($pages, $newPages, $navPages);
     pages::save_pages($newPages);
     pages::remove_deleted_pages($pages, $newPages);
     pages::sitemap($navPages);
     return array('status' => 0, 'pages' => pages::reduce_pages($newPages));
 }
Example #2
0
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['add']);
$cms = new pages();
if (!isset($_GET['sub_of']) || !is_numeric($_GET['sub_of'])) {
    $_GET['sub_of'] = 0;
}
if (isset($_POST['add'])) {
    $status = $cms->add();
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=list&sub_of=" . $_GET['sub_of'], $langArray['add_complete']);
    }
} else {
    $_POST['visible'] = 'true';
}
$_POST['footer'] = isset($_POST['footer']) ? 'true' : 'false';
if ($_GET['sub_of'] != 0) {
    $pdata = $cms->get($_GET['sub_of']);
    abr('pdata', $pdata);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Example #3
0
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(ROOT_PATH . "/apps/" . $_GET['m'] . "/admin/add.php");
_setTitle($langArray['edit']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'INVALID ID', 'error');
}
if (!isset($_GET['p'])) {
    $_GET['p'] = '';
}
$cms = new pages();
if (isset($_POST['edit'])) {
    $status = $cms->edit($_GET['id']);
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=list&sub_of=" . $_GET['sub_of'] . "&p=" . $_GET['p'], $langArray['edit_complete']);
    }
} else {
    $_POST = $cms->get($_GET['id']);
}
$pagesArr = $cms->getAllWithChilds($_GET['id']);
$select = $cms->generateSelect($pagesArr, $_POST['sub_of']);
abr('select', $select);
if ($_GET['sub_of'] != 0) {
    $pdata = $cms->get($_GET['sub_of']);
    abr('pdata', $pdata);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';