Updated CodeCorner1 (markdown)

leithoff 2016-05-31 16:51:09 +02:00
parent 8071894ab7
commit 55be49adb7

@ -1,18 +1,19 @@
> [Wiki](Home) ▸ [Developer Docs](Developer Docs) ▸ [Code Corner](Code Corner) ▸ **day one** ▸ [day two](CodeCorner2)
***
On our first day, we had do do some of the stuff of day zero - the "how to get started" stuff - to be up to date. We went through the setup of the eGroupware Application, which is described ((AdminDocs|elsewhere)).
On our first day, we had do do some of the stuff of day zero - the "how to get started" stuff - to be up to date.
And we went through the setup of the EGroupware Application, which is described elsewhere.
As first application we decided to do: Hello World
The motivation for this was to learn the very basics of: what does an eGroupware application need.
The motivation for this was to learn the very basics of: what does an EGroupware application need.
Every application needs an application directory within the egroupware tree.
Every application needs an application directory within the EGroupware tree.
Consider <code>[droyws]</code> the document root of your web-server.
Then <code>[droyws]/Egroupware</code> is the root of your eGroupware-application.
Then <code>[droyws]/egroupware</code> is the root of your EGroupware-application.
Your own Application, we will baptise it <code>test</code>, for obvious reasons needs a folder "test" just there:
<code>[droyws]/Egroupware/test</code>
<code>[droyws]/egroupware/test</code>
Within <code>test</code> the following structure is needed, for eGroupware to recognize our new application:
Within <code>test</code> the following structure is needed, for EGroupware to recognize our new application:
***
```bash
/index.php
@ -28,8 +29,8 @@ Within <code>test</code> the following structure is needed, for eGroupware to re
***
Obviously ```inc```, ```setup```, ```templates```, ```templates/default``` and ```templates/default/images``` are folders.
After suplying the structure, you have to register the application with eGroupware.
This is done via the setup area within eGroupware (via the egw/setup/ URL).
After suplying the structure, you have to register the application with EGroupware.
This is done via the setup area within EGroupware (via the egw/setup/ URL).
But you need the (required) file ```setup.inc.php``` in folder ```$app/setup```.
```$app/setup/setup.inc.php``` should contain the information to setup your application.
***
@ -62,7 +63,7 @@ But you need the (required) file ```setup.inc.php``` in folder ```$app/setup```.
);
```
***
Within the setup area you go to manage Applications (Setup Main Menu) check the name of your application (the name of the folder within the eGroupwaretree, where your Application is going to reside) and click install.
Within the setup area you go to manage Applications (Setup Main Menu) check the name of your application (the name of the folder within the EGroupwaretree, where your Application is going to reside) and click install.
***
Or you can do it via directly accessing the mySQL database:
```php
@ -72,7 +73,7 @@ Or you can do it via directly accessing the mySQL database:
_**Apply sufficient rights, ...**_
After adding the entry there you have to allow yourself or your group the access to the newly registered application.
You do that by using the admin/preferences module, choosing Usergroups/Useraccounts , choosing a User or a ::Group and checking the newly registered application.
After logoff/logon you should be able to access the new application via eGroupware.
After logoff/logon you should be able to access the new application via EGroupware.
You will get an error - for sure. Since there is no suitable index.php within the new application subtree.
_**... and some code to the file index.php and off you go.**_
@ -81,7 +82,7 @@ The content of test/index.php should include:
```php
<?php
/*
prepare some application information for eGroupware to know
prepare some application information for EGroupware to know
If the applicationname of your application (e.g.: test) and the value of
currentapp does not match, you will recieve an authentication error
*/
@ -92,7 +93,7 @@ $GLOBALS['egw_info'] = array('flags' => array(
'nonavbar' => False,
));
/*
include THE eGroupware header, that takes care of the sessionhandling
include THE EGroupware header, that takes care of the sessionhandling
and the other background stuff
the information provided above is used/required here in order to get the application running
*/
@ -113,14 +114,14 @@ unset($userinfo['apps']);//the users effective / available apps
unset($userinfo['passwd']);//effective password for you. we dont want to show it here
_debug_array($userinfo);
//display the eGroupware footer
//display the EGroupware footer
common::egw_footer();
```
***
We provided only the starting ```<?php``` tag, to avoid problems with trailing blanks after the closing tag.
You have now created your first application within eGroupware.
You have now created your first application within EGroupware.
Unleash the ```_debug_array($GLOBALS['egw_info'])``` and you will get info thrown at you, that you did not really want to have in the first place. A lot.
```_debug_array($userinfo)``` informs you about your loginid your sessionid and so on (after we stripped some of the info, that may or may not confuse you at this time).
***
@ -158,6 +159,6 @@ Array
)
```
***
If you loose your sessionid you loose connection to eGroupware, or to put it straight: eGroupware throws you out.
If you loose your sessionid you loose connection to EGroupware, or to put it straight: EGroupware throws you out.
> [Wiki](Home) ▸ [Developer Docs](Developer Docs) ▸ [Code Corner](Code Corner) ▸ **day one** ▸ [the refining of the first days work](CodeCorner2)