| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html lang="en"><head> |
| 3 | |
| 4 | |
| 5 | |
| 6 | <meta content="text/html; charset=ISO-8859-15" http-equiv="content-type"><title>Tools</title> |
| 7 | |
| 8 | <link rel="stylesheet" type="text/css" href="style/layout.css"> |
| 9 | <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"></head><body> |
| 10 | <h1 style="text-align: center;">Tools<br> |
| 11 | </h1> |
| 12 | |
| 13 | LAM includes a "Tools" page which contains various tools like the |
| 14 | profile editor or the file upload. The content of this page is dynamic. |
| 15 | LAM includes all *.inc files in the directory lib/tools. Each found |
| 16 | class which implements the LAMtool interface is a candidate for this |
| 17 | page. The different tools are displayed and ordered based on their |
| 18 | security level and ordering preferences.<br> |
| 19 | <br> |
| 20 | <span style="font-weight: bold;">Example:</span><br> |
| 21 | <br> |
| 22 | The profile editor implements the LAMtool interface.<br> |
| 23 | <br> |
| 24 | |
| 25 | <div class="mod-code"> |
| 26 | * Profile editor<br> |
| 27 | * <br> |
| 28 | * @package tools<br> |
| 29 | */ <br> |
| 30 | class <span style="font-weight: bold;">toolProfileEditor</span> implements <span style="font-weight: bold;">LAMTool</span> {<br> |
| 31 | <br> |
| 32 | /**<br> |
| 33 | * Returns the name of the tool.<br> |
| 34 | * <br> |
| 35 | * @return string name<br> |
| 36 | */<br> |
| 37 | function <span style="font-weight: bold;">getName</span>() {<br> |
| 38 | return _("Profile editor");<br> |
| 39 | }<br> |
| 40 | <br> |
| 41 | /**<br> |
| 42 | * returns a description text for the tool.<br> |
| 43 | * <br> |
| 44 | * @return string description<br> |
| 45 | */<br> |
| 46 | function <span style="font-weight: bold;">getDescription</span>() {<br> |
| 47 | return _("Here you can manage your account profiles.");<br> |
| 48 | }<br> |
| 49 | <br> |
| 50 | /**<br> |
| 51 | * Returns a link to the tool page (relative to templates/).<br> |
| 52 | * <br> |
| 53 | * @return string link<br> |
| 54 | */<br> |
| 55 | function <span style="font-weight: bold;">getLink</span>() {<br> |
| 56 | return "profedit/profilemain.php";<br> |
| 57 | }<br> |
| 58 | <br> |
| 59 | /** <br> |
| 60 | * Returns if the tool requires write access to LDAP.<br> |
| 61 | * <br> |
| 62 | * @return boolean true if write access is needed<br> |
| 63 | */<br> |
| 64 | function <span style="font-weight: bold;">getRequiresWriteAccess</span>() {<br> |
| 65 | return true;<br> |
| 66 | }<br> |
| 67 | <br> |
| 68 | /**<br> |
| 69 | * Returns if the tool requires password change rights.<br> |
| 70 | * <br> |
| 71 | * @return boolean true if password change rights are needed<br> |
| 72 | */<br> |
| 73 | function <span style="font-weight: bold;">getRequiresPasswordChangeRights</span>() {<br> |
| 74 | return true;<br> |
| 75 | }<br> |
| 76 | <br> |
| 77 | /**<br> |
| 78 | * Returns the link to the tool image (relative to graphics/)<br> |
| 79 | *<br> |
| 80 | * @return string image URL<br> |
| 81 | */<br> |
| 82 | function <span style="font-weight: bold;">getImageLink</span>() {<br> |
| 83 | return 'edit.png';<br> |
| 84 | }<br> |
| 85 | <br> |
| 86 | /**<br> |
| 87 | * Returns the preferred position of this tool on the tools page.<br> |
| 88 | * The position may be between 0 and 1000. 0 is the top position.<br> |
| 89 | *<br> |
| 90 | * @return int preferred position<br> |
| 91 | */<br> |
| 92 | function <span style="font-weight: bold;">getPosition</span>() {<br> |
| 93 | return 100;<br> |
| 94 | }<br> |
| 95 | <br> |
| 96 | }<br> |
| 97 | </div> |
| 98 | <br> |
| 99 | <br> |
| 100 | <br> |
| 101 | |
| 102 | </body></html> |