示例#1
0
文件: delete.php 项目: ssrsfs/blg
    $pm->setVariable('page', $page);
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        $page->delete();
        Typeframe::Redirect('Page deleted.', Typeframe::CurrentPage()->applicationUri());
    }
} else {
    Typeframe::Redirect('Invalid page specified.', Typeframe::CurrentPage()->applicationUri());
}
return;
/**
 * Typeframe Pages application
 *
 * admin delete controller
 */
// save typing below
$typef_app_dir = TYPEF_WEB_DIR . '/admin/pages';
// can only process posts
if ('POST' != $_SERVER['REQUEST_METHOD']) {
    //Typeframe::Redirect('Nothing to do.', $typef_app_dir);
    return;
}
// validate the page id
$pageid = @$_POST['pageid'];
$page = Model_Page::Get($pageid);
if (!$page->exists()) {
    Typeframe::Redirect('Invalid page.', $typef_app_dir);
    return;
}
Model_Page::Delete($pageid);
Typeframe::Registry()->purgeRegistryCache();
Typeframe::Redirect('Page deleted.', $typef_app_dir);
 public function deleteAction()
 {
     $isAdmin = $this->isAdmin();
     $Page = new Model_Page();
     $data = $Page->Delete($this->_getParam('pid'));
     $this->_redirect('/page/list');
 }