Preparing for installing of extensions
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 20 Jan 2009 15:31:32 +0000 (15:31 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 20 Jan 2009 15:31:32 +0000 (15:31 +0000)
CHANGELOG.txt
frontaccounting.php
installed_extensions.php [new file with mode: 0644]

index b3f80b9f268664f1f0e7a747e2ffc759af597975..41a55000255369d0537f21b46cef724c580b01d0 100644 (file)
@@ -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
index 6f3ad3335bd5786fbf0e07ec9db99d6d97912f3e..ccbc5755c9499db332ea8c4e989eb51b29832e39 100644 (file)
@@ -1,4 +1,14 @@
 <?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
        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");
                        $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 (file)
index 0000000..ccf6daa
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+/* How to make new entries here
+
+-- if adding extensions at the beginning of the list, make sure it's index is set to 0 (it has ' 0 => ')
+-- '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