| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <title>Module HowTo - Help entries</title> |
| 5 | <link rel="stylesheet" type="text/css" href="style/layout.css"> |
| 6 | <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"> |
| 7 | </head> |
| 8 | <body> |
| 9 | <div style="text-align: center;"> |
| 10 | <h1>Module HowTo - Help entries<br> |
| 11 | </h1> |
| 12 | <br> |
| 13 | <br> |
| 14 | <div style="text-align: left;"><br> |
| 15 | <h2>1. Defining help entries<br> |
| 16 | </h2> |
| 17 | Your module should provide help for all input fields and other |
| 18 | important things.<br> |
| 19 | The LAM help system defines an extra ID range for each module. So you |
| 20 | are free in defining your own IDs.<br> |
| 21 | <br> |
| 22 | The help entries are specified with <span style="font-weight: bold;">get_help()</span> |
| 23 | or <span style="font-weight: bold;">meta['help']</span>.<br> |
| 24 | <br> |
| 25 | <span style="font-weight: bold; text-decoration: underline;">Example:</span><br |
| 26 | style="font-weight: bold; text-decoration: underline;"> |
| 27 | <br> |
| 28 | The <span style="font-style: italic;">ieee802Device</span> |
| 29 | module needs help entries for the MAC address.<br> |
| 30 | <br> |
| 31 | <div class="mod-code"> |
| 32 | * Returns meta data that is interpreted by parent |
| 33 | class<br> |
| 34 | *<br> |
| 35 | * @return array array with meta data<br> |
| 36 | */<br> |
| 37 | <span style="font-weight: bold;">function</span> |
| 38 | get_metaData() {<br> |
| 39 | $return = array();<br> |
| 40 | <span style="color: rgb(255, 0, 0);"> |
| 41 | // help Entries</span><br |
| 42 | style="color: rgb(255, 0, 0);"> |
| 43 | <span style="color: rgb(255, 0, 0);"> |
| 44 | $return['help'] = array(</span><br |
| 45 | style="color: rgb(255, 0, 0);"> |
| 46 | <span style="color: rgb(255, 0, 0);"> |
| 47 | 'mac' => array(</span><br |
| 48 | style="color: rgb(255, 0, 0);"> |
| 49 | <span style="color: rgb(255, 0, 0);"> |
| 50 | "Headline" |
| 51 | => _("MAC address"),</span><br style="color: rgb(255, 0, 0);"> |
| 52 | <span style="color: rgb(255, 0, 0);"> |
| 53 | "Text" => |
| 54 | _("This is the MAC address of the network card of the device (e.g. |
| 55 | 00:01:02:DE:EF:18).")</span><br style="color: rgb(255, 0, 0);"> |
| 56 | <span style="color: rgb(255, 0, 0);"> |
| 57 | ),</span><br |
| 58 | style="color: rgb(255, 0, 0);"> |
| 59 | <span style="color: rgb(255, 0, 0);"> |
| 60 | 'macList' => array(</span><br |
| 61 | style="color: rgb(255, 0, 0);"> |
| 62 | <span style="color: rgb(255, 0, 0);"> |
| 63 | "Headline" |
| 64 | => _("MAC address list"),</span><br style="color: rgb(255, 0, 0);"> |
| 65 | <span style="color: rgb(255, 0, 0);"> |
| 66 | "Text" => |
| 67 | _("This is a comma separated list of MAC addresses.")</span><br |
| 68 | style="color: rgb(255, 0, 0);"> |
| 69 | <span style="color: rgb(255, 0, 0);"> |
| 70 | ));</span><br |
| 71 | style="color: rgb(255, 0, 0);"> |
| 72 | return $return;<br> |
| 73 | }<br> |
| 74 | </div> |
| 75 | <br> |
| 76 | <br> |
| 77 | </div> |
| 78 | </div> |
| 79 | </body> |
| 80 | </html> |