From 56ac75c659f3ee07ca9d585146cf258ebd6cdd77 Mon Sep 17 00:00:00 2001
From: Ralf Becker 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) That files contains the necessary information for setup to install the app. 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.2. registering the app manualy
-
-
-
-3. creating et_media/setup/setup.inc.php
+2. creating et_media/setup/setup.inc.php
<?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
We can use the db-Tools from the etemplate app to create the file for us:
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.
-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:
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: }
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.
-