The "Template" software addon is designed to be a part of the ochin_web project.
This template was made to help develop new applications. It also has the purpose of defining a base line for the development of addons, in order to maintain the coherence between the pages as much as possible..
Each Addon is embedded in ochin_web but is self-contained. Except for the topbar and some general libraries (jquery and bootstrap) which are part of the main framework, the addon contains everything it needs (specific libraries, databases, images etc ..)
This addon shows an example table. By means of the "+" button located at the top right of the same, it is possible to add a new empty row to the table.
On the right side of each row there are two buttons: "Edit" and "Delete".
With the first button it is possible to insert and modify the data of the row, while with the second button it is possible to delete the entire row.
All the data inserted in the table are written inside a sqlite3 database. It is created the first time the addon is started in the "db" subfolder. The table is updated at each page refresh requesting all the data from the database.
info.html
index.php
icons
helper
SQLiteConstructor.php
init.php
Config.php
db
emptyTemplate.db
css
loader.css
Is the file in which this guide is contained.
It is the file by which the Addon manager is able to correctly load the Addon within the Framework. It is an XML file and it contains the following fields:
<install> <addon name = 'Template'> (the name of the addon)
<en> true </en> (enable addon by default)
<topbarpos> Application </topbarpos> (the position in the topbar)
<foldername> template </foldername> (the name of the folder, should be the same as the .zip)
<description> addon template <description> (a short description)
</addon>
</install>
It is the file that contains the main page of the addon. It is a .php file but it contains the HTML of the page, the Javascript to manage the client-side automation and the call to some PHP functions for database management.
It is the folder that contains the icons used by the Addon.
It is the folder that contains the helper files.
It is the file that contains all the PHP code to manage the database. It contains the functions to create a new db, insert new tuples, edit their content, delete them etc ...
It contains the initialization of the SQLiteConstructor class and includes the files necessary for the functioning of the Addon.
Contains the paths to the folders used by the Addon.
Contains style sheets. In this example, only the loader.css file is contained, which is used to display the "loader" when waiting for the page.