X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=applications%2Fapplication.php;h=c9f8e943a791e4ddc6113209aeed3e471903b1bf;hb=c9cb6e8b05e007305888f244807abda14632205e;hp=efa11f23febe0ae42dd89812a238497999db4e75;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/applications/application.php b/applications/application.php index efa11f23..c9f8e943 100644 --- a/applications/application.php +++ b/applications/application.php @@ -1,118 +1,148 @@ -label = $label; - $this->link = $link; - } - } - - class menu - { - var $title; - var $items; - - function menu($title) - { - $this->title = $title; - $this->items = array(); - } - - function add_item($label, $link) - { - $item = new menu_item($label,$link); - array_push($this->items,$item); - return $item; - } - - } - - class app_function - { - var $label; - var $link; - var $access; - - function app_function($label,$link,$access=1) - { - $this->label = $label; - $this->link = $link; - $this->access = $access; - } - } - - class module - { - var $name; - var $icon; - var $lappfunctions; - var $rappfunctions; - - function module($name,$icon = null) - { - $this->name = $name; - $this->icon = $icon; - $this->lappfunctions = array(); - $this->rappfunctions = array(); - } - - function add_lapp_function($label,$link="",$access=1) - { - $appfunction = new app_function($label,$link,$access); - //array_push($this->lappfunctions,$appfunction); - $this->lappfunctions[] = $appfunction; - return $appfunction; - } - - function add_rapp_function($label,$link="",$access=1) - { - $appfunction = new app_function($label,$link,$access); - //array_push($this->rappfunctions,$appfunction); - $this->rappfunctions[] = $appfunction; - return $appfunction; - } - - - } - - class application - { - var $id; - var $name; - var $modules; - var $enabled; - - function application($id, $name, $enabled=true) - { - $this->id = $id; - $this->name = $name; - $this->enables = $enabled; - $this->modules = array(); - } - - function add_module($name, $icon = null) - { - $module = new module($name,$icon); - //array_push($this->modules,$module); - $this->modules[] = $module; - return $module; - } - - function add_lapp_function($level, $label,$link="",$access=1) - { - $this->modules[$level]->lappfunctions[] = new app_function($label, $link, $access); - } - - function add_rapp_function($level, $label,$link="",$access=1) - { - $this->modules[$level]->rappfunctions[] = new app_function($label, $link, $access); - } - } - - -?> \ No newline at end of file +. +***********************************************************************/ + +define('MENU_ENTRY', 'menu_entry'); +define('MENU_TRANSACTION', 'menu_transaction'); +define('MENU_INQUIRY', 'menu_inquiry'); +define('MENU_REPORT', 'menu_report'); +define('MENU_MAINTENANCE', 'menu_maintenance'); +define('MENU_UPDATE', 'menu_update'); +define('MENU_SETTINGS', 'menu_settings'); +define('MENU_SYSTEM', 'menu_system'); + + class menu_item + { + var $label; + var $link; + + function __construct($label, $link) + { + $this->label = $label; + $this->link = $link; + } + } + + class menu + { + var $title; + var $items; + + function __construct($title) + { + $this->title = $title; + $this->items = array(); + } + + function add_item($label, $link) + { + $item = new menu_item($label,$link); + array_push($this->items,$item); + return $item; + } + + } + + class app_function + { + var $label; + var $link; + var $access; + var $category; + + function __construct($label,$link,$access='SA_OPEN',$category='') + { + $this->label = $label; + $this->link = $link; + $this->access = $access; + $this->category = $category; + } + } + + class module + { + var $name; + var $icon; + var $lappfunctions; + var $rappfunctions; + + function __construct($name,$icon = null) + { + $this->name = $name; + $this->icon = $icon; + $this->lappfunctions = array(); + $this->rappfunctions = array(); + } + + function add_lapp_function($label,$link="",$access='SA_OPEN',$category='') + { + $appfunction = new app_function($label,$link,$access,$category); + $this->lappfunctions[] = $appfunction; + return $appfunction; + } + + function add_rapp_function($label,$link="",$access='SA_OPEN',$category='') + { + $appfunction = new app_function($label,$link,$access,$category); + $this->rappfunctions[] = $appfunction; + return $appfunction; + } + + + } + + class application + { + var $id; + var $name; + var $help_context; + var $modules; + var $enabled; + + function __construct($id, $name, $enabled=true) + { + $this->id = $id; + $this->name = $name; + $this->enabled = $enabled; + $this->modules = array(); + } + + function add_module($name, $icon = null) + { + $module = new module($name,$icon); + $this->modules[] = $module; + return $module; + } + + function add_lapp_function($level, $label,$link="",$access='SA_OPEN',$category='') + { + $this->modules[$level]->lappfunctions[] = new app_function($label, $link, $access, $category); + } + + function add_rapp_function($level, $label,$link="",$access='SA_OPEN',$category='') + { + $this->modules[$level]->rappfunctions[] = new app_function($label, $link, $access, $category); + } + + function add_extensions() + { + hook_invoke_all('install_options', $this); + } + // + // Helper returning link to report class added by extension module. + // + function report_class_url($class) + { + return "reporting/reports_main.php?Class=".$class; + } + } + +