예제 #1
0
파일: index.php 프로젝트: mrbidon/menu
    //	$links_auto_combo = array(
    //		'-' => '0',
    //	__('categories') => '1',
    //	__('tags') => '2',
    //	__('posts selected') => '3'
    //	);
    $link_title = $_POST['link_title'];
    $link_level = $_POST['link_level'];
    //$link_auto = $_POST['link_auto'];
    $link_auto = 0;
    $link_href = $_POST['link_href'];
    $link_desc = $_POST['link_desc'];
    $link_lang = $_POST['link_lang'];
    $link_class = $_POST['link_class'];
    try {
        $menu->addLink($link_title, $link_href, $link_level, $link_auto, 0, $link_desc, $link_lang, $link_class);
        http::redirect($p_url . '&addlink=1');
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
        $default_tab = 'add-link';
    }
}
# Delete link
if (!empty($_POST['removeaction']) && !empty($_POST['remove'])) {
    foreach ($_POST['remove'] as $k => $v) {
        try {
            $menu->delItem($v);
        } catch (Exception $e) {
            $core->error->add($e->getMessage());
            break;
        }
예제 #2
0
파일: index.php 프로젝트: HackerMajor/root
$menu = new dcBlogMenu($core->blog);
if (!empty($_REQUEST['edit']) && !empty($_REQUEST['id'])) {
    include dirname(__FILE__) . '/edit.php';
    return;
}
$default_tab = '';
$link_title = $link_href = $link_desc = $link_lang = '';
$cat_title = '';
# Add link
if (!empty($_POST['add_link'])) {
    $link_title = $_POST['link_title'];
    $link_href = $_POST['link_href'];
    $link_desc = $_POST['link_desc'];
    $link_lang = $_POST['link_lang'];
    try {
        $menu->addLink($link_title, $link_href, $link_desc, $link_lang);
        http::redirect($p_url . '&addlink=1');
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
        $default_tab = 'add-link';
    }
}
/*
# Add category
if (!empty($_POST['add_cat']))
{
	$cat_title = $_POST['cat_title'];
	
	try {
		$menu->addCategory($cat_title);
		http::redirect($p_url.'&addcat=1');