<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Type HowTo - Basic concepts</title> <link rel="stylesheet" type="text/css" href="style/layout.css"> <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"> </head> <body> <div style="text-align: center;"> <h1>Type HowTo - Basic concepts<br> </h1> <br> <br> <div style="text-align: left;"><br> <h2>1. Licensing</h2> LAM is licensed under the <a href="http://www.gnu.org/licenses/gpl.txt">GNU General Public License</a>. This means your plugins need a compatible license.<br> LAM is distributed with a copy of the GPL license.<br> <br> <br> <h2>2. Naming and position in directory structure</h2> Type names are usually named after the group of accounts they manage. However, you can use any name you want, it should be short and containing only a-z and 0-9. The type name is only shown in the configuration dialog, on all other pages LAM will show a provided <span style="font-style: italic;">alias</span> name.<br> All type modules are stored in <span style="font-weight: bold;">lib/types</span>. The filename must end with <span style="font-weight: bold;">.inc</span> and the file must have the same name as its inside class.<br> <br> <span style="font-weight: bold; text-decoration: underline;">Example:</span> Our example module will provide the <span style="font-weight: bold;">class </span><span style="font-style: italic; font-weight: bold;">smbDomain</span>, therefore the file will be called <span style="font-weight: bold;">lib/types/</span><span style="font-style: italic; font-weight: bold;">smbDomain.inc</span>.<span style="font-style: italic;"></span><br> <br> <br> <h2>3. Defining the class</h2> All type classes have <span style="font-weight: bold;">baseType</span> as parent class. This provides common functionality and dummy functions for all required class functions.<br> <br> <span style="font-weight: bold;">Example:</span><br> <br> <table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;">/**<br> * The account type for Samba domains.<br> *<br> * @package types<br> */<span style="font-weight: bold;"><br> class</span> <span style="color: rgb(255, 0, 0);">smbDomain</span><span style="font-style: italic;"> extends </span><span style="font-weight: bold;">baseType</span> {<br> <br> }<br> </td> </tr> </tbody> </table> <br> <br> <h2><span style="font-weight: bold;"></span></h2> </div> </div> </body> </html>