예제 #1
0
파일: navbar.php 프로젝트: flyysr/emlog
}
if ($action == 'add_page') {
    $pages = isset($_POST['pages']) ? $_POST['pages'] : array();
    if (empty($pages)) {
        emDirect("./navbar.php?error_e=1");
    }
    foreach ($pages as $id => $title) {
        $Navi_Model->addNavi($title, '', 0, 0, 'n', Navi_Model::navitype_page, $id);
    }
    $CACHE->updateCache('navi');
    emDirect('./navbar.php?active_add=1');
}
if ($action == 'mod') {
    $naviId = isset($_GET['navid']) ? intval($_GET['navid']) : '';
    $navis = $CACHE->readCache('navi');
    $naviData = $Navi_Model->getOneNavi($naviId);
    extract($naviData);
    if ($type != Navi_Model::navitype_custom) {
        $url = '该导航地址由系统生成,无法修改';
    }
    $conf_newtab = $newtab == 'y' ? 'checked="checked"' : '';
    $conf_isdefault = $type != Navi_Model::navitype_custom ? 'disabled="disabled"' : '';
    include View::getView('header');
    require_once View::getView('naviedit');
    include View::getView('footer');
    View::output();
}
if ($action == 'update') {
    $naviname = isset($_POST['naviname']) ? addslashes(trim($_POST['naviname'])) : '';
    $url = isset($_POST['url']) ? addslashes(trim($_POST['url'])) : '';
    $newtab = isset($_POST['newtab']) ? addslashes(trim($_POST['newtab'])) : 'n';