Location: PHPKode > projects > ProjectButler > ProjectButler/menu/php/show_menu_list.php
<?php

     $offset = "../../includes/";

     require_once($offset."class.menu.inc");
     require_once($offset."class.user_group.inc");
     

     if (PM_Common::check_login($system_user_id, $system_user_group_id ) != $secure_check) {
       $error = new Error_Management;
       $error->error_page(1,'');
       die();
     }

     if ($system_user_group_id != 1)  {
       $error = new Error_Management;
       $error->error_page(1,'');
       die();
     }

     if (strcmp($action,'delete') == 0) {
       $menu = new Menu($selected_menu_id);
       
       $check_user_group_id=$menu->get_user_group($selected_menu_id);
       $delete_result=$menu->delete_menu($selected_menu_id);
       if ($delete_result != 1) {
         $error = new Error_Management;
         $error->error_page(104,'');
         die();
       }

       if ($check_user_group_id == 1)  {
         echo "<script language='JavaScript'>\n";
         echo "parent.menu.location.reload();\n";
         echo "</script>";
       }
     }


     $menu_array = new Menu;
     $user_group = new User_Group;

     if ((empty($orderby)) || (strcmp($orderby, "user_group") == 0)) {
       $ob = "UserGr_ID, Menu_ID, Topic, Status";
     } elseif (strcmp($orderby, "topic") == 0){
       $ob = "Topic, Status, UserGr_ID";
     } elseif (strcmp($orderby, "path") == 0) {
       $ob = "Path, UserGr_ID, Topic";
     } elseif (strcmp($orderby, "status") == 0) {
       $ob = "Status, UserGr_ID, Topic";
     }

     $menu_array =$menu_array->get_menus('','', $ob);
     for($i=1; $i <= count($menu_array); $i++) {
       $menu_list=$menu_array[$i];
       $menu_id_list[$i] = $menu_list->menu_id;
       $user_group_id[$i] = $menu_list->user_group_id;
       $short_name[$i] = $user_group->get_short_name($user_group_id[$i]);
       $topic[$i] =$menu_list->topic;
       $path[$i] = $menu_list->path;
       $status[$i] = $menu_list->status;
     }

?>


Return current item: ProjectButler