|--hello
|--inc | |--functions.inc.php |--templates | |--default | | |--hello_form.tpl | | |--hello_result.tpl |--index.php |
Create the hello, inc, templates and default directory. We will write the files in the next section.
<?php
/**************************************************************************\ * functions.inc.php for phpGroupWare - Hello World example * http://www.phpgroupware.org * This file has been written by J-F Declercq <jef@jfdeclercq.com> * http://www.jfdeclercq.com * -------------------------------------------- * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. \**************************************************************************/ /***************************************************************************\
|
<!-- hello_form.tpl
template -->
<p>Type Here your text to hello()</p> <form method="post" action="{hello_action}"> <input type="text" name="input" value= "{hello_value}" > <input type="submit" value="OK"> </form> |
This template looks like this :
Type Here your text to hello()
|
The hello_result.tpl template allows you to display the parameter and the result of the hello() function.
<!-- hello_result.tpl
-->
hello({hello_input})={hello_result} <hr> |
hello({hello_input})={hello_result}
|
You have to put these .tpl files in the /templates/default/ directory.
<?php
/**************************************************************************\ * index.php for phpGroupWare - Hello World example * * http://www.phpgroupware.org * * This file written by J-F Declercq <jef@jfdeclercq.com> * * http://www.jfdeclercq.com * * -------------------------------------------- * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ /***************************************************************************\
|
insert into phpgw_applications (app_name, app_title, app_enabled) values ('hello', 'Hello World for phpGroupware', 1); |
"These guidelines must be followed for any application that wants considered for inclusion into phpGroupWare deluxe"
It must run on PHP3 and PHP4. | OK - I think it's ok (?) I'm not a king of php and I use PHP4. |
SQL statements must be compatible with both MySQL and PostgreSQL. | OK - No SQL statement so far |
It must use our default header.inc.php include. | OK - cfr index.php |
It must use our $phpgw_link($url) for all links (this is for session support). | OK - cfr hello_form.tpl |
It must use ``post'' for forms. | OK - cfr hello_form.tpl |
It must respect phpGW group rights and phpGW user permissions. | KO - We didn't check that particular aspect. --> TODO |
It must use our directory structure, template support and lang (multi-language) support. | KO - we didn't use the language aspects --> TODO |
Where possible it should run on both Unix and NT platforms. | OK ? - Only tested on NT |
hello isn't a phpGroupware deluxe application... The next evolution of hello will be to add a group right and a multi-language feature. See what's next.
phpGroupWare offers very interesting features for people wanting to write 100% web-based applications :