Example #1
0
function page_admin_menu_edit($parent_id = "", $act = "", $id = "")
{
    requires_admin();
    set_lang("other");
    use_template("admin");
    if (!$parent_id) {
        $parent_id = 0;
    }
    $o = "";
    if ($act == "del") {
        $rec = db_object_get("menu", $id);
        if ($rec->fixed == 'Y') {
            $act = "-";
            $o .= '<script>alert("Эту запись нельзя удалить.")</script>';
        }
    }
    global $tables;
    $tables['menu']['fields'][] = "title";
    $tables['menu']['fields'][] = "link";
    $tables['menu']['weight'] = true;
    if ($parent_id) {
        $o .= menu_path($parent_id);
    }
    $o .= table_edit("menu", "admin/menu/edit/{$parent_id}", $act, $id, "parent_id", $parent_id, "", "on_menu");
    return $o;
}
Example #2
0
File: menu.php Project: NazarK/sqp
function page_admin_menu_edit($parent_id = "", $act = "", $id = "")
{
    requires_admin();
    set_lang("other");
    use_layout("admin");
    if (!$parent_id) {
        $parent_id = 0;
    }
    $o = "";
    if ($act == "del") {
        $rec = db_object_get("menu", $id);
        if ($rec->fixed == 'Y') {
            $act = "-";
            $o .= '<script>alert("Эту запись нельзя удалить.")</script>';
        }
    }
    global $tables;
    $tables['menu']['fields'][] = "title";
    $tables['menu']['fields'][] = "link";
    $tables['menu']['weight'] = true;
    if ($parent_id) {
        $o .= menu_path($parent_id);
    }
    global $table_edit_props;
    $table_edit_props->use_rename_icon_for_edit = true;
    $o .= table_edit("menu", "admin/menu/edit/{$parent_id}", $act, $id, "parent_id", $parent_id, "", "on_menu");
    $o .= "<style> input[type='submit'] { padding: 5px 10px; width: auto;}\r\n\t  input{ width:400px; }\r\n\t</style>";
    return $o;
}