2 /**********************************************************************
3 Copyright (C) FrontAccounting, LLC.
4 Released under the terms of the GNU General Public License, GPL,
5 as published by the Free Software Foundation, either version 3
6 of the License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
17 function menu_item($label, $link)
19 $this->label = $label;
31 $this->title = $title;
32 $this->items = array();
35 function add_item($label, $link)
37 $item = new menu_item($label,$link);
38 array_push($this->items,$item);
50 function app_function($label,$link,$access=1)
52 $this->label = $label;
54 $this->access = $access;
65 function module($name,$icon = null)
69 $this->lappfunctions = array();
70 $this->rappfunctions = array();
73 function add_lapp_function($label,$link="",$access=1)
75 $appfunction = new app_function($label,$link,$access);
76 //array_push($this->lappfunctions,$appfunction);
77 $this->lappfunctions[] = $appfunction;
81 function add_rapp_function($label,$link="",$access=1)
83 $appfunction = new app_function($label,$link,$access);
84 //array_push($this->rappfunctions,$appfunction);
85 $this->rappfunctions[] = $appfunction;
99 function application($id, $name, $enabled=true)
103 $this->enables = $enabled;
104 $this->modules = array();
107 function add_module($name, $icon = null)
109 $module = new module($name,$icon);
110 //array_push($this->modules,$module);
111 $this->modules[] = $module;
115 function add_lapp_function($level, $label,$link="",$access=1)
117 $this->modules[$level]->lappfunctions[] = new app_function($label, $link, $access);
120 function add_rapp_function($level, $label,$link="",$access=1)
122 $this->modules[$level]->rappfunctions[] = new app_function($label, $link, $access);