Table of Contents Previous Next

Sugar Developer Guide

Version 5.1


Chapter 4 Customizing Sugar : Module Loader : Sample Manifest

Sample Manifest
The following sample manifest file defines the $manifest and $installdef array elements for a new module (Songs) which depends on two other modules: "Whale Pod" and "Maps". In addition to defining the $manifest and $installdef array elements it also defines the $upgrade_manifest array.
<?php
$manifest = array(
'acceptable_sugar_versions' => array(),
'is_uninstallable' => true,
'name' => 'Song Module',
'description' => 'A Module for all your song needs',
'author' => 'Ajay',
'published_date' => '2005/08/11',
'version' => '2.0',
'type' => 'module',
'icon' => '',
'dependencies' => array (
array ('id_name' => 'whale_pod', 'version => '1.0'),
array ('id_name' => 'maps', 'version => '1.5'),
),
);
$installdefs = array (
'id' => 'songs',
'image_dir' => '<basepath>/images',
'copy' => array (
array (
'from' => '<basepath>/module/Songs',
'to' => 'modules/Songs',
),
),
'language' => array (
'from'=> '<basepath>/administration/en_us.songsadmin.php'
'to_module'=> 'application',
'language'=>'en_us'
),
array (
'from'=> '<basepath>/administration/en_us.songsadmin.php',
'to_module'=> 'Administration',
'language'=>'en_us'
),
),
'layoutdefs'=> array(
array(
'from'=> '<basepath>/layoutdefs/contacts_layout_defs.php',
'to_module'=> 'Contacts',
),
),
'vardefs'=> array(
array(
'from'=> '<basepath>/vardefs/contacts_vardefs.php',
'to_module'=> 'Contacts',
),
),
'administration'=> array (
array ( 'from'=>'<basepath>/administration/songsadminoption.php', ),
),
),
'beans'=> array (
array (
'module'=> 'Songs',
'class'=> 'Song',
'path'=> 'modules/Songs/Song.php',
'tab'=> true,
)
),
'relationships'=>array (
array (
'module'=> 'Contacts',
'meta_data'=>'<basepath>/relationships/contacts_songsMetaData.php',
'module_vardefs'=>'<basepath>/vardefs/contacts_vardefs.php',
'module_layoutdefs'=>'<basepath>/layoutdefs/contactslayout_defs.php'
),
array (
'module'=> 'Products',
'meta_data'=>'<basepath>/relationships/products_songsMetaData.php',
'module_vardefs'=>'<basepath>/vardefs/products_vardefs.php',
'module_layoutdefs'=>'<basepath>/layoutdefs/productslayout_defs.php'
)
),
'custom_fields'=>array (
'array (
'name'=> 'music_name',
'label'=>'Music Name',
'type'=>'varchar',
'max_size'=>255,
 
'require_option'=>'optional',
'default_value'=>' ',
'ext1' => 'name',
'ext2' => 'Accounts',
'ext3' => ' ',
'audited'=>0,
'module'=>'Songs',
)
),
);
array (
'name'=>'label_company',
'label'=>'Label',
'type'=>'relate',
'max_size'=>36,
'require_option'=>'optional',
'default_value'=>'',
'ext1'=>'name',
'ext2'=>'Accounts',
'ext3'=>'', 'audited'=>0,
'module'=>'Songs',
)
),
);
 
$upgrade_manifest = array (
'upgrade_paths' => array (
'1.0' => array(
'id'=>'songs',
'copy'=>array(
array (
'from'=> '<basepath>/module/Songs',
'to'=> 'modules/Songs',
),
),
),
'1.5' => array (
'id'=>'songs',
'copy' => array(
array (
'from'=> '<basepath>/module/Songs',
'to'=> 'modules/Songs',
),
),
),
),
);
?>

Table of Contents Previous Next

Copyright 2004-2008 SugarCRM Inc.
Product License