Zurmo Module Configurations via Global Metadata
Global metadata properties can be found in Modules, Models, and Views. They are used to define configuration options related to a particular class.
Use the getDefaultMetadata() function to define the metadata properties.
The main purpose of the metadata Module is for menu generation, but the metadata can be used for other purposes, such as searches.
Below is the metadata configuration on the Accounts module and a description of the metadata properties.
public static function getDefaultMetadata()
{
$metadata = array();
$metadata['global'] = array(
'designerMenuItems' => array(
'showFieldsLink' => true,
'showGeneralLink' => true,
'showLayoutsLink' => true,
'showMenusLink' => true,
),
'globalSearchAttributeNames' => array(
'name',
'anyEmail',
'officePhone',
),
'tabMenuItems' => array(
array(
'label' => 'AccountsModulePluralLabel',
'url' => array('/accounts/default'),
'right' => self::RIGHT_ACCESS_ACCOUNTS,
'items' => array(
array(
'label' => 'Create AccountsModuleSingularLabel',
'url' => array('/accounts/default/create'),
'right' => self::RIGHT_CREATE_ACCOUNTS
),
array(
'label' => 'AccountsModulePluralLabel',
'url' => array('/accounts/default'),
'right' => self::RIGHT_ACCESS_ACCOUNTS
),
),
),
)
);
return $metadata;
}
designerMenuItems defines options related to the designer module (ie. which menu/sections are available).
globalSearchAttributeNames defines global search fields that will be used in this module to filter results, when somebody searches the system using the header search form.
tabMenuItems is used to configure the main menu.
There are few more available options, such as:
configureMenuItems is used to configure links in the admin area (ie. to set up roles).
headerMenuItems is used to configure the top menu (Profile, About, Logout and other links).
tabMenuItemsModuleOrdering defines the order of links in main/tab menu.