UserPage
Overview
The UserPage
extension adds sections to the User Management view.
Properties
The following extension properties are available. For more information, please refer to the Extension Property documentation.
Property | Value |
Extension Scope | Module: Users |
Extension Directory | ./custom/Extension/modules/Users/Ext/UserPage/ |
Compiled Extension File | ./custom/Users/Ext/UserPage/userpage.ext.php |
Manifest Installdef | $installdefs['user_page'] |
Implementation
The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System
When working directly with the filesystem, you can create a file in ./custom/Extension/modules/Users/Ext/UserPage/
to add custom elements to the User page. The following example will add a custom table to the Users module's detail view:
./custom/Extension/modules/Users/Ext/UserPage/<file>.php
<?php
$HTML=<<<HTML
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<tbody>
<tr height="20">
<th scope="col" width="15%">
<slot>Header</slot>
</th>
</tr>
<tr height="20" class="oddListRowS1">
<td scope="row" valign="top">
Content
</td>
</tr>
</tbody>
</table>
HTML;
echo $HTML;
Navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules/Users/Ext/UserPage/userpage.ext.php
Module Loadable Package
When building a module loadable package, you can use the $installdefs['user_page']
index to install the extension file.
Installdef Properties
Name | Type | Description |
from | String | The base path of the file to be installed |
The example below demonstrates the proper install definition that should be used in the ./manifest.php
file in order to add the UserPage file to the system. When using this approach, Sugar will automatically execute Rebuild Extensions to reflect the changes to the User view in the system.
./manifest.php
<?php
$manifest = array(
...
);
$installdefs = array(
'id' => 'userPage_Example',
'user_page' => array(
array(
'from' => '<basepath>/Files/custom/Extension/modules/Users/Ext/UserPage/<file>.php',
)
)
);
Alternatively, you may use the $installdefs['copy']
index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy']
index and module-loadable packages, please refer to the Introduction to the Manifest page.