Cleanup in files that is not php
[racktables] / plugins / README
CommitLineData
dd14756b
AA
1Put your custom RackTables add-ons into this folder.
2
3Old local.php file is the sample of such add-ons and should be put here
4to continue working.
5
6Files should be named with .php extension to be loaded automatically.
7Files are loaded in alphabetical order.
8
9It is recommended to override existing tabhandlers and ophandlers using
10registerTabHandler and registerOpHandler functions, respectively.
f1dfa768 11This is preferred over overwriting of items in $tabhandler and $ophandler,
dd14756b
AA
12because allows overriding the same tab or operation in multiple plugins.
13
14Consider the following sample:
15
16<?php
17
18registerTabHandler ('object', 'default', 'renderObject_add_FQDN_waring');
19
20function renderObject_add_FQDN_waring ($object_id)
21{
22 $object = spotEntity ('object', $object_id);
23 $attrs = getAttrValues ($object_id);
24 $fqdn = @$attrs[3]['value'];
25 if
26 (
27 considerGivenConstraint ($object, '{server} and not {offline}') &&
28 $fqdn == ''
29 )
30 showWarning ("Please set FQDN for this server");
31}
32
33?>