Rev 362 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
387 | daniel-mar | 1 | |
2 | FEATURE OIDS |
||
3 | ============ |
||
4 | |||
5 | PHP classes belonging to the OIDplus system (such as the class handling the tree menu structure, |
||
6 | the sitemap, the AJAX handling, etc) are communicating to plugins the "normal way", i.e. |
||
7 | the plugin class defines a function which is called by the OIDplus system. |
||
8 | |||
9 | Plugins can offer interfaces/functionalities that can be used by other plugins. |
||
10 | For Example: The OOBE plugin queries other plugins if they want to be included |
||
11 | in the Out-Of-Box-Experience configuration. Therefore the plugins need to implement an |
||
12 | "oobeEntry" function. However, if we would do it the normal way (the OOBE plugin defining |
||
13 | a PHP interface and the other plugins implementing it), the plugins would not work |
||
14 | anymore if the plugin offering the interface is missing, due to a PHP compilation error. |
||
15 | Therefore, we use a functionality called "features". |
||
16 | A plugin can ask another plugin if it supports a feature (defined as OID) using |
||
17 | the function OIDplusPlugin::implementsFeature(). |
||
18 | If it supports the feature with a given OID, the plugin promises that it |
||
19 | contains a set of functions defined by that OID. |
||
20 | |||
21 | Currently, there are following features defined in the standard plugins of OIDplus: |
||
22 | |||
23 | Interface <1.3.6.1.4.1.37476.2.5.2.3.1> { |
||
24 | // called by plugin adminPages/050_oobe |
||
25 | public function oobeEntry($step, $do_edits, &$errors_happened): void; |
||
26 | public function oobeRequested(): bool; |
||
27 | } |
||
28 | |||
29 | Interface <1.3.6.1.4.1.37476.2.5.2.3.2> { |
||
30 | // called by plugin publicPages/000_objects (gui) |
||
31 | public function modifyContent($id, &$title, &$icon, &$text); |
||
32 | } |
||
33 | |||
34 | Interface <1.3.6.1.4.1.37476.2.5.2.3.3> { |
||
35 | // called by plugin publicPages/000_objects (ajax) |
||
36 | public function beforeObjectDelete($id); |
||
37 | public function afterObjectDelete($id); |
||
38 | public function beforeObjectUpdateSuperior($id, &$params); |
||
39 | public function afterObjectUpdateSuperior($id, &$params); |
||
40 | public function beforeObjectUpdateSelf($id, &$params); |
||
41 | public function afterObjectUpdateSelf($id, &$params); |
||
42 | public function beforeObjectInsert($id, &$params); |
||
43 | public function afterObjectInsert($id, &$params); |
||
44 | } |
||
45 | |||
46 | Interface <1.3.6.1.4.1.37476.2.5.2.3.4> { |
||
47 | // called by plugin publicPages/100_whois |
||
48 | public function whoisObjectAttributes($id, &$out); |
||
49 | public function whoisRaAttributes($email, &$out); |
||
50 | } |
||
51 | |||
52 | |||
53 | TL;DR: |
||
54 | Plugins communicate with other plugins using the OIDplusPlugin::implementsFeature() |
||
55 | function, which provide a way of "optional" interfaces. |