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 @@ + +
+###FIELDFILTERSETS### + +###FIELDLISTSETS### +
\ 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::_('

Multi Filter Error

'), + 'Error' + ); + $field_url + = "index.php?option=com_componentbuilder&view=fields&task=field.edit&id=" + . $filter['id']; + $field_fix + = "
if (\$this->multiple === false) { // <-- this if statement is needed";
+						$field_fix .= PHP_EOL . $this->_t(1)
+							. "\$options[] = JHtml::_('select.option', '', 'Select an option'); // <-- the empty option";
+						$field_fix .= PHP_EOL . "}
"; + $this->app->enqueueMessage( + JText::sprintf( + 'We detected that you have an empty option in a custom field (%s) that is used in a multi filter.
This will cause a problem, you will need to add the following code to it.
%s', + $field_url, + $filter['code'], + $field_fix + ), 'Error' + ); + } + } + // divert the code to a file if this is not a funtion path + if (!$funtion_path + && ComponentbuilderHelper::checkArray( + $function + )) + { + // set the filter file + $this->setFilterFieldFile( + implode(PHP_EOL, $function), $filter + ); + // clear the filter out + $function = array(); } } - if (ComponentbuilderHelper::checkArray($function)) + // if this is a function path, return the function if set + if ($funtion_path && ComponentbuilderHelper::checkArray($function)) { // return the function return PHP_EOL . implode(PHP_EOL, $function); @@ -17758,15 +17845,26 @@ class Interpretation extends Fields } /** - * build other filter loading scripts + * build sidebar filter loading scripts * - * @param string $nameListCode The list view name + * @param string $nameSingleCode The single view name + * @param string $nameListCode The list view name * * @return string The php to place in view.html.php * */ - public function setOtherFilter(&$nameListCode) - { + public function setFilterFieldSidebarDisplayHelper(&$nameSingleCode, + &$nameListCode + ) { + // start the filter bucket + $fieldFilters = array(); + // add the default filter + $this->setDefaultSidebarFilterHelper( + $fieldFilters, $nameSingleCode, $nameListCode + ); + // add the category filter stuff + $this->setCategorySidebarFilterHelper($fieldFilters, $nameListCode); + // check if filter fields are added if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 1 && isset($this->filterBuilder[$nameListCode]) @@ -17775,88 +17873,72 @@ class Interpretation extends Fields )) { // get component name - $Component = $this->fileContentStatic[$this->hhh . 'Component' + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; - $otherFilter = array(); + // load the rest of the filters foreach ($this->filterBuilder[$nameListCode] as $filter) { if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom']) && $filter['custom']['extends'] !== 'user') { - $CodeName = ComponentbuilderHelper::safeString( + $CodeName = ComponentbuilderHelper::safeString( $filter['code'] . ' ' . $filter['custom']['text'], 'W' ); - $codeName = $filter['code'] + $codeName = $filter['code'] . ComponentbuilderHelper::safeString( $filter['custom']['text'], 'F' ); - $type = ComponentbuilderHelper::safeString( + $type = ComponentbuilderHelper::safeString( $filter['custom']['type'], 'F' ); - $otherFilter[] = PHP_EOL . $this->_t(2) . "//" + $fieldFilters[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set " . $CodeName . " Selection"; - $otherFilter[] = $this->_t(2) . "\$this->" . $codeName + $fieldFilters[] = $this->_t(2) . "\$this->" . $codeName . "Options = JFormHelper::loadFieldType('" . $type . "')->options;"; - $otherFilter[] = $this->_t(2) . "//" . $this->setLine( + $fieldFilters[] = $this->_t(2) . "//" . $this->setLine( __LINE__ ) . " We do some sanitation for " . $CodeName . " filter"; - $otherFilter[] = $this->_t(2) . "if (" . $Component + $fieldFilters[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $codeName . "Options) &&"; - $otherFilter[] = $this->_t(3) . "isset(\$this->" . $codeName + $fieldFilters[] = $this->_t(3) . "isset(\$this->" + . $codeName . "Options[0]->value) &&"; - $otherFilter[] = $this->_t(3) . "!" . $Component + $fieldFilters[] = $this->_t(3) . "!" . $Component . "Helper::checkString(\$this->" . $codeName . "Options[0]->value))"; - $otherFilter[] = $this->_t(2) . "{"; - $otherFilter[] = $this->_t(3) . "unset(\$this->" . $codeName + $fieldFilters[] = $this->_t(2) . "{"; + $fieldFilters[] = $this->_t(3) . "unset(\$this->" + . $codeName . "Options[0]);"; - $otherFilter[] = $this->_t(2) . "}"; - $otherFilter[] = $this->_t(2) . "//" . $this->setLine( + $fieldFilters[] = $this->_t(2) . "}"; + $fieldFilters[] = $this->_t(2) . "//" . $this->setLine( __LINE__ ) . " Only load " . $CodeName . " filter if it has values"; - $otherFilter[] = $this->_t(2) . "if (" . $Component + $fieldFilters[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $codeName . "Options))"; - $otherFilter[] = $this->_t(2) . "{"; - $otherFilter[] = $this->_t(3) . "//" . $this->setLine( + $fieldFilters[] = $this->_t(2) . "{"; + $fieldFilters[] = $this->_t(3) . "//" . $this->setLine( __LINE__ ) . " " . $CodeName . " Filter"; - $otherFilter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; - $otherFilter[] = $this->_t(4) . "'- Select '.JText:" + $fieldFilters[] = $this->_t(3) . "JHtmlSidebar::addFilter("; + $fieldFilters[] = $this->_t(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = $this->_t(4) . "'filter_" . $filter['code'] + $fieldFilters[] = $this->_t(4) . "'filter_" + . $filter['code'] . "',"; - $otherFilter[] = $this->_t(4) + $fieldFilters[] = $this->_t(4) . "JHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; - $otherFilter[] = $this->_t(3) . ");"; - - $otherFilter[] = PHP_EOL . $this->_t(3) - . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $otherFilter[] = $this->_t(3) . "{"; - $otherFilter[] = $this->_t(4) . "//" . $this->setLine( - __LINE__ - ) . " " . $CodeName . " Batch Selection"; - $otherFilter[] = $this->_t(4) - . "JHtmlBatch_::addListSelection("; - $otherFilter[] = $this->_t(5) . "'- Keep Original '.JText:" - . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = $this->_t(5) . "'batch[" . $filter['code'] - . "]',"; - $otherFilter[] = $this->_t(5) - . "JHtml::_('select.options', \$this->" . $codeName - . "Options, 'value', 'text')"; - $otherFilter[] = $this->_t(4) . ");"; - $otherFilter[] = $this->_t(3) . "}"; - - $otherFilter[] = $this->_t(2) . "}"; + $fieldFilters[] = $this->_t(3) . ");"; + $fieldFilters[] = $this->_t(2) . "}"; } elseif ($filter['type'] != 'category') { @@ -17877,82 +17959,384 @@ class Interpretation extends Fields $functionName = "\$this->getThe" . $filter['function'] . "Selections();"; } - $otherFilter[] = PHP_EOL . $this->_t(2) . "//" + $fieldFilters[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set " . $Codename . " Selection"; - $otherFilter[] = $this->_t(2) . "\$this->" . $filter['code'] + $fieldFilters[] = $this->_t(2) . "\$this->" + . $filter['code'] . "Options = " . $functionName; - $otherFilter[] = $this->_t(2) . "//" . $this->setLine( + $fieldFilters[] = $this->_t(2) . "//" . $this->setLine( __LINE__ ) . " We do some sanitation for " . $Codename . " filter"; - $otherFilter[] = $this->_t(2) . "if (" . $Component + $fieldFilters[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $filter['code'] . "Options) &&"; - $otherFilter[] = $this->_t(3) . "isset(\$this->" + $fieldFilters[] = $this->_t(3) . "isset(\$this->" . $filter['code'] . "Options[0]->value) &&"; - $otherFilter[] = $this->_t(3) . "!" . $Component + $fieldFilters[] = $this->_t(3) . "!" . $Component . "Helper::checkString(\$this->" . $filter['code'] . "Options[0]->value))"; - $otherFilter[] = $this->_t(2) . "{"; - $otherFilter[] = $this->_t(3) . "unset(\$this->" + $fieldFilters[] = $this->_t(2) . "{"; + $fieldFilters[] = $this->_t(3) . "unset(\$this->" . $filter['code'] . "Options[0]);"; - $otherFilter[] = $this->_t(2) . "}"; - $otherFilter[] = $this->_t(2) . "//" . $this->setLine( + $fieldFilters[] = $this->_t(2) . "}"; + $fieldFilters[] = $this->_t(2) . "//" . $this->setLine( __LINE__ ) . " Only load " . $Codename . " filter if it has values"; - $otherFilter[] = $this->_t(2) . "if (" . $Component + $fieldFilters[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $filter['code'] . "Options))"; - $otherFilter[] = $this->_t(2) . "{"; - $otherFilter[] = $this->_t(3) . "//" . $this->setLine( + $fieldFilters[] = $this->_t(2) . "{"; + $fieldFilters[] = $this->_t(3) . "//" . $this->setLine( __LINE__ ) . " " . $Codename . " Filter"; - $otherFilter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; - $otherFilter[] = $this->_t(4) . "'- Select '.JText:" + $fieldFilters[] = $this->_t(3) . "JHtmlSidebar::addFilter("; + $fieldFilters[] = $this->_t(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = $this->_t(4) . "'filter_" . $filter['code'] + $fieldFilters[] = $this->_t(4) . "'filter_" + . $filter['code'] . "',"; - $otherFilter[] = $this->_t(4) + $fieldFilters[] = $this->_t(4) . "JHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; - $otherFilter[] = $this->_t(3) . ");"; + $fieldFilters[] = $this->_t(3) . ");"; - $otherFilter[] = PHP_EOL . $this->_t(3) - . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $otherFilter[] = $this->_t(3) . "{"; - $otherFilter[] = $this->_t(4) . "//" . $this->setLine( - __LINE__ - ) . " " . $Codename . " Batch Selection"; - $otherFilter[] = $this->_t(4) - . "JHtmlBatch_::addListSelection("; - $otherFilter[] = $this->_t(5) . "'- Keep Original '.JText:" - . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = $this->_t(5) . "'batch[" . $filter['code'] - . "]',"; - $otherFilter[] = $this->_t(5) - . "JHtml::_('select.options', \$this->" - . $filter['code'] . "Options, 'value', 'text')"; - $otherFilter[] = $this->_t(4) . ");"; - $otherFilter[] = $this->_t(3) . "}"; - - $otherFilter[] = $this->_t(2) . "}"; + $fieldFilters[] = $this->_t(2) . "}"; } } - if (ComponentbuilderHelper::checkArray($otherFilter)) - { - // return the filter - return PHP_EOL . implode(PHP_EOL, $otherFilter); - } + } + // did we find filters + if (ComponentbuilderHelper::checkArray($fieldFilters)) + { + // return the filter + return PHP_EOL . implode(PHP_EOL, $fieldFilters); } return ''; } - public function setCategoryFilter($nameListCode) + /** + * add default filter helper + * + * @param array $filter The batch code array + * @param string $nameSingleCode The single view name + * @param string $nameListCode The list view name + * + * @return void + * + */ + protected function setDefaultSidebarFilterHelper(&$filter, &$nameSingleCode, + &$nameListCode + ) { + // add the default filters if we are on the old filter paths + if (isset($this->adminFilterType[$nameListCode]) + && $this->adminFilterType[$nameListCode] == 1) + { + // set batch + $filter[] = PHP_EOL . $this->_t(2) + . "//" . $this->setLine(__LINE__) + . " Only load publish filter if state change is allowed"; + $filter[] = $this->_t(2) + . "if (\$this->canState)"; + $filter[] = $this->_t(2) . "{"; + $filter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; + $filter[] = $this->_t(4) . "JText:" + . ":_('JOPTION_SELECT_PUBLISHED'),"; + $filter[] = $this->_t(4) . "'filter_published',"; + $filter[] = $this->_t(4) + . "JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', \$this->state->get('filter.published'), true)"; + $filter[] = $this->_t(3) . ");"; + $filter[] = $this->_t(2) . "}"; + // check if view has access + if (isset($this->accessBuilder[$nameSingleCode]) + && ComponentbuilderHelper::checkString( + $this->accessBuilder[$nameSingleCode] + ) + && !isset($this->fieldsNames[$nameSingleCode]['access'])) + { + $filter[] = PHP_EOL . $this->_t(2) . "JHtmlSidebar::addFilter("; + $filter[] = $this->_t(3) . "JText:" + . ":_('JOPTION_SELECT_ACCESS'),"; + $filter[] = $this->_t(3) . "'filter_access',"; + $filter[] = $this->_t(3) + . "JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', \$this->state->get('filter.access'))"; + $filter[] = $this->_t(2) . ");"; + } + } + } + + /** + * build category sidebar display filter helper + * + * @param array $filter The filter code array + * @param string $nameListCode The list view name + * + * @return void + * + */ + protected function setCategorySidebarFilterHelper(&$filter, &$nameListCode) + { + // add the category filter if we are on the old filter paths + if (isset($this->adminFilterType[$nameListCode]) + && $this->adminFilterType[$nameListCode] == 1 + && isset($this->categoryBuilder[$nameListCode]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$nameListCode] + ) + && isset($this->categoryBuilder[$nameListCode]['extension'])) + { + // set filter + $filter[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Category Filter."; + $filter[] = $this->_t(2) . "JHtmlSidebar::addFilter("; + $filter[] = $this->_t(3) . "JText:" + . ":_('JOPTION_SELECT_CATEGORY'),"; + $filter[] = $this->_t(3) . "'filter_category_id',"; + $filter[] = $this->_t(3) + . "JHtml::_('select.options', JHtml::_('category.options', '" + . $this->categoryBuilder[$nameListCode]['extension'] + . "'), 'value', 'text', \$this->state->get('filter.category_id'))"; + $filter[] = $this->_t(2) . ");"; + } + } + + /** + * build batch loading helper scripts + * + * @param string $nameSingleCode The single view name + * @param string $nameListCode The list view name + * + * @return string The php to place in view.html.php + * + */ + public function setBatchDisplayHelper(&$nameSingleCode, &$nameListCode) + { + // start the batch bucket + $fieldBatch = array(); + // add the default batch + $this->setDefaultBatchHelper($fieldBatch, $nameSingleCode); + // add the category filter stuff + $this->setCategoryBatchHelper($fieldBatch, $nameListCode); + // check if we have other batch options to add + if (isset($this->filterBuilder[$nameListCode]) + && ComponentbuilderHelper::checkArray( + $this->filterBuilder[$nameListCode] + )) + { + // check if we should add some help to get the values + $get_values = false; + if (isset($this->adminFilterType[$nameListCode]) + && $this->adminFilterType[$nameListCode] == 2) + { + // since the old path is not used, we need to add those values here + $get_values = true; + } + // get component name + $Component = $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh]; + // load the rest of the batch options + foreach ($this->filterBuilder[$nameListCode] as $filter) + { + if ($filter['type'] != 'category' + && ComponentbuilderHelper::checkArray($filter['custom']) + && $filter['custom']['extends'] !== 'user') + { + $CodeName = ComponentbuilderHelper::safeString( + $filter['code'] . ' ' . $filter['custom']['text'], 'W' + ); + $codeName = $filter['code'] + . ComponentbuilderHelper::safeString( + $filter['custom']['text'], 'F' + ); + $fieldBatch[] = PHP_EOL . $this->_t(2) + . "//" . $this->setLine(__LINE__) + . " Only load " . $CodeName + . " batch if create, edit, and batch is allowed"; + $fieldBatch[] = $this->_t(2) + . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $fieldBatch[] = $this->_t(2) . "{"; + // add the get values here + if ($get_values) + { + $type = ComponentbuilderHelper::safeString( + $filter['custom']['type'], 'F' + ); + $fieldBatch[] = $this->_t(3) . "//" + . $this->setLine(__LINE__) . " Set " . $CodeName + . " Selection"; + $fieldBatch[] = $this->_t(3) . "\$this->" . $codeName + . "Options = JFormHelper::loadFieldType('" . $type + . "')->options;"; + $fieldBatch[] = $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " We do some sanitation for " . $CodeName + . " filter"; + $fieldBatch[] = $this->_t(3) . "if (" . $Component + . "Helper::checkArray(\$this->" . $codeName + . "Options) &&"; + $fieldBatch[] = $this->_t(4) . "isset(\$this->" + . $codeName + . "Options[0]->value) &&"; + $fieldBatch[] = $this->_t(4) . "!" . $Component + . "Helper::checkString(\$this->" . $codeName + . "Options[0]->value))"; + $fieldBatch[] = $this->_t(3) . "{"; + $fieldBatch[] = $this->_t(4) . "unset(\$this->" + . $codeName + . "Options[0]);"; + $fieldBatch[] = $this->_t(3) . "}"; + } + $fieldBatch[] = $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " " . $CodeName . " Batch Selection"; + $fieldBatch[] = $this->_t(3) + . "JHtmlBatch_::addListSelection("; + $fieldBatch[] = $this->_t(4) . "'- Keep Original '.JText:" + . ":_('" . $filter['lang'] . "').' -',"; + $fieldBatch[] = $this->_t(4) . "'batch[" . $filter['code'] + . "]',"; + $fieldBatch[] = $this->_t(4) + . "JHtml::_('select.options', \$this->" . $codeName + . "Options, 'value', 'text')"; + $fieldBatch[] = $this->_t(3) . ");"; + $fieldBatch[] = $this->_t(2) . "}"; + } + elseif ($filter['type'] != 'category') + { + $CodeName = ComponentbuilderHelper::safeString( + $filter['code'], 'W' + ); + + $fieldBatch[] = PHP_EOL . $this->_t(2) + . "//" . $this->setLine(__LINE__) + . " Only load " . $CodeName + . " batch if create, edit, and batch is allowed"; + $fieldBatch[] = $this->_t(2) + . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $fieldBatch[] = $this->_t(2) . "{"; + // add the get values here + if ($get_values) + { + $fieldBatch[] = $this->_t(3) . "//" + . $this->setLine(__LINE__) . " Set " . $CodeName + . " Selection"; + $fieldBatch[] = $this->_t(3) . "\$this->" + . $filter['code'] + . "Options = JFormHelper::loadFieldType('" + . $filter['filter_type'] + . "')->options;"; + $fieldBatch[] = $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " We do some sanitation for " . $CodeName + . " filter"; + $fieldBatch[] = $this->_t(3) . "if (" . $Component + . "Helper::checkArray(\$this->" . $filter['code'] + . "Options) &&"; + $fieldBatch[] = $this->_t(4) . "isset(\$this->" + . $filter['code'] . "Options[0]->value) &&"; + $fieldBatch[] = $this->_t(4) . "!" . $Component + . "Helper::checkString(\$this->" . $filter['code'] + . "Options[0]->value))"; + $fieldBatch[] = $this->_t(3) . "{"; + $fieldBatch[] = $this->_t(4) . "unset(\$this->" + . $filter['code'] . "Options[0]);"; + $fieldBatch[] = $this->_t(3) . "}"; + } + $fieldBatch[] = $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " " . $CodeName . " Batch Selection"; + $fieldBatch[] = $this->_t(3) + . "JHtmlBatch_::addListSelection("; + $fieldBatch[] = $this->_t(4) . "'- Keep Original '.JText:" + . ":_('" . $filter['lang'] . "').' -',"; + $fieldBatch[] = $this->_t(4) . "'batch[" . $filter['code'] + . "]',"; + $fieldBatch[] = $this->_t(4) + . "JHtml::_('select.options', \$this->" + . $filter['code'] . "Options, 'value', 'text')"; + $fieldBatch[] = $this->_t(3) . ");"; + $fieldBatch[] = $this->_t(2) . "}"; + } + } + } + // did we find batch options + if (ComponentbuilderHelper::checkArray($fieldBatch)) + { + // return the batch + return PHP_EOL . implode(PHP_EOL, $fieldBatch); + } + + return ''; + } + + /** + * add default batch helper + * + * @param array $batch The batch code array + * @param string $nameSingleCode The single view name + * + * @return void + * + */ + protected function setDefaultBatchHelper(&$batch, &$nameSingleCode) + { + // set component name + $COPMONENT = ComponentbuilderHelper::safeString( + $this->componentData->name_code, 'U' + ); + // set batch + $batch[] = PHP_EOL . $this->_t(2) + . "//" . $this->setLine(__LINE__) + . " Only load published batch if state and batch is allowed"; + $batch[] = $this->_t(2) + . "if (\$this->canState && \$this->canBatch)"; + $batch[] = $this->_t(2) . "{"; + $batch[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; + $batch[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT + . "_KEEP_ORIGINAL_STATE'),"; + $batch[] = $this->_t(4) . "'batch[published]',"; + $batch[] = $this->_t(4) + . "JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)"; + $batch[] = $this->_t(3) . ");"; + $batch[] = $this->_t(2) . "}"; + // check if view has access + if (isset($this->accessBuilder[$nameSingleCode]) + && ComponentbuilderHelper::checkString( + $this->accessBuilder[$nameSingleCode] + ) + && !isset($this->fieldsNames[$nameSingleCode]['access'])) + { + $batch[] = PHP_EOL . $this->_t(2) + . "//" . $this->setLine(__LINE__) + . " Only load access batch if create, edit and batch is allowed"; + $batch[] = $this->_t(2) + . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $batch[] = $this->_t(2) . "{"; + $batch[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; + $batch[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT + . "_KEEP_ORIGINAL_ACCESS'),"; + $batch[] = $this->_t(4) . "'batch[access]',"; + $batch[] = $this->_t(4) + . "JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')"; + $batch[] = $this->_t(3) . ");"; + $batch[] = $this->_t(2) . "}"; + } + } + + /** + * build category batch helper + * + * @param array $batch The batch code array + * @param string $nameListCode The list view name + * + * @return mixed The php to place in view.html.php + * + */ + protected function setCategoryBatchHelper(&$batch, &$nameListCode) { if (isset($this->categoryBuilder[$nameListCode]) && ComponentbuilderHelper::checkArray( @@ -17965,41 +18349,22 @@ class Interpretation extends Fields $this->componentData->name_code, 'U' ); // set filter - $filter = array(); - $filter[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Category Filter."; - $filter[] = $this->_t(2) . "JHtmlSidebar::addFilter("; - $filter[] = $this->_t(3) . "JText:" - . ":_('JOPTION_SELECT_CATEGORY'),"; - $filter[] = $this->_t(3) . "'filter_category_id',"; - $filter[] = $this->_t(3) - . "JHtml::_('select.options', JHtml::_('category.options', '" - . $this->categoryBuilder[$nameListCode]['extension'] - . "'), 'value', 'text', \$this->state->get('filter.category_id'))"; - $filter[] = $this->_t(2) . ");"; - - - $filter[] = PHP_EOL . $this->_t(2) + $batch[] = PHP_EOL . $this->_t(2) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $filter[] = $this->_t(2) . "{"; - $filter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batch[] = $this->_t(2) . "{"; + $batch[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Category Batch selection."; - $filter[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; - $filter[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT + $batch[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; + $batch[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT . "_KEEP_ORIGINAL_CATEGORY'),"; - $filter[] = $this->_t(4) . "'batch[category]',"; - $filter[] = $this->_t(4) + $batch[] = $this->_t(4) . "'batch[category]',"; + $batch[] = $this->_t(4) . "JHtml::_('select.options', JHtml::_('category.options', '" . $this->categoryBuilder[$nameListCode]['extension'] . "'), 'value', 'text')"; - $filter[] = $this->_t(3) . ");"; - $filter[] = $this->_t(2) . "}"; - - // return the filter - return implode(PHP_EOL, $filter); + $batch[] = $this->_t(3) . ");"; + $batch[] = $this->_t(2) . "}"; } - - return ''; } public function setRouterCategoryViews($nameSingleCode, $nameListCode) @@ -19731,7 +20096,7 @@ class Interpretation extends Fields * @return string The code for the filter fields array * */ - public function setFilterFields(&$nameListCode) + public function setFilterFieldsArray(&$nameListCode) { // keep track of all fields already added $donelist = array('id' => true, 'search' => true, @@ -20355,8 +20720,9 @@ class Interpretation extends Fields protected function getPopulateStateFilterCode(&$filter, $new_filter, $extra = '' ) { + $state = ''; // add category stuff (may still remove these) TODO - if ($filter['type'] === 'category') + if (isset($filter['type']) && $filter['type'] === 'category') { $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; @@ -20368,7 +20734,7 @@ class Interpretation extends Fields . "\$this->setState('filter.category_id', \$categoryId);"; } // always add the default filter - $state = PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $filter['code'] + $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "'" . $extra . ");"; @@ -21279,6 +21645,15 @@ class Interpretation extends Fields return $script . $forEachStart . $fix; } + /** + * Build headers for the model/view/controller headers + * + * @param string $context The name of the context + * @param string $viewsCodeName The view or views name + * + * @return string The php to place in the header + * + */ public function setClassHeaders($context, $viewsCodeName) { // set the defaults @@ -21291,6 +21666,34 @@ class Interpretation extends Fields $headers[] = 'use Joomla\String\StringHelper;'; $headers[] = 'use Joomla\Utilities\ArrayHelper;'; break; + case 'admin.view': + case 'custom.admin.view': + case 'custom.admin.views': + case 'site.admin.view': + $headers[] + = 'JHtml::addIncludePath(JPATH_COMPONENT.\'/helpers/html\');'; + $headers[] = 'JHtml::_(\'behavior.tooltip\');'; + $headers[] = 'JHtml::_(\'behavior.formvalidation\');'; + $headers[] = 'JHtml::_(\'formbehavior.chosen\', \'select\');'; + $headers[] = 'JHtml::_(\'behavior.keepalive\');'; + if ($context === 'site.admin.view') + { + $headers[] = 'JHtml::_(\'behavior.tabstate\');'; + $headers[] = 'JHtml::_(\'behavior.calendar\');'; + } + break; + case 'admin.views': + $headers[] = 'JHtml::_(\'behavior.tooltip\');'; + $headers[] = 'JHtml::_(\'behavior.multiselect\');'; + $headers[] = 'JHtml::_(\'dropdown.init\');'; + // add more headers if the new filter option is used + $this->setChosenMultiSelectionHeaders($headers, $viewsCodeName); + $headers[] = 'JHtml::_(\'formbehavior.chosen\', \'select\');'; + break; + case 'site.view': + case 'site.views': + $headers = array(); + break; default: $headers[] = 'use Joomla\Utilities\ArrayHelper;'; break; @@ -21301,9 +21704,62 @@ class Interpretation extends Fields array(&$this->componentContext, &$context, &$viewsCodeName, &$headers) ); + // check if headers were added + if (ComponentbuilderHelper::checkArray($headers)) + { + // return the headers + return implode(PHP_EOL, $headers); + } - // return the headers - return implode(PHP_EOL, $headers); + return ''; + } + + /** + * Build chosen multi selection headers for the view + * + * @param array $headers The headers array + * @param string $nameListCode The list view name + * + * @return void + * + */ + protected function setChosenMultiSelectionHeaders(&$headers, $nameListCode) + { + // check that the filter type is the new filter option + if (isset($this->adminFilterType[$nameListCode]) + && $this->adminFilterType[$nameListCode] == 2 + && isset($this->filterBuilder[$nameListCode]) + && ComponentbuilderHelper::checkArray( + $this->filterBuilder[$nameListCode] + )) + { + // main lang prefix + $lang_ = $this->langPrefix . '_FILTER_'; + foreach ($this->filterBuilder[$nameListCode] as $filter) + { + // we need this only for filters that are multi + if (isset($filter['multi']) + && $filter['multi'] == 2) + { + // set the selection string (not ideal) + $select_name = "Select " . strip_tags($filter['name']); + // set the language + $select_lang = $lang_ . ComponentbuilderHelper::safeString( + $select_name, 'U' + ); + // set selection lang + $this->setLangContent( + $this->lang, $select_lang, $select_name + ); + // add the header + $headers[] + = 'JHtml::_(\'formbehavior.chosen\', \'.multiple' + . $filter['class'] + . '\', null, array(\'placeholder_text_multiple\' => JText::_(\'' + . $select_lang . '\')));'; + } + } + } } protected function setModelFieldRelation($item, $nameListCode, $tab) diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 9457d79a6..71c2114d4 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -631,7 +631,7 @@ class Infusion extends Interpretation $nameSingleCode, $view ); } - // SITE_VIEW_CONTROLLER_HEADER <<>> add the header details for the model + // SITE_ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller $this->fileContentDynamic[$nameSingleCode][$this->hhh . 'SITE_ADMIN_VIEW_CONTROLLER_HEADER' . $this->hhh] = $this->setClassHeaders( @@ -645,6 +645,13 @@ class Infusion extends Interpretation 'site.admin.view.model', $nameSingleCode ); + // SITE_ADMIN_VIEW_HEADER <<>> add the header details for the view + $this->fileContentDynamic[$nameSingleCode][$this->hhh + . 'SITE_ADMIN_VIEW_HEADER' . $this->hhh] + = $this->setClassHeaders( + 'site.admin.view', + $nameSingleCode + ); } // TABLAYOUTFIELDSARRAY <<>> add the tab layout fields array to the model @@ -654,7 +661,7 @@ class Infusion extends Interpretation $nameSingleCode ); - // ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the model + // ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller $this->fileContentDynamic[$nameSingleCode][$this->hhh . 'ADMIN_VIEW_CONTROLLER_HEADER' . $this->hhh] = $this->setClassHeaders( @@ -667,6 +674,12 @@ class Infusion extends Interpretation = $this->setClassHeaders( 'admin.view.model', $nameSingleCode ); + // ADMIN_VIEW_HEADER <<>> add the header details for the view + $this->fileContentDynamic[$nameSingleCode][$this->hhh + . 'ADMIN_VIEW_HEADER' . $this->hhh] + = $this->setClassHeaders( + 'admin.view', $nameSingleCode + ); // Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent $this->triggerEvent( @@ -805,7 +818,7 @@ class Infusion extends Interpretation // FILTER_FIELDS <<>> $this->fileContentDynamic[$nameListCode][$this->hhh . 'FILTER_FIELDS' . $this->hhh] - = $this->setFilterFields( + = $this->setFilterFieldsArray( $nameListCode ); @@ -828,13 +841,6 @@ class Infusion extends Interpretation $nameListCode ); - // CATEGORYFILTER <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'CATEGORYFILTER' . $this->hhh] - = $this->setCategoryFilter( - $nameListCode - ); - // CATEGORY_VIEWS if (!isset( $this->fileContentStatic[$this->hhh @@ -852,17 +858,44 @@ class Infusion extends Interpretation $nameListCode ); - // OTHERFILTERS <<>> + // FILTERFIELDDISPLAYHELPER <<>> $this->fileContentDynamic[$nameListCode][$this->hhh - . 'OTHERFILTERS' . $this->hhh] - = $this->setOtherFilter( + . 'FILTERFIELDDISPLAYHELPER' . $this->hhh] + = $this->setFilterFieldSidebarDisplayHelper( + $nameSingleCode, + $nameListCode + ); + + // BATCHDISPLAYHELPER <<>> + $this->fileContentDynamic[$nameListCode][$this->hhh + . 'BATCHDISPLAYHELPER' . $this->hhh] + = $this->setBatchDisplayHelper( + $nameSingleCode, $nameListCode ); // FILTERFUNCTIONS <<>> $this->fileContentDynamic[$nameListCode][$this->hhh . 'FILTERFUNCTIONS' . $this->hhh] - = $this->setFilterFunctions( + = $this->setFilterFieldHelper( + $nameSingleCode, + $nameListCode + ); + + // FIELDFILTERSETS <<>> + $this->fileContentDynamic['filter_' + . $nameListCode][$this->hhh + . 'FIELDFILTERSETS' . $this->hhh] + = $this->setFieldFilterSet( + $nameSingleCode, + $nameListCode + ); + + // FIELDLISTSETS <<>> + $this->fileContentDynamic['filter_' + . $nameListCode][$this->hhh + . 'FIELDLISTSETS' . $this->hhh] + = $this->setFieldFilterListSet( $nameSingleCode, $nameListCode ); @@ -988,7 +1021,7 @@ class Infusion extends Interpretation = ''; } - // ADMIN_VIEWS_CONTROLLER_HEADER <<>> add the header details for the model + // ADMIN_VIEWS_CONTROLLER_HEADER <<>> add the header details for the controller $this->fileContentDynamic[$nameListCode][$this->hhh . 'ADMIN_VIEWS_CONTROLLER_HEADER' . $this->hhh] = $this->setClassHeaders( @@ -1001,6 +1034,12 @@ class Infusion extends Interpretation = $this->setClassHeaders( 'admin.views.model', $nameListCode ); + // ADMIN_VIEWS_HEADER <<>> add the header details for the views + $this->fileContentDynamic[$nameListCode][$this->hhh + . 'ADMIN_VIEWS_HEADER' . $this->hhh] + = $this->setClassHeaders( + 'admin.views', $nameListCode + ); // Trigger Event: jcb_ce_onAfterBuildAdminListViewContent $this->triggerEvent( @@ -1459,7 +1498,7 @@ class Infusion extends Interpretation // set headers based on the main get type if ($view['settings']->main_get->gettype == 1) { - // CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the model + // CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER' . $this->hhh] = $this->setClassHeaders( @@ -1472,10 +1511,16 @@ class Infusion extends Interpretation = $this->setClassHeaders( 'custom.admin.view.model', $view['settings']->code ); + // CUSTOM_ADMIN_VIEW_HEADER <<>> add the header details for the view + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_VIEW_HEADER' . $this->hhh] + = $this->setClassHeaders( + 'custom.admin.view', $view['settings']->code + ); } elseif ($view['settings']->main_get->gettype == 2) { - // CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER <<>> add the header details for the model + // CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER <<>> add the header details for the controller $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER' . $this->hhh] = $this->setClassHeaders( @@ -1488,6 +1533,12 @@ class Infusion extends Interpretation = $this->setClassHeaders( 'custom.admin.views.model', $view['settings']->code ); + // CUSTOM_ADMIN_VIEWS_HEADER <<>> add the header details for the view + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_VIEWS_HEADER' . $this->hhh] + = $this->setClassHeaders( + 'custom.admin.views', $view['settings']->code + ); } // Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent @@ -1943,6 +1994,12 @@ class Infusion extends Interpretation = $this->setClassHeaders( 'site.view.model', $view['settings']->code ); + // SITE_VIEW_HEADER <<>> add the header details for the view + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_VIEW_HEADER' . $this->hhh] + = $this->setClassHeaders( + 'site.view', $view['settings']->code + ); } elseif ($view['settings']->main_get->gettype == 2) { @@ -1965,6 +2022,12 @@ class Infusion extends Interpretation = $this->setClassHeaders( 'site.views.model', $view['settings']->code ); + // SITE_VIEWS_HEADER <<>> add the header details for the view + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_VIEWS_HEADER' . $this->hhh] + = $this->setClassHeaders( + 'site.views', $view['settings']->code + ); } // Trigger Event: jcb_ce_onAfterBuildSiteViewContent diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index 469805100..659fee20b 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -82,64 +82,29 @@ class ComponentbuilderModelAdmin_views extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Check if the form was submitted - $formSubmited = $app->input->post->get('form_submited'); - $add_fadein = $this->getUserStateFromRequest($this->context . '.filter.add_fadein', 'filter_add_fadein'); - if ($formSubmited) - { - $add_fadein = $app->input->post->get('add_fadein'); - $this->setState('filter.add_fadein', $add_fadein); - } + $this->setState('filter.add_fadein', $add_fadein); $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type'); - if ($formSubmited) - { - $type = $app->input->post->get('type'); - $this->setState('filter.type', $type); - } + $this->setState('filter.type', $type); $add_custom_button = $this->getUserStateFromRequest($this->context . '.filter.add_custom_button', 'filter_add_custom_button'); - if ($formSubmited) - { - $add_custom_button = $app->input->post->get('add_custom_button'); - $this->setState('filter.add_custom_button', $add_custom_button); - } + $this->setState('filter.add_custom_button', $add_custom_button); $add_php_ajax = $this->getUserStateFromRequest($this->context . '.filter.add_php_ajax', 'filter_add_php_ajax'); - if ($formSubmited) - { - $add_php_ajax = $app->input->post->get('add_php_ajax'); - $this->setState('filter.add_php_ajax', $add_php_ajax); - } + $this->setState('filter.add_php_ajax', $add_php_ajax); $add_custom_import = $this->getUserStateFromRequest($this->context . '.filter.add_custom_import', 'filter_add_custom_import'); - if ($formSubmited) - { - $add_custom_import = $app->input->post->get('add_custom_import'); - $this->setState('filter.add_custom_import', $add_custom_import); - } + $this->setState('filter.add_custom_import', $add_custom_import); $system_name = $this->getUserStateFromRequest($this->context . '.filter.system_name', 'filter_system_name'); - if ($formSubmited) - { - $system_name = $app->input->post->get('system_name'); - $this->setState('filter.system_name', $system_name); - } + $this->setState('filter.system_name', $system_name); $name_single = $this->getUserStateFromRequest($this->context . '.filter.name_single', 'filter_name_single'); - if ($formSubmited) - { - $name_single = $app->input->post->get('name_single'); - $this->setState('filter.name_single', $name_single); - } + $this->setState('filter.name_single', $name_single); $short_description = $this->getUserStateFromRequest($this->context . '.filter.short_description', 'filter_short_description'); - if ($formSubmited) - { - $short_description = $app->input->post->get('short_description'); - $this->setState('filter.short_description', $short_description); - } + $this->setState('filter.short_description', $short_description); // List state information. parent::populateState($ordering, $direction); @@ -342,44 +307,9 @@ class ComponentbuilderModelAdmin_views extends JModelList $query->where('a.add_fadein = ' . $db->quote($db->escape($add_fadein))); } // Filter by Type. - $_type = $this->getState('filter.type'); - if (is_numeric($_type)) + if ($type = $this->getState('filter.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))); - } - elseif (ComponentbuilderHelper::checkArray($_type)) - { - // Secure the array for the query - $_type = array_map( function ($val) use(&$db) { - if (is_numeric($val)) - { - if (is_float($val)) - { - return (float) $val; - } - else - { - return (int) $val; - } - } - elseif (ComponentbuilderHelper::checkString($val)) - { - return $db->quote($db->escape($val)); - } - }, $_type); - // Filter by the Type Array. - $query->where('a.type IN (' . implode(',', $_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')) diff --git a/admin/models/fields.php b/admin/models/fields.php index 454012dd9..68aadb2c1 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -98,6 +98,12 @@ class ComponentbuilderModelFields extends JModelList $store = $this->getUserStateFromRequest($this->context . '.filter.store', 'filter_store'); $this->setState('filter.store', $store); + $category = $app->getUserStateFromRequest($this->context . '.filter.category', 'filter_category'); + $this->setState('filter.category', $category); + + $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id'); + $this->setState('filter.category_id', $categoryId); + $catid = $this->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid'); $this->setState('filter.catid', $catid); diff --git a/admin/models/fieldtypes.php b/admin/models/fieldtypes.php index ee557f9e7..103079250 100644 --- a/admin/models/fieldtypes.php +++ b/admin/models/fieldtypes.php @@ -79,6 +79,12 @@ class ComponentbuilderModelFieldtypes extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); + $category = $app->getUserStateFromRequest($this->context . '.filter.category', 'filter_category'); + $this->setState('filter.category', $category); + + $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id'); + $this->setState('filter.category_id', $categoryId); + $catid = $this->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid'); $this->setState('filter.catid', $catid); diff --git a/admin/views/admin_custom_tabs/tmpl/edit.php b/admin/views/admin_custom_tabs/tmpl/edit.php index eb213b4fc..2bfa1093b 100644 --- a/admin/views/admin_custom_tabs/tmpl/edit.php +++ b/admin/views/admin_custom_tabs/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/admin_fields/tmpl/edit.php b/admin/views/admin_fields/tmpl/edit.php index f024c18b6..3c533d767 100644 --- a/admin/views/admin_fields/tmpl/edit.php +++ b/admin/views/admin_fields/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/admin_fields_conditions/tmpl/edit.php b/admin/views/admin_fields_conditions/tmpl/edit.php index 1ef755774..580efee01 100644 --- a/admin/views/admin_fields_conditions/tmpl/edit.php +++ b/admin/views/admin_fields_conditions/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/admin_fields_relations/tmpl/edit.php b/admin/views/admin_fields_relations/tmpl/edit.php index 9cdee6ac0..c21dc6239 100644 --- a/admin/views/admin_fields_relations/tmpl/edit.php +++ b/admin/views/admin_fields_relations/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/admin_view/tmpl/edit.php b/admin/views/admin_view/tmpl/edit.php index da0706cbf..73386976e 100644 --- a/admin/views/admin_view/tmpl/edit.php +++ b/admin/views/admin_view/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/admin_views/tmpl/default.php b/admin/views/admin_views/tmpl/default.php index 81bc87541..aca5d86a1 100644 --- a/admin/views/admin_views/tmpl/default.php +++ b/admin/views/admin_views/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admin_views.saveOrderAjax&tmpl=component'; diff --git a/admin/views/admin_views/tmpl/default_head.php b/admin/views/admin_views/tmpl/default_head.php index 67725fabb..7de3fdddd 100644 --- a/admin/views/admin_views/tmpl/default_head.php +++ b/admin/views/admin_views/tmpl/default_head.php @@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> @@ -30,17 +30,17 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> @@ -48,6 +48,6 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/admin_views/view.html.php b/admin/views/admin_views/view.html.php index 9d6d89594..170fe0d18 100644 --- a/admin/views/admin_views/view.html.php +++ b/admin/views/admin_views/view.html.php @@ -34,10 +34,6 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->user = JFactory::getUser(); - // Load the filter form from xml. - $this->filterForm = $this->get('FilterForm'); - // Load the active filters. - $this->activeFilters = $this->get('ActiveFilters'); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); @@ -161,39 +157,197 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Set Add Fadein Selection + $this->add_fadeinOptions = $this->getTheAdd_fadeinSelections(); + // We do some sanitation for Add Fadein filter + if (ComponentbuilderHelper::checkArray($this->add_fadeinOptions) && + isset($this->add_fadeinOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->add_fadeinOptions[0]->value)) + { + unset($this->add_fadeinOptions[0]); + } + // Only load Add Fadein filter if it has values + if (ComponentbuilderHelper::checkArray($this->add_fadeinOptions)) + { + // Add Fadein Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_FADEIN_LABEL').' -', + 'filter_add_fadein', + JHtml::_('select.options', $this->add_fadeinOptions, 'value', 'text', $this->state->get('filter.add_fadein')) + ); + } + + // Set Type Selection + $this->typeOptions = $this->getTheTypeSelections(); + // We do some sanitation for Type filter + if (ComponentbuilderHelper::checkArray($this->typeOptions) && + isset($this->typeOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + { + unset($this->typeOptions[0]); + } + // Only load Type filter if it has values + if (ComponentbuilderHelper::checkArray($this->typeOptions)) + { + // Type Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_TYPE_LABEL').' -', + 'filter_type', + JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type')) + ); + } + + // Set Add Custom Button Selection + $this->add_custom_buttonOptions = $this->getTheAdd_custom_buttonSelections(); + // We do some sanitation for Add Custom Button filter + if (ComponentbuilderHelper::checkArray($this->add_custom_buttonOptions) && + isset($this->add_custom_buttonOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->add_custom_buttonOptions[0]->value)) + { + unset($this->add_custom_buttonOptions[0]); + } + // Only load Add Custom Button filter if it has values + if (ComponentbuilderHelper::checkArray($this->add_custom_buttonOptions)) + { + // Add Custom Button Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', + 'filter_add_custom_button', + JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text', $this->state->get('filter.add_custom_button')) + ); + } + + // Set Add Php Ajax Selection + $this->add_php_ajaxOptions = $this->getTheAdd_php_ajaxSelections(); + // We do some sanitation for Add Php Ajax filter + if (ComponentbuilderHelper::checkArray($this->add_php_ajaxOptions) && + isset($this->add_php_ajaxOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->add_php_ajaxOptions[0]->value)) + { + unset($this->add_php_ajaxOptions[0]); + } + // Only load Add Php Ajax filter if it has values + if (ComponentbuilderHelper::checkArray($this->add_php_ajaxOptions)) + { + // Add Php Ajax Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -', + 'filter_add_php_ajax', + JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text', $this->state->get('filter.add_php_ajax')) + ); + } + + // Set Add Custom Import Selection + $this->add_custom_importOptions = $this->getTheAdd_custom_importSelections(); + // We do some sanitation for Add Custom Import filter + if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions) && + isset($this->add_custom_importOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->add_custom_importOptions[0]->value)) + { + unset($this->add_custom_importOptions[0]); + } + // Only load Add Custom Import filter if it has values + if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions)) + { + // Add Custom Import Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -', + 'filter_add_custom_import', + JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text', $this->state->get('filter.add_custom_import')) + ); + } + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Add Fadein batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Fadein Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_FADEIN_LABEL').' -', + 'batch[add_fadein]', + JHtml::_('select.options', $this->add_fadeinOptions, 'value', 'text') + ); + } + + // Only load Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_TYPE_LABEL').' -', + 'batch[type]', + JHtml::_('select.options', $this->typeOptions, 'value', 'text') + ); + } + + // Only load Add Custom Button batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Custom Button Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', + 'batch[add_custom_button]', + JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text') + ); + } + + // Only load Add Php Ajax batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Php Ajax Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -', + 'batch[add_php_ajax]', + JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text') + ); + } + + // Only load Add Custom Import batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Custom Import Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -', + 'batch[add_custom_import]', + JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text') + ); } } @@ -245,5 +399,185 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy 'a.short_description' => JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SHORT_DESCRIPTION_LABEL'), 'a.id' => JText::_('JGRID_HEADING_ID') ); + } + + protected function getTheAdd_fadeinSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('add_fadein')); + $query->from($db->quoteName('#__componentbuilder_admin_view')); + $query->order($db->quoteName('add_fadein') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $add_fadein) + { + // Translate the add_fadein selection + $text = $model->selectionTranslation($add_fadein,'add_fadein'); + // Now add the add_fadein and its text to the options array + $_filter[] = JHtml::_('select.option', $add_fadein, JText::_($text)); + } + return $_filter; + } + return false; + } + + protected function getTheTypeSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('type')); + $query->from($db->quoteName('#__componentbuilder_admin_view')); + $query->order($db->quoteName('type') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $type) + { + // Translate the type selection + $text = $model->selectionTranslation($type,'type'); + // Now add the type and its text to the options array + $_filter[] = JHtml::_('select.option', $type, JText::_($text)); + } + return $_filter; + } + return false; + } + + protected function getTheAdd_custom_buttonSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('add_custom_button')); + $query->from($db->quoteName('#__componentbuilder_admin_view')); + $query->order($db->quoteName('add_custom_button') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $add_custom_button) + { + // Translate the add_custom_button selection + $text = $model->selectionTranslation($add_custom_button,'add_custom_button'); + // Now add the add_custom_button and its text to the options array + $_filter[] = JHtml::_('select.option', $add_custom_button, JText::_($text)); + } + return $_filter; + } + return false; + } + + protected function getTheAdd_php_ajaxSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('add_php_ajax')); + $query->from($db->quoteName('#__componentbuilder_admin_view')); + $query->order($db->quoteName('add_php_ajax') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $add_php_ajax) + { + // Translate the add_php_ajax selection + $text = $model->selectionTranslation($add_php_ajax,'add_php_ajax'); + // Now add the add_php_ajax and its text to the options array + $_filter[] = JHtml::_('select.option', $add_php_ajax, JText::_($text)); + } + return $_filter; + } + return false; + } + + protected function getTheAdd_custom_importSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('add_custom_import')); + $query->from($db->quoteName('#__componentbuilder_admin_view')); + $query->order($db->quoteName('add_custom_import') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $add_custom_import) + { + // Translate the add_custom_import selection + $text = $model->selectionTranslation($add_custom_import,'add_custom_import'); + // Now add the add_custom_import and its text to the options array + $_filter[] = JHtml::_('select.option', $add_custom_import, JText::_($text)); + } + return $_filter; + } + return false; } } diff --git a/admin/views/admins_custom_tabs/tmpl/default.php b/admin/views/admins_custom_tabs/tmpl/default.php index aa8f02124..fc3753653 100644 --- a/admin/views/admins_custom_tabs/tmpl/default.php +++ b/admin/views/admins_custom_tabs/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_custom_tabs.saveOrderAjax&tmpl=component'; diff --git a/admin/views/admins_custom_tabs/view.html.php b/admin/views/admins_custom_tabs/view.html.php index 7225c0e97..55730342d 100644 --- a/admin/views/admins_custom_tabs/view.html.php +++ b/admin/views/admins_custom_tabs/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewAdmins_custom_tabs extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/admins_fields/tmpl/default.php b/admin/views/admins_fields/tmpl/default.php index 7dccc39d3..4a070c198 100644 --- a/admin/views/admins_fields/tmpl/default.php +++ b/admin/views/admins_fields/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields.saveOrderAjax&tmpl=component'; diff --git a/admin/views/admins_fields/view.html.php b/admin/views/admins_fields/view.html.php index 307295363..e86d00c01 100644 --- a/admin/views/admins_fields/view.html.php +++ b/admin/views/admins_fields/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/admins_fields_conditions/tmpl/default.php b/admin/views/admins_fields_conditions/tmpl/default.php index 3ab5688cc..d0c534c2f 100644 --- a/admin/views/admins_fields_conditions/tmpl/default.php +++ b/admin/views/admins_fields_conditions/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields_conditions.saveOrderAjax&tmpl=component'; diff --git a/admin/views/admins_fields_conditions/view.html.php b/admin/views/admins_fields_conditions/view.html.php index ed507b146..b4a113ae9 100644 --- a/admin/views/admins_fields_conditions/view.html.php +++ b/admin/views/admins_fields_conditions/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/admins_fields_relations/tmpl/default.php b/admin/views/admins_fields_relations/tmpl/default.php index 78be3e631..6fbd76ba2 100644 --- a/admin/views/admins_fields_relations/tmpl/default.php +++ b/admin/views/admins_fields_relations/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields_relations.saveOrderAjax&tmpl=component'; diff --git a/admin/views/admins_fields_relations/view.html.php b/admin/views/admins_fields_relations/view.html.php index 9e7e4b5c4..913407d67 100644 --- a/admin/views/admins_fields_relations/view.html.php +++ b/admin/views/admins_fields_relations/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewAdmins_fields_relations extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/class_extendings/tmpl/default.php b/admin/views/class_extendings/tmpl/default.php index 8bcf84882..785b3799d 100644 --- a/admin/views/class_extendings/tmpl/default.php +++ b/admin/views/class_extendings/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_extendings.saveOrderAjax&tmpl=component'; diff --git a/admin/views/class_extendings/view.html.php b/admin/views/class_extendings/view.html.php index 2190bff01..d07a6d71b 100644 --- a/admin/views/class_extendings/view.html.php +++ b/admin/views/class_extendings/view.html.php @@ -142,41 +142,24 @@ class ComponentbuilderViewClass_extendings extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Extension Type Selection $this->extension_typeOptions = $this->getTheExtension_typeSelections(); // We do some sanitation for Extension Type filter @@ -195,16 +178,37 @@ class ComponentbuilderViewClass_extendings extends JViewLegacy 'filter_extension_type', JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text', $this->state->get('filter.extension_type')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Extension Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -', - 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Extension Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Extension Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -', + 'batch[extension_type]', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + ); } } diff --git a/admin/views/class_extends/tmpl/edit.php b/admin/views/class_extends/tmpl/edit.php index 8bbebc8a1..395f83c99 100644 --- a/admin/views/class_extends/tmpl/edit.php +++ b/admin/views/class_extends/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/class_method/tmpl/edit.php b/admin/views/class_method/tmpl/edit.php index 05a1ed5c9..55e781fad 100644 --- a/admin/views/class_method/tmpl/edit.php +++ b/admin/views/class_method/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/class_methods/tmpl/default.php b/admin/views/class_methods/tmpl/default.php index f93ca7f7f..3519498ee 100644 --- a/admin/views/class_methods/tmpl/default.php +++ b/admin/views/class_methods/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_methods.saveOrderAjax&tmpl=component'; diff --git a/admin/views/class_methods/view.html.php b/admin/views/class_methods/view.html.php index d8f433b8b..98c0abb94 100644 --- a/admin/views/class_methods/view.html.php +++ b/admin/views/class_methods/view.html.php @@ -152,41 +152,24 @@ class ComponentbuilderViewClass_methods extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Visibility Selection $this->visibilityOptions = $this->getTheVisibilitySelections(); // We do some sanitation for Visibility filter @@ -205,16 +188,6 @@ class ComponentbuilderViewClass_methods extends JViewLegacy 'filter_visibility', JHtml::_('select.options', $this->visibilityOptions, 'value', 'text', $this->state->get('filter.visibility')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Visibility Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -', - 'batch[visibility]', - JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') - ); - } } // Set Extension Type Selection @@ -235,16 +208,48 @@ class ComponentbuilderViewClass_methods extends JViewLegacy 'filter_extension_type', JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text', $this->state->get('filter.extension_type')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Extension Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -', - 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Visibility batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Visibility Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -', + 'batch[visibility]', + JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') + ); + } + + // Only load Extension Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Extension Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -', + 'batch[extension_type]', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + ); } } diff --git a/admin/views/class_properties/tmpl/default.php b/admin/views/class_properties/tmpl/default.php index 4cdb2ccd4..987e7d216 100644 --- a/admin/views/class_properties/tmpl/default.php +++ b/admin/views/class_properties/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_properties.saveOrderAjax&tmpl=component'; diff --git a/admin/views/class_properties/view.html.php b/admin/views/class_properties/view.html.php index 0920beef9..fd503c023 100644 --- a/admin/views/class_properties/view.html.php +++ b/admin/views/class_properties/view.html.php @@ -152,41 +152,24 @@ class ComponentbuilderViewClass_properties extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Visibility Selection $this->visibilityOptions = $this->getTheVisibilitySelections(); // We do some sanitation for Visibility filter @@ -205,16 +188,6 @@ class ComponentbuilderViewClass_properties extends JViewLegacy 'filter_visibility', JHtml::_('select.options', $this->visibilityOptions, 'value', 'text', $this->state->get('filter.visibility')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Visibility Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -', - 'batch[visibility]', - JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') - ); - } } // Set Extension Type Selection @@ -235,16 +208,48 @@ class ComponentbuilderViewClass_properties extends JViewLegacy 'filter_extension_type', JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text', $this->state->get('filter.extension_type')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Extension Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -', - 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Visibility batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Visibility Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -', + 'batch[visibility]', + JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') + ); + } + + // Only load Extension Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Extension Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -', + 'batch[extension_type]', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + ); } } diff --git a/admin/views/class_property/tmpl/edit.php b/admin/views/class_property/tmpl/edit.php index c371b7f3d..eab4d5d26 100644 --- a/admin/views/class_property/tmpl/edit.php +++ b/admin/views/class_property/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/compiler/tmpl/default.php b/admin/views/compiler/tmpl/default.php index a58a36ea2..9cc8f7b7c 100644 --- a/admin/views/compiler/tmpl/default.php +++ b/admin/views/compiler/tmpl/default.php @@ -10,17 +10,17 @@ */ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +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'); $this->app->input->set('hidemainmenu', false); $selectNotice = '

' . JText::_('COM_COMPONENTBUILDER_HI') . ' ' . $this->user->name . '

'; $selectNotice .= '

' . JText::_('COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE') . '

'; - -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); ?> canDo->get('compiler.access')): ?>
diff --git a/admin/views/component_admin_views/tmpl/edit.php b/admin/views/component_admin_views/tmpl/edit.php index fcf93e100..5437546d9 100644 --- a/admin/views/component_admin_views/tmpl/edit.php +++ b/admin/views/component_admin_views/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_config/tmpl/edit.php b/admin/views/component_config/tmpl/edit.php index 756745e9c..30a39ce89 100644 --- a/admin/views/component_config/tmpl/edit.php +++ b/admin/views/component_config/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_custom_admin_menus/tmpl/edit.php b/admin/views/component_custom_admin_menus/tmpl/edit.php index 7edc56830..3ddccb0a7 100644 --- a/admin/views/component_custom_admin_menus/tmpl/edit.php +++ b/admin/views/component_custom_admin_menus/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_custom_admin_views/tmpl/edit.php b/admin/views/component_custom_admin_views/tmpl/edit.php index 6e7aab4bc..97243352a 100644 --- a/admin/views/component_custom_admin_views/tmpl/edit.php +++ b/admin/views/component_custom_admin_views/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_dashboard/tmpl/edit.php b/admin/views/component_dashboard/tmpl/edit.php index 3b737d6e8..200e80754 100644 --- a/admin/views/component_dashboard/tmpl/edit.php +++ b/admin/views/component_dashboard/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_files_folders/tmpl/edit.php b/admin/views/component_files_folders/tmpl/edit.php index f25b1e7fd..aa5625930 100644 --- a/admin/views/component_files_folders/tmpl/edit.php +++ b/admin/views/component_files_folders/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_modules/tmpl/edit.php b/admin/views/component_modules/tmpl/edit.php index c8b23313c..09b0a55cd 100644 --- a/admin/views/component_modules/tmpl/edit.php +++ b/admin/views/component_modules/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_mysql_tweaks/tmpl/edit.php b/admin/views/component_mysql_tweaks/tmpl/edit.php index a04dcd019..0005cb2f2 100644 --- a/admin/views/component_mysql_tweaks/tmpl/edit.php +++ b/admin/views/component_mysql_tweaks/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_placeholders/tmpl/edit.php b/admin/views/component_placeholders/tmpl/edit.php index 9776309e7..e4410466a 100644 --- a/admin/views/component_placeholders/tmpl/edit.php +++ b/admin/views/component_placeholders/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_plugins/tmpl/edit.php b/admin/views/component_plugins/tmpl/edit.php index f14227200..fdbe4e03b 100644 --- a/admin/views/component_plugins/tmpl/edit.php +++ b/admin/views/component_plugins/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_site_views/tmpl/edit.php b/admin/views/component_site_views/tmpl/edit.php index 3006ac614..ccb248ad4 100644 --- a/admin/views/component_site_views/tmpl/edit.php +++ b/admin/views/component_site_views/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/component_updates/tmpl/edit.php b/admin/views/component_updates/tmpl/edit.php index 998874f5b..3f7d82a8c 100644 --- a/admin/views/component_updates/tmpl/edit.php +++ b/admin/views/component_updates/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/components_admin_views/tmpl/default.php b/admin/views/components_admin_views/tmpl/default.php index 14bc2391f..76f10ee5f 100644 --- a/admin/views/components_admin_views/tmpl/default.php +++ b/admin/views/components_admin_views/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_admin_views.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_admin_views/view.html.php b/admin/views/components_admin_views/view.html.php index 8aae9c781..2003e7c67 100644 --- a/admin/views/components_admin_views/view.html.php +++ b/admin/views/components_admin_views/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_config/tmpl/default.php b/admin/views/components_config/tmpl/default.php index 236784fb6..e58d0f782 100644 --- a/admin/views/components_config/tmpl/default.php +++ b/admin/views/components_config/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_config.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_config/view.html.php b/admin/views/components_config/view.html.php index a9085c5bb..47ef9cc4a 100644 --- a/admin/views/components_config/view.html.php +++ b/admin/views/components_config/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_config extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_custom_admin_menus/tmpl/default.php b/admin/views/components_custom_admin_menus/tmpl/default.php index 8641f277c..39fb4e4ad 100644 --- a/admin/views/components_custom_admin_menus/tmpl/default.php +++ b/admin/views/components_custom_admin_menus/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_custom_admin_menus.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_custom_admin_menus/view.html.php b/admin/views/components_custom_admin_menus/view.html.php index 8905f5279..8a5350db5 100644 --- a/admin/views/components_custom_admin_menus/view.html.php +++ b/admin/views/components_custom_admin_menus/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_custom_admin_views/tmpl/default.php b/admin/views/components_custom_admin_views/tmpl/default.php index 95658c7ed..16d158c9a 100644 --- a/admin/views/components_custom_admin_views/tmpl/default.php +++ b/admin/views/components_custom_admin_views/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_custom_admin_views.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_custom_admin_views/view.html.php b/admin/views/components_custom_admin_views/view.html.php index 1d7173d66..02dc1a2ed 100644 --- a/admin/views/components_custom_admin_views/view.html.php +++ b/admin/views/components_custom_admin_views/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_dashboard/tmpl/default.php b/admin/views/components_dashboard/tmpl/default.php index 35c258e27..8ac5c9c3e 100644 --- a/admin/views/components_dashboard/tmpl/default.php +++ b/admin/views/components_dashboard/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_dashboard.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_dashboard/view.html.php b/admin/views/components_dashboard/view.html.php index a9b927e9d..54503b921 100644 --- a/admin/views/components_dashboard/view.html.php +++ b/admin/views/components_dashboard/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_files_folders/tmpl/default.php b/admin/views/components_files_folders/tmpl/default.php index 382ebe1c2..88d4d3d13 100644 --- a/admin/views/components_files_folders/tmpl/default.php +++ b/admin/views/components_files_folders/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_files_folders.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_files_folders/view.html.php b/admin/views/components_files_folders/view.html.php index 9e51c47c9..bc3ccb92f 100644 --- a/admin/views/components_files_folders/view.html.php +++ b/admin/views/components_files_folders/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_modules/tmpl/default.php b/admin/views/components_modules/tmpl/default.php index 58c4b9242..328bcce4d 100644 --- a/admin/views/components_modules/tmpl/default.php +++ b/admin/views/components_modules/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_modules.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_modules/view.html.php b/admin/views/components_modules/view.html.php index 0148c7e84..33dcac9b9 100644 --- a/admin/views/components_modules/view.html.php +++ b/admin/views/components_modules/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_modules extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_mysql_tweaks/tmpl/default.php b/admin/views/components_mysql_tweaks/tmpl/default.php index e8da76ced..78593ab7b 100644 --- a/admin/views/components_mysql_tweaks/tmpl/default.php +++ b/admin/views/components_mysql_tweaks/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_mysql_tweaks.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_mysql_tweaks/view.html.php b/admin/views/components_mysql_tweaks/view.html.php index e231a83d1..f3d65de03 100644 --- a/admin/views/components_mysql_tweaks/view.html.php +++ b/admin/views/components_mysql_tweaks/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_placeholders/tmpl/default.php b/admin/views/components_placeholders/tmpl/default.php index 3d92b31a4..0d3f05eab 100644 --- a/admin/views/components_placeholders/tmpl/default.php +++ b/admin/views/components_placeholders/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_placeholders.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_placeholders/view.html.php b/admin/views/components_placeholders/view.html.php index 54ba49ffe..6d12dd367 100644 --- a/admin/views/components_placeholders/view.html.php +++ b/admin/views/components_placeholders/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_placeholders extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_plugins/tmpl/default.php b/admin/views/components_plugins/tmpl/default.php index 225327979..9e207e653 100644 --- a/admin/views/components_plugins/tmpl/default.php +++ b/admin/views/components_plugins/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_plugins.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_plugins/view.html.php b/admin/views/components_plugins/view.html.php index 6428de1e7..f1a3bf390 100644 --- a/admin/views/components_plugins/view.html.php +++ b/admin/views/components_plugins/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_plugins extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_site_views/tmpl/default.php b/admin/views/components_site_views/tmpl/default.php index d6114ac29..cd0ce8f54 100644 --- a/admin/views/components_site_views/tmpl/default.php +++ b/admin/views/components_site_views/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_site_views.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_site_views/view.html.php b/admin/views/components_site_views/view.html.php index 54754509d..ad274f544 100644 --- a/admin/views/components_site_views/view.html.php +++ b/admin/views/components_site_views/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/components_updates/tmpl/default.php b/admin/views/components_updates/tmpl/default.php index c1487633d..7a28fa75a 100644 --- a/admin/views/components_updates/tmpl/default.php +++ b/admin/views/components_updates/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_updates.saveOrderAjax&tmpl=component'; diff --git a/admin/views/components_updates/view.html.php b/admin/views/components_updates/view.html.php index 51fb1f6a3..62dc86a37 100644 --- a/admin/views/components_updates/view.html.php +++ b/admin/views/components_updates/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/custom_admin_view/tmpl/edit.php b/admin/views/custom_admin_view/tmpl/edit.php index 6571f0dd8..9c660c027 100644 --- a/admin/views/custom_admin_view/tmpl/edit.php +++ b/admin/views/custom_admin_view/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/custom_admin_views/tmpl/default.php b/admin/views/custom_admin_views/tmpl/default.php index 6559c7b63..43c6478d4 100644 --- a/admin/views/custom_admin_views/tmpl/default.php +++ b/admin/views/custom_admin_views/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=custom_admin_views.saveOrderAjax&tmpl=component'; diff --git a/admin/views/custom_admin_views/view.html.php b/admin/views/custom_admin_views/view.html.php index 1e5067f21..367c10389 100644 --- a/admin/views/custom_admin_views/view.html.php +++ b/admin/views/custom_admin_views/view.html.php @@ -157,41 +157,24 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Main Get Name Selection $this->main_getNameOptions = JFormHelper::loadFieldType('Maingets')->options; // We do some sanitation for Main Get Name filter @@ -210,16 +193,6 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy 'filter_main_get', JHtml::_('select.options', $this->main_getNameOptions, 'value', 'text', $this->state->get('filter.main_get')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Main Get Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_MAIN_GET_LABEL').' -', - 'batch[main_get]', - JHtml::_('select.options', $this->main_getNameOptions, 'value', 'text') - ); - } } // Set Add Php Ajax Selection @@ -240,16 +213,6 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy 'filter_add_php_ajax', JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text', $this->state->get('filter.add_php_ajax')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Add Php Ajax Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -', - 'batch[add_php_ajax]', - JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text') - ); - } } // Set Add Custom Button Selection @@ -270,16 +233,59 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy 'filter_add_custom_button', JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text', $this->state->get('filter.add_custom_button')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Add Custom Button Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', - 'batch[add_custom_button]', - JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Main Get Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Main Get Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_MAIN_GET_LABEL').' -', + 'batch[main_get]', + JHtml::_('select.options', $this->main_getNameOptions, 'value', 'text') + ); + } + + // Only load Add Php Ajax batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Php Ajax Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -', + 'batch[add_php_ajax]', + JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text') + ); + } + + // Only load Add Custom Button batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Custom Button Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', + 'batch[add_custom_button]', + JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text') + ); } } diff --git a/admin/views/custom_code/tmpl/edit.php b/admin/views/custom_code/tmpl/edit.php index 13e16aba5..76306f33c 100644 --- a/admin/views/custom_code/tmpl/edit.php +++ b/admin/views/custom_code/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/custom_codes/tmpl/default.php b/admin/views/custom_codes/tmpl/default.php index f9214e15e..bb4297f27 100644 --- a/admin/views/custom_codes/tmpl/default.php +++ b/admin/views/custom_codes/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=custom_codes.saveOrderAjax&tmpl=component'; diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index 1c82bbeb3..0069a9def 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -157,41 +157,24 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Component System Name Selection $this->componentSystem_nameOptions = JFormHelper::loadFieldType('Component')->options; // We do some sanitation for Component System Name filter @@ -210,16 +193,6 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy 'filter_component', JHtml::_('select.options', $this->componentSystem_nameOptions, 'value', 'text', $this->state->get('filter.component')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Component System Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL').' -', - 'batch[component]', - JHtml::_('select.options', $this->componentSystem_nameOptions, 'value', 'text') - ); - } } // Set Target Selection @@ -240,16 +213,6 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy 'filter_target', JHtml::_('select.options', $this->targetOptions, 'value', 'text', $this->state->get('filter.target')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Target Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL').' -', - 'batch[target]', - JHtml::_('select.options', $this->targetOptions, 'value', 'text') - ); - } } // Set Type Selection @@ -270,16 +233,6 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL').' -', - 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') - ); - } } // Set Comment Type Selection @@ -300,16 +253,70 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy 'filter_comment_type', JHtml::_('select.options', $this->comment_typeOptions, 'value', 'text', $this->state->get('filter.comment_type')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Comment Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', - 'batch[comment_type]', - JHtml::_('select.options', $this->comment_typeOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Component System Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Component System Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL').' -', + 'batch[component]', + JHtml::_('select.options', $this->componentSystem_nameOptions, 'value', 'text') + ); + } + + // Only load Target batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Target Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL').' -', + 'batch[target]', + JHtml::_('select.options', $this->targetOptions, 'value', 'text') + ); + } + + // Only load Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL').' -', + 'batch[type]', + JHtml::_('select.options', $this->typeOptions, 'value', 'text') + ); + } + + // Only load Comment Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Comment Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', + 'batch[comment_type]', + JHtml::_('select.options', $this->comment_typeOptions, 'value', 'text') + ); } } diff --git a/admin/views/dynamic_get/tmpl/edit.php b/admin/views/dynamic_get/tmpl/edit.php index 24243052a..8fcb98986 100644 --- a/admin/views/dynamic_get/tmpl/edit.php +++ b/admin/views/dynamic_get/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/dynamic_gets/tmpl/default.php b/admin/views/dynamic_gets/tmpl/default.php index 78a79ace1..4db0b247a 100644 --- a/admin/views/dynamic_gets/tmpl/default.php +++ b/admin/views/dynamic_gets/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=dynamic_gets.saveOrderAjax&tmpl=component'; diff --git a/admin/views/dynamic_gets/view.html.php b/admin/views/dynamic_gets/view.html.php index d6ed85e77..9e183fdf9 100644 --- a/admin/views/dynamic_gets/view.html.php +++ b/admin/views/dynamic_gets/view.html.php @@ -157,41 +157,24 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Main Source Selection $this->main_sourceOptions = $this->getTheMain_sourceSelections(); // We do some sanitation for Main Source filter @@ -210,16 +193,6 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy 'filter_main_source', JHtml::_('select.options', $this->main_sourceOptions, 'value', 'text', $this->state->get('filter.main_source')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Main Source Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL').' -', - 'batch[main_source]', - JHtml::_('select.options', $this->main_sourceOptions, 'value', 'text') - ); - } } // Set Gettype Selection @@ -240,16 +213,48 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy 'filter_gettype', JHtml::_('select.options', $this->gettypeOptions, 'value', 'text', $this->state->get('filter.gettype')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Gettype Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL').' -', - 'batch[gettype]', - JHtml::_('select.options', $this->gettypeOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Main Source batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Main Source Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL').' -', + 'batch[main_source]', + JHtml::_('select.options', $this->main_sourceOptions, 'value', 'text') + ); + } + + // Only load Gettype batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Gettype Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL').' -', + 'batch[gettype]', + JHtml::_('select.options', $this->gettypeOptions, 'value', 'text') + ); } } diff --git a/admin/views/field/tmpl/edit.php b/admin/views/field/tmpl/edit.php index ad01f1828..3fb9941fb 100644 --- a/admin/views/field/tmpl/edit.php +++ b/admin/views/field/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/fields/tmpl/default.php b/admin/views/fields/tmpl/default.php index 008cd39f0..5ab370a84 100644 --- a/admin/views/fields/tmpl/default.php +++ b/admin/views/fields/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=fields.saveOrderAjax&tmpl=component'; diff --git a/admin/views/fields/view.html.php b/admin/views/fields/view.html.php index 539c4ebfa..27627e70f 100644 --- a/admin/views/fields/view.html.php +++ b/admin/views/fields/view.html.php @@ -157,41 +157,24 @@ class ComponentbuilderViewFields extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Category Filter. JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_CATEGORY'), @@ -199,16 +182,6 @@ class ComponentbuilderViewFields extends JViewLegacy JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.field'), 'value', 'text', $this->state->get('filter.category_id')) ); - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Category Batch selection. - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), - 'batch[category]', - JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.field'), 'value', 'text') - ); - } - // Set Fieldtype Name Selection $this->fieldtypeNameOptions = JFormHelper::loadFieldType('Fieldtypes')->options; // We do some sanitation for Fieldtype Name filter @@ -227,16 +200,6 @@ class ComponentbuilderViewFields extends JViewLegacy 'filter_fieldtype', JHtml::_('select.options', $this->fieldtypeNameOptions, 'value', 'text', $this->state->get('filter.fieldtype')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Fieldtype Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL').' -', - 'batch[fieldtype]', - JHtml::_('select.options', $this->fieldtypeNameOptions, 'value', 'text') - ); - } } // Set Datatype Selection @@ -257,16 +220,6 @@ class ComponentbuilderViewFields extends JViewLegacy 'filter_datatype', JHtml::_('select.options', $this->datatypeOptions, 'value', 'text', $this->state->get('filter.datatype')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Datatype Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL').' -', - 'batch[datatype]', - JHtml::_('select.options', $this->datatypeOptions, 'value', 'text') - ); - } } // Set Indexes Selection @@ -287,16 +240,6 @@ class ComponentbuilderViewFields extends JViewLegacy 'filter_indexes', JHtml::_('select.options', $this->indexesOptions, 'value', 'text', $this->state->get('filter.indexes')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Indexes Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL').' -', - 'batch[indexes]', - JHtml::_('select.options', $this->indexesOptions, 'value', 'text') - ); - } } // Set Null Switch Selection @@ -317,16 +260,6 @@ class ComponentbuilderViewFields extends JViewLegacy 'filter_null_switch', JHtml::_('select.options', $this->null_switchOptions, 'value', 'text', $this->state->get('filter.null_switch')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Null Switch Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL').' -', - 'batch[null_switch]', - JHtml::_('select.options', $this->null_switchOptions, 'value', 'text') - ); - } } // Set Store Selection @@ -347,16 +280,91 @@ class ComponentbuilderViewFields extends JViewLegacy 'filter_store', JHtml::_('select.options', $this->storeOptions, 'value', 'text', $this->state->get('filter.store')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Store Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL').' -', - 'batch[store]', - JHtml::_('select.options', $this->storeOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Category Batch selection. + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), + 'batch[category]', + JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.field'), 'value', 'text') + ); + } + + // Only load Fieldtype Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Fieldtype Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL').' -', + 'batch[fieldtype]', + JHtml::_('select.options', $this->fieldtypeNameOptions, 'value', 'text') + ); + } + + // Only load Datatype batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Datatype Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL').' -', + 'batch[datatype]', + JHtml::_('select.options', $this->datatypeOptions, 'value', 'text') + ); + } + + // Only load Indexes batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Indexes Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL').' -', + 'batch[indexes]', + JHtml::_('select.options', $this->indexesOptions, 'value', 'text') + ); + } + + // Only load Null Switch batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Null Switch Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL').' -', + 'batch[null_switch]', + JHtml::_('select.options', $this->null_switchOptions, 'value', 'text') + ); + } + + // Only load Store batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Store Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL').' -', + 'batch[store]', + JHtml::_('select.options', $this->storeOptions, 'value', 'text') + ); } } diff --git a/admin/views/fieldtype/tmpl/edit.php b/admin/views/fieldtype/tmpl/edit.php index 39f606a97..93e0ef50a 100644 --- a/admin/views/fieldtype/tmpl/edit.php +++ b/admin/views/fieldtype/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/fieldtypes/tmpl/default.php b/admin/views/fieldtypes/tmpl/default.php index f94f3dfc1..7d24f1f44 100644 --- a/admin/views/fieldtypes/tmpl/default.php +++ b/admin/views/fieldtypes/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=fieldtypes.saveOrderAjax&tmpl=component'; diff --git a/admin/views/fieldtypes/view.html.php b/admin/views/fieldtypes/view.html.php index f7b9060c1..4085d4612 100644 --- a/admin/views/fieldtypes/view.html.php +++ b/admin/views/fieldtypes/view.html.php @@ -152,41 +152,24 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Category Filter. JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_CATEGORY'), @@ -194,6 +177,26 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fieldtype'), 'value', 'text', $this->state->get('filter.category_id')) ); + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + if ($this->canBatch && $this->canCreate && $this->canEdit) { // Category Batch selection. diff --git a/admin/views/get_snippets/tmpl/default.php b/admin/views/get_snippets/tmpl/default.php index e3e6dc816..73f6409c5 100644 --- a/admin/views/get_snippets/tmpl/default.php +++ b/admin/views/get_snippets/tmpl/default.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); ?> canDo->get('get_snippets.access')): ?> diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php index 112643754..abb668680 100644 --- a/admin/views/help_document/tmpl/edit.php +++ b/admin/views/help_document/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/help_documents/tmpl/default.php b/admin/views/help_documents/tmpl/default.php index c887f4a1b..8a7e35653 100644 --- a/admin/views/help_documents/tmpl/default.php +++ b/admin/views/help_documents/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=help_documents.saveOrderAjax&tmpl=component'; diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index d83583dfa..7e50b6715 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -152,39 +152,16 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); } // Set Type Selection @@ -205,16 +182,6 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL').' -', - 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') - ); - } } // Set Location Selection @@ -235,16 +202,6 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy 'filter_location', JHtml::_('select.options', $this->locationOptions, 'value', 'text', $this->state->get('filter.location')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Location Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL').' -', - 'batch[location]', - JHtml::_('select.options', $this->locationOptions, 'value', 'text') - ); - } } // Set Admin View Selection @@ -265,16 +222,6 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy 'filter_admin_view', JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text', $this->state->get('filter.admin_view')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Admin View Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', - 'batch[admin_view]', - JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text') - ); - } } // Set Site View Selection @@ -295,16 +242,60 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy 'filter_site_view', JHtml::_('select.options', $this->site_viewOptions, 'value', 'text', $this->state->get('filter.site_view')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Site View Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', - 'batch[site_view]', - JHtml::_('select.options', $this->site_viewOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL').' -', + 'batch[type]', + JHtml::_('select.options', $this->typeOptions, 'value', 'text') + ); + } + + // Only load Location batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Location Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL').' -', + 'batch[location]', + JHtml::_('select.options', $this->locationOptions, 'value', 'text') + ); + } + + // Only load Admin View batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Admin View Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', + 'batch[admin_view]', + JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text') + ); + } + + // Only load Site View batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Site View Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', + 'batch[site_view]', + JHtml::_('select.options', $this->site_viewOptions, 'value', 'text') + ); } } diff --git a/admin/views/joomla_component/tmpl/edit.php b/admin/views/joomla_component/tmpl/edit.php index a4c3cf7e0..6d90b5c97 100644 --- a/admin/views/joomla_component/tmpl/edit.php +++ b/admin/views/joomla_component/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/joomla_components/tmpl/default.php b/admin/views/joomla_components/tmpl/default.php index ecc519339..0a4faf646 100644 --- a/admin/views/joomla_components/tmpl/default.php +++ b/admin/views/joomla_components/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_components.saveOrderAjax&tmpl=component'; diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php index b5c7a5160..ac94ffdbe 100644 --- a/admin/views/joomla_components/view.html.php +++ b/admin/views/joomla_components/view.html.php @@ -182,41 +182,24 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Companyname Selection $this->companynameOptions = $this->getTheCompanynameSelections(); // We do some sanitation for Companyname filter @@ -235,16 +218,6 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy 'filter_companyname', JHtml::_('select.options', $this->companynameOptions, 'value', 'text', $this->state->get('filter.companyname')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Companyname Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL').' -', - 'batch[companyname]', - JHtml::_('select.options', $this->companynameOptions, 'value', 'text') - ); - } } // Set Author Selection @@ -265,16 +238,48 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy 'filter_author', JHtml::_('select.options', $this->authorOptions, 'value', 'text', $this->state->get('filter.author')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Author Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL').' -', - 'batch[author]', - JHtml::_('select.options', $this->authorOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Companyname batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Companyname Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL').' -', + 'batch[companyname]', + JHtml::_('select.options', $this->companynameOptions, 'value', 'text') + ); + } + + // Only load Author batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Author Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL').' -', + 'batch[author]', + JHtml::_('select.options', $this->authorOptions, 'value', 'text') + ); } } diff --git a/admin/views/joomla_module/tmpl/edit.php b/admin/views/joomla_module/tmpl/edit.php index 947b7d1f2..c7ef51da5 100644 --- a/admin/views/joomla_module/tmpl/edit.php +++ b/admin/views/joomla_module/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/joomla_module_files_folders_urls/tmpl/edit.php b/admin/views/joomla_module_files_folders_urls/tmpl/edit.php index 44f8f487f..85aed5226 100644 --- a/admin/views/joomla_module_files_folders_urls/tmpl/edit.php +++ b/admin/views/joomla_module_files_folders_urls/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/joomla_module_updates/tmpl/edit.php b/admin/views/joomla_module_updates/tmpl/edit.php index 63a069319..9eded0f5a 100644 --- a/admin/views/joomla_module_updates/tmpl/edit.php +++ b/admin/views/joomla_module_updates/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/joomla_modules/tmpl/default.php b/admin/views/joomla_modules/tmpl/default.php index 4100065a7..3dff2626a 100644 --- a/admin/views/joomla_modules/tmpl/default.php +++ b/admin/views/joomla_modules/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_modules.saveOrderAjax&tmpl=component'; diff --git a/admin/views/joomla_modules/view.html.php b/admin/views/joomla_modules/view.html.php index c670ec33a..dbf5f1756 100644 --- a/admin/views/joomla_modules/view.html.php +++ b/admin/views/joomla_modules/view.html.php @@ -152,41 +152,24 @@ class ComponentbuilderViewJoomla_modules extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Target Selection $this->targetOptions = $this->getTheTargetSelections(); // We do some sanitation for Target filter @@ -205,16 +188,37 @@ class ComponentbuilderViewJoomla_modules extends JViewLegacy 'filter_target', JHtml::_('select.options', $this->targetOptions, 'value', 'text', $this->state->get('filter.target')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Target Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULE_TARGET_LABEL').' -', - 'batch[target]', - JHtml::_('select.options', $this->targetOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Target batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Target Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULE_TARGET_LABEL').' -', + 'batch[target]', + JHtml::_('select.options', $this->targetOptions, 'value', 'text') + ); } } diff --git a/admin/views/joomla_modules_files_folders_urls/tmpl/default.php b/admin/views/joomla_modules_files_folders_urls/tmpl/default.php index a11d6d717..1768b54cd 100644 --- a/admin/views/joomla_modules_files_folders_urls/tmpl/default.php +++ b/admin/views/joomla_modules_files_folders_urls/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_modules_files_folders_urls.saveOrderAjax&tmpl=component'; diff --git a/admin/views/joomla_modules_files_folders_urls/view.html.php b/admin/views/joomla_modules_files_folders_urls/view.html.php index e3faa3a52..918a901a7 100644 --- a/admin/views/joomla_modules_files_folders_urls/view.html.php +++ b/admin/views/joomla_modules_files_folders_urls/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewJoomla_modules_files_folders_urls extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/joomla_modules_updates/tmpl/default.php b/admin/views/joomla_modules_updates/tmpl/default.php index ce44e137a..03c4ce269 100644 --- a/admin/views/joomla_modules_updates/tmpl/default.php +++ b/admin/views/joomla_modules_updates/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_modules_updates.saveOrderAjax&tmpl=component'; diff --git a/admin/views/joomla_modules_updates/view.html.php b/admin/views/joomla_modules_updates/view.html.php index 41d850efb..c3994a707 100644 --- a/admin/views/joomla_modules_updates/view.html.php +++ b/admin/views/joomla_modules_updates/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewJoomla_modules_updates extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/joomla_plugin/tmpl/edit.php b/admin/views/joomla_plugin/tmpl/edit.php index f173a8107..870412fd2 100644 --- a/admin/views/joomla_plugin/tmpl/edit.php +++ b/admin/views/joomla_plugin/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/joomla_plugin_files_folders_urls/tmpl/edit.php b/admin/views/joomla_plugin_files_folders_urls/tmpl/edit.php index f2df0079b..5bf462e70 100644 --- a/admin/views/joomla_plugin_files_folders_urls/tmpl/edit.php +++ b/admin/views/joomla_plugin_files_folders_urls/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/joomla_plugin_group/tmpl/edit.php b/admin/views/joomla_plugin_group/tmpl/edit.php index d5d007869..3c4c0ab32 100644 --- a/admin/views/joomla_plugin_group/tmpl/edit.php +++ b/admin/views/joomla_plugin_group/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/joomla_plugin_groups/tmpl/default.php b/admin/views/joomla_plugin_groups/tmpl/default.php index 27e28fdc4..44907dcd6 100644 --- a/admin/views/joomla_plugin_groups/tmpl/default.php +++ b/admin/views/joomla_plugin_groups/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_plugin_groups.saveOrderAjax&tmpl=component'; diff --git a/admin/views/joomla_plugin_groups/view.html.php b/admin/views/joomla_plugin_groups/view.html.php index fcc094be7..43b6d2264 100644 --- a/admin/views/joomla_plugin_groups/view.html.php +++ b/admin/views/joomla_plugin_groups/view.html.php @@ -142,41 +142,24 @@ class ComponentbuilderViewJoomla_plugin_groups extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Class Extends Name Selection $this->class_extendsNameOptions = JFormHelper::loadFieldType('Classextends')->options; // We do some sanitation for Class Extends Name filter @@ -195,16 +178,37 @@ class ComponentbuilderViewJoomla_plugin_groups extends JViewLegacy 'filter_class_extends', JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text', $this->state->get('filter.class_extends')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Class Extends Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_LABEL').' -', - 'batch[class_extends]', - JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Class Extends Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Class Extends Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_LABEL').' -', + 'batch[class_extends]', + JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text') + ); } } diff --git a/admin/views/joomla_plugin_updates/tmpl/edit.php b/admin/views/joomla_plugin_updates/tmpl/edit.php index 32b180cf0..c169b7826 100644 --- a/admin/views/joomla_plugin_updates/tmpl/edit.php +++ b/admin/views/joomla_plugin_updates/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/joomla_plugins/tmpl/default.php b/admin/views/joomla_plugins/tmpl/default.php index 67e1e8eac..416c93049 100644 --- a/admin/views/joomla_plugins/tmpl/default.php +++ b/admin/views/joomla_plugins/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_plugins.saveOrderAjax&tmpl=component'; diff --git a/admin/views/joomla_plugins/view.html.php b/admin/views/joomla_plugins/view.html.php index 4588737c8..662b29902 100644 --- a/admin/views/joomla_plugins/view.html.php +++ b/admin/views/joomla_plugins/view.html.php @@ -162,41 +162,24 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Class Extends Name Selection $this->class_extendsNameOptions = JFormHelper::loadFieldType('Classextends')->options; // We do some sanitation for Class Extends Name filter @@ -215,16 +198,6 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy 'filter_class_extends', JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text', $this->state->get('filter.class_extends')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Class Extends Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL').' -', - 'batch[class_extends]', - JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text') - ); - } } // Set Joomla Plugin Group Name Selection @@ -245,16 +218,48 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy 'filter_joomla_plugin_group', JHtml::_('select.options', $this->joomla_plugin_groupNameOptions, 'value', 'text', $this->state->get('filter.joomla_plugin_group')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Joomla Plugin Group Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL').' -', - 'batch[joomla_plugin_group]', - JHtml::_('select.options', $this->joomla_plugin_groupNameOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Class Extends Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Class Extends Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL').' -', + 'batch[class_extends]', + JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text') + ); + } + + // Only load Joomla Plugin Group Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Joomla Plugin Group Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL').' -', + 'batch[joomla_plugin_group]', + JHtml::_('select.options', $this->joomla_plugin_groupNameOptions, 'value', 'text') + ); } } diff --git a/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php index 63ebb88d9..451f56a33 100644 --- a/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php +++ b/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_plugins_files_folders_urls.saveOrderAjax&tmpl=component'; diff --git a/admin/views/joomla_plugins_files_folders_urls/view.html.php b/admin/views/joomla_plugins_files_folders_urls/view.html.php index 2dbfb0958..2b5b69c8e 100644 --- a/admin/views/joomla_plugins_files_folders_urls/view.html.php +++ b/admin/views/joomla_plugins_files_folders_urls/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewJoomla_plugins_files_folders_urls extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/joomla_plugins_updates/tmpl/default.php b/admin/views/joomla_plugins_updates/tmpl/default.php index cc8e175bc..a409ba854 100644 --- a/admin/views/joomla_plugins_updates/tmpl/default.php +++ b/admin/views/joomla_plugins_updates/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_plugins_updates.saveOrderAjax&tmpl=component'; diff --git a/admin/views/joomla_plugins_updates/view.html.php b/admin/views/joomla_plugins_updates/view.html.php index a40ea29b5..66e7e7f0b 100644 --- a/admin/views/joomla_plugins_updates/view.html.php +++ b/admin/views/joomla_plugins_updates/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewJoomla_plugins_updates extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/language/tmpl/edit.php b/admin/views/language/tmpl/edit.php index bacaef603..2b4e1d48f 100644 --- a/admin/views/language/tmpl/edit.php +++ b/admin/views/language/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/language_translation/tmpl/edit.php b/admin/views/language_translation/tmpl/edit.php index 738c8cdd1..dea2fd45d 100644 --- a/admin/views/language_translation/tmpl/edit.php +++ b/admin/views/language_translation/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/language_translations/tmpl/default.php b/admin/views/language_translations/tmpl/default.php index 071d79297..24d1e373c 100644 --- a/admin/views/language_translations/tmpl/default.php +++ b/admin/views/language_translations/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=language_translations.saveOrderAjax&tmpl=component'; diff --git a/admin/views/language_translations/view.html.php b/admin/views/language_translations/view.html.php index 12b008395..2319dba62 100644 --- a/admin/views/language_translations/view.html.php +++ b/admin/views/language_translations/view.html.php @@ -152,39 +152,42 @@ class ComponentbuilderViewLanguage_translations extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/languages/tmpl/default.php b/admin/views/languages/tmpl/default.php index f7bc1f9a7..9ce54ae02 100644 --- a/admin/views/languages/tmpl/default.php +++ b/admin/views/languages/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=languages.saveOrderAjax&tmpl=component'; diff --git a/admin/views/languages/view.html.php b/admin/views/languages/view.html.php index 3ea33e7a7..1a8858a8e 100644 --- a/admin/views/languages/view.html.php +++ b/admin/views/languages/view.html.php @@ -157,39 +157,42 @@ class ComponentbuilderViewLanguages extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/layout/tmpl/edit.php b/admin/views/layout/tmpl/edit.php index 66561f86c..05ae906cb 100644 --- a/admin/views/layout/tmpl/edit.php +++ b/admin/views/layout/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/layouts/tmpl/default.php b/admin/views/layouts/tmpl/default.php index 71c5e14b5..5c0731be9 100644 --- a/admin/views/layouts/tmpl/default.php +++ b/admin/views/layouts/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=layouts.saveOrderAjax&tmpl=component'; diff --git a/admin/views/layouts/view.html.php b/admin/views/layouts/view.html.php index 11b20f5d2..317c1b274 100644 --- a/admin/views/layouts/view.html.php +++ b/admin/views/layouts/view.html.php @@ -157,41 +157,24 @@ class ComponentbuilderViewLayouts extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Dynamic Get Name Selection $this->dynamic_getNameOptions = JFormHelper::loadFieldType('Dynamicget')->options; // We do some sanitation for Dynamic Get Name filter @@ -210,16 +193,6 @@ class ComponentbuilderViewLayouts extends JViewLegacy 'filter_dynamic_get', JHtml::_('select.options', $this->dynamic_getNameOptions, 'value', 'text', $this->state->get('filter.dynamic_get')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Dynamic Get Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_GET_LABEL').' -', - 'batch[dynamic_get]', - JHtml::_('select.options', $this->dynamic_getNameOptions, 'value', 'text') - ); - } } // Set Add Php View Selection @@ -240,16 +213,48 @@ class ComponentbuilderViewLayouts extends JViewLegacy 'filter_add_php_view', JHtml::_('select.options', $this->add_php_viewOptions, 'value', 'text', $this->state->get('filter.add_php_view')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Add Php View Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LAYOUT_ADD_PHP_VIEW_LABEL').' -', - 'batch[add_php_view]', - JHtml::_('select.options', $this->add_php_viewOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Dynamic Get Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Dynamic Get Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_GET_LABEL').' -', + 'batch[dynamic_get]', + JHtml::_('select.options', $this->dynamic_getNameOptions, 'value', 'text') + ); + } + + // Only load Add Php View batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Php View Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LAYOUT_ADD_PHP_VIEW_LABEL').' -', + 'batch[add_php_view]', + JHtml::_('select.options', $this->add_php_viewOptions, 'value', 'text') + ); } } diff --git a/admin/views/libraries/tmpl/default.php b/admin/views/libraries/tmpl/default.php index 2f72be745..59fd0692e 100644 --- a/admin/views/libraries/tmpl/default.php +++ b/admin/views/libraries/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=libraries.saveOrderAjax&tmpl=component'; diff --git a/admin/views/libraries/view.html.php b/admin/views/libraries/view.html.php index ecbeffd3b..9e32756be 100644 --- a/admin/views/libraries/view.html.php +++ b/admin/views/libraries/view.html.php @@ -147,41 +147,24 @@ class ComponentbuilderViewLibraries extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Target Selection $this->targetOptions = $this->getTheTargetSelections(); // We do some sanitation for Target filter @@ -200,16 +183,6 @@ class ComponentbuilderViewLibraries extends JViewLegacy 'filter_target', JHtml::_('select.options', $this->targetOptions, 'value', 'text', $this->state->get('filter.target')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Target Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LIBRARY_TARGET_LABEL').' -', - 'batch[target]', - JHtml::_('select.options', $this->targetOptions, 'value', 'text') - ); - } } // Set How Selection @@ -230,16 +203,6 @@ class ComponentbuilderViewLibraries extends JViewLegacy 'filter_how', JHtml::_('select.options', $this->howOptions, 'value', 'text', $this->state->get('filter.how')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // How Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LIBRARY_HOW_LABEL').' -', - 'batch[how]', - JHtml::_('select.options', $this->howOptions, 'value', 'text') - ); - } } // Set Type Selection @@ -260,16 +223,59 @@ class ComponentbuilderViewLibraries extends JViewLegacy 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LIBRARY_TYPE_LABEL').' -', - 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Target batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Target Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LIBRARY_TARGET_LABEL').' -', + 'batch[target]', + JHtml::_('select.options', $this->targetOptions, 'value', 'text') + ); + } + + // Only load How batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // How Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LIBRARY_HOW_LABEL').' -', + 'batch[how]', + JHtml::_('select.options', $this->howOptions, 'value', 'text') + ); + } + + // Only load Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_LIBRARY_TYPE_LABEL').' -', + 'batch[type]', + JHtml::_('select.options', $this->typeOptions, 'value', 'text') + ); } } diff --git a/admin/views/libraries_config/tmpl/default.php b/admin/views/libraries_config/tmpl/default.php index de01322d2..1e7ccf0c1 100644 --- a/admin/views/libraries_config/tmpl/default.php +++ b/admin/views/libraries_config/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=libraries_config.saveOrderAjax&tmpl=component'; diff --git a/admin/views/libraries_config/view.html.php b/admin/views/libraries_config/view.html.php index 2b58e7289..a276ccae3 100644 --- a/admin/views/libraries_config/view.html.php +++ b/admin/views/libraries_config/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewLibraries_config extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/libraries_files_folders_urls/tmpl/default.php b/admin/views/libraries_files_folders_urls/tmpl/default.php index 7ba0381f3..62246cafa 100644 --- a/admin/views/libraries_files_folders_urls/tmpl/default.php +++ b/admin/views/libraries_files_folders_urls/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=libraries_files_folders_urls.saveOrderAjax&tmpl=component'; diff --git a/admin/views/libraries_files_folders_urls/view.html.php b/admin/views/libraries_files_folders_urls/view.html.php index ad34c262b..a1dec4d3a 100644 --- a/admin/views/libraries_files_folders_urls/view.html.php +++ b/admin/views/libraries_files_folders_urls/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewLibraries_files_folders_urls extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/library/tmpl/edit.php b/admin/views/library/tmpl/edit.php index 1d7cb8eab..52caee2f3 100644 --- a/admin/views/library/tmpl/edit.php +++ b/admin/views/library/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/library_config/tmpl/edit.php b/admin/views/library_config/tmpl/edit.php index 74fede23e..5cce6c626 100644 --- a/admin/views/library_config/tmpl/edit.php +++ b/admin/views/library_config/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/library_files_folders_urls/tmpl/edit.php b/admin/views/library_files_folders_urls/tmpl/edit.php index 604258b5c..16afd0255 100644 --- a/admin/views/library_files_folders_urls/tmpl/edit.php +++ b/admin/views/library_files_folders_urls/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/placeholder/tmpl/edit.php b/admin/views/placeholder/tmpl/edit.php index 090122636..bc0ba7503 100644 --- a/admin/views/placeholder/tmpl/edit.php +++ b/admin/views/placeholder/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/placeholders/tmpl/default.php b/admin/views/placeholders/tmpl/default.php index ac46aef81..c1bc84448 100644 --- a/admin/views/placeholders/tmpl/default.php +++ b/admin/views/placeholders/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=placeholders.saveOrderAjax&tmpl=component'; diff --git a/admin/views/placeholders/view.html.php b/admin/views/placeholders/view.html.php index b1dc60a0d..fd097e807 100644 --- a/admin/views/placeholders/view.html.php +++ b/admin/views/placeholders/view.html.php @@ -152,39 +152,42 @@ class ComponentbuilderViewPlaceholders extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/server/tmpl/edit.php b/admin/views/server/tmpl/edit.php index 3595cdf68..98b972f0c 100644 --- a/admin/views/server/tmpl/edit.php +++ b/admin/views/server/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/servers/tmpl/default.php b/admin/views/servers/tmpl/default.php index b137f22ef..55dcad013 100644 --- a/admin/views/servers/tmpl/default.php +++ b/admin/views/servers/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=servers.saveOrderAjax&tmpl=component'; diff --git a/admin/views/servers/view.html.php b/admin/views/servers/view.html.php index 0d37ebab7..56bde83c3 100644 --- a/admin/views/servers/view.html.php +++ b/admin/views/servers/view.html.php @@ -152,41 +152,24 @@ class ComponentbuilderViewServers extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Name Selection $this->nameOptions = $this->getTheNameSelections(); // We do some sanitation for Name filter @@ -205,16 +188,6 @@ class ComponentbuilderViewServers extends JViewLegacy 'filter_name', JHtml::_('select.options', $this->nameOptions, 'value', 'text', $this->state->get('filter.name')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SERVER_NAME_LABEL').' -', - 'batch[name]', - JHtml::_('select.options', $this->nameOptions, 'value', 'text') - ); - } } // Set Protocol Selection @@ -235,16 +208,48 @@ class ComponentbuilderViewServers extends JViewLegacy 'filter_protocol', JHtml::_('select.options', $this->protocolOptions, 'value', 'text', $this->state->get('filter.protocol')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Protocol Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SERVER_PROTOCOL_LABEL').' -', - 'batch[protocol]', - JHtml::_('select.options', $this->protocolOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SERVER_NAME_LABEL').' -', + 'batch[name]', + JHtml::_('select.options', $this->nameOptions, 'value', 'text') + ); + } + + // Only load Protocol batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Protocol Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SERVER_PROTOCOL_LABEL').' -', + 'batch[protocol]', + JHtml::_('select.options', $this->protocolOptions, 'value', 'text') + ); } } diff --git a/admin/views/site_view/tmpl/edit.php b/admin/views/site_view/tmpl/edit.php index 60a99d2e2..6841ccbbd 100644 --- a/admin/views/site_view/tmpl/edit.php +++ b/admin/views/site_view/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/site_views/tmpl/default.php b/admin/views/site_views/tmpl/default.php index 237791534..a27121596 100644 --- a/admin/views/site_views/tmpl/default.php +++ b/admin/views/site_views/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=site_views.saveOrderAjax&tmpl=component'; diff --git a/admin/views/site_views/view.html.php b/admin/views/site_views/view.html.php index 343c75572..12591203c 100644 --- a/admin/views/site_views/view.html.php +++ b/admin/views/site_views/view.html.php @@ -157,41 +157,24 @@ class ComponentbuilderViewSite_views extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Main Get Name Selection $this->main_getNameOptions = JFormHelper::loadFieldType('Maingets')->options; // We do some sanitation for Main Get Name filter @@ -210,16 +193,6 @@ class ComponentbuilderViewSite_views extends JViewLegacy 'filter_main_get', JHtml::_('select.options', $this->main_getNameOptions, 'value', 'text', $this->state->get('filter.main_get')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Main Get Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_MAIN_GET_LABEL').' -', - 'batch[main_get]', - JHtml::_('select.options', $this->main_getNameOptions, 'value', 'text') - ); - } } // Set Add Php Ajax Selection @@ -240,16 +213,6 @@ class ComponentbuilderViewSite_views extends JViewLegacy 'filter_add_php_ajax', JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text', $this->state->get('filter.add_php_ajax')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Add Php Ajax Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_AJAX_LABEL').' -', - 'batch[add_php_ajax]', - JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text') - ); - } } // Set Add Custom Button Selection @@ -270,16 +233,59 @@ class ComponentbuilderViewSite_views extends JViewLegacy 'filter_add_custom_button', JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text', $this->state->get('filter.add_custom_button')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Add Custom Button Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', - 'batch[add_custom_button]', - JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Main Get Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Main Get Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_MAIN_GET_LABEL').' -', + 'batch[main_get]', + JHtml::_('select.options', $this->main_getNameOptions, 'value', 'text') + ); + } + + // Only load Add Php Ajax batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Php Ajax Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_AJAX_LABEL').' -', + 'batch[add_php_ajax]', + JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text') + ); + } + + // Only load Add Custom Button batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Custom Button Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', + 'batch[add_custom_button]', + JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text') + ); } } diff --git a/admin/views/snippet/tmpl/edit.php b/admin/views/snippet/tmpl/edit.php index 3ec825be8..7720739f8 100644 --- a/admin/views/snippet/tmpl/edit.php +++ b/admin/views/snippet/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/snippet_type/tmpl/edit.php b/admin/views/snippet_type/tmpl/edit.php index c42121ab3..5d3760291 100644 --- a/admin/views/snippet_type/tmpl/edit.php +++ b/admin/views/snippet_type/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/snippet_types/tmpl/default.php b/admin/views/snippet_types/tmpl/default.php index c08e9a460..bf1b48e79 100644 --- a/admin/views/snippet_types/tmpl/default.php +++ b/admin/views/snippet_types/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=snippet_types.saveOrderAjax&tmpl=component'; diff --git a/admin/views/snippet_types/view.html.php b/admin/views/snippet_types/view.html.php index 82c84f333..cfed2c494 100644 --- a/admin/views/snippet_types/view.html.php +++ b/admin/views/snippet_types/view.html.php @@ -142,39 +142,42 @@ class ComponentbuilderViewSnippet_types extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/admin/views/snippets/tmpl/default.php b/admin/views/snippets/tmpl/default.php index 4be137907..b30c6f15e 100644 --- a/admin/views/snippets/tmpl/default.php +++ b/admin/views/snippets/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=snippets.saveOrderAjax&tmpl=component'; diff --git a/admin/views/snippets/view.html.php b/admin/views/snippets/view.html.php index b8b36e432..820b215dd 100644 --- a/admin/views/snippets/view.html.php +++ b/admin/views/snippets/view.html.php @@ -162,41 +162,24 @@ class ComponentbuilderViewSnippets extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Type Name Selection $this->typeNameOptions = JFormHelper::loadFieldType('Snippettype')->options; // We do some sanitation for Type Name filter @@ -215,16 +198,6 @@ class ComponentbuilderViewSnippets extends JViewLegacy 'filter_type', JHtml::_('select.options', $this->typeNameOptions, 'value', 'text', $this->state->get('filter.type')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Type Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SNIPPET_TYPE_LABEL').' -', - 'batch[type]', - JHtml::_('select.options', $this->typeNameOptions, 'value', 'text') - ); - } } // Set Library Name Selection @@ -245,16 +218,48 @@ class ComponentbuilderViewSnippets extends JViewLegacy 'filter_library', JHtml::_('select.options', $this->libraryNameOptions, 'value', 'text', $this->state->get('filter.library')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Library Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SNIPPET_LIBRARY_LABEL').' -', - 'batch[library]', - JHtml::_('select.options', $this->libraryNameOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Type Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Type Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SNIPPET_TYPE_LABEL').' -', + 'batch[type]', + JHtml::_('select.options', $this->typeNameOptions, 'value', 'text') + ); + } + + // Only load Library Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Library Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_SNIPPET_LIBRARY_LABEL').' -', + 'batch[library]', + JHtml::_('select.options', $this->libraryNameOptions, 'value', 'text') + ); } } diff --git a/admin/views/template/tmpl/edit.php b/admin/views/template/tmpl/edit.php index 8f7ee22d0..480f76f89 100644 --- a/admin/views/template/tmpl/edit.php +++ b/admin/views/template/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/templates/tmpl/default.php b/admin/views/templates/tmpl/default.php index 30a5e9324..cc1468aae 100644 --- a/admin/views/templates/tmpl/default.php +++ b/admin/views/templates/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=templates.saveOrderAjax&tmpl=component'; diff --git a/admin/views/templates/view.html.php b/admin/views/templates/view.html.php index f516ed5af..2c4c61334 100644 --- a/admin/views/templates/view.html.php +++ b/admin/views/templates/view.html.php @@ -157,41 +157,24 @@ class ComponentbuilderViewTemplates extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Dynamic Get Name Selection $this->dynamic_getNameOptions = JFormHelper::loadFieldType('Dynamicget')->options; // We do some sanitation for Dynamic Get Name filter @@ -210,16 +193,6 @@ class ComponentbuilderViewTemplates extends JViewLegacy 'filter_dynamic_get', JHtml::_('select.options', $this->dynamic_getNameOptions, 'value', 'text', $this->state->get('filter.dynamic_get')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Dynamic Get Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_GET_LABEL').' -', - 'batch[dynamic_get]', - JHtml::_('select.options', $this->dynamic_getNameOptions, 'value', 'text') - ); - } } // Set Add Php View Selection @@ -240,16 +213,48 @@ class ComponentbuilderViewTemplates extends JViewLegacy 'filter_add_php_view', JHtml::_('select.options', $this->add_php_viewOptions, 'value', 'text', $this->state->get('filter.add_php_view')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Add Php View Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_TEMPLATE_ADD_PHP_VIEW_LABEL').' -', - 'batch[add_php_view]', - JHtml::_('select.options', $this->add_php_viewOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Dynamic Get Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Dynamic Get Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_GET_LABEL').' -', + 'batch[dynamic_get]', + JHtml::_('select.options', $this->dynamic_getNameOptions, 'value', 'text') + ); + } + + // Only load Add Php View batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Add Php View Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_TEMPLATE_ADD_PHP_VIEW_LABEL').' -', + 'batch[add_php_view]', + JHtml::_('select.options', $this->add_php_viewOptions, 'value', 'text') + ); } } diff --git a/admin/views/validation_rule/tmpl/edit.php b/admin/views/validation_rule/tmpl/edit.php index 1040aef74..682c05cde 100644 --- a/admin/views/validation_rule/tmpl/edit.php +++ b/admin/views/validation_rule/tmpl/edit.php @@ -12,10 +12,10 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/validation_rules/tmpl/default.php b/admin/views/validation_rules/tmpl/default.php index c0d7fd02a..fa704dadc 100644 --- a/admin/views/validation_rules/tmpl/default.php +++ b/admin/views/validation_rules/tmpl/default.php @@ -12,12 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=validation_rules.saveOrderAjax&tmpl=component'; diff --git a/admin/views/validation_rules/view.html.php b/admin/views/validation_rules/view.html.php index 31fa34589..75101fbec 100644 --- a/admin/views/validation_rules/view.html.php +++ b/admin/views/validation_rules/view.html.php @@ -157,39 +157,42 @@ class ComponentbuilderViewValidation_rules extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); - } - - 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_COMPONENTBUILDER_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_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + 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) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } diff --git a/componentbuilder.xml b/componentbuilder.xml index 096495187..d414be435 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 24th November, 2020 + 28th November, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com diff --git a/site/views/api/tmpl/default.php b/site/views/api/tmpl/default.php index 4213956ce..c9b7fea36 100644 --- a/site/views/api/tmpl/default.php +++ b/site/views/api/tmpl/default.php @@ -12,6 +12,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + ?>