| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <title>Type HowTo - Basic concepts</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>Type HowTo - Basic concepts<br> |
| 11 | </h1> |
| 12 | <br> |
| 13 | <br> |
| 14 | <div style="text-align: left;"><br> |
| 15 | <h2>1. Licensing</h2> |
| 16 | LAM is licensed under the <a href="https://www.gnu.org/licenses/gpl.txt">GNU |
| 17 | General Public License</a>. This means your plugins need a compatible |
| 18 | license.<br> |
| 19 | LAM is distributed with a copy of the GPL license.<br> |
| 20 | <br> |
| 21 | <br> |
| 22 | <h2>2. Naming and position in directory structure</h2> |
| 23 | Type names are usually named after the group of accounts they manage. |
| 24 | However, you can use any name you want, it should be short and |
| 25 | containing only a-z and 0-9. The type name is only shown in the |
| 26 | configuration dialog, on all other pages LAM will show a provided <span |
| 27 | style="font-style: italic;">alias</span> name.<br> |
| 28 | All type modules are stored in <span style="font-weight: bold;">lib/types</span>. |
| 29 | The filename must end with <span style="font-weight: bold;">.inc</span> |
| 30 | and the file must have the same name as its inside class.<br> |
| 31 | <br> |
| 32 | <span style="font-weight: bold; text-decoration: underline;">Example:</span> |
| 33 | Our example module will provide the <span style="font-weight: bold;">class |
| 34 | </span><span style="font-style: italic; font-weight: bold;">smbDomain</span>, |
| 35 | therefore the file will be called <span style="font-weight: bold;">lib/types/</span><span |
| 36 | style="font-style: italic; font-weight: bold;">smbDomain.inc</span>.<span |
| 37 | style="font-style: italic;"></span><br> |
| 38 | <br> |
| 39 | <br> |
| 40 | <h2>3. Defining the class</h2> |
| 41 | All type classes have <span style="font-weight: bold;">baseType</span> |
| 42 | as parent class. This provides common functionality and dummy functions |
| 43 | for all required class functions.<br> |
| 44 | <br> |
| 45 | <span style="font-weight: bold;">Example:</span><br> |
| 46 | <br> |
| 47 | <div class="mod-code"> |
| 48 | * The account type for Samba domains.<br> |
| 49 | *<br> |
| 50 | * @package types<br> |
| 51 | */<span style="font-weight: bold;"><br> |
| 52 | class</span> <span style="color: rgb(255, 0, 0);">smbDomain</span><span |
| 53 | style="font-style: italic;"> extends </span><span |
| 54 | style="font-weight: bold;">baseType</span> {<br> |
| 55 | <br> |
| 56 | }<br> |
| 57 | </div> |
| 58 | <br> |
| 59 | <br> |
| 60 | </div> |
| 61 | </div> |
| 62 | </body> |
| 63 | </html> |