Added the feature that loads the company global values when creating a new component, if they are set.
This commit is contained in:
@ -407,7 +407,20 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
|
||||
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Only load these values if no id is found
|
||||
if (0 == $id)
|
||||
{
|
||||
// get components global params
|
||||
$params = JComponentHelper::getParams('com_componentbuilder');
|
||||
// set company defaults
|
||||
$form->setValue('companyname', null, $params->get('export_company', ''));
|
||||
$form->setValue('author', null, $params->get('export_owner', ''));
|
||||
$form->setValue('email', null, $params->get('export_email', ''));
|
||||
$form->setValue('website', null, $params->get('export_website', ''));
|
||||
$form->setValue('copyright', null, $params->get('export_copyright', 'Copyright (C) 2015. All Rights Reserved'));
|
||||
$form->setValue('license', null, $params->get('export_license', 'GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html'));
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user