diff --git a/README.md b/README.md
index 99086cb7a..2056d59e5 100644
--- a/README.md
+++ b/README.md
@@ -144,11 +144,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
-+ *Last Build*: 24th November, 2020
++ *Last Build*: 28th November, 2020
+ *Version*: 2.11.7
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **283833**
++ *Line count*: **284181**
+ *Field count*: **1537**
+ *File count*: **1799**
+ *Folder count*: **304**
diff --git a/admin/README.txt b/admin/README.txt
index 99086cb7a..2056d59e5 100644
--- a/admin/README.txt
+++ b/admin/README.txt
@@ -144,11 +144,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
-+ *Last Build*: 24th November, 2020
++ *Last Build*: 28th November, 2020
+ *Version*: 2.11.7
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **283833**
++ *Line count*: **284181**
+ *Field count*: **1537**
+ *File count*: **1799**
+ *Folder count*: **304**
diff --git a/admin/compiler/joomla_3/JViewLegacy_list.php b/admin/compiler/joomla_3/JViewLegacy_list.php
index 0f819adde..be06c75cb 100644
--- a/admin/compiler/joomla_3/JViewLegacy_list.php
+++ b/admin/compiler/joomla_3/JViewLegacy_list.php
@@ -139,40 +139,7 @@ class ###Component###View###Views### extends JViewLegacy
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_###component###');
- }
-
- if ($this->canState)
- {
- JHtmlSidebar::addFilter(
- JText::_('JOPTION_SELECT_PUBLISHED'),
- 'filter_published',
- JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
- );
- // only load if batch allowed
- if ($this->canBatch)
- {
- JHtmlBatch_::addListSelection(
- JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_STATE'),
- 'batch[published]',
- JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
- );
- }
- }
-
- JHtmlSidebar::addFilter(
- JText::_('JOPTION_SELECT_ACCESS'),
- 'filter_access',
- JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
- );
-
- if ($this->canBatch && $this->canCreate && $this->canEdit)
- {
- JHtmlBatch_::addListSelection(
- JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_ACCESS'),
- 'batch[access]',
- JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
- );
- }###CATEGORYFILTER######OTHERFILTERS###
+ }###FILTERFIELDDISPLAYHELPER######BATCHDISPLAYHELPER###
}
/**
diff --git a/admin/compiler/joomla_3/default.php b/admin/compiler/joomla_3/default.php
index b93d04e3f..b4b20e500 100644
--- a/admin/compiler/joomla_3/default.php
+++ b/admin/compiler/joomla_3/default.php
@@ -17,12 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED###
-// load tooltip behavior
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.multiselect');
-JHtml::_('dropdown.init');
-JHtml::_('formbehavior.chosen', 'select');
-
+###ADMIN_VIEWS_HEADER###
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_###component###&task=###views###.saveOrderAjax&tmpl=component';
diff --git a/admin/compiler/joomla_3/default_custom_admin.php b/admin/compiler/joomla_3/default_custom_admin.php
index d3c514504..c8aa64812 100644
--- a/admin/compiler/joomla_3/default_custom_admin.php
+++ b/admin/compiler/joomla_3/default_custom_admin.php
@@ -15,13 +15,9 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_CODE_BODY###
+defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
-JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.formvalidation');
-JHtml::_('formbehavior.chosen', 'select');
-JHtml::_('behavior.keepalive');
+###CUSTOM_ADMIN_VIEW_HEADER######CUSTOM_ADMIN_CODE_BODY###
?>
canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
item->id)) ? '&id='. (int) $this->item->id : ''; ?>
diff --git a/admin/compiler/joomla_3/default_list_custom_admin.php b/admin/compiler/joomla_3/default_list_custom_admin.php
index 038a79cba..a2a73271c 100644
--- a/admin/compiler/joomla_3/default_list_custom_admin.php
+++ b/admin/compiler/joomla_3/default_list_custom_admin.php
@@ -15,13 +15,9 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_CODE_BODY###
+defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
-JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.formvalidation');
-JHtml::_('formbehavior.chosen', 'select');
-JHtml::_('behavior.keepalive');
+###CUSTOM_ADMIN_VIEWS_HEADER######CUSTOM_ADMIN_CODE_BODY###
?>
canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM###
diff --git a/admin/compiler/joomla_3/default_list_site.php b/admin/compiler/joomla_3/default_list_site.php
index 758f184c3..f3d2191fc 100644
--- a/admin/compiler/joomla_3/default_list_site.php
+++ b/admin/compiler/joomla_3/default_list_site.php
@@ -15,7 +15,8 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_CODE_BODY###
+defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
+###SITE_VIEWS_HEADER######SITE_CODE_BODY###
?>
###SITE_TOP_FORM######SITE_TOP_BUTTON######SITE_BODY######SITE_BOTTOM_BUTTON######SITE_BOTTOM_FORM###
diff --git a/admin/compiler/joomla_3/default_site.php b/admin/compiler/joomla_3/default_site.php
index 758f184c3..8d0338477 100644
--- a/admin/compiler/joomla_3/default_site.php
+++ b/admin/compiler/joomla_3/default_site.php
@@ -15,7 +15,8 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_CODE_BODY###
+defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
+###SITE_VIEW_HEADER######SITE_CODE_BODY###
?>
###SITE_TOP_FORM######SITE_TOP_BUTTON######SITE_BODY######SITE_BOTTOM_BUTTON######SITE_BOTTOM_FORM###
diff --git a/admin/compiler/joomla_3/edit.php b/admin/compiler/joomla_3/edit.php
index 8e87bf81a..ed1e7f0f5 100644
--- a/admin/compiler/joomla_3/edit.php
+++ b/admin/compiler/joomla_3/edit.php
@@ -17,11 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.formvalidation');
-JHtml::_('formbehavior.chosen', 'select');
-JHtml::_('behavior.keepalive');
+###ADMIN_VIEW_HEADER###
$componentParams = $this->params; // will be removed just use $this->params instead
?>
###EDITBODYFADEIN###
diff --git a/admin/compiler/joomla_3/edit_site.php b/admin/compiler/joomla_3/edit_site.php
index 17f2e9277..c8c04e44e 100644
--- a/admin/compiler/joomla_3/edit_site.php
+++ b/admin/compiler/joomla_3/edit_site.php
@@ -17,13 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.formvalidation');
-JHtml::_('formbehavior.chosen', 'select');
-JHtml::_('behavior.keepalive');
-JHtml::_('behavior.tabstate');
-JHtml::_('behavior.calendar');
+###SITE_ADMIN__VIEW_HEADER###
?>
toolbar->render(); ?>
diff --git a/admin/compiler/joomla_3/filter_forms.xml b/admin/compiler/joomla_3/filter_forms.xml
new file mode 100644
index 000000000..c1a539eff
--- /dev/null
+++ b/admin/compiler/joomla_3/filter_forms.xml
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/admin/compiler/joomla_3/settings.json b/admin/compiler/joomla_3/settings.json
index 748bc7e17..13321c9f9 100644
--- a/admin/compiler/joomla_3/settings.json
+++ b/admin/compiler/joomla_3/settings.json
@@ -269,6 +269,11 @@
"rename": false,
"type": "dashboard"
},
+ "filter_forms.xml": {
+ "path": "c0mp0n3nt/admin/models/forms",
+ "rename": "filter_forms",
+ "type": "filter"
+ },
"module_forms.xml": {
"path": "c0mp0n3nt/admin/models/forms",
"rename": "module_forms",
diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php
index f7c1aa12c..7cdec4777 100644
--- a/admin/helpers/compiler/a_Get.php
+++ b/admin/helpers/compiler/a_Get.php
@@ -829,7 +829,8 @@ class Get
if (isset($config) && count($config))
{
// we do not yet have this set as an option
- $config['remove_line_breaks'] = 2; // 2 is global (use the components value)
+ $config['remove_line_breaks']
+ = 2; // 2 is global (use the components value)
// load application
$this->app = JFactory::getApplication();
// Set the params
@@ -908,13 +909,15 @@ class Get
$this->componentContext = $this->componentCodeName . '.'
. $this->componentID;
// set if language strings line breaks should be removed
- $global = ((int) ComponentbuilderHelper::getVar(
+ $global = ((int) ComponentbuilderHelper::getVar(
'joomla_component', $this->componentID, 'id',
'remove_line_breaks'
) == 1) ? true : false;
- $this->removeLineBreaks = ((int) $config['remove_line_breaks'] == 0)
+ $this->removeLineBreaks = ((int) $config['remove_line_breaks']
+ == 0)
? false
- : (((int) $config['remove_line_breaks'] == 1) ? true : $global);
+ : (((int) $config['remove_line_breaks'] == 1) ? true
+ : $global);
// set if placeholders should be added to customcode
$global = ((int) ComponentbuilderHelper::getVar(
'joomla_component', $this->componentID, 'id',
@@ -1510,15 +1513,18 @@ class Get
$array['view']
);
// set the filter option for this view
- $this->adminFilterType[$array['settings']->name_list_code] = 1; // Side (old) [default for now]
+ $this->adminFilterType[$array['settings']->name_list_code]
+ = 1; // Side (old) [default for now]
if (isset($array['filter'])
&& is_numeric(
$array['filter']
)
&& $array['filter'] > 0)
{
- $this->adminFilterType[$array['settings']->name_list_code] = (int) $array['filter'];
+ $this->adminFilterType[$array['settings']->name_list_code]
+ = (int) $array['filter'];
}
+
return $array;
}, array_values($component->addadmin_views)
);
@@ -2099,14 +2105,16 @@ class Get
}
elseif (!isset($this->langContent[$target][$language]))
{
- $this->langContent[$target][$language] = $this->fixLangString($string);
+ $this->langContent[$target][$language] = $this->fixLangString(
+ $string
+ );
}
}
/**
* We need to remove all text breaks from all language strings
*
- * @param string $string The language string
+ * @param string $string The language string
*
* @return string
*
@@ -2117,6 +2125,7 @@ class Get
{
return trim(str_replace(array(PHP_EOL, "\r", "\n"), '', $string));
}
+
return trim($string);
}
@@ -2248,8 +2257,9 @@ class Get
{
$this->customScriptBuilder['token'] = array();
}
- $this->customScriptBuilder['token'][$view->name_single_code] = false;
- $this->customScriptBuilder['token'][$view->name_list_code] = false;
+ $this->customScriptBuilder['token'][$view->name_single_code]
+ = false;
+ $this->customScriptBuilder['token'][$view->name_list_code] = false;
// set some placeholders
$this->placeholders[$this->hhh . 'view' . $this->hhh]
= $view->name_single_code;
@@ -2302,7 +2312,8 @@ class Get
// set custom tabs
$this->customTabs[$view->name_single_code] = null;
- $view->customtabs = (isset($view->customtabs)
+ $view->customtabs
+ = (isset($view->customtabs)
&& ComponentbuilderHelper::checkJson($view->customtabs))
? json_decode($view->customtabs, true) : null;
if (ComponentbuilderHelper::checkArray($view->customtabs))
@@ -2476,7 +2487,8 @@ class Get
) {
// set the field details
$this->setFieldDetails(
- $field, $view->name_single_code, $view->name_list_code
+ $field, $view->name_single_code,
+ $view->name_list_code
);
// check if this field is a default field OR
// check if this is none database related field
@@ -2542,7 +2554,9 @@ class Get
foreach ($view->fields as $field)
{
// so first we lock the field name in
- $field_name = $this->getFieldName($field, $view->name_list_code);
+ $field_name = $this->getFieldName(
+ $field, $view->name_list_code
+ );
// check if the field changed since the last compilation (default fields never change and are always added)
if (!isset($ignoreFields[$field['field']])
&& ComponentbuilderHelper::checkObject(
@@ -2567,7 +2581,8 @@ class Get
. $field['settings']->history->datalenght_other,
$field['settings']->datalenght
. $field['settings']->datalenght_other,
- 'field.lenght', $view->name_single_code . '.' . $field_name
+ 'field.lenght',
+ $view->name_single_code . '.' . $field_name
);
}
// check if the name changed
@@ -2611,7 +2626,8 @@ class Get
$this->setUpdateSQL(
$old_field_name, $field_name,
'field.name',
- $view->name_single_code . '.' . $field_name
+ $view->name_single_code . '.'
+ . $field_name
);
}
elseif ($old_field_name !== $field_name)
@@ -2624,7 +2640,8 @@ class Get
$this->app->enqueueMessage(
JText::sprintf(
'You have a field called %s that has been added multiple times to the %s view, the name of that field has changed to %s. Normaly we would automaticly add the update SQL to your component, but with multiple fields this does not work automaticly since it could be that noting changed and it just seems like it did. Therefore you will have to do this manualy if it actualy did change!',
- $field_name, $view->name_single_code,
+ $field_name,
+ $view->name_single_code,
$old_field_name
), 'Notice'
);
@@ -2646,7 +2663,8 @@ class Get
$this->setUpdateSQL(
ComponentbuilderHelper::safeString(
$old_view->name_single
- ), $view->name_single_code, 'table_name', $view->name_single_code
+ ), $view->name_single_code, 'table_name',
+ $view->name_single_code
);
}
// loop the mysql table settings
@@ -2877,7 +2895,7 @@ class Get
// set linked views
$this->linkedAdminViews[$view->name_single_code] = null;
$view->addlinked_views
- = (isset($view->addlinked_views)
+ = (isset($view->addlinked_views)
&& ComponentbuilderHelper::checkJson($view->addlinked_views))
? json_decode($view->addlinked_views, true) : null;
if (ComponentbuilderHelper::checkArray($view->addlinked_views))
@@ -2989,7 +3007,9 @@ class Get
);
// check if we have template or layouts to load
- $this->setTemplateAndLayoutData($view->{$scripter}, $view->name_single_code);
+ $this->setTemplateAndLayoutData(
+ $view->{$scripter}, $view->name_single_code
+ );
unset($view->{$scripter});
}
@@ -3023,7 +3043,9 @@ class Get
);
// check if we have template or layouts to load
- $this->setTemplateAndLayoutData($view->{$button_code_field}, $view->name_single_code);
+ $this->setTemplateAndLayoutData(
+ $view->{$button_code_field}, $view->name_single_code
+ );
}
}
// set the button array
@@ -3053,7 +3075,7 @@ class Get
{
// update GUI mapper field
$guiMapper['field'] = $importScripter;
- $guiMapper['type'] = 'php';
+ $guiMapper['type'] = 'php';
// Make sure html gets HTML comment for placeholder
if ('html_import_view' === $importScripter)
{
@@ -3083,8 +3105,9 @@ class Get
if (isset($view->add_php_ajax) && $view->add_php_ajax == 1)
{
// insure the token is added to edit view atleast
- $this->customScriptBuilder['token'][$view->name_single_code] = true;
- $addAjaxSite = false;
+ $this->customScriptBuilder['token'][$view->name_single_code]
+ = true;
+ $addAjaxSite = false;
if (isset($this->siteEditView[$id]) && $this->siteEditView[$id])
{
// we should add this site ajax to front ajax
@@ -3166,9 +3189,12 @@ class Get
if (ComponentbuilderHelper::checkArray($alias_fields))
{
// load the field names
- $this->customAliasBuilder[$view->name_single_code] = (array) array_map(
+ $this->customAliasBuilder[$view->name_single_code]
+ = (array) array_map(
function ($field) use (&$view) {
- return $this->getFieldName($field, $view->name_list_code);
+ return $this->getFieldName(
+ $field, $view->name_list_code
+ );
}, $alias_fields
);
}
@@ -3182,7 +3208,9 @@ class Get
{
// build and add the SQL dump
$this->customScriptBuilder['sql'][$view->name_single_code]
- = $this->buildSqlDump($view->tables, $view->name_single_code, $id);
+ = $this->buildSqlDump(
+ $view->tables, $view->name_single_code, $id
+ );
unset($view->tables);
}
elseif ($view->source == 2 && isset($view->sql))
@@ -6447,6 +6475,7 @@ class Get
}
}
}
+
return false;
}
@@ -8797,7 +8826,7 @@ class Get
$addScriptTypes = array('install', 'update',
'uninstall');
// the next are php placeholders
- $guiMapper['type'] = 'php';
+ $guiMapper['type'] = 'php';
foreach ($addScriptMethods as $scriptMethod)
{
foreach ($addScriptTypes as $scriptType)
@@ -9279,7 +9308,7 @@ class Get
);
// set description
$this->placeholders[$this->hhh . 'DESCRIPTION' . $this->hhh]
- = $plugin->description;
+ = $plugin->description;
$plugin->description = '
' . $plugin->description
. '
';
}
@@ -9765,13 +9794,16 @@ class Get
);
unset(
$this->placeholders[$this->hhh . 'VERSION'
- . $this->hhh]);
+ . $this->hhh]
+ );
unset(
$this->placeholders[$this->hhh . 'DESCRIPTION'
- . $this->hhh]);
+ . $this->hhh]
+ );
unset(
$this->placeholders[$this->hhh . 'PLUGIN_NAME'
- . $this->hhh]);
+ . $this->hhh]
+ );
$this->joomlaPlugins[$id] = $plugin;
@@ -10432,19 +10464,26 @@ class Get
if (strpos($script, 'LOCKBASE64((((') !== false)
{
// get the strings
- $values = ComponentbuilderHelper::getAllBetween($script, 'LOCKBASE64((((', '))))');
+ $values = ComponentbuilderHelper::getAllBetween(
+ $script, 'LOCKBASE64((((', '))))'
+ );
$locker = array();
// convert them
- foreach($values as $value)
+ foreach ($values as $value)
{
- $locker['LOCKBASE64((((' . $value . '))))'] = "base64_decode( preg_replace('/\s+/', ''," .
+ $locker['LOCKBASE64((((' . $value . '))))']
+ = "base64_decode( preg_replace('/\s+/', ''," .
PHP_EOL . $this->_t(2) . "'" .
- wordwrap(base64_encode($value), 64, PHP_EOL . $this->_t(2), true) .
+ wordwrap(
+ base64_encode($value), 64, PHP_EOL . $this->_t(2), true
+ ) .
"'))";
}
+
// update the script
return $this->setPlaceholders($script, $locker);
}
+
return $script;
}
diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php
index caea7cafb..858847f38 100644
--- a/admin/helpers/compiler/b_Structure.php
+++ b/admin/helpers/compiler/b_Structure.php
@@ -2634,11 +2634,13 @@ class Structure extends Get
{
// get the fields ids
$ids = array_map(
- 'trim', explode(
- ',', ComponentbuilderHelper::getBetween(
- $multi_field['settings']->xml, 'fields="', '"'
- )
- )
+ 'trim',
+ explode(
+ ',',
+ ComponentbuilderHelper::getBetween(
+ $multi_field['settings']->xml, 'fields="', '"'
+ )
+ )
);
if (ComponentbuilderHelper::checkArray($ids))
{
diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php
index 306ec094e..3ec806ce1 100644
--- a/admin/helpers/compiler/c_Fields.php
+++ b/admin/helpers/compiler/c_Fields.php
@@ -5003,16 +5003,28 @@ class Fields extends Structure
&& $typeName != 'repeatable'
&& $typeName != 'subform'))
{
- $this->filterBuilder[$nameListCode][] = array('type' => $typeName,
- 'multi' => $field['filter'],
- 'code' => $name,
- 'lang' => $listLangName,
- 'database' => $nameSingleCode,
- 'function' => ComponentbuilderHelper::safeString(
- $name, 'F'
- ),
- 'custom' => $custom,
- 'options' => $options);
+ // this pains me... but to avoid collusion
+ $filter_type_code = ComponentbuilderHelper::safeString(
+ $name . $field['filter'] . $typeName
+ );
+ $filter_type_code = preg_replace('/_+/', '', $filter_type_code);
+ $filter_function_name = ComponentbuilderHelper::safeString(
+ $name, 'F'
+ );
+ // add the filter details
+ $this->filterBuilder[$nameListCode][] = array(
+ 'id' => (int) $field['field'],
+ 'type' => $typeName,
+ 'multi' => $field['filter'],
+ 'code' => $name,
+ 'label' => $langLabel,
+ 'lang' => $listLangName,
+ 'database' => $nameSingleCode,
+ 'function' => $filter_function_name,
+ 'custom' => $custom,
+ 'options' => $options,
+ 'filter_type' => $filter_type_code
+ );
}
// build the layout
@@ -5148,7 +5160,7 @@ class Fields extends Structure
}
// start loading the field type
$this->fileContentDynamic['customfield_' . $data['type']] = array();
- // JPREFIX <>>
+ // JPREFIX <<>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh
. 'JPREFIX' . $this->hhh]
= $jprefix;
@@ -5414,6 +5426,275 @@ class Fields extends Structure
}
}
+ /**
+ * This is just to get the code.
+ * Don't use this to build the field
+ *
+ * @param array $custom The field complete data set
+ *
+ * @return array with the code
+ *
+ */
+ public function getCustomFieldCode($custom)
+ {
+ // the code bucket
+ $code_bucket = array(
+ 'JFORM_TYPE_HEADER' => '',
+ 'JFORM_TYPE_PHP' => ''
+ );
+ // set tab and break replacements
+ $tabBreak = array(
+ '\t' => $this->_t(1),
+ '\n' => PHP_EOL
+ );
+ // load the other PHP options
+ foreach (ComponentbuilderHelper::$phpFieldArray as $x)
+ {
+ // reset the php bucket
+ $phpBucket = '';
+ // only set if available
+ if (isset($custom['php' . $x])
+ && ComponentbuilderHelper::checkArray(
+ $custom['php' . $x]
+ ))
+ {
+ foreach ($custom['php' . $x] as $line => $code)
+ {
+ if (ComponentbuilderHelper::checkString($code))
+ {
+ $phpBucket .= PHP_EOL . $this->setPlaceholders(
+ $code, $tabBreak
+ );
+ }
+ }
+ // check if this is header text
+ if ('HEADER' === $x)
+ {
+ $code_bucket['JFORM_TYPE_HEADER']
+ .= PHP_EOL . $phpBucket;
+ }
+ else
+ {
+ // JFORM_TYPE_PHP <<>>
+ $code_bucket['JFORM_TYPE_PHP']
+ .= PHP_EOL . $phpBucket;
+ }
+ }
+ }
+
+ return $code_bucket;
+ }
+
+ /**
+ * set the Filter Field set of a view
+ *
+ * @param string $nameSingleCode The single view name
+ * @param string $nameListCode The list view name
+ *
+ * @return string The fields set in xml
+ *
+ */
+ public function setFieldFilterSet(&$nameSingleCode, &$nameListCode)
+ {
+ // check if this is the above/new filter option
+ if (isset($this->adminFilterType[$nameListCode])
+ && $this->adminFilterType[$nameListCode] == 2
+ && isset($this->filterBuilder[$nameListCode])
+ && ComponentbuilderHelper::checkArray(
+ $this->filterBuilder[$nameListCode]
+ ))
+ {
+ // we first create the file
+ $target = array('admin' => 'filter_' . $nameListCode);
+ $this->buildDynamique(
+ $target, 'filter'
+ );
+ // now build the XML
+ $field_filter_sets = array();
+ $field_filter_sets[] = $this->_t(1) . '';
+ // we first add the search
+ $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="text"';
+ $field_filter_sets[] = $this->_t(3) . 'name="search"';
+ $field_filter_sets[] = $this->_t(3) . 'inputmode="search"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'label="COM_CONTENT_FILTER_SEARCH_LABEL"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'description="COM_CONTENT_FILTER_SEARCH_DESC"';
+ $field_filter_sets[] = $this->_t(3) . 'hint="JSEARCH_FILTER"';
+ $field_filter_sets[] = $this->_t(2) . '/>';
+ // add the published filter if published is not set
+ if (!isset($this->fieldsNames[$nameSingleCode]['published']))
+ {
+ $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="status"';
+ $field_filter_sets[] = $this->_t(3) . 'name="published"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'label="COM_CONTENT_FILTER_PUBLISHED"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'description="COM_CONTENT_FILTER_PUBLISHED_DESC"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'onchange="this.form.submit();"';
+ $field_filter_sets[] = $this->_t(2) . '>';
+ $field_filter_sets[] = $this->_t(3)
+ . '';
+ $field_filter_sets[] = $this->_t(2) . '';
+ }
+ // add the access filter if this view has access
+ // and if access manually is not set
+ if (isset($this->accessBuilder[$nameSingleCode])
+ && ComponentbuilderHelper::checkString(
+ $this->accessBuilder[$nameSingleCode]
+ )
+ && !isset($this->fieldsNames[$nameSingleCode]['access']))
+ {
+ $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="accesslevel"';
+ $field_filter_sets[] = $this->_t(3) . 'name="access"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'label="JOPTION_FILTER_ACCESS"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'description="JOPTION_FILTER_ACCESS_DESC"';
+ $field_filter_sets[] = $this->_t(3) . 'multiple="true"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'class="multipleAccessLevels"';
+ $field_filter_sets[] = $this->_t(3)
+ . 'onchange="this.form.submit();"';
+ $field_filter_sets[] = $this->_t(2) . '/>';
+ }
+ // now add the dynamic fields
+ foreach ($this->filterBuilder[$nameListCode] as $r => &$filter)
+ {
+ if ($filter['type'] != 'category')
+ {
+ $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="'
+ . $filter['type'] . '"';
+ // set css classname of this field
+ $filter['class'] = ucfirst($filter['type']);
+ }
+ else
+ {
+ // we use the filter field type that was build
+ $field_filter_sets[] = $this->_t(3) . 'type="'
+ . $filter['filter_type'] . '"';
+ // set css classname of this field
+ $filter['class'] = ucfirst($filter['filter_type']);
+ }
+ $field_filter_sets[] = $this->_t(3) . 'name="'
+ . $filter['code'] . '"';
+ $field_filter_sets[] = $this->_t(3) . 'label="'
+ . $filter['label'] . '"';
+ // if this is a multi field
+ if ($filter['multi'] == 2)
+ {
+ $field_filter_sets[] = $this->_t(3) . 'class="multiple'
+ . $filter['class'] . '"';
+ $field_filter_sets[] = $this->_t(3) . 'multiple="true"';
+ }
+ else
+ {
+ $field_filter_sets[] = $this->_t(3)
+ . 'multiple="false"';
+ }
+ $field_filter_sets[] = $this->_t(3)
+ . 'onchange="this.form.submit();"';
+ $field_filter_sets[] = $this->_t(2) . '/>';
+ }
+ }
+ $field_filter_sets[] = $this->_t(2)
+ . '';
+ $field_filter_sets[] = $this->_t(1) . '';
+
+ // now update the file
+ return implode(PHP_EOL, $field_filter_sets);
+ }
+
+ return '';
+ }
+
+ /**
+ * set the Filter List set of a view
+ *
+ * @param string $nameSingleCode The single view name
+ * @param string $nameListCode The list view name
+ *
+ * @return string The fields set in xml
+ *
+ */
+ public function setFieldFilterListSet(&$nameSingleCode, &$nameListCode)
+ {
+ // soon we will add this TODO
+ return '';
+ }
+
+ /**
+ * set Custom Field for Filter
+ *
+ * @param string $getOptions The get options php string/code
+ * @param array $filter The filter details
+ *
+ * @return void
+ *
+ */
+ public function setFilterFieldFile($getOptions, $filter)
+ {
+ // make sure it is not already been build
+ if (!isset(
+ $this->fileContentDynamic['customfilterfield_'
+ . $filter['filter_type']]
+ )
+ || !ComponentbuilderHelper::checkArray(
+ $this->fileContentDynamic['customfilterfield_'
+ . $filter['filter_type']]
+ )
+ )
+ {
+ // start loading the field type
+ $this->fileContentDynamic['customfilterfield_'
+ . $filter['filter_type']]
+ = array();
+ // JPREFIX <>>
+ $this->fileContentDynamic['customfilterfield_'
+ . $filter['filter_type']][$this->hhh
+ . 'JPREFIX' . $this->hhh]
+ = 'J';
+ // Type <<>>
+ $this->fileContentDynamic['customfilterfield_'
+ . $filter['filter_type']][$this->hhh
+ . 'Type' . $this->hhh]
+ = ComponentbuilderHelper::safeString(
+ $filter['filter_type'], 'F'
+ );
+ // type <<>>
+ $this->fileContentDynamic['customfilterfield_'
+ . $filter['filter_type']][$this->hhh
+ . 'type' . $this->hhh]
+ = ComponentbuilderHelper::safeString($filter['filter_type']);
+ // JFORM_GETOPTIONS_PHP <<>>
+ $this->fileContentDynamic['customfilterfield_'
+ . $filter['filter_type']][$this->hhh . 'JFORM_GETOPTIONS_PHP'
+ . $this->hhh]
+ = $getOptions;
+ // ADD_BUTTON <<>>
+ $this->fileContentDynamic['customfilterfield_'
+ . $filter['filter_type']][$this->hhh . 'ADD_BUTTON' . $this->hhh]
+ = '';
+ // now build the custom filter field type file
+ $target = array('admin' => 'customfilterfield');
+ $this->buildDynamique(
+ $target, 'fieldlist',
+ $filter['filter_type']
+ );
+ }
+ }
+
/**
* set Add Button To List Field (getInput tweak)
*
diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php
index 3e5905a2f..1a70d4d6b 100644
--- a/admin/helpers/compiler/e_Interpretation.php
+++ b/admin/helpers/compiler/e_Interpretation.php
@@ -14596,7 +14596,7 @@ class Interpretation extends Fields
*
* @return string
*/
- public function setGetItemsModelMethod($nameSingleCode, $nameListCode,
+ public function setGetItemsModelMethod(&$nameSingleCode, &$nameListCode,
$config
= array('functionName' => 'getExportData',
'docDesc' => 'Method to get list export data.',
@@ -15155,7 +15155,7 @@ class Interpretation extends Fields
. $this->hhh];
}
- public function setListQuery($nameSingleCode, $nameListCode)
+ public function setListQuery(&$nameSingleCode, &$nameListCode)
{
// check if this view has category added
if (isset($this->categoryBuilder[$nameListCode])
@@ -17420,31 +17420,41 @@ class Interpretation extends Fields
* @return string The php to place in view.html.php
*
*/
- public function setFilterFunctions($nameSingleCode, $nameListCode)
+ public function setFilterFieldHelper(&$nameSingleCode, &$nameListCode)
{
// the old filter type uses these functions
- if (isset($this->adminFilterType[$nameListCode])
- && $this->adminFilterType[$nameListCode] == 1
- && isset($this->filterBuilder[$nameListCode])
+ if (isset($this->filterBuilder[$nameListCode])
&& ComponentbuilderHelper::checkArray(
$this->filterBuilder[$nameListCode]
))
{
+ // set the function or file path
+ $funtion_path = true;
+ if (isset($this->adminFilterType[$nameListCode])
+ && $this->adminFilterType[$nameListCode] == 2)
+ {
+ $funtion_path = false;
+ }
$function = array();
// set component name
$component = $this->componentCodeName;
+ $Component = ucfirst($component);
foreach ($this->filterBuilder[$nameListCode] as $filter)
{
if ($filter['type'] != 'category'
&& ComponentbuilderHelper::checkArray($filter['custom'])
&& $filter['custom']['extends'] === 'user')
{
- $function[] = PHP_EOL . $this->_t(1)
- . "protected function getThe" . $filter['function']
- . ComponentbuilderHelper::safeString(
- $filter['custom']['text'], 'F'
- ) . "Selections()";
- $function[] = $this->_t(1) . "{";
+ // add if this is a function path
+ if ($funtion_path)
+ {
+ $function[] = PHP_EOL . $this->_t(1)
+ . "protected function getThe" . $filter['function']
+ . ComponentbuilderHelper::safeString(
+ $filter['custom']['text'], 'F'
+ ) . "Selections()";
+ $function[] = $this->_t(1) . "{";
+ }
$function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Get a db connection.";
$function[] = $this->_t(2) . "\$db = JFactory::getDbo();";
@@ -17498,7 +17508,11 @@ class Interpretation extends Fields
$function[] = $this->_t(3) . "return \$filter;";
$function[] = $this->_t(2) . "}";
$function[] = $this->_t(2) . "return false;";
- $function[] = $this->_t(1) . "}";
+ // add if this is a function path
+ if ($funtion_path)
+ {
+ $function[] = $this->_t(1) . "}";
+ }
/* else
{
@@ -17554,10 +17568,14 @@ class Interpretation extends Fields
{
$translation = true;
}
- $function[] = PHP_EOL . $this->_t(1)
- . "protected function getThe" . $filter['function']
- . "Selections()";
- $function[] = $this->_t(1) . "{";
+ // add if this is a function path
+ if ($funtion_path)
+ {
+ $function[] = PHP_EOL . $this->_t(1)
+ . "protected function getThe" . $filter['function']
+ . "Selections()";
+ $function[] = $this->_t(1) . "{";
+ }
$function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Get a db connection.";
$function[] = $this->_t(2) . "\$db = JFactory::getDbo();";
@@ -17620,7 +17638,7 @@ class Interpretation extends Fields
$function[] = $this->_t(2) . "{";
// check if translated value is used
- if ($translation)
+ if ($funtion_path && $translation)
{
$function[] = $this->_t(3) . "//" . $this->setLine(
__LINE__
@@ -17628,6 +17646,15 @@ class Interpretation extends Fields
$function[] = $this->_t(3)
. "\$model = \$this->getModel();";
}
+ elseif ($translation)
+ {
+ $function[] = $this->_t(3) . "//" . $this->setLine(
+ __LINE__
+ ) . " get " . $nameListCode . "model";
+ $function[] = $this->_t(3)
+ . "\$model = " . $Component . "Helper::getModel('"
+ . $nameListCode . "');";
+ }
// check if usergroup as we change to an object query
if ($filter['type'] !== 'usergroup')
{
@@ -17698,10 +17725,70 @@ class Interpretation extends Fields
$function[] = $this->_t(3) . "return \$_filter;";
$function[] = $this->_t(2) . "}";
$function[] = $this->_t(2) . "return false;";
- $function[] = $this->_t(1) . "}";
+ // add if this is a function path
+ if ($funtion_path)
+ {
+ $function[] = $this->_t(1) . "}";
+ }
+ }
+ // we check if this is a multi field
+ // and if there is a blank option
+ // and give a notice that this will cause an issue
+ elseif (!$funtion_path && $filter['type'] != 'category'
+ && $filter['multi'] == 2
+ && ComponentbuilderHelper::checkArray($filter['custom']))
+ {
+ //var_dump($filter);
+ //jexit();
+ // get the field code
+ $field_code = $this->getCustomFieldCode(
+ $filter['custom']
+ )['JFORM_TYPE_PHP'];
+ // check for the [JHtml::_('select.option', '',] code
+ if (strpos($field_code, "JHtml::_('select.option', '',")
+ !== false
+ && strpos($field_code, '($this->multiple === false)')
+ === false)
+ {
+ // for now we just give an error message (don't fix it)
+ $this->app->enqueueMessage(
+ JText::_('