diff --git a/README.md b/README.md index c588f8c3f..40c043732 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*: 16th July, 2020 ++ *Last Build*: 24th July, 2020 + *Version*: 2.11.2 + *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*: **282693** ++ *Line count*: **283043** + *Field count*: **1525** + *File count*: **1785** + *Folder count*: **295** diff --git a/admin/README.txt b/admin/README.txt index c588f8c3f..40c043732 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*: 16th July, 2020 ++ *Last Build*: 24th July, 2020 + *Version*: 2.11.2 + *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*: **282693** ++ *Line count*: **283043** + *Field count*: **1525** + *File count*: **1785** + *Folder count*: **295** diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 8c6214ed0..4b10da9a8 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -1637,6 +1637,9 @@ class Interpretation extends Fields $exel[] = $this->_t(3) . "->setLastModifiedBy(\$modified)"; $exel[] = $this->_t(3) . "->setTitle(\$title)"; $exel[] = $this->_t(3) . "->setSubject(\$subjectTab);"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " The file type"; + $exel[] = $this->_t(2) . "\$file_type = 'Xls';"; $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set description"; $exel[] = $this->_t(2) . "if (\$description)"; @@ -1682,27 +1685,52 @@ class Interpretation extends Fields $exel[] = $this->_t(2) . "));"; $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add some data"; - $exel[] = $this->_t(2) . "if (self::checkArray(\$rows))"; + $exel[] = $this->_t(2) . "if ((\$size = self::checkArray(\$rows)) !== false)"; $exel[] = $this->_t(2) . "{"; $exel[] = $this->_t(3) . "\$i = 1;"; - $exel[] = $this->_t(3) . "foreach (\$rows as \$array){"; + $exel[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Based on data size we adapt the behaviour."; + $exel[] = $this->_t(3) . "\$xls_mode = 1;"; + $exel[] = $this->_t(3) . "if (\$size > 3000)"; + $exel[] = $this->_t(3) . "{"; + $exel[] = $this->_t(4) . "\$xls_mode = 3;"; + $exel[] = $this->_t(4) . "\$file_type = 'Csv';"; + $exel[] = $this->_t(3) . "}"; + $exel[] = $this->_t(3) . "elseif (\$size > 2000)"; + $exel[] = $this->_t(3) . "{"; + $exel[] = $this->_t(4) . "\$xls_mode = 2;"; + $exel[] = $this->_t(3) . "}"; + $exel[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Set active sheet and get it."; + $exel[] = $this->_t(3) . "\$active_sheet = \$spreadsheet->setActiveSheetIndex(0);"; + $exel[] = $this->_t(3) . "foreach (\$rows as \$array)"; + $exel[] = $this->_t(3) . "{"; $exel[] = $this->_t(4) . "\$a = 'A';"; - $exel[] = $this->_t(4) . "foreach (\$array as \$value){"; + $exel[] = $this->_t(4) . "foreach (\$array as \$value)"; + $exel[] = $this->_t(4) . "{"; $exel[] = $this->_t(5) - . "\$spreadsheet->setActiveSheetIndex(0)->setCellValue(\$a.\$i, \$value);"; - $exel[] = $this->_t(5) . "if (\$i == 1){"; - $exel[] = $this->_t(6) - . "\$spreadsheet->getActiveSheet()->getColumnDimension(\$a)->setAutoSize(true);"; - $exel[] = $this->_t(6) - . "\$spreadsheet->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$headerStyles);"; - $exel[] = $this->_t(6) - . "\$spreadsheet->getActiveSheet()->getStyle(\$a.\$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);"; - $exel[] = $this->_t(5) . "} elseif (\$a === 'A'){"; - $exel[] = $this->_t(6) - . "\$spreadsheet->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$sideStyles);"; - $exel[] = $this->_t(5) . "} else {"; - $exel[] = $this->_t(6) - . "\$spreadsheet->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$normalStyles);"; + . "\$active_sheet->setCellValue(\$a.\$i, \$value);"; + $exel[] = $this->_t(5) . "if (\$xls_mode != 3)"; + $exel[] = $this->_t(5) . "{"; + $exel[] = $this->_t(6) . "if (\$i == 1)"; + $exel[] = $this->_t(6) . "{"; + $exel[] = $this->_t(7) + . "\$active_sheet->getColumnDimension(\$a)->setAutoSize(true);"; + $exel[] = $this->_t(7) + . "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$headerStyles);"; + $exel[] = $this->_t(7) + . "\$active_sheet->getStyle(\$a.\$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);"; + $exel[] = $this->_t(6) . "}"; + $exel[] = $this->_t(6) . "elseif (\$a === 'A')"; + $exel[] = $this->_t(6) . "{"; + $exel[] = $this->_t(7) + . "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$sideStyles);"; + $exel[] = $this->_t(6) . "}"; + $exel[] = $this->_t(6) . "elseif (\$xls_mode == 1)"; + $exel[] = $this->_t(6) . "{"; + $exel[] = $this->_t(7) + . "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$normalStyles);"; + $exel[] = $this->_t(6) . "}"; $exel[] = $this->_t(5) . "}"; $exel[] = $this->_t(5) . "\$a++;"; $exel[] = $this->_t(4) . "}"; @@ -1725,7 +1753,7 @@ class Interpretation extends Fields $exel[] = $this->_t(2) . "header('Content-Type: application/vnd.ms-excel');"; $exel[] = $this->_t(2) - . "header('Content-Disposition: attachment;filename=\"'.\$fileName.'.xls\"');"; + . "header('Content-Disposition: attachment;filename=\"' . \$fileName . '.' . strtolower(\$file_type) .'\"');"; $exel[] = $this->_t(2) . "header('Cache-Control: max-age=0');"; $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " If you're serving to IE 9, then the following may be needed"; @@ -1744,7 +1772,7 @@ class Interpretation extends Fields $exel[] = $this->_t(2) . "header ('Pragma: public'); //" . $this->setLine(__LINE__) . " HTTP/1.0"; $exel[] = PHP_EOL . $this->_t(2) - . "\$writer = IOFactory::createWriter(\$spreadsheet, 'Xls');"; + . "\$writer = IOFactory::createWriter(\$spreadsheet, \$file_type);"; $exel[] = $this->_t(2) . "\$writer->save('php://output');"; $exel[] = $this->_t(2) . "jexit();"; $exel[] = $this->_t(1) . "}"; @@ -5631,7 +5659,8 @@ class Interpretation extends Fields $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "JToolBarHelper::custom('" . $viewName . "." . $custom_button['method'] . "', '" - . $custom_button['icomoon'] . "', '', '" . $keyLang + . $custom_button['icomoon'] . " custom-button-" + . strtolower($custom_button['method']) . "', '', '" . $keyLang . "', false);"; $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "}"; } @@ -5665,7 +5694,8 @@ class Interpretation extends Fields ) . $tab . $this->_t(1) . "JToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" - . $custom_button['icomoon'] . "', '', '" + . $custom_button['icomoon'] . " custom-button-" + . strtolower($custom_button['method']) . "', '', '" . $keyLang . "', false);"; $this->onlyFunctionButton[$viewsName][] = $this->_t( 1 @@ -5685,7 +5715,8 @@ class Interpretation extends Fields $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "JToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" - . $custom_button['icomoon'] . "', '', '" + . $custom_button['icomoon'] . " custom-button-" + . strtolower($custom_button['method']) . "', '', '" . $keyLang . "', '" . $validateSelection . "');"; $buttons[] = $this->_t(1) . $tab . $this->_t(1) @@ -14365,9 +14396,9 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(1) . "{"; $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " setup the query"; - $query .= PHP_EOL . $this->_t(2) . "if (" + $query .= PHP_EOL . $this->_t(2) . "if ((\$pks_size = " . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$pks))"; + . $this->hhh] . "Helper::checkArray(\$pks)) !== false || 'bulk' === \$pks)"; $query .= PHP_EOL . $this->_t(2) . "{"; $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set a value to know this is " . $config['type'] @@ -14399,8 +14430,39 @@ class Interpretation extends Fields . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $viewName_single . "', 'a'));"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " The bulk export path"; + $query .= PHP_EOL . $this->_t(3) . "if ('bulk' === \$pks)"; $query .= PHP_EOL . $this->_t(3) + . "{"; + $query .= PHP_EOL . $this->_t(4) + . "\$query->where('a.id > 0');"; + $query .= PHP_EOL . $this->_t(3) + . "}"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " A large array of ID's will not work out well"; + $query .= PHP_EOL . $this->_t(3) . "elseif (\$pks_size > 500)"; + $query .= PHP_EOL . $this->_t(3) + . "{"; + $query .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Use lowest ID"; + $query .= PHP_EOL . $this->_t(4) + . "\$query->where('a.id >= ' . (int) min(\$pks));"; + $query .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Use highest ID"; + $query .= PHP_EOL . $this->_t(4) + . "\$query->where('a.id <= ' . (int) max(\$pks));"; + $query .= PHP_EOL . $this->_t(3) + . "}"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " The normal default path"; + $query .= PHP_EOL . $this->_t(3) . "else"; + $query .= PHP_EOL . $this->_t(3) + . "{"; + $query .= PHP_EOL . $this->_t(4) . "\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; + $query .= PHP_EOL . $this->_t(3) + . "}"; // add custom filtering php $query .= $this->getCustomScriptBuilder( 'php_getlistquery', $viewName_single, diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 8cafa3d41..c4d29f654 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -6309,6 +6309,8 @@ abstract class ComponentbuilderHelper ->setLastModifiedBy($modified) ->setTitle($title) ->setSubject($subjectTab); + // The file type + $file_type = 'Xls'; // set description if ($description) { @@ -6348,21 +6350,46 @@ abstract class ComponentbuilderHelper )); // Add some data - if (self::checkArray($rows)) + if (($size = self::checkArray($rows)) !== false) { $i = 1; - foreach ($rows as $array){ + + // Based on data size we adapt the behaviour. + $xls_mode = 1; + if ($size > 3000) + { + $xls_mode = 3; + $file_type = 'Csv'; + } + elseif ($size > 2000) + { + $xls_mode = 2; + } + + // Set active sheet and get it. + $active_sheet = $spreadsheet->setActiveSheetIndex(0); + foreach ($rows as $array) + { $a = 'A'; - foreach ($array as $value){ - $spreadsheet->setActiveSheetIndex(0)->setCellValue($a.$i, $value); - if ($i == 1){ - $spreadsheet->getActiveSheet()->getColumnDimension($a)->setAutoSize(true); - $spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($headerStyles); - $spreadsheet->getActiveSheet()->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); - } elseif ($a === 'A'){ - $spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($sideStyles); - } else { - $spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($normalStyles); + foreach ($array as $value) + { + $active_sheet->setCellValue($a.$i, $value); + if ($xls_mode != 3) + { + if ($i == 1) + { + $active_sheet->getColumnDimension($a)->setAutoSize(true); + $active_sheet->getStyle($a.$i)->applyFromArray($headerStyles); + $active_sheet->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); + } + elseif ($a === 'A') + { + $active_sheet->getStyle($a.$i)->applyFromArray($sideStyles); + } + elseif ($xls_mode == 1) + { + $active_sheet->getStyle($a.$i)->applyFromArray($normalStyles); + } } $a++; } @@ -6382,7 +6409,7 @@ abstract class ComponentbuilderHelper // Redirect output to a client's web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment;filename="'.$fileName.'.xls"'); + header('Content-Disposition: attachment;filename="' . $fileName . '.' . strtolower($file_type) .'"'); header('Cache-Control: max-age=0'); // If you're serving to IE 9, then the following may be needed header('Cache-Control: max-age=1'); @@ -6393,7 +6420,7 @@ abstract class ComponentbuilderHelper header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header ('Pragma: public'); // HTTP/1.0 - $writer = IOFactory::createWriter($spreadsheet, 'Xls'); + $writer = IOFactory::createWriter($spreadsheet, $file_type); $writer->save('php://output'); jexit(); } diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index 35eecdbe0..2bff5e023 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -342,7 +342,7 @@ class ComponentbuilderModelAdmin_views extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -360,7 +360,24 @@ class ComponentbuilderModelAdmin_views extends JModelList // From the componentbuilder_admin_view table $query->from($db->quoteName('#__componentbuilder_admin_view', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/class_methods.php b/admin/models/class_methods.php index 0d9d4c9da..dbca552ae 100644 --- a/admin/models/class_methods.php +++ b/admin/models/class_methods.php @@ -269,7 +269,7 @@ class ComponentbuilderModelClass_methods extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -287,7 +287,24 @@ class ComponentbuilderModelClass_methods extends JModelList // From the componentbuilder_class_method table $query->from($db->quoteName('#__componentbuilder_class_method', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/class_properties.php b/admin/models/class_properties.php index 9e9befe8a..db8ae024e 100644 --- a/admin/models/class_properties.php +++ b/admin/models/class_properties.php @@ -269,7 +269,7 @@ class ComponentbuilderModelClass_properties extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -287,7 +287,24 @@ class ComponentbuilderModelClass_properties extends JModelList // From the componentbuilder_class_property table $query->from($db->quoteName('#__componentbuilder_class_property', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php index ede100835..447816d19 100644 --- a/admin/models/custom_admin_views.php +++ b/admin/models/custom_admin_views.php @@ -283,7 +283,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -301,7 +301,24 @@ class ComponentbuilderModelCustom_admin_views extends JModelList // From the componentbuilder_custom_admin_view table $query->from($db->quoteName('#__componentbuilder_custom_admin_view', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php index d9745bf2d..3c016267e 100644 --- a/admin/models/custom_codes.php +++ b/admin/models/custom_codes.php @@ -316,7 +316,7 @@ class ComponentbuilderModelCustom_codes extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -334,7 +334,24 @@ class ComponentbuilderModelCustom_codes extends JModelList // From the componentbuilder_custom_code table $query->from($db->quoteName('#__componentbuilder_custom_code', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index 91356cf03..9f66a6f5b 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -266,7 +266,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -284,7 +284,24 @@ class ComponentbuilderModelDynamic_gets extends JModelList // From the componentbuilder_dynamic_get table $query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/fields.php b/admin/models/fields.php index 8eb0104d8..b6b8225b6 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -382,7 +382,7 @@ class ComponentbuilderModelFields extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -400,7 +400,24 @@ class ComponentbuilderModelFields extends JModelList // From the componentbuilder_field table $query->from($db->quoteName('#__componentbuilder_field', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/fieldtypes.php b/admin/models/fieldtypes.php index 399098cce..d4a5615aa 100644 --- a/admin/models/fieldtypes.php +++ b/admin/models/fieldtypes.php @@ -235,7 +235,7 @@ class ComponentbuilderModelFieldtypes extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -253,7 +253,24 @@ class ComponentbuilderModelFieldtypes extends JModelList // From the componentbuilder_fieldtype table $query->from($db->quoteName('#__componentbuilder_fieldtype', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index 4587f36f0..a78e375d8 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -278,7 +278,7 @@ class ComponentbuilderModelHelp_documents extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -296,7 +296,24 @@ class ComponentbuilderModelHelp_documents extends JModelList // From the componentbuilder_help_document table $query->from($db->quoteName('#__componentbuilder_help_document', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Order the results by ordering $query->order('a.ordering ASC'); diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 6f2a6d7ce..3e551c730 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -2252,7 +2252,7 @@ class ComponentbuilderModelJoomla_components extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -2270,7 +2270,24 @@ class ComponentbuilderModelJoomla_components extends JModelList // From the componentbuilder_joomla_component table $query->from($db->quoteName('#__componentbuilder_joomla_component', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/language_translations.php b/admin/models/language_translations.php index 2a839d248..d66135701 100644 --- a/admin/models/language_translations.php +++ b/admin/models/language_translations.php @@ -249,7 +249,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -267,7 +267,24 @@ class ComponentbuilderModelLanguage_translations extends JModelList // From the componentbuilder_language_translation table $query->from($db->quoteName('#__componentbuilder_language_translation', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/languages.php b/admin/models/languages.php index 302ad4554..a232fecb2 100644 --- a/admin/models/languages.php +++ b/admin/models/languages.php @@ -322,7 +322,7 @@ class ComponentbuilderModelLanguages extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -340,7 +340,24 @@ class ComponentbuilderModelLanguages extends JModelList // From the componentbuilder_language table $query->from($db->quoteName('#__componentbuilder_language', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/layouts.php b/admin/models/layouts.php index 0c5bd8fe8..bbede2926 100644 --- a/admin/models/layouts.php +++ b/admin/models/layouts.php @@ -255,7 +255,7 @@ class ComponentbuilderModelLayouts extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -273,7 +273,24 @@ class ComponentbuilderModelLayouts extends JModelList // From the componentbuilder_layout table $query->from($db->quoteName('#__componentbuilder_layout', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/placeholders.php b/admin/models/placeholders.php index 6d191f790..153139148 100644 --- a/admin/models/placeholders.php +++ b/admin/models/placeholders.php @@ -201,7 +201,7 @@ class ComponentbuilderModelPlaceholders extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -219,7 +219,24 @@ class ComponentbuilderModelPlaceholders extends JModelList // From the componentbuilder_placeholder table $query->from($db->quoteName('#__componentbuilder_placeholder', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/servers.php b/admin/models/servers.php index 2f820e780..f12905b60 100644 --- a/admin/models/servers.php +++ b/admin/models/servers.php @@ -244,7 +244,7 @@ class ComponentbuilderModelServers extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -262,7 +262,24 @@ class ComponentbuilderModelServers extends JModelList // From the componentbuilder_server table $query->from($db->quoteName('#__componentbuilder_server', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/site_views.php b/admin/models/site_views.php index 69207716f..2ad2c53bb 100644 --- a/admin/models/site_views.php +++ b/admin/models/site_views.php @@ -287,7 +287,7 @@ class ComponentbuilderModelSite_views extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -305,7 +305,24 @@ class ComponentbuilderModelSite_views extends JModelList // From the componentbuilder_site_view table $query->from($db->quoteName('#__componentbuilder_site_view', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/snippets.php b/admin/models/snippets.php index 5fa27a5aa..c2613b5ff 100644 --- a/admin/models/snippets.php +++ b/admin/models/snippets.php @@ -343,7 +343,7 @@ class ComponentbuilderModelSnippets extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -361,7 +361,24 @@ class ComponentbuilderModelSnippets extends JModelList // From the componentbuilder_snippet table $query->from($db->quoteName('#__componentbuilder_snippet', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/templates.php b/admin/models/templates.php index ac562b4f4..be7fc91a1 100644 --- a/admin/models/templates.php +++ b/admin/models/templates.php @@ -255,7 +255,7 @@ class ComponentbuilderModelTemplates extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -273,7 +273,24 @@ class ComponentbuilderModelTemplates extends JModelList // From the componentbuilder_template table $query->from($db->quoteName('#__componentbuilder_template', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/models/validation_rules.php b/admin/models/validation_rules.php index b1dbca638..a2636f860 100644 --- a/admin/models/validation_rules.php +++ b/admin/models/validation_rules.php @@ -199,7 +199,7 @@ class ComponentbuilderModelValidation_rules extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (ComponentbuilderHelper::checkArray($pks)) + if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -217,7 +217,24 @@ class ComponentbuilderModelValidation_rules extends JModelList // From the componentbuilder_validation_rule table $query->from($db->quoteName('#__componentbuilder_validation_rule', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_componentbuilder')) { diff --git a/admin/views/admin_views/view.html.php b/admin/views/admin_views/view.html.php index aa6cbd4fb..2df832309 100644 --- a/admin/views/admin_views/view.html.php +++ b/admin/views/admin_views/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy if ($this->user->authorise('admin_view.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('admin_views.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('admin_views.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('admin_view.import')) diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 12c562fc4..7adbb2f1e 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -339,17 +339,17 @@ class ComponentbuilderViewCompiler extends JViewLegacy if ($this->canDo->get('compiler.run_expansion')) { // add Run Expansion button. - JToolBarHelper::custom('compiler.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('compiler.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('compiler.translate')) { // add Translate button. - JToolBarHelper::custom('compiler.runTranslator', 'comments-2', '', 'COM_COMPONENTBUILDER_TRANSLATE', false); + JToolBarHelper::custom('compiler.runTranslator', 'comments-2 custom-button-runtranslator', '', 'COM_COMPONENTBUILDER_TRANSLATE', false); } if ($this->canDo->get('compiler.clear_tmp')) { // add Clear tmp button. - JToolBarHelper::custom('compiler.clearTmp', 'purge', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); + JToolBarHelper::custom('compiler.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); } // set help url for this view if found diff --git a/admin/views/custom_admin_views/view.html.php b/admin/views/custom_admin_views/view.html.php index e040d422f..381c261c1 100644 --- a/admin/views/custom_admin_views/view.html.php +++ b/admin/views/custom_admin_views/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy if ($this->user->authorise('custom_admin_view.get_snippets', 'com_componentbuilder')) { // add Get Snippets button. - JToolBarHelper::custom('custom_admin_views.getSnippets', 'search', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); + JToolBarHelper::custom('custom_admin_views.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); } if ($this->canDo->get('core.import') && $this->canDo->get('custom_admin_view.import')) diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index 18976f197..5dd2c29fe 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy if ($this->user->authorise('custom_code.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('custom_codes.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('custom_codes.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('custom_code.import')) diff --git a/admin/views/dynamic_gets/view.html.php b/admin/views/dynamic_gets/view.html.php index 32a81413e..14e316411 100644 --- a/admin/views/dynamic_gets/view.html.php +++ b/admin/views/dynamic_gets/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy if ($this->user->authorise('dynamic_get.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('dynamic_gets.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('dynamic_gets.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('dynamic_get.import')) diff --git a/admin/views/fields/view.html.php b/admin/views/fields/view.html.php index 3fc356eba..bfa580282 100644 --- a/admin/views/fields/view.html.php +++ b/admin/views/fields/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewFields extends JViewLegacy if ($this->user->authorise('field.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('fields.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('fields.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('field.import')) diff --git a/admin/views/get_snippets/view.html.php b/admin/views/get_snippets/view.html.php index 0a791cdf1..8fbbcf7d9 100644 --- a/admin/views/get_snippets/view.html.php +++ b/admin/views/get_snippets/view.html.php @@ -257,32 +257,32 @@ class ComponentbuilderViewGet_snippets extends JViewLegacy if ($this->canDo->get('get_snippets.custom_admin_views')) { // add Custom Admin Views button. - JToolBarHelper::custom('get_snippets.openCustomAdminViews', 'screen', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false); + JToolBarHelper::custom('get_snippets.openCustomAdminViews', 'screen custom-button-opencustomadminviews', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false); } if ($this->canDo->get('get_snippets.site_views')) { // add Site Views button. - JToolBarHelper::custom('get_snippets.openSiteViews', 'palette', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false); + JToolBarHelper::custom('get_snippets.openSiteViews', 'palette custom-button-opensiteviews', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false); } if ($this->canDo->get('get_snippets.templates')) { // add Templates button. - JToolBarHelper::custom('get_snippets.openTemplates', 'brush', '', 'COM_COMPONENTBUILDER_TEMPLATES', false); + JToolBarHelper::custom('get_snippets.openTemplates', 'brush custom-button-opentemplates', '', 'COM_COMPONENTBUILDER_TEMPLATES', false); } if ($this->canDo->get('get_snippets.layouts')) { // add Layouts button. - JToolBarHelper::custom('get_snippets.openLayouts', 'brush', '', 'COM_COMPONENTBUILDER_LAYOUTS', false); + JToolBarHelper::custom('get_snippets.openLayouts', 'brush custom-button-openlayouts', '', 'COM_COMPONENTBUILDER_LAYOUTS', false); } if ($this->canDo->get('get_snippets.snippets')) { // add Snippets button. - JToolBarHelper::custom('get_snippets.openSnippets', 'pin', '', 'COM_COMPONENTBUILDER_SNIPPETS', false); + JToolBarHelper::custom('get_snippets.openSnippets', 'pin custom-button-opensnippets', '', 'COM_COMPONENTBUILDER_SNIPPETS', false); } if ($this->canDo->get('get_snippets.libraries')) { // add Libraries button. - JToolBarHelper::custom('get_snippets.openLibraries', 'puzzle', '', 'COM_COMPONENTBUILDER_LIBRARIES', false); + JToolBarHelper::custom('get_snippets.openLibraries', 'puzzle custom-button-openlibraries', '', 'COM_COMPONENTBUILDER_LIBRARIES', false); } // set help url for this view if found diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php index 00036299d..e95bc3295 100644 --- a/admin/views/joomla_components/view.html.php +++ b/admin/views/joomla_components/view.html.php @@ -123,12 +123,12 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy if ($this->user->authorise('joomla_component.clone', 'com_componentbuilder')) { // add Clone button. - JToolBarHelper::custom('joomla_components.cloner', 'save-copy', '', 'COM_COMPONENTBUILDER_CLONE', 'true'); + JToolBarHelper::custom('joomla_components.cloner', 'save-copy custom-button-cloner', '', 'COM_COMPONENTBUILDER_CLONE', 'true'); } if ($this->user->authorise('joomla_component.export_jcb_packages', 'com_componentbuilder')) { // add Export JCB Packages button. - JToolBarHelper::custom('joomla_components.smartExport', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_JCB_PACKAGES', 'true'); + JToolBarHelper::custom('joomla_components.smartExport', 'download custom-button-smartexport', '', 'COM_COMPONENTBUILDER_EXPORT_JCB_PACKAGES', 'true'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) @@ -148,22 +148,22 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy if ($this->user->authorise('joomla_component.import_jcb_packages', 'com_componentbuilder')) { // add Import JCB Packages button. - JToolBarHelper::custom('joomla_components.smartImport', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_JCB_PACKAGES', false); + JToolBarHelper::custom('joomla_components.smartImport', 'upload custom-button-smartimport', '', 'COM_COMPONENTBUILDER_IMPORT_JCB_PACKAGES', false); } if ($this->user->authorise('joomla_component.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('joomla_components.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('joomla_components.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->user->authorise('joomla_component.backup', 'com_componentbuilder')) { // add Backup button. - JToolBarHelper::custom('joomla_components.backup', 'archive', '', 'COM_COMPONENTBUILDER_BACKUP', false); + JToolBarHelper::custom('joomla_components.backup', 'archive custom-button-backup', '', 'COM_COMPONENTBUILDER_BACKUP', false); } if ($this->user->authorise('joomla_component.clear_tmp', 'com_componentbuilder')) { // add Clear tmp button. - JToolBarHelper::custom('joomla_components.clearTmp', 'purge', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); + JToolBarHelper::custom('joomla_components.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); } if ($this->canDo->get('core.import') && $this->canDo->get('joomla_component.import')) diff --git a/admin/views/joomla_modules/view.html.php b/admin/views/joomla_modules/view.html.php index f4e5fc7ee..3197a6050 100644 --- a/admin/views/joomla_modules/view.html.php +++ b/admin/views/joomla_modules/view.html.php @@ -133,12 +133,12 @@ class ComponentbuilderViewJoomla_modules extends JViewLegacy if ($this->user->authorise('joomla_module.get_snippets', 'com_componentbuilder')) { // add Get Snippets button. - JToolBarHelper::custom('joomla_modules.getSnippets', 'search', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); + JToolBarHelper::custom('joomla_modules.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); } if ($this->user->authorise('joomla_module.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('joomla_modules.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('joomla_modules.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } // set help url for this view if found diff --git a/admin/views/joomla_plugins/view.html.php b/admin/views/joomla_plugins/view.html.php index 1d98c0306..f75abb729 100644 --- a/admin/views/joomla_plugins/view.html.php +++ b/admin/views/joomla_plugins/view.html.php @@ -133,22 +133,22 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy if ($this->user->authorise('joomla_plugin.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('joomla_plugins.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('joomla_plugins.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->user->authorise('joomla_plugin.get_boilerplate', 'com_componentbuilder')) { // add Get Boilerplate button. - JToolBarHelper::custom('joomla_plugins.getBoilerplate', 'joomla', '', 'COM_COMPONENTBUILDER_GET_BOILERPLATE', false); + JToolBarHelper::custom('joomla_plugins.getBoilerplate', 'joomla custom-button-getboilerplate', '', 'COM_COMPONENTBUILDER_GET_BOILERPLATE', false); } if ($this->user->authorise('joomla_plugin.methods', 'com_componentbuilder')) { // add Methods button. - JToolBarHelper::custom('joomla_plugins.openClassMethods', 'joomla', '', 'COM_COMPONENTBUILDER_METHODS', false); + JToolBarHelper::custom('joomla_plugins.openClassMethods', 'joomla custom-button-openclassmethods', '', 'COM_COMPONENTBUILDER_METHODS', false); } if ($this->user->authorise('joomla_plugin.properties', 'com_componentbuilder')) { // add Properties button. - JToolBarHelper::custom('joomla_plugins.openClassProperties', 'joomla', '', 'COM_COMPONENTBUILDER_PROPERTIES', false); + JToolBarHelper::custom('joomla_plugins.openClassProperties', 'joomla custom-button-openclassproperties', '', 'COM_COMPONENTBUILDER_PROPERTIES', false); } // set help url for this view if found diff --git a/admin/views/languages/view.html.php b/admin/views/languages/view.html.php index 71dd8b38d..356f0d7da 100644 --- a/admin/views/languages/view.html.php +++ b/admin/views/languages/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewLanguages extends JViewLegacy if ($this->user->authorise('language.build', 'com_componentbuilder')) { // add Build button. - JToolBarHelper::custom('languages.buildLanguages', 'joomla', '', 'COM_COMPONENTBUILDER_BUILD', false); + JToolBarHelper::custom('languages.buildLanguages', 'joomla custom-button-buildlanguages', '', 'COM_COMPONENTBUILDER_BUILD', false); } if ($this->canDo->get('core.import') && $this->canDo->get('language.import')) diff --git a/admin/views/layouts/view.html.php b/admin/views/layouts/view.html.php index 6bd7ac34c..b80e465c4 100644 --- a/admin/views/layouts/view.html.php +++ b/admin/views/layouts/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewLayouts extends JViewLegacy if ($this->user->authorise('layout.get_snippets', 'com_componentbuilder')) { // add Get Snippets button. - JToolBarHelper::custom('layouts.getSnippets', 'search', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); + JToolBarHelper::custom('layouts.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); } if ($this->canDo->get('core.import') && $this->canDo->get('layout.import')) diff --git a/admin/views/libraries/view.html.php b/admin/views/libraries/view.html.php index 7f906a1d4..387ad101e 100644 --- a/admin/views/libraries/view.html.php +++ b/admin/views/libraries/view.html.php @@ -133,7 +133,7 @@ class ComponentbuilderViewLibraries extends JViewLegacy if ($this->user->authorise('library.get_snippets', 'com_componentbuilder')) { // add Get Snippets button. - JToolBarHelper::custom('libraries.getSnippets', 'search', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); + JToolBarHelper::custom('libraries.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); } // set help url for this view if found diff --git a/admin/views/site_views/view.html.php b/admin/views/site_views/view.html.php index 6d51fc227..2fe9ec51a 100644 --- a/admin/views/site_views/view.html.php +++ b/admin/views/site_views/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewSite_views extends JViewLegacy if ($this->user->authorise('site_view.get_snippets', 'com_componentbuilder')) { // add Get Snippets button. - JToolBarHelper::custom('site_views.getSnippets', 'search', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); + JToolBarHelper::custom('site_views.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); } if ($this->canDo->get('core.import') && $this->canDo->get('site_view.import')) diff --git a/admin/views/snippets/view.html.php b/admin/views/snippets/view.html.php index e4b62e813..f2cf6f21b 100644 --- a/admin/views/snippets/view.html.php +++ b/admin/views/snippets/view.html.php @@ -123,7 +123,7 @@ class ComponentbuilderViewSnippets extends JViewLegacy if ($this->user->authorise('snippet.share_snippets', 'com_componentbuilder')) { // add Share Snippets button. - JToolBarHelper::custom('snippets.shareSnippets', 'share', '', 'COM_COMPONENTBUILDER_SHARE_SNIPPETS', 'true'); + JToolBarHelper::custom('snippets.shareSnippets', 'share custom-button-sharesnippets', '', 'COM_COMPONENTBUILDER_SHARE_SNIPPETS', 'true'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) @@ -143,7 +143,7 @@ class ComponentbuilderViewSnippets extends JViewLegacy if ($this->user->authorise('snippet.get_snippets', 'com_componentbuilder')) { // add Get Snippets button. - JToolBarHelper::custom('snippets.getSnippets', 'search', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); + JToolBarHelper::custom('snippets.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); } if ($this->canDo->get('core.import') && $this->canDo->get('snippet.import')) diff --git a/admin/views/templates/view.html.php b/admin/views/templates/view.html.php index 3c4de15bb..83e26eb5b 100644 --- a/admin/views/templates/view.html.php +++ b/admin/views/templates/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewTemplates extends JViewLegacy if ($this->user->authorise('template.get_snippets', 'com_componentbuilder')) { // add Get Snippets button. - JToolBarHelper::custom('templates.getSnippets', 'search', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); + JToolBarHelper::custom('templates.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false); } if ($this->canDo->get('core.import') && $this->canDo->get('template.import')) diff --git a/admin/views/validation_rules/view.html.php b/admin/views/validation_rules/view.html.php index 3005c815c..0b1f3d44c 100644 --- a/admin/views/validation_rules/view.html.php +++ b/admin/views/validation_rules/view.html.php @@ -138,7 +138,7 @@ class ComponentbuilderViewValidation_rules extends JViewLegacy if ($this->user->authorise('validation_rule.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('validation_rules.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + JToolBarHelper::custom('validation_rules.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('validation_rule.import')) diff --git a/componentbuilder.xml b/componentbuilder.xml index 68395744d..858737d50 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 16th July, 2020 + 24th July, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com