Hi,
EDIT:
Sorry... I've read addon but understood applet...
I suggest to solve this like that:
Define addon_label method in Common file:
public static function addon_label() {
if ( check group here or anything else )
return array('label' => __('Addon Label 1'), 'show' => true);
if (Utils_RecordBrowserCommon::get_access('task','browse')) // sample code from Tasks
return array('label' => __('Addon Label 2'), 'show' => true);
return array('show' => false); // no applet
}
Then in Main module file:
public function addon( parameters ) {
$label = YourModuleCommon::addon_label();
if (!$label['show']) return;
switch ($label['label']) {
case __('Addon Label 1'):
return $this->addon_type1( parameters );
case __('Addon Label 2'):
return $this->addon_type2( parameters );
}
And finally installation file
Utils_RecordBrowserCommon::new_addon('recordset_name', 'Custom/YourModule', 'addon', array('Custom_YourModuleCommon','addon_label'));
Then create private addon methods methods: addon_type1, addon_type2.
Regards,
Adam