Added custom getOptions back after the fix of the field area

This commit is contained in:
Llewellyn van der Merwe 2018-04-13 22:11:35 +02:00
parent a0890ea87f
commit 3002e093de
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
4 changed files with 32 additions and 4 deletions

View File

@ -130,7 +130,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.7.3
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **182266**
+ *Line count*: **182294**
+ *Field count*: **1012**
+ *File count*: **1199**
+ *Folder count*: **193**

View File

@ -130,7 +130,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.7.3
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **182266**
+ *Line count*: **182294**
+ *Field count*: **1012**
+ *File count*: **1199**
+ *Folder count*: **193**

View File

@ -49,6 +49,20 @@ class JFormFieldAdminviewfolderlist extends JFormFieldList
*/
public function getOptions()
{
return null;
// get custom folder files
$localfolder = JPATH_COMPONENT_ADMINISTRATOR.'/views';
// set the default
$options = array();
// import all needed classes
jimport('joomla.filesystem.folder');
// now check if there are files in the folder
if (JFolder::exists($localfolder) && $folders = JFolder::folders($localfolder))
{
foreach ($folders as $folder)
{
$options[] = JHtml::_('select.option', $folder, ComponentbuilderHelper::safeString($folder, 'W'));
}
}
return $options;
}
}

View File

@ -49,6 +49,20 @@ class JFormFieldSiteviewfolderlist extends JFormFieldList
*/
public function getOptions()
{
return null;
// get custom folder files
$localfolder = JPATH_COMPONENT_SITE.'/views';
// set the default
$options = array();
// import all needed classes
jimport('joomla.filesystem.folder');
// now check if there are files in the folder
if (JFolder::exists($localfolder) && $folders = JFolder::folders($localfolder))
{
foreach ($folders as $folder)
{
$options[] = JHtml::_('select.option', $folder, ComponentbuilderHelper::safeString($folder, 'W'));
}
}
return $options;
}
}