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 ***********************************************************************/
13 define('MENU_ENTRY', 'menu_entry');
14 define('MENU_TRANSACTION', 'menu_transaction');
15 define('MENU_INQUIRY', 'menu_inquiry');
16 define('MENU_REPORT', 'menu_report');
17 define('MENU_MAINTENANCE', 'menu_maintenance');
18 define('MENU_UPDATE', 'menu_update');
19 define('MENU_SETTINGS', 'menu_settings');
20 define('MENU_SYSTEM', 'menu_system');
27 function menu_item($label, $link)
29 $this->label = $label;
41 $this->title = $title;
42 $this->items = array();
45 function add_item($label, $link)
47 $item = new menu_item($label,$link);
48 array_push($this->items,$item);
61 function app_function($label,$link,$access='SA_OPEN',$category='')
63 $this->label = $label;
65 $this->access = $access;
66 $this->category = $category;
77 function module($name,$icon = null)
81 $this->lappfunctions = array();
82 $this->rappfunctions = array();
85 function add_lapp_function($label,$link="",$access='SA_OPEN',$category='')
87 $appfunction = new app_function($label,$link,$access,$category);
88 //array_push($this->lappfunctions,$appfunction);
89 $this->lappfunctions[] = $appfunction;
93 function add_rapp_function($label,$link="",$access='SA_OPEN',$category='')
95 $appfunction = new app_function($label,$link,$access,$category);
96 //array_push($this->rappfunctions,$appfunction);
97 $this->rappfunctions[] = $appfunction;
112 function application($id, $name, $enabled=true)
116 $this->enabled = $enabled;
117 $this->modules = array();
120 function add_module($name, $icon = null)
122 $module = new module($name,$icon);
123 //array_push($this->modules,$module);
124 $this->modules[] = $module;
128 function add_lapp_function($level, $label,$link="",$access='SA_OPEN',$category='')
130 $this->modules[$level]->lappfunctions[] = new app_function($label, $link, $access, $category);
133 function add_rapp_function($level, $label,$link="",$access='SA_OPEN',$category='')
135 $this->modules[$level]->rappfunctions[] = new app_function($label, $link, $access, $category);
138 function add_extensions()
140 hook_invoke_all('install_options', $this);
143 // Helper returning link to report class added by extension module.
145 function report_class_url($class)
147 global $installed_extensions;
149 // TODO : konwencja lub ?
151 // if (file_exists($path_to_root.'/'.$mod['path'].'/'.$entry['url']
152 // .'/'.'reporting/reports_custom.php'))
153 return "reporting/reports_main.php?Class=".$class;