Moved menu-system from header.inc/footer.inc to renderer.php for relevant theme....
[fa-stable.git] / frontaccounting.php
1 <?php
2         include_once('applications/application.php');
3         include_once('applications/customers.php');
4         include_once('applications/suppliers.php');
5         include_once('applications/inventory.php');
6         include_once('applications/manufacturing.php');
7         include_once('applications/dimensions.php');
8         include_once('applications/generalledger.php');
9         include_once('applications/setup.php');
10         $path_to_root=".";
11         include_once($path_to_root . "/includes/session.inc");
12
13         class front_accounting
14                 {
15                 var $user;
16                 var $settings;
17                 var $applications;
18                 var $selected_application;
19                 // GUI
20                 var $menu;
21                 //var $renderer;
22                 function front_accounting()
23                 {
24                         //$this->renderer =& new renderer();
25                 }
26                 function add_application($app)
27                                 {
28                                                         $this->applications[$app->id] = &$app;
29                                 }
30                 function get_application($id)
31                                 {
32                                  if (isset($this->applications[$id]))
33                                         return $this->applications[$id];
34                                  return null;
35                                 }
36                 function get_selected_application()
37                 {
38                         if (isset($this->selected_application))
39                                  return $this->applications[$this->selected_application];
40                         foreach ($this->applications as $application)
41                                 return $application;
42                         return null;
43                 }
44                 function display()
45                 {
46                         global $path_to_root;
47                         include($path_to_root . "/themes/".user_theme()."/renderer.php");
48                         $this->init();
49                         $rend = new renderer();
50                         $rend->wa_header();
51                         //$rend->menu_header($this->menu);
52                         $rend->display_applications($this);
53                         //$rend->menu_footer($this->menu);
54                         $rend->wa_footer();
55                 }
56                 function init()
57                                 {
58                         $this->menu = new menu(_("Main  Menu"));
59                         $this->menu->add_item(_("Main  Menu"), "index.php");
60                         $this->menu->add_item(_("Logout"), "/account/access/logout.php");
61                         $this->applications = array();
62                         $this->add_application(new customers_app());
63                         $this->add_application(new suppliers_app());
64                         $this->add_application(new inventory_app());
65                         $this->add_application(new manufacturing_app());
66                         $this->add_application(new dimensions_app());
67                         $this->add_application(new general_ledger_app());
68                         $this->add_application(new setup_app());
69                         }
70 }
71 ?>