Added getListViewDefaultOrdering method to compiler. Moved getFieldDatabaseName to the get class of the compiler. Updated the setFieldFilterListSet method. Imporved the filter query code to ignore empty values. gh-378
This commit is contained in:
@ -302,29 +302,89 @@ class ComponentbuilderModelAdmin_views extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Add_fadein.
|
||||
if ($add_fadein = $this->getState('filter.add_fadein'))
|
||||
$_add_fadein = $this->getState('filter.add_fadein');
|
||||
if (is_numeric($_add_fadein))
|
||||
{
|
||||
$query->where('a.add_fadein = ' . $db->quote($db->escape($add_fadein)));
|
||||
if (is_float($_add_fadein))
|
||||
{
|
||||
$query->where('a.add_fadein = ' . (float) $_add_fadein);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_fadein = ' . (int) $_add_fadein);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_fadein))
|
||||
{
|
||||
$query->where('a.add_fadein = ' . $db->quote($db->escape($_add_fadein)));
|
||||
}
|
||||
// Filter by Type.
|
||||
if ($type = $this->getState('filter.type'))
|
||||
$_type = $this->getState('filter.type');
|
||||
if (is_numeric($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($type)));
|
||||
if (is_float($_type))
|
||||
{
|
||||
$query->where('a.type = ' . (float) $_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.type = ' . (int) $_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($_type)));
|
||||
}
|
||||
// Filter by Add_custom_button.
|
||||
if ($add_custom_button = $this->getState('filter.add_custom_button'))
|
||||
$_add_custom_button = $this->getState('filter.add_custom_button');
|
||||
if (is_numeric($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . $db->quote($db->escape($add_custom_button)));
|
||||
if (is_float($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . (float) $_add_custom_button);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . (int) $_add_custom_button);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . $db->quote($db->escape($_add_custom_button)));
|
||||
}
|
||||
// Filter by Add_php_ajax.
|
||||
if ($add_php_ajax = $this->getState('filter.add_php_ajax'))
|
||||
$_add_php_ajax = $this->getState('filter.add_php_ajax');
|
||||
if (is_numeric($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . $db->quote($db->escape($add_php_ajax)));
|
||||
if (is_float($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . (float) $_add_php_ajax);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . (int) $_add_php_ajax);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . $db->quote($db->escape($_add_php_ajax)));
|
||||
}
|
||||
// Filter by Add_custom_import.
|
||||
if ($add_custom_import = $this->getState('filter.add_custom_import'))
|
||||
$_add_custom_import = $this->getState('filter.add_custom_import');
|
||||
if (is_numeric($_add_custom_import))
|
||||
{
|
||||
$query->where('a.add_custom_import = ' . $db->quote($db->escape($add_custom_import)));
|
||||
if (is_float($_add_custom_import))
|
||||
{
|
||||
$query->where('a.add_custom_import = ' . (float) $_add_custom_import);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_custom_import = ' . (int) $_add_custom_import);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_custom_import))
|
||||
{
|
||||
$query->where('a.add_custom_import = ' . $db->quote($db->escape($_add_custom_import)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -220,9 +220,21 @@ class ComponentbuilderModelClass_extendings extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Extension_type.
|
||||
if ($extension_type = $this->getState('filter.extension_type'))
|
||||
$_extension_type = $this->getState('filter.extension_type');
|
||||
if (is_numeric($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($extension_type)));
|
||||
if (is_float($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . (float) $_extension_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.extension_type = ' . (int) $_extension_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($_extension_type)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -244,14 +244,38 @@ class ComponentbuilderModelClass_methods extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Visibility.
|
||||
if ($visibility = $this->getState('filter.visibility'))
|
||||
$_visibility = $this->getState('filter.visibility');
|
||||
if (is_numeric($_visibility))
|
||||
{
|
||||
$query->where('a.visibility = ' . $db->quote($db->escape($visibility)));
|
||||
if (is_float($_visibility))
|
||||
{
|
||||
$query->where('a.visibility = ' . (float) $_visibility);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.visibility = ' . (int) $_visibility);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_visibility))
|
||||
{
|
||||
$query->where('a.visibility = ' . $db->quote($db->escape($_visibility)));
|
||||
}
|
||||
// Filter by Extension_type.
|
||||
if ($extension_type = $this->getState('filter.extension_type'))
|
||||
$_extension_type = $this->getState('filter.extension_type');
|
||||
if (is_numeric($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($extension_type)));
|
||||
if (is_float($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . (float) $_extension_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.extension_type = ' . (int) $_extension_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($_extension_type)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -244,14 +244,38 @@ class ComponentbuilderModelClass_properties extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Visibility.
|
||||
if ($visibility = $this->getState('filter.visibility'))
|
||||
$_visibility = $this->getState('filter.visibility');
|
||||
if (is_numeric($_visibility))
|
||||
{
|
||||
$query->where('a.visibility = ' . $db->quote($db->escape($visibility)));
|
||||
if (is_float($_visibility))
|
||||
{
|
||||
$query->where('a.visibility = ' . (float) $_visibility);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.visibility = ' . (int) $_visibility);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_visibility))
|
||||
{
|
||||
$query->where('a.visibility = ' . $db->quote($db->escape($_visibility)));
|
||||
}
|
||||
// Filter by Extension_type.
|
||||
if ($extension_type = $this->getState('filter.extension_type'))
|
||||
$_extension_type = $this->getState('filter.extension_type');
|
||||
if (is_numeric($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($extension_type)));
|
||||
if (is_float($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . (float) $_extension_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.extension_type = ' . (int) $_extension_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_extension_type))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($_extension_type)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -253,19 +253,55 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Main_get.
|
||||
if ($main_get = $this->getState('filter.main_get'))
|
||||
$_main_get = $this->getState('filter.main_get');
|
||||
if (is_numeric($_main_get))
|
||||
{
|
||||
$query->where('a.main_get = ' . $db->quote($db->escape($main_get)));
|
||||
if (is_float($_main_get))
|
||||
{
|
||||
$query->where('a.main_get = ' . (float) $_main_get);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.main_get = ' . (int) $_main_get);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_main_get))
|
||||
{
|
||||
$query->where('a.main_get = ' . $db->quote($db->escape($_main_get)));
|
||||
}
|
||||
// Filter by Add_php_ajax.
|
||||
if ($add_php_ajax = $this->getState('filter.add_php_ajax'))
|
||||
$_add_php_ajax = $this->getState('filter.add_php_ajax');
|
||||
if (is_numeric($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . $db->quote($db->escape($add_php_ajax)));
|
||||
if (is_float($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . (float) $_add_php_ajax);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . (int) $_add_php_ajax);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . $db->quote($db->escape($_add_php_ajax)));
|
||||
}
|
||||
// Filter by Add_custom_button.
|
||||
if ($add_custom_button = $this->getState('filter.add_custom_button'))
|
||||
$_add_custom_button = $this->getState('filter.add_custom_button');
|
||||
if (is_numeric($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . $db->quote($db->escape($add_custom_button)));
|
||||
if (is_float($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . (float) $_add_custom_button);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . (int) $_add_custom_button);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . $db->quote($db->escape($_add_custom_button)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -281,24 +281,72 @@ class ComponentbuilderModelCustom_codes extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Component.
|
||||
if ($component = $this->getState('filter.component'))
|
||||
$_component = $this->getState('filter.component');
|
||||
if (is_numeric($_component))
|
||||
{
|
||||
$query->where('a.component = ' . $db->quote($db->escape($component)));
|
||||
if (is_float($_component))
|
||||
{
|
||||
$query->where('a.component = ' . (float) $_component);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.component = ' . (int) $_component);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_component))
|
||||
{
|
||||
$query->where('a.component = ' . $db->quote($db->escape($_component)));
|
||||
}
|
||||
// Filter by Target.
|
||||
if ($target = $this->getState('filter.target'))
|
||||
$_target = $this->getState('filter.target');
|
||||
if (is_numeric($_target))
|
||||
{
|
||||
$query->where('a.target = ' . $db->quote($db->escape($target)));
|
||||
if (is_float($_target))
|
||||
{
|
||||
$query->where('a.target = ' . (float) $_target);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.target = ' . (int) $_target);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_target))
|
||||
{
|
||||
$query->where('a.target = ' . $db->quote($db->escape($_target)));
|
||||
}
|
||||
// Filter by Type.
|
||||
if ($type = $this->getState('filter.type'))
|
||||
$_type = $this->getState('filter.type');
|
||||
if (is_numeric($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($type)));
|
||||
if (is_float($_type))
|
||||
{
|
||||
$query->where('a.type = ' . (float) $_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.type = ' . (int) $_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($_type)));
|
||||
}
|
||||
// Filter by Comment_type.
|
||||
if ($comment_type = $this->getState('filter.comment_type'))
|
||||
$_comment_type = $this->getState('filter.comment_type');
|
||||
if (is_numeric($_comment_type))
|
||||
{
|
||||
$query->where('a.comment_type = ' . $db->quote($db->escape($comment_type)));
|
||||
if (is_float($_comment_type))
|
||||
{
|
||||
$query->where('a.comment_type = ' . (float) $_comment_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.comment_type = ' . (int) $_comment_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_comment_type))
|
||||
{
|
||||
$query->where('a.comment_type = ' . $db->quote($db->escape($_comment_type)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -241,14 +241,38 @@ class ComponentbuilderModelDynamic_gets extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Main_source.
|
||||
if ($main_source = $this->getState('filter.main_source'))
|
||||
$_main_source = $this->getState('filter.main_source');
|
||||
if (is_numeric($_main_source))
|
||||
{
|
||||
$query->where('a.main_source = ' . $db->quote($db->escape($main_source)));
|
||||
if (is_float($_main_source))
|
||||
{
|
||||
$query->where('a.main_source = ' . (float) $_main_source);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.main_source = ' . (int) $_main_source);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_main_source))
|
||||
{
|
||||
$query->where('a.main_source = ' . $db->quote($db->escape($_main_source)));
|
||||
}
|
||||
// Filter by Gettype.
|
||||
if ($gettype = $this->getState('filter.gettype'))
|
||||
$_gettype = $this->getState('filter.gettype');
|
||||
if (is_numeric($_gettype))
|
||||
{
|
||||
$query->where('a.gettype = ' . $db->quote($db->escape($gettype)));
|
||||
if (is_float($_gettype))
|
||||
{
|
||||
$query->where('a.gettype = ' . (float) $_gettype);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.gettype = ' . (int) $_gettype);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_gettype))
|
||||
{
|
||||
$query->where('a.gettype = ' . $db->quote($db->escape($_gettype)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -320,29 +320,89 @@ class ComponentbuilderModelFields extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Fieldtype.
|
||||
if ($fieldtype = $this->getState('filter.fieldtype'))
|
||||
$_fieldtype = $this->getState('filter.fieldtype');
|
||||
if (is_numeric($_fieldtype))
|
||||
{
|
||||
$query->where('a.fieldtype = ' . $db->quote($db->escape($fieldtype)));
|
||||
if (is_float($_fieldtype))
|
||||
{
|
||||
$query->where('a.fieldtype = ' . (float) $_fieldtype);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.fieldtype = ' . (int) $_fieldtype);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_fieldtype))
|
||||
{
|
||||
$query->where('a.fieldtype = ' . $db->quote($db->escape($_fieldtype)));
|
||||
}
|
||||
// Filter by Datatype.
|
||||
if ($datatype = $this->getState('filter.datatype'))
|
||||
$_datatype = $this->getState('filter.datatype');
|
||||
if (is_numeric($_datatype))
|
||||
{
|
||||
$query->where('a.datatype = ' . $db->quote($db->escape($datatype)));
|
||||
if (is_float($_datatype))
|
||||
{
|
||||
$query->where('a.datatype = ' . (float) $_datatype);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.datatype = ' . (int) $_datatype);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_datatype))
|
||||
{
|
||||
$query->where('a.datatype = ' . $db->quote($db->escape($_datatype)));
|
||||
}
|
||||
// Filter by Indexes.
|
||||
if ($indexes = $this->getState('filter.indexes'))
|
||||
$_indexes = $this->getState('filter.indexes');
|
||||
if (is_numeric($_indexes))
|
||||
{
|
||||
$query->where('a.indexes = ' . $db->quote($db->escape($indexes)));
|
||||
if (is_float($_indexes))
|
||||
{
|
||||
$query->where('a.indexes = ' . (float) $_indexes);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.indexes = ' . (int) $_indexes);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_indexes))
|
||||
{
|
||||
$query->where('a.indexes = ' . $db->quote($db->escape($_indexes)));
|
||||
}
|
||||
// Filter by Null_switch.
|
||||
if ($null_switch = $this->getState('filter.null_switch'))
|
||||
$_null_switch = $this->getState('filter.null_switch');
|
||||
if (is_numeric($_null_switch))
|
||||
{
|
||||
$query->where('a.null_switch = ' . $db->quote($db->escape($null_switch)));
|
||||
if (is_float($_null_switch))
|
||||
{
|
||||
$query->where('a.null_switch = ' . (float) $_null_switch);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.null_switch = ' . (int) $_null_switch);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_null_switch))
|
||||
{
|
||||
$query->where('a.null_switch = ' . $db->quote($db->escape($_null_switch)));
|
||||
}
|
||||
// Filter by Store.
|
||||
if ($store = $this->getState('filter.store'))
|
||||
$_store = $this->getState('filter.store');
|
||||
if (is_numeric($_store))
|
||||
{
|
||||
$query->where('a.store = ' . $db->quote($db->escape($store)));
|
||||
if (is_float($_store))
|
||||
{
|
||||
$query->where('a.store = ' . (float) $_store);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.store = ' . (int) $_store);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_store))
|
||||
{
|
||||
$query->where('a.store = ' . $db->quote($db->escape($_store)));
|
||||
}
|
||||
|
||||
// Filter by a single or group of categories.
|
||||
|
@ -243,24 +243,72 @@ class ComponentbuilderModelHelp_documents extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Type.
|
||||
if ($type = $this->getState('filter.type'))
|
||||
$_type = $this->getState('filter.type');
|
||||
if (is_numeric($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($type)));
|
||||
if (is_float($_type))
|
||||
{
|
||||
$query->where('a.type = ' . (float) $_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.type = ' . (int) $_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($_type)));
|
||||
}
|
||||
// Filter by Location.
|
||||
if ($location = $this->getState('filter.location'))
|
||||
$_location = $this->getState('filter.location');
|
||||
if (is_numeric($_location))
|
||||
{
|
||||
$query->where('a.location = ' . $db->quote($db->escape($location)));
|
||||
if (is_float($_location))
|
||||
{
|
||||
$query->where('a.location = ' . (float) $_location);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.location = ' . (int) $_location);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_location))
|
||||
{
|
||||
$query->where('a.location = ' . $db->quote($db->escape($_location)));
|
||||
}
|
||||
// Filter by Admin_view.
|
||||
if ($admin_view = $this->getState('filter.admin_view'))
|
||||
$_admin_view = $this->getState('filter.admin_view');
|
||||
if (is_numeric($_admin_view))
|
||||
{
|
||||
$query->where('a.admin_view = ' . $db->quote($db->escape($admin_view)));
|
||||
if (is_float($_admin_view))
|
||||
{
|
||||
$query->where('a.admin_view = ' . (float) $_admin_view);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.admin_view = ' . (int) $_admin_view);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_admin_view))
|
||||
{
|
||||
$query->where('a.admin_view = ' . $db->quote($db->escape($_admin_view)));
|
||||
}
|
||||
// Filter by Site_view.
|
||||
if ($site_view = $this->getState('filter.site_view'))
|
||||
$_site_view = $this->getState('filter.site_view');
|
||||
if (is_numeric($_site_view))
|
||||
{
|
||||
$query->where('a.site_view = ' . $db->quote($db->escape($site_view)));
|
||||
if (is_float($_site_view))
|
||||
{
|
||||
$query->where('a.site_view = ' . (float) $_site_view);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.site_view = ' . (int) $_site_view);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_site_view))
|
||||
{
|
||||
$query->where('a.site_view = ' . $db->quote($db->escape($_site_view)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -2232,14 +2232,38 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Companyname.
|
||||
if ($companyname = $this->getState('filter.companyname'))
|
||||
$_companyname = $this->getState('filter.companyname');
|
||||
if (is_numeric($_companyname))
|
||||
{
|
||||
$query->where('a.companyname = ' . $db->quote($db->escape($companyname)));
|
||||
if (is_float($_companyname))
|
||||
{
|
||||
$query->where('a.companyname = ' . (float) $_companyname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.companyname = ' . (int) $_companyname);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_companyname))
|
||||
{
|
||||
$query->where('a.companyname = ' . $db->quote($db->escape($_companyname)));
|
||||
}
|
||||
// Filter by Author.
|
||||
if ($author = $this->getState('filter.author'))
|
||||
$_author = $this->getState('filter.author');
|
||||
if (is_numeric($_author))
|
||||
{
|
||||
$query->where('a.author = ' . $db->quote($db->escape($author)));
|
||||
if (is_float($_author))
|
||||
{
|
||||
$query->where('a.author = ' . (float) $_author);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.author = ' . (int) $_author);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_author))
|
||||
{
|
||||
$query->where('a.author = ' . $db->quote($db->escape($_author)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -222,9 +222,21 @@ class ComponentbuilderModelJoomla_modules extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Target.
|
||||
if ($target = $this->getState('filter.target'))
|
||||
$_target = $this->getState('filter.target');
|
||||
if (is_numeric($_target))
|
||||
{
|
||||
$query->where('a.target = ' . $db->quote($db->escape($target)));
|
||||
if (is_float($_target))
|
||||
{
|
||||
$query->where('a.target = ' . (float) $_target);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.target = ' . (int) $_target);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_target))
|
||||
{
|
||||
$query->where('a.target = ' . $db->quote($db->escape($_target)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -167,9 +167,21 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Class_extends.
|
||||
if ($class_extends = $this->getState('filter.class_extends'))
|
||||
$_class_extends = $this->getState('filter.class_extends');
|
||||
if (is_numeric($_class_extends))
|
||||
{
|
||||
$query->where('a.class_extends = ' . $db->quote($db->escape($class_extends)));
|
||||
if (is_float($_class_extends))
|
||||
{
|
||||
$query->where('a.class_extends = ' . (float) $_class_extends);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.class_extends = ' . (int) $_class_extends);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_class_extends))
|
||||
{
|
||||
$query->where('a.class_extends = ' . $db->quote($db->escape($_class_extends)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -366,14 +366,38 @@ class ComponentbuilderModelJoomla_plugins extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Class_extends.
|
||||
if ($class_extends = $this->getState('filter.class_extends'))
|
||||
$_class_extends = $this->getState('filter.class_extends');
|
||||
if (is_numeric($_class_extends))
|
||||
{
|
||||
$query->where('a.class_extends = ' . $db->quote($db->escape($class_extends)));
|
||||
if (is_float($_class_extends))
|
||||
{
|
||||
$query->where('a.class_extends = ' . (float) $_class_extends);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.class_extends = ' . (int) $_class_extends);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_class_extends))
|
||||
{
|
||||
$query->where('a.class_extends = ' . $db->quote($db->escape($_class_extends)));
|
||||
}
|
||||
// Filter by Joomla_plugin_group.
|
||||
if ($joomla_plugin_group = $this->getState('filter.joomla_plugin_group'))
|
||||
$_joomla_plugin_group = $this->getState('filter.joomla_plugin_group');
|
||||
if (is_numeric($_joomla_plugin_group))
|
||||
{
|
||||
$query->where('a.joomla_plugin_group = ' . $db->quote($db->escape($joomla_plugin_group)));
|
||||
if (is_float($_joomla_plugin_group))
|
||||
{
|
||||
$query->where('a.joomla_plugin_group = ' . (float) $_joomla_plugin_group);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.joomla_plugin_group = ' . (int) $_joomla_plugin_group);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_joomla_plugin_group))
|
||||
{
|
||||
$query->where('a.joomla_plugin_group = ' . $db->quote($db->escape($_joomla_plugin_group)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -230,14 +230,38 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Dynamic_get.
|
||||
if ($dynamic_get = $this->getState('filter.dynamic_get'))
|
||||
$_dynamic_get = $this->getState('filter.dynamic_get');
|
||||
if (is_numeric($_dynamic_get))
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . $db->quote($db->escape($dynamic_get)));
|
||||
if (is_float($_dynamic_get))
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . (float) $_dynamic_get);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . (int) $_dynamic_get);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_dynamic_get))
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . $db->quote($db->escape($_dynamic_get)));
|
||||
}
|
||||
// Filter by Add_php_view.
|
||||
if ($add_php_view = $this->getState('filter.add_php_view'))
|
||||
$_add_php_view = $this->getState('filter.add_php_view');
|
||||
if (is_numeric($_add_php_view))
|
||||
{
|
||||
$query->where('a.add_php_view = ' . $db->quote($db->escape($add_php_view)));
|
||||
if (is_float($_add_php_view))
|
||||
{
|
||||
$query->where('a.add_php_view = ' . (float) $_add_php_view);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_php_view = ' . (int) $_add_php_view);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_php_view))
|
||||
{
|
||||
$query->where('a.add_php_view = ' . $db->quote($db->escape($_add_php_view)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -267,19 +267,55 @@ class ComponentbuilderModelLibraries extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Target.
|
||||
if ($target = $this->getState('filter.target'))
|
||||
$_target = $this->getState('filter.target');
|
||||
if (is_numeric($_target))
|
||||
{
|
||||
$query->where('a.target = ' . $db->quote($db->escape($target)));
|
||||
if (is_float($_target))
|
||||
{
|
||||
$query->where('a.target = ' . (float) $_target);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.target = ' . (int) $_target);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_target))
|
||||
{
|
||||
$query->where('a.target = ' . $db->quote($db->escape($_target)));
|
||||
}
|
||||
// Filter by How.
|
||||
if ($how = $this->getState('filter.how'))
|
||||
$_how = $this->getState('filter.how');
|
||||
if (is_numeric($_how))
|
||||
{
|
||||
$query->where('a.how = ' . $db->quote($db->escape($how)));
|
||||
if (is_float($_how))
|
||||
{
|
||||
$query->where('a.how = ' . (float) $_how);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.how = ' . (int) $_how);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_how))
|
||||
{
|
||||
$query->where('a.how = ' . $db->quote($db->escape($_how)));
|
||||
}
|
||||
// Filter by Type.
|
||||
if ($type = $this->getState('filter.type'))
|
||||
$_type = $this->getState('filter.type');
|
||||
if (is_numeric($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($type)));
|
||||
if (is_float($_type))
|
||||
{
|
||||
$query->where('a.type = ' . (float) $_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.type = ' . (int) $_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($_type)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -219,14 +219,38 @@ class ComponentbuilderModelServers extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Name.
|
||||
if ($name = $this->getState('filter.name'))
|
||||
$_name = $this->getState('filter.name');
|
||||
if (is_numeric($_name))
|
||||
{
|
||||
$query->where('a.name = ' . $db->quote($db->escape($name)));
|
||||
if (is_float($_name))
|
||||
{
|
||||
$query->where('a.name = ' . (float) $_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.name = ' . (int) $_name);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_name))
|
||||
{
|
||||
$query->where('a.name = ' . $db->quote($db->escape($_name)));
|
||||
}
|
||||
// Filter by Protocol.
|
||||
if ($protocol = $this->getState('filter.protocol'))
|
||||
$_protocol = $this->getState('filter.protocol');
|
||||
if (is_numeric($_protocol))
|
||||
{
|
||||
$query->where('a.protocol = ' . $db->quote($db->escape($protocol)));
|
||||
if (is_float($_protocol))
|
||||
{
|
||||
$query->where('a.protocol = ' . (float) $_protocol);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.protocol = ' . (int) $_protocol);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_protocol))
|
||||
{
|
||||
$query->where('a.protocol = ' . $db->quote($db->escape($_protocol)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -257,19 +257,55 @@ class ComponentbuilderModelSite_views extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Main_get.
|
||||
if ($main_get = $this->getState('filter.main_get'))
|
||||
$_main_get = $this->getState('filter.main_get');
|
||||
if (is_numeric($_main_get))
|
||||
{
|
||||
$query->where('a.main_get = ' . $db->quote($db->escape($main_get)));
|
||||
if (is_float($_main_get))
|
||||
{
|
||||
$query->where('a.main_get = ' . (float) $_main_get);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.main_get = ' . (int) $_main_get);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_main_get))
|
||||
{
|
||||
$query->where('a.main_get = ' . $db->quote($db->escape($_main_get)));
|
||||
}
|
||||
// Filter by Add_php_ajax.
|
||||
if ($add_php_ajax = $this->getState('filter.add_php_ajax'))
|
||||
$_add_php_ajax = $this->getState('filter.add_php_ajax');
|
||||
if (is_numeric($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . $db->quote($db->escape($add_php_ajax)));
|
||||
if (is_float($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . (float) $_add_php_ajax);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . (int) $_add_php_ajax);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_php_ajax))
|
||||
{
|
||||
$query->where('a.add_php_ajax = ' . $db->quote($db->escape($_add_php_ajax)));
|
||||
}
|
||||
// Filter by Add_custom_button.
|
||||
if ($add_custom_button = $this->getState('filter.add_custom_button'))
|
||||
$_add_custom_button = $this->getState('filter.add_custom_button');
|
||||
if (is_numeric($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . $db->quote($db->escape($add_custom_button)));
|
||||
if (is_float($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . (float) $_add_custom_button);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . (int) $_add_custom_button);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_custom_button))
|
||||
{
|
||||
$query->where('a.add_custom_button = ' . $db->quote($db->escape($_add_custom_button)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -318,14 +318,38 @@ class ComponentbuilderModelSnippets extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Type.
|
||||
if ($type = $this->getState('filter.type'))
|
||||
$_type = $this->getState('filter.type');
|
||||
if (is_numeric($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($type)));
|
||||
if (is_float($_type))
|
||||
{
|
||||
$query->where('a.type = ' . (float) $_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.type = ' . (int) $_type);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_type))
|
||||
{
|
||||
$query->where('a.type = ' . $db->quote($db->escape($_type)));
|
||||
}
|
||||
// Filter by Library.
|
||||
if ($library = $this->getState('filter.library'))
|
||||
$_library = $this->getState('filter.library');
|
||||
if (is_numeric($_library))
|
||||
{
|
||||
$query->where('a.library = ' . $db->quote($db->escape($library)));
|
||||
if (is_float($_library))
|
||||
{
|
||||
$query->where('a.library = ' . (float) $_library);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.library = ' . (int) $_library);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_library))
|
||||
{
|
||||
$query->where('a.library = ' . $db->quote($db->escape($_library)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
@ -230,14 +230,38 @@ class ComponentbuilderModelTemplates extends JModelList
|
||||
}
|
||||
|
||||
// Filter by Dynamic_get.
|
||||
if ($dynamic_get = $this->getState('filter.dynamic_get'))
|
||||
$_dynamic_get = $this->getState('filter.dynamic_get');
|
||||
if (is_numeric($_dynamic_get))
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . $db->quote($db->escape($dynamic_get)));
|
||||
if (is_float($_dynamic_get))
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . (float) $_dynamic_get);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . (int) $_dynamic_get);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_dynamic_get))
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . $db->quote($db->escape($_dynamic_get)));
|
||||
}
|
||||
// Filter by Add_php_view.
|
||||
if ($add_php_view = $this->getState('filter.add_php_view'))
|
||||
$_add_php_view = $this->getState('filter.add_php_view');
|
||||
if (is_numeric($_add_php_view))
|
||||
{
|
||||
$query->where('a.add_php_view = ' . $db->quote($db->escape($add_php_view)));
|
||||
if (is_float($_add_php_view))
|
||||
{
|
||||
$query->where('a.add_php_view = ' . (float) $_add_php_view);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.add_php_view = ' . (int) $_add_php_view);
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($_add_php_view))
|
||||
{
|
||||
$query->where('a.add_php_view = ' . $db->quote($db->escape($_add_php_view)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
|
Reference in New Issue
Block a user