simpleinvoices/simpleinvoices — pull request #4 by soif (2012-11-26 15:40:33+00:00)
Title: Feature/easy customize

This PR aims to make life easier for anyone wanting to easily customize SimpleInvoice to their own needs (Website Integration, adding new features...).

It avoid the user to have to touch any of the default templates or modules provided by SimpleInvoices, while he stays relatively free to customize anything. Resisting to SimpleInvoice future updates is certainly its most notable feature.

There are the two approaches that I've coded:

1) Hooks: For basic needs like adding a Header/Footer, some CSS and menus.

By editing the custom/hooks.tlp template file, you can plug some HTML code bits at strategic places like :
- HEAD section (ie to add custom CSS or JS headers)
- Start and End of BODY (ie to add a Custom Header and Footer with logo)
- In the Top and Tabs menu (ie to add some custom navigation)
(I might certainly add a couple of other places : maybe in Filters and/or buttons bars)

This is totally Update proof!

2) Override System : To customize any template or module..

Creating a template in /custom/default_template/ or creating a module in /custom/modules/ will automatically override their factory version (originally in /templates/default/ and /modules/)

This is easily update-able by a simple diff between the overridden and the overriding version of the existing custom files; It may be even simpler if the overriding files do "require()" their overridden files.

--------
I've also added:
- a new HTML Title to each page (using $module and $view) , using new (not mandatory) $LANG.title_module_name variables.
- a class attribute to the BODY tag (using $module and $view) to be able to easily catch any page from a CSS declaration.

--------

All those changes does not modify the way SI currently works and while keeping code modification really simples, they should be certainly appreciated by anyone who want to integrate SI in his own website, without fearing next SI updates.

So I hope you will like it and merge. :-)

BTW If you want me to move some function elsewhere, change naming conventions, remove or change some features, please just ask.