From: Joe Hunt Date: Tue, 20 Jan 2009 15:31:32 +0000 (+0000) Subject: Preparing for installing of extensions X-Git-Tag: v2.4.2~19^2~1602 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=324fd5303def6848f9f276596d417786b08377c3;hp=e1c22a904052bae141ace1ebdaaf2b81d9111139;p=fa-stable.git Preparing for installing of extensions --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b3f80b9f..41a55000 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,11 @@ Legend: ! -> Note $ -> Affected files +20-Jan-2009 Joe Hunt +! Preparing for installing of extensions +$ installed_extensions.php (new file) + frontaccounting.php + 19-Jan-2009 Joe Hunt ! Changed direct sales document line descriptions to be editable (via edit link) $ /sales/sales_order_entry.php diff --git a/frontaccounting.php b/frontaccounting.php index 6f3ad333..ccbc5755 100644 --- a/frontaccounting.php +++ b/frontaccounting.php @@ -1,4 +1,14 @@ . +***********************************************************************/ include_once('applications/application.php'); include_once('applications/customers.php'); include_once('applications/suppliers.php'); @@ -7,6 +17,7 @@ include_once('applications/dimensions.php'); include_once('applications/generalledger.php'); include_once('applications/setup.php'); + include_once('installed_extensions.php'); $path_to_root="."; include_once($path_to_root . "/includes/session.inc"); @@ -54,7 +65,8 @@ $rend->wa_footer(); } function init() - { + { + global $installed_extensions, $applications; $this->menu = new menu(_("Main Menu")); $this->menu->add_item(_("Main Menu"), "index.php"); $this->menu->add_item(_("Logout"), "/account/access/logout.php"); @@ -65,6 +77,20 @@ $this->add_application(new manufacturing_app()); $this->add_application(new dimensions_app()); $this->add_application(new general_ledger_app()); + if (count($installed_extensions) > 0) + { + foreach ($installed_extensions as $ext) + { + $s = $applications['system']; + array_pop($applications); + $applications[$ext['name']] = $ext['title'];; + $applications['system'] = $s; + include_once("applications/".$ext['app_file']); + $class = $ext['name']."_app"; + $this->add_application(new $class()); + } + } + $this->add_application(new setup_app()); } } diff --git a/installed_extensions.php b/installed_extensions.php new file mode 100644 index 00000000..ccf6daa5 --- /dev/null +++ b/installed_extensions.php @@ -0,0 +1,21 @@ + ') +-- 'app_file' is the application file name to be put into folder applications +-- 'name' is the name of the extension module. Will become the index of the application +-- 'title' is the Menu Title +-- 'folder' is the folder where the extension files exist + +*/ + +$installed_extensions = array (); + +/* example +$installed_extensions = array ( + 0 => array ('app_file' => 'organizer.php', 'name' => 'organizer', 'title' => 'Organizer', 'folder' => 'organizer') + array ('app_file' => 'payroll.php', 'name' => 'payroll', 'title' => 'Payroll', 'folder' => 'payroll') + ); +*/ +?> \ No newline at end of file