Other possible adaptations

Some files will check if a corresponding file exists in local and then load that overriding the class defined in standard. This allows you to fine tune some behaviour or add more actions. We'll add a list here in the manual with everything that can be overwritten in that way.

validateclass... And postprocessclass...

You can add validation and post processing in these two kinds of classes, to do so create a file called validateclass_tablename.php and/or postprocessclass_tablename.php.share/fieldhandlersShowList.phphp

Starting with validateclass, these exists to give you a chance to check the data before it's inserted into the database. This is done through a class inside the file called LocalValidator_tablename that inherits from either Validator or an existing class for that table.

You have access to two function, $this->getNewValues() and $this->getOldValues() to have something to work with. To update an new value you call the function $this->setValue(column,newvalue) If you want to send a message to whoever is working on your table you can use $this->setMessage(text) to have that text shown. This is used when you refuse an update to say why it was refused.

You can add the functions checkContent() that should return 1 if it's OK and 0 (zero) if you don't approve the action to the table. checkContent is mostly useful to modify the data according to some rules before it's later saved.

The other functions you can add, isUpdateOk(), isDeleteOk() and isInsertOk() can be used to prevent a certain action to take place. There is one very important rule when writing validation code, you must not issue and statements to the database that changes it's content. The validation code can be called without there being any intention of doing a later update, if you change the database that change will remain even if the change you checked doesn't go through. To alter the database, you should instead use the post processing.

postprocessclass_tablename.php is loaded and used after an update, delete or insert takes place. This is similar to how triggers work in the database. Once you have created the file, write the class Postprocessor_tablename extends Postprocessor in it. You can of course also inherit from an existing postprocessor class if you want to keep the default behaviour and just add to it.share/fieldhandlersShowList.phphp

The function you create here is process($type), where $type can be insert, update, or delete. In this class you also have access to the getNewValues() and getOldValues() methods to have something to work with. If the table you're working with has an auto_increment primary key that value will be set if $type is insert. After the insert you have free reign on changing the database. It's the whole purpose of this class. Keep in mind that if you doUpdate on the same table you can get an infinite recursion going on. Beware of that.

heartbeat_ and info_

In the heartbeat/ directory are a few files called info_<name>.php these should contain a class info_<name> with a function called getContent that returns a html string that will fit into the banner space in TwoSpot.

The backend server will look for files named info_ and randomly execute this to serve interesting information to the user of the system.