<?php

$is_new_menu = false;
$sortable_id = "edit_client_menu";
if (isset($request["create_new_menu"])) {
    $menu_id = ft_create_blank_client_menu();
    $is_new_menu = true;
} else {
    $menu_id = $request["menu_id"];
}
if (isset($request["update_client_menu"])) {
    $info = $_POST;
    $info["sortable_id"] = $sortable_id;
    list($g_success, $g_message) = ft_update_client_menu($info);
}
$menu_info = ft_get_client_menu($menu_id);
$num_menu_items = count($menu_info["menu_items"]);
$selected_client_ids = array();
foreach ($menu_info["clients"] as $client_info) {
    $selected_client_ids[] = $client_info["account_id"];
}
// get a list of all menus names; this is used to ensure the uniqueness of the menu names to ward
// against confusion
$menus = ft_get_menu_list();
$menu_names = array();
foreach ($menus as $curr_menu_info) {
    if ($menu_id == $curr_menu_info["menu_id"]) {
        continue;
    }
    $menu_names[] = "\"" . htmlspecialchars($curr_menu_info["menu"]) . "\"";
}
Beispiel #2
0
/**
 * A wrapper function for ft_get_client_menu (and ft_get_admin_menu). Returns all info
 * about a menu, regardless of type. If it's an admin menu, it'll be returned with an empty "clients"
 * hash key.
 *
 * @param integer $menu_id
 * @return
 */
function ft_get_menu($menu_id)
{
    return ft_get_client_menu($menu_id);
}