Let the platform do the work

WirelessLayoutdefs

Overview

The WirelessLayoutdefs extension adds additional subpanels to wireless views. This extension is only applicable to modules running in backward compatibility mode.

Properties

The following extension properties are available. For more information, please refer to the Extension Property documentation.

Property Value
Extension Scope Module
Sugar Variable $layout_defs
Extension Directory ./custom/Extension/modules/<module>/Ext/WirelessLayoutdefs/
Compiled Extension File ./custom/<module>/Ext/WirelessLayoutdefs/wireless.subpaneldefs.ext.php
Manifest Installdef $installdefs['wireless_subpanels']

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/<module>/Ext/WirelessLayoutdefs/ to add a subpanel to a module in the system. The following example will add a new subpanel to a specified module:

./custom/Extension/modules/<module>/Ext/WirelessLayoutdefs/<file>.php

<?php

$layout_defs['<module>']['subpanel_setup']['<subpanel module>'] = array(
    'order' => 10,
    'module' => '<subpanel module>',
    'get_subpanel_data' => '<subpanel name>',
    'title_key' => 'LBL_SUBPANEL_TITLE',
);

Navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules/<module>/Ext/WirelessLayoutdefs/wireless.subpaneldefs.ext.php.

Module Loadable Package

When building a module loadable package, you can use the $installdefs['wireless_subpanels'] index to install the extension file.

Installdef Properties

Name Type Description
from String The base path of the file to be installed
to_module String The key for the module where the file will be installed

The example below will demonstrate the proper install definition that should be used in the ./manifest.php file in order to add the subpanel file to a specific module. You should note that when using this approach Sugar will automatically execute Rebuild Extensions to reflect the subpanel in the system.

./manifest.php

<?php

$manifest = array(
    ...
);

$installdefs = array(
    'id' => 'wirelessLayoutdefs_Example',
    'wireless_subpanels' => array(
        array(
            'from' => '<basepath>/Files/custom/Extension/modules/<module>/Ext/WirelessLayoutdefs/<file>.php',
            'to_module' => '<module>',
        )
    )
);

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.

Topics