Skip to content
Joey edited this page Jan 18, 2014 · 9 revisions

Address any complaints, suggestions, fixes or vitriol to xisi @ freenode / #mpos or thanks :)

Last updated: Jan 16th, 2014

This guide is not intended to be documentation; this is a simple overview developers can reference for common tasks and learning the layout of MPOS.

This is written towards developers with a solid understanding of basic php/html/sql and a little smarty/css/js for good measure. If that does not describe you, proceed with caution.

This guide covers

  • Adding a static page
  • Adding a config option (file)
  • Version incrementing

Adding a static page

There are 2 components you'll need to add for a new static page:

  • Template - A smarty template for the page

  • public/templates/mpos/type/[type]/default.tpl

  • Page - A php controller for the page

  • public/include/pages/[type]/page.inc.php

If you need to add or change any functionality, you'll need to edit the related class files in:

  • public/include/classes

Adding a config option (file)

You'll have to add at least 1 thing, possibly 2:

  • Config option - The config option in your global.inc.php and in global.inc.dist.php

  • public/include/config/global.inc.php

  • public/include/config/global.inc.dist.php

  • Smarty Globals - If you need to access the config option in a template, you need to add it to the smarty globals

  • public/include/smarty_globals.inc.php

Version incrementing

If your update is ready to be pulled, there's a few things you need to check first:

  • If you inserted any new rows into the default tables or modified/added tables, you must update SQL version

  • If you added any config options into the dist config, you must update config version

  • DB Version

  • DB Version - If you updated the db, update DB_VERSION in public/include/version.inc.php

  • Update SQL - Create 0XY_whatever_update.sql and update/insert any changes needed to fix existing installs

  • DB Insert SQL - DB_VERSION = '0.X.Y' in 000_base_structure.sql

    • Check the 000_base_structure.sql to see how this works
  • DB Update SQL - DB_VERSION = '0.X.Y' in your 0XY_whatever_update.sql

    • Check an existing 0XY_whatever_update.sql to see how this works
  • Config Version

    • Config Version - if you updated the config, update CONFIG_VERSION in public/include/version.inc.php
Clone this wiki locally