Added the feature that loads the company global values when creating a new component, if they are set.

This commit is contained in:
Llewellyn van der Merwe 2019-05-16 01:07:38 +02:00
parent 8e79417664
commit 42d5b3b55c
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
3 changed files with 16 additions and 3 deletions

View File

@ -150,7 +150,7 @@ TODO
+ *Version*: 2.9.18
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **206374**
+ *Line count*: **206387**
+ *Field count*: **1136**
+ *File count*: **1344**
+ *Folder count*: **209**

View File

@ -150,7 +150,7 @@ TODO
+ *Version*: 2.9.18
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **206374**
+ *Line count*: **206387**
+ *Field count*: **1136**
+ *File count*: **1344**
+ *Folder count*: **209**

View File

@ -408,6 +408,19 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
}
}
// 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;
}