phpwcms - Suche (Google)
Module creation guide
A guide to create your own Module in phpwcms
A small sortout of hints how to create an own module with PHP
List of needed files / At least List
- include/inc_module/my_module/frontent.render.php
- include/inc_module/my_module/backend.default.php
- include/inc_module/my_module/lang/de.lang.php
- include/inc_module/my_module/lang/en.lang.php
Where are we playing:
The work in principal:
phpwcms reads from the module directory which is located in /include/inc_module/
The Module Menue Entries
they are fixed in : (each language for itself)
/include/inc_module/mymodule/lang/de.lang.php
/include/inc_module/mymodule/lang/en.lang.php
where the var is:
$BLM['backend_menu'] = 'My_module';
Module Settings are fixed in:
module.default.php:
// Module/Plug-in Glossary
// register module name
//DO NOT USE SPECIAL CHARS HERE, NO WHITE SPACES, USE LOWER CASE!!!
$_module_name = 'my_module';
// module type - defines where used
// 0 = BE and FE, 1 = BE only, 2 = FE only
$_module_type = 0;
// Set if it should be listed as content part
// has content part: true or false
$_module_contentpart = true;
// simple switch to allow fe render or fe init
$_module_fe_render = true;
$_module_fe_init = false;
$_module_fe_search = true;
...
self explaining
Frontend related Operations
will be done in frontend.render.php via a pipe {} - Stystem exactliy the same as in the so called frontend-render directory.
Example for repalcing code will follow in here.
Second way: replacing via template system
Make shure :
All your code is redered via the system (as default) so "echo" and print orders are out of the website Template, but textvars given back to the system via $content['all'] are rendered correctly.
fronten.init.php
watchdo System, needs some more explanation
Backend Triple, the same as in contentparts
1.) backend.listing.php
The Module "glossary" is a good example on how this is needed to be used, to get things into the system in a secure way and order.
No extra Temoplatin active, combinations of php and html are possible
2.) backend.editform.php
this used to define how entries are to edit.
Last advice
All things will be easily resolved, when reproduced from a running module !
(January 2009) to be extended soon
Have fun and no guarantee :)
Juergen