From fb8d08fbf81ff928b80fed42ebba3cb49c62ae6f Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 8 Dec 2007 11:07:23 +0000 Subject: [PATCH] added icon --- lam/docs/devel/mod_general.htm | 124 +++++++++++++++++++-------------- 1 file changed, 73 insertions(+), 51 deletions(-) diff --git a/lam/docs/devel/mod_general.htm b/lam/docs/devel/mod_general.htm index a3d71b4b..3eeb9ea4 100644 --- a/lam/docs/devel/mod_general.htm +++ b/lam/docs/devel/mod_general.htm @@ -1,10 +1,9 @@ - - - Module HowTo - General module options - - - +Module HowTo - General module options + + + +

Module HowTo - General module options

@@ -13,21 +12,18 @@

1. Account types

-LAM currently provides three account types: users, groups, hosts
+LAM currently provides three account types: users, groups, hosts
A module can manage one or more account types.

The types are specified with can_manage() or meta['account_types'].

-Example:
+Example:

Our ieee802Device module will be used only for host accounts.

- +
@@ -54,15 +49,13 @@ get_metaData() {

2. Base modules

In LDAP every entry needs exactly one structural -object class. Therefore all modules which provide a structural object class are marked +object class. Therefore all modules which provide a structural object class are marked as base module.

This is done with is_base_module() or meta['is_base'].

-Example:
+Example:

The inetOrgPerson module manages the structural object class "inetOrgPerson" and @@ -70,8 +63,7 @@ therefore is a base module.
If your module is not a base module you can skip the meta data for this, default is false.

-
    /**
@@ -41,8 +37,7 @@ get_metaData() {
        $return = array();
        // manages host accounts
    -    $return["account_types"] = array("host");
+    $return["account_types"] = array("host");
        return $return;
    }
+
@@ -96,9 +87,7 @@ get_metaData() {


3. Alias name

-The module name is very limited, therefore every module has an alias name. This alias name has no limitations and +The module name is very limited, therefore every module has an alias name. This alias name has no limitations and can be translated. It may contain special characters but make sure that it does not contain HTML special characters like "<".
The alias name can be the @@ -109,14 +98,12 @@ The alias name is specified with get_alias() or meta['alias'].

-Example:
+Example:

Our ieee802Device module will get the alias MAC address.

-
    /**
@@ -85,8 +77,7 @@ get_metaData() {
        $return = array();
        // base module
    -    $return["is_base"] = true;
+    $return["is_base"] = true;
        return $return;
    }
+
@@ -148,15 +134,13 @@ module are not structural.
The dependencies are specified with get_dependencies() or meta['dependencies'].

-Example:
+Example:

Our ieee802Device module depends on the account module (because it is the only structural module at this time).

-
    /**
@@ -130,8 +117,7 @@ get_metaData() {
        $return = array();
         // alias name
    -    $return["alias"] = _("MAC address");
+    $return["alias"] = _("MAC address");
        return $return;
    }
+
@@ -185,29 +168,25 @@ array('account'), 'conflicts' => array());
-The baseModule offers the $messages variable for this. It +The baseModule offers the $messages variable for this. It should be filled by a function called load_Messages().
The baseModule will automatically check if you have implemented this function and call it at construction time.

-Example:
+Example:

Now let our ieee802Device module define a message.

-
    /**
@@ -171,8 +155,7 @@ get_metaData() {
         // module dependencies
        $return['dependencies'] = array('depends' => -array('account'), 'conflicts' => array());
+array('account'), 'conflicts' => array());
        return $return;
    }
+
    /**
    * This function fills the error message array with messages
    */
-    function load_Messages() {
+    function load_Messages() {
        $this->messages['mac'][0] = array('ERROR', 'MAC address is invalid!');  // third array value is set dynamically
@@ -231,8 +210,7 @@ smbldap-tools) also create accounts and the spelling is differnt.
The ieee802Device module manages one object class.

- +
    /**
@@ -271,8 +249,7 @@ the "cn" attribute. This attribute is also known under the alias This way the module will never see attributes called "commonName" because LAM renames them as soon as the LDAP entry is loaded.

- +
    /**
@@ -300,5 +277,50 @@ get_metaData() {

- - +

8. Icon
+

+You can specify a icon for you module. It will be displayed on the +account pages and other module specific places (e.g. file upload).
+The icons must be 32x32 pixels in size. The location is relative to the graphics directory.
+ +
+ +Example:
+ +
+ +The posixGroup module uses the "tux.png" from the graphics directory.
+ +
+ + + + + + + + +
    /**
+    * Returns meta data that is interpreted by parent +class
+    *
+    * @return array array with meta data
+    */
+    function +get_metaData() {
+        $return = array();
        // icon
+        $return['icon'] = 'tux.png';
+        return $return;
+    }
+
+ +
+ +
+ + +

+ + + + \ No newline at end of file