From 56ac75c659f3ee07ca9d585146cf258ebd6cdd77 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 19 Mar 2003 17:04:08 +0000 Subject: [PATCH] changed $GLOBALS['setup_info'] to $setup_info (it gets included within a function in setup) remove step 2) as db-tools now show uninstalled apps to create tables for --- etemplate/doc/etemplate.html | 53 ++++++++++++++---------------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/etemplate/doc/etemplate.html b/etemplate/doc/etemplate.html index b498636127..cb9f933dfb 100644 --- a/etemplate/doc/etemplate.html +++ b/etemplate/doc/etemplate.html @@ -63,40 +63,29 @@ et_media that has to be identical to our app-name + images here goes our images / icons -

2. registering the app manualy

-

To be able to see the app in the navbar and call it we need to do the following steps (later this can be done via setup)

-
    -
  1. login to phpgw as an admin -
  2. call the admin app (the first icon with the tower) -
  3. start Admin/Applications -
  4. click on Add -
  5. type in 'et_media' for the app-name and eg. 'eT-Media' for the titel, leave the rest alone and hit Add -
  6. start Admin/User accounts and enable the new app for your account -
- -

3. creating et_media/setup/setup.inc.php

+

2. creating et_media/setup/setup.inc.php

That files contains the necessary information for setup to install the app.

 <?php
-	$GLOBALS['setup_info']['et_media']['name']      = 'et_media';
-	$GLOBALS['setup_info']['et_media']['title']     = 'eT-Media';
-	$GLOBALS['setup_info']['et_media']['version']   = '0.9.15.001';
-	$GLOBALS['setup_info']['et_media']['app_order'] = 100;		// at the end
-	$GLOBALS['setup_info']['et_media']['tables']    = array('phpgw_et_media');
-	$GLOBALS['setup_info']['et_media']['enable']    = 1;
+	$setup_info['et_media']['name']      = 'et_media';
+	$setup_info['et_media']['title']     = 'eT-Media';
+	$setup_info['et_media']['version']   = '0.9.15.001';
+	$setup_info['et_media']['app_order'] = 100;		// at the end
+	$setup_info['et_media']['tables']    = array('phpgw_et_media');
+	$setup_info['et_media']['enable']    = 1;
 
 	/* Dependencies for this app to work */
-	$GLOBALS['setup_info']['et_media']['depends'][] = array(
+	setup_info['et_media']['depends'][] = array(
 		 'appname' => 'phpgwapi',
 		 'versions' => Array('0.9.13','0.9.14','0.9.15')
 	);
-	$GLOBALS['setup_info']['et_media']['depends'][] = array(	// this is only necessary as long the etemplate-class is not in the api
+	$setup_info['et_media']['depends'][] = array(	// this is only necessary as long the etemplate-class is not in the api
 		 'appname' => 'etemplate',
 		 'versions' => Array('0.9.13','0.9.14','0.9.15')
 	);
 
-

4. setting up the db-table with the db_tools and setup

+

3. setting up the db-table with the db_tools and setup

To enable setup to create a db-table for us and to supply the so_sql-class with the necessary information, we need to define the type and size of the fields / columns in our db-table.
We can use the db-Tools from the etemplate app to create the file for us:

@@ -110,14 +99,12 @@ We can use the db-Tools from the etemplate app to create the file for us:

  • now use [Add Column] to create the necessary fields as shown on the screenshot
  • Click on [Write Table] (If you get the error-message like in the screenshot, you need to give the webserver write-permission to the setup-dir of et_media, leave the write-permission as it is necessary later on too, click on write again) -
  • log out and log into setup again and start manage applications -
  • eT-Media is shown now as installed but need upgrade, don't select upgrade, check remove and submit -
  • the next page should tell you everythings allright so click on go back (or if u use konqueror reload) -
  • now for eT-Media only install is offerd, check it and submit -
  • you can now log out of setup, out db-table is now created +
  • log out and log into setup and start manage applications +
  • eT-Media is shown as not installed and only install is offerd, check it and submit +
  • you can now log out from setup, the db-table is now created -

    5. creating an eTemplates for the edit-dialog

    +

    4. creating an eTemplates for the edit-dialog

    Now we need a nice edit dialog and use the eTemplate editor to set it up:

    @@ -133,7 +120,7 @@ We can use the db-Tools from the etemplate app to create the file for us:

    As you see above i added an application titel, a horizontal rule after it and some space (empty label's). Do so if you want.

    -

    6. setting up the index page

    +

    5. setting up the index page

    The index page is only used if someone clicks on the navbar icon (or on the black cross as we haven't supplied one so far).
    Create the file /et_media/index.php with the following content:

    @@ -151,7 +138,7 @@ Create the file /et_media/index.php with the following content:

    exit; -

    7. the code of class.et_media.inc.php

    +

    6. the code of class.et_media.inc.php

    As a first step, we only save new entries. The code of the app is in /et_media/inc/class.et_media.inc.php:

    @@ -321,7 +308,7 @@ with the content the user put into the fields of the dialog.

    Now we are able to store entries in the db and retrive them by searching the database for patterns in the different fields.
    We are only lacking some way to show if we get more than one match on a search, that's what we are going to implement next:

    -

    8. adding a list-dialog for the search-function

    +

    7. adding a list-dialog for the search-function

    First we need to create an other eTemplate to show the list: 'et_media.show'

    @@ -438,7 +425,7 @@ We are only lacking some way to show if we get more than one match on a search,

    Of course we have to add this buttons to the template 'et_media.edit'. I trust you can add 2 Submitbuttons with the names 'cancel' and 'delete', a Label and a nice helpmessages by now without looking at a screenshot ;-).

    -

    9. creating the english lang-file

    +

    8. creating the english lang-file

    To get rid of the stars '*' behind each Label and to be able to translate the app in other languages we need to create a lang-file
    There are 2 possibilties to create it automaticaly:

      @@ -465,13 +452,13 @@ There are 2 possibilties to create it automaticaly:

      }
    -

    10. dumping the eTemplate to a file for distribution

    +

    9. dumping the eTemplate to a file for distribution

    To be able to put the eTemplates in CVS and to ship them with your app, you need to dump them in a file first.

    This is done in the eTemplate editor by putting the app-name or an template-name in the Name field and clicking on the button [Dump4Setup]. This creates the file et_media/setup/etemplates.inc.php. The etemplate-class loads this file whenever it finds a new version automaticaly.

    -

    11. further information

    +

    10. further information

    1. the referenz-documentation of the eTemplates
    2. for all functions and parameters of the etemplate-class look in the comments (yes there are comments) of the files: