DEVELOPER'S GUIDE
- Requirements
- Directories
- Coding standards
- Add new options in the menu
- Add new links in the header
- Add new tabs in the administration interface
Requirements
If you modify POSH, do not forget to submit your changes to give us chance to improve the POSH tool to the community. For that, contact us on http://www.portaneo.net
Directories
Directories usages :
- admin : PHP pages and scripts that manage the admin interface
- cache : XML caches of the application informations (modules, categories, ...)
- images : All the pictures used in the application (except modules' ones)
- includes : All the javascript files and PHP includes
- l10n : Language files
- modules : modules used in the application
- cache : rss modules caches
- external : pictures and scripts used by modules
- pictures : icons of the modules
- quarantine : temporary folder used by tutorial for users module creation
- portal : PHP pages and scripts php that manage the main pages
- styles : All the css files of the application
- tools : Tools used by the application (rss parser, ...)
- tutorial : PHP pages and scripts that manage the tutorial
Coding standards
All the PHP pages must call includes/session.inc.php and previously define the variables $not_access (1 : the user must be connected to open this page, 0 : the user is not connected) et $granted ("A": grant access only for admin users, "I": grant access only for connected POSH users).
To access the database, use the class "connection" of the file includes/connection.inc.php.
You can add new javascript / php functions through plug-ins. See "test" plug-ins as an example.
Add new links in the header
To add new links in the portals header (next to "connection link") :
- Modify the "headlinks" parameter of the "adm_config" table, by adding new link just like the existing ones (fct: function called (type link(\"your_link\") for an hyperlink), label: name displayed, img:pictures of the link, comment:text displayed on mouseover, anonymous: is the option available on the homepage?, connected: is the option available on the personal portals). Links are sorted the same way in "adm_config" and in the portals.
- From admin interface, Submit the "general settings" to re-generate the includes/config.js. file
Add new tabs in the administration interface
- Create your PHP files in the admin/ folder
- Add the new tabs in the "adm_tabs" table :
name : tab id
label : tab title
type : type 4
param : name of the PHP file that opens when we click on the tab
And don't forget to become a POSH contributor by sending us your developments !