Esempio n. 1
0
function doDelete()
{
    global $WebPagesList;
    if (isset($_GET[action]) and $_GET[action] == 'delete') {
        $slug = $_GET[slug];
        foreach ($WebPagesList as $k => $pg) {
            //if( !inSidebar( $pg ) ) continue;
            if (getSlug($pg) == $slug) {
                if ($k == 0) {
                    echo "cannot delete the Top page";
                    return;
                }
                // how can we possibly move the topmost one up :)
                unset($WebPagesList[$k]);
                unlink(sitedir(getSlug($pg)));
                $WebPagesList = msort($WebPagesList);
                savepages();
                echo 'success fully deleted';
                break;
            }
        }
    }
}
Esempio n. 2
0
function show_content()
{
    global $WebPagesList, $CurrentActivePage;
    $slug = getSlug($CurrentActivePage);
    if (file_exists(sitedir($slug))) {
        require_once sitedir($slug);
    } else {
        echo "no content defined for this page";
    }
}