diff --git a/README.md b/README.md index ffe9ac8..5ddf818 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Hello World (1.0.0) +# Hello World (1.0.1) @@ -8,24 +8,24 @@ + *Author*: [Llewellyn](mailto:joomla@vdm.io) + *Name*: [Hello World](https://www.vdm.io) + *First Build*: 20th September, 2017 -+ *Last Build*: 30th May, 2020 -+ *Version*: 1.0.0 ++ *Last Build*: 4th January, 2021 ++ *Version*: 1.0.1 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ## Build Time -**40 Hours** or **5 Eight Hour Days** (actual time the author saved - +**41 Hours** or **5 Eight Hour Days** (actual time the author saved - due to [Automated Component Builder](http://joomlacomponentbuilder.com)) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **14355** -+ *File count*: **136** ++ *Line count*: **14632** ++ *File count*: **139** + *Folder count*: **55** -**27 Hours** or **3 Eight Hour Days** (the actual time the author spent) +**27 Hours** or **4 Eight Hour Days** (the actual time the author spent) > (with the following break down: > **debugging @10hours** = codingtime / 4; @@ -33,20 +33,49 @@ due to [Automated Component Builder](http://joomlacomponentbuilder.com)) > **mapping @4hours** = codingtime / 10; > **office @7hours** = codingtime / 6;) -**67 Hours** or **8 Eight Hour Days** +**68 Hours** or **9 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > with the normal everyday realities at the office, that includes the component planning, mapping & debugging.) -Project duration: **1.6 weeks** or **0.3 months** +Project duration: **1.8 weeks** or **0.4 months** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) -## Donations + +## Contributors +This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder). -If you want to support this project, please consider donating: -* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) -* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf -* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218 \ No newline at end of file +[![Contributors](https://opencollective.com/Joomla-Component-Builder/contributors.svg?width=890&button=false)](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors) + +### Backers +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)] + +[![Our Backers on opencollective](https://opencollective.com/Joomla-Component-Builder/backers.svg?width=890)](https://opencollective.com/Joomla-Component-Builder#backers) + +### Sponsors +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)] + +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/0/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/1/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/2/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/3/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/4/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/5/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/6/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/7/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/8/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/9/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/10/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/11/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/12/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/13/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/14/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/15/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/16/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/17/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/18/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/19/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/20/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website) \ No newline at end of file diff --git a/admin/README.txt b/admin/README.txt index ffe9ac8..5ddf818 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Hello World (1.0.0) +# Hello World (1.0.1) @@ -8,24 +8,24 @@ + *Author*: [Llewellyn](mailto:joomla@vdm.io) + *Name*: [Hello World](https://www.vdm.io) + *First Build*: 20th September, 2017 -+ *Last Build*: 30th May, 2020 -+ *Version*: 1.0.0 ++ *Last Build*: 4th January, 2021 ++ *Version*: 1.0.1 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ## Build Time -**40 Hours** or **5 Eight Hour Days** (actual time the author saved - +**41 Hours** or **5 Eight Hour Days** (actual time the author saved - due to [Automated Component Builder](http://joomlacomponentbuilder.com)) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **14355** -+ *File count*: **136** ++ *Line count*: **14632** ++ *File count*: **139** + *Folder count*: **55** -**27 Hours** or **3 Eight Hour Days** (the actual time the author spent) +**27 Hours** or **4 Eight Hour Days** (the actual time the author spent) > (with the following break down: > **debugging @10hours** = codingtime / 4; @@ -33,20 +33,49 @@ due to [Automated Component Builder](http://joomlacomponentbuilder.com)) > **mapping @4hours** = codingtime / 10; > **office @7hours** = codingtime / 6;) -**67 Hours** or **8 Eight Hour Days** +**68 Hours** or **9 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > with the normal everyday realities at the office, that includes the component planning, mapping & debugging.) -Project duration: **1.6 weeks** or **0.3 months** +Project duration: **1.8 weeks** or **0.4 months** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) -## Donations + +## Contributors +This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder). -If you want to support this project, please consider donating: -* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) -* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf -* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218 \ No newline at end of file +[![Contributors](https://opencollective.com/Joomla-Component-Builder/contributors.svg?width=890&button=false)](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors) + +### Backers +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)] + +[![Our Backers on opencollective](https://opencollective.com/Joomla-Component-Builder/backers.svg?width=890)](https://opencollective.com/Joomla-Component-Builder#backers) + +### Sponsors +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)] + +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/0/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/1/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/2/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/3/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/4/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/5/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/6/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/7/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/8/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/9/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/10/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/11/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/12/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/13/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/14/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/15/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/16/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/17/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/18/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/19/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website) +[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/20/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website) \ No newline at end of file diff --git a/admin/access.xml b/admin/access.xml index cc07873..cb65edb 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -22,14 +22,12 @@ -
-
diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index e3b1da9..fb7bd30 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage admin.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 05ccd8c..04cf2c6 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage dashboard.css diff --git a/admin/assets/css/greeting.css b/admin/assets/css/greeting.css index 4c9fa7f..fba7b34 100644 --- a/admin/assets/css/greeting.css +++ b/admin/assets/css/greeting.css @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greeting.css diff --git a/admin/assets/css/greetings.css b/admin/assets/css/greetings.css index 25e7fd6..e873ad8 100644 --- a/admin/assets/css/greetings.css +++ b/admin/assets/css/greetings.css @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greetings.css diff --git a/admin/assets/js/admin.js b/admin/assets/js/admin.js index abc79e7..6c1456d 100644 --- a/admin/assets/js/admin.js +++ b/admin/assets/js/admin.js @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage admin.js diff --git a/admin/controller.php b/admin/controller.php index 314d9a2..e6c5b15 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage controller.php diff --git a/admin/controllers/greeting.php b/admin/controllers/greeting.php index 719705f..e202cb1 100644 --- a/admin/controllers/greeting.php +++ b/admin/controllers/greeting.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greeting.php diff --git a/admin/controllers/greetings.php b/admin/controllers/greetings.php index 3d58455..ad1b8f8 100644 --- a/admin/controllers/greetings.php +++ b/admin/controllers/greetings.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greetings.php @@ -64,7 +64,7 @@ class Hello_worldControllerGreetings extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Greetings'); // get the data to export diff --git a/admin/controllers/hello_world.php b/admin/controllers/hello_world.php index cc63d3a..4301083 100644 --- a/admin/controllers/hello_world.php +++ b/admin/controllers/hello_world.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage hello_world.php diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 6920e36..71d3bb8 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage import.php diff --git a/admin/hello_world.php b/admin/hello_world.php index 1052e4f..2a3c6cd 100644 --- a/admin/hello_world.php +++ b/admin/hello_world.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage hello_world.php @@ -20,6 +20,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + JHtml::_('behavior.tabstate'); // Access check. diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php index f288cce..f352a15 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage headercheck.php diff --git a/admin/helpers/hello_world.php b/admin/helpers/hello_world.php index 4b2d622..60ef45b 100644 --- a/admin/helpers/hello_world.php +++ b/admin/helpers/hello_world.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage hello_world.php @@ -21,8 +21,9 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\CMS\Language\Language; -use Joomla\String\StringHelper; +use Joomla\CMS\Language\Language; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\Spreadsheet; @@ -47,7 +48,7 @@ abstract class Hello_worldHelper */ public static $langTag; -/***[INSERTED$$$$]***//*69*/ + /** * Write a file to the server * @@ -79,8 +80,8 @@ abstract class Hello_worldHelper } return $klaar; } -/***[/INSERTED$$$$]***/ -/***[INSERTED$$$$]***//*60*/ + + /** * get the content of a file * @@ -132,8 +133,8 @@ abstract class Hello_worldHelper } return $none; } -/***[/INSERTED$$$$]***/ -/***[INSERTED$$$$]***//*71*/ + + /** * Remove folders with files * @@ -206,7 +207,7 @@ abstract class Hello_worldHelper } return false; } -/***[/INSERTED$$$$]***/ + /** * Load the Composer Vendors @@ -464,6 +465,8 @@ abstract class Hello_worldHelper ->setLastModifiedBy($modified) ->setTitle($title) ->setSubject($subjectTab); + // The file type + $file_type = 'Xls'; // set description if ($description) { @@ -503,21 +506,46 @@ abstract class Hello_worldHelper )); // 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++; } @@ -537,7 +565,7 @@ abstract class Hello_worldHelper // 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'); @@ -548,7 +576,7 @@ abstract class Hello_worldHelper 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/helpers/html/batch_.php b/admin/helpers/html/batch_.php index 2541040..4b6b213 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage batch_.php diff --git a/admin/language/en-GB/en-GB.com_hello_world.ini b/admin/language/en-GB/en-GB.com_hello_world.ini index c32b241..55a4181 100644 --- a/admin/language/en-GB/en-GB.com_hello_world.ini +++ b/admin/language/en-GB/en-GB.com_hello_world.ini @@ -1,5 +1,6 @@ COM_HELLO_WORLD="Hello World" COM_HELLO_WORLD_ARCHIVED="Archived" +COM_HELLO_WORLD_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS="Are you sure you want to delete? Confirming will permanently delete the selected item(s)!" COM_HELLO_WORLD_AUTHOR="Author" COM_HELLO_WORLD_BACK="Back" COM_HELLO_WORLD_CLOSE_NEW="Close & New" @@ -51,9 +52,18 @@ COM_HELLO_WORLD_EDIT_CREATED_DATE_DESC="Allows users in this group to edit creat COM_HELLO_WORLD_EDIT_S="Edit %s" COM_HELLO_WORLD_EDIT_VERSIONS="Edit Version" COM_HELLO_WORLD_EDIT_VERSIONS_DESC="Allows users in this group to edit versions." +COM_HELLO_WORLD_EMPTY_TRASH="Empty trash" +COM_HELLO_WORLD_EXIT_TRASH="Exit trash" COM_HELLO_WORLD_EXPORT_DATA="Export Data" COM_HELLO_WORLD_EXPORT_DATA_DESC="Allows users in this group to export data." COM_HELLO_WORLD_EXPORT_FAILED="Export Failed" +COM_HELLO_WORLD_FILTER_GREETING_ASCENDING="Greeting ascending" +COM_HELLO_WORLD_FILTER_GREETING_DESCENDING="Greeting descending" +COM_HELLO_WORLD_FILTER_PUBLISHED="Status" +COM_HELLO_WORLD_FILTER_PUBLISHED_GREETINGS="Status options for greetings" +COM_HELLO_WORLD_FILTER_SEARCH="Searchgreetings" +COM_HELLO_WORLD_FILTER_SEARCH_GREETINGS="Search the greeting items. Prefix with ID: to search for an item by ID." +COM_HELLO_WORLD_FILTER_SELECT_ACCESS="Select Access" COM_HELLO_WORLD_GREETING="Greeting" COM_HELLO_WORLD_GREETINGS="Greetings" COM_HELLO_WORLD_GREETINGS_ACCESS="Greetings Access" @@ -68,8 +78,6 @@ COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD="Greetings Dashboard Add" COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of greeting" COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST="Greetings Dashboard List" COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of greeting" -COM_HELLO_WORLD_GREETINGS_EDIT_GREETING="Greetings Edit Greeting" -COM_HELLO_WORLD_GREETINGS_EDIT_GREETING_DESC="Allows the users in this group to edit greeting of greeting" COM_HELLO_WORLD_GREETINGS_EDIT_VERSION="Greetings Edit Version" COM_HELLO_WORLD_GREETINGS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version greetings" COM_HELLO_WORLD_GREETINGS_EXPORT="Greetings Export" @@ -83,6 +91,8 @@ COM_HELLO_WORLD_GREETINGS_N_ITEMS_CHECKED_IN_1="%d Greeting successfully checked COM_HELLO_WORLD_GREETINGS_N_ITEMS_CHECKED_IN_MORE="%d Greetings successfully checked in." COM_HELLO_WORLD_GREETINGS_N_ITEMS_DELETED="%s Greetings deleted." COM_HELLO_WORLD_GREETINGS_N_ITEMS_DELETED_1="%s Greeting deleted." +COM_HELLO_WORLD_GREETINGS_N_ITEMS_FAILED_PUBLISHING="%s Greetings failed publishing." +COM_HELLO_WORLD_GREETINGS_N_ITEMS_FAILED_PUBLISHING_1="%s Greeting failed publishing." COM_HELLO_WORLD_GREETINGS_N_ITEMS_FEATURED="%s Greetings featured." COM_HELLO_WORLD_GREETINGS_N_ITEMS_FEATURED_1="%s Greeting featured." COM_HELLO_WORLD_GREETINGS_N_ITEMS_PUBLISHED="%s Greetings published." @@ -176,8 +186,12 @@ COM_HELLO_WORLD_SUBMENU_GREETINGS="Greetings" COM_HELLO_WORLD_SUBMENU_GREETINGS_FIELDS="Greetings Fields" COM_HELLO_WORLD_SUBMENU_GREETINGS_FIELDS_GROUPS="Greetings Field Groups" COM_HELLO_WORLD_TRASHED="Trashed" +COM_HELLO_WORLD_TRASHED_ITEMS="Trashed items" +COM_HELLO_WORLD_TRASH_AREA="Trash Area" COM_HELLO_WORLD_TYPE_GREETING="Greeting" COM_HELLO_WORLD_USE_BATCH="Use Batch" COM_HELLO_WORLD_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." COM_HELLO_WORLD_VERSION="Version" -COM_HELLO_WORLD_WEBSITE="Website" \ No newline at end of file +COM_HELLO_WORLD_WEBSITE="Website" +COM_HELLO_WORLD_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items." +COM_HELLO_WORLD_YOU_ARE_CURRENTLY_VIEWING_THE_TRASH_AREA_AND_YOU_DONT_HAVE_ANY_ITEMS_IN_TRASH_AT_THE_MOMENT="You are currently viewing the trash area, and you don't have any items in trash at the moment!" \ No newline at end of file diff --git a/admin/language/en-GB/en-GB.com_hello_world.sys.ini b/admin/language/en-GB/en-GB.com_hello_world.sys.ini index db514ba..8d1c526 100644 --- a/admin/language/en-GB/en-GB.com_hello_world.sys.ini +++ b/admin/language/en-GB/en-GB.com_hello_world.sys.ini @@ -18,8 +18,6 @@ COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD="Greetings Dashboard Add" COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of greeting" COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST="Greetings Dashboard List" COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of greeting" -COM_HELLO_WORLD_GREETINGS_EDIT_GREETING="Greetings Edit Greeting" -COM_HELLO_WORLD_GREETINGS_EDIT_GREETING_DESC="Allows the users in this group to edit greeting of greeting" COM_HELLO_WORLD_GREETINGS_EDIT_VERSION="Greetings Edit Version" COM_HELLO_WORLD_GREETINGS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version greetings" COM_HELLO_WORLD_GREETINGS_EXPORT="Greetings Export" diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index dc098c6..08575b9 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage batchselection.php diff --git a/admin/layouts/greeting/details_left.php b/admin/layouts/greeting/details_left.php index 81705c6..49f2333 100644 --- a/admin/layouts/greeting/details_left.php +++ b/admin/layouts/greeting/details_left.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage details_left.php diff --git a/admin/layouts/greeting/metadata.php b/admin/layouts/greeting/metadata.php index c3fbed0..1af483a 100644 --- a/admin/layouts/greeting/metadata.php +++ b/admin/layouts/greeting/metadata.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage metadata.php diff --git a/admin/layouts/greeting/publishing.php b/admin/layouts/greeting/publishing.php index 6bb8c12..e3d12cf 100644 --- a/admin/layouts/greeting/publishing.php +++ b/admin/layouts/greeting/publishing.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage publishing.php @@ -35,6 +35,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/trashhelper.php b/admin/layouts/trashhelper.php new file mode 100644 index 0000000..24056ba --- /dev/null +++ b/admin/layouts/trashhelper.php @@ -0,0 +1,82 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + ____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____ + (_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _) +.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )( +\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__) + +/------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('JPATH_BASE') or die('Restricted access'); + + + +?> +state->get('filter.published') == -2 && ($displayData->canState && $displayData->canDelete)) : ?> + +
+ items)): ?> +

+ + +

+

+ +

+ + +

+

+ + + +
+ diff --git a/admin/models/forms/filter_greetings.xml b/admin/models/forms/filter_greetings.xml new file mode 100644 index 0000000..509ea95 --- /dev/null +++ b/admin/models/forms/filter_greetings.xml @@ -0,0 +1,67 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/admin/models/forms/greeting.js b/admin/models/forms/greeting.js index 3df9004..020e5df 100644 --- a/admin/models/forms/greeting.js +++ b/admin/models/forms/greeting.js @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greeting.js diff --git a/admin/models/forms/greeting.xml b/admin/models/forms/greeting.xml index 8f455f7..f71faac 100644 --- a/admin/models/forms/greeting.xml +++ b/admin/models/forms/greeting.xml @@ -102,6 +102,14 @@ rows="3" cols="30" /> + + + + setFieldAttribute('created', 'filter', 'unset'); } - // Modify the form based on Edit Greeting access controls. - if ($id != 0 && (!$user->authorise('greeting.edit.greeting', 'com_hello_world.greeting.' . (int) $id)) - || ($id == 0 && !$user->authorise('greeting.edit.greeting', 'com_hello_world'))) - { - // Disable fields for display. - $form->setFieldAttribute('greeting', 'disabled', 'true'); - // Disable fields for display. - $form->setFieldAttribute('greeting', 'readonly', 'true'); - // If there is no value continue. - if (!$form->getValue('greeting')) - { - // Disable fields while saving. - $form->setFieldAttribute('greeting', 'filter', 'unset'); - // Disable fields while saving. - $form->setFieldAttribute('greeting', 'required', 'false'); - } - } // Only load these values if no id is found if (0 == $id) { diff --git a/admin/models/greetings.php b/admin/models/greetings.php index fc62472..0004c15 100644 --- a/admin/models/greetings.php +++ b/admin/models/greetings.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greetings.php @@ -35,6 +35,7 @@ class Hello_worldModelGreetings extends JModelList $config['filter_fields'] = array( 'a.id','id', 'a.published','published', + 'a.access','access', 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', @@ -44,11 +45,17 @@ class Hello_worldModelGreetings extends JModelList parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -58,27 +65,39 @@ class Hello_worldModelGreetings extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } + } + + // Check if the form was submitted + $formSubmited = $app->input->post->get('form_submited'); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + if ($formSubmited) + { + $access = $app->input->post->get('access'); + $this->setState('filter.access', $access); + } + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + $greeting = $this->getUserStateFromRequest($this->context . '.filter.greeting', 'filter_greeting'); - $this->setState('filter.greeting', $greeting); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); + if ($formSubmited) + { + $greeting = $app->input->post->get('greeting'); + $this->setState('filter.greeting', $greeting); + } // List state information. parent::populateState($ordering, $direction); @@ -135,9 +154,17 @@ class Hello_worldModelGreetings extends JModelList $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. - if ($access = $this->getState('filter.access')) + $_access = $this->getState('filter.access'); + if ($_access && is_numeric($_access)) { - $query->where('a.access = ' . (int) $access); + $query->where('a.access = ' . (int) $_access); + } + elseif (Hello_worldHelper::checkArray($_access)) + { + // Secure the array for the query + $_access = ArrayHelper::toInteger($_access); + // Filter by the Access Array. + $query->where('a.access IN (' . implode(',', $_access) . ')'); } // Implement View Level Access if (!$user->authorise('core.options', 'com_hello_world')) @@ -163,7 +190,7 @@ class Hello_worldModelGreetings extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -183,7 +210,7 @@ class Hello_worldModelGreetings extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (Hello_worldHelper::checkArray($pks)) + if (($pks_size = Hello_worldHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -201,7 +228,24 @@ class Hello_worldModelGreetings extends JModelList // From the hello_world_greeting table $query->from($db->quoteName('#__hello_world_greeting', '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_hello_world')) { @@ -281,6 +325,18 @@ class Hello_worldModelGreetings extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); + // Check if the value is an array + $_access = $this->getState('filter.access'); + if (Hello_worldHelper::checkArray($_access)) + { + $id .= ':' . implode(':', $_access); + } + // Check if this is only an number or string + elseif (is_numeric($_access) + || Hello_worldHelper::checkString($_access)) + { + $id .= ':' . $_access; + } $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/models/hello_world.php b/admin/models/hello_world.php index c391022..fcd0171 100644 --- a/admin/models/hello_world.php +++ b/admin/models/hello_world.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage hello_world.php @@ -62,8 +62,8 @@ class Hello_worldModelHello_world extends JModelList $viewName = $name; $alt = $name; $url = $url; - $image = $name.'.'.$type; - $name = 'COM_HELLO_WORLD_DASHBOARD_'.Hello_worldHelper::safeString($name,'U'); + $image = $name . '.' . $type; + $name = 'COM_HELLO_WORLD_DASHBOARD_' . Hello_worldHelper::safeString($name,'U'); } } // internal views @@ -85,17 +85,27 @@ class Hello_worldModelHello_world extends JModelList switch($action) { case 'add': - $url = 'index.php?option=com_hello_world&view='.$name.'&layout=edit'; - $image = $name.'_'.$action.'.'.$type; - $alt = $name.' '.$action; + $url = 'index.php?option=com_hello_world&view=' . $name . '&layout=edit'; + $image = $name . '_' . $action. '.' . $type; + $alt = $name . ' ' . $action; $name = 'COM_HELLO_WORLD_DASHBOARD_'.Hello_worldHelper::safeString($name,'U').'_ADD'; $add = true; break; default: - $url = 'index.php?option=com_categories&view=categories&extension=com_hello_world.'.$name; - $image = $name.'_'.$action.'.'.$type; - $alt = $name.' '.$action; - $name = 'COM_HELLO_WORLD_DASHBOARD_'.Hello_worldHelper::safeString($name,'U').'_'.Hello_worldHelper::safeString($action,'U'); + // check for new convention (more stable) + if (strpos($action, '_qpo0O0oqp_') !== false) + { + list($action, $extension) = (array) explode('_qpo0O0oqp_', $action); + $extension = str_replace('_po0O0oq_', '.', $extension); + } + else + { + $extension = 'com_hello_world.' . $name; + } + $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; + $image = $name . '_' . $action . '.' . $type; + $alt = $viewName . ' ' . $action; + $name = 'COM_HELLO_WORLD_DASHBOARD_' . Hello_worldHelper::safeString($name,'U') . '_' . Hello_worldHelper::safeString($action,'U'); break; } } @@ -103,9 +113,9 @@ class Hello_worldModelHello_world extends JModelList { $viewName = $name; $alt = $name; - $url = 'index.php?option=com_hello_world&view='.$name; - $image = $name.'.'.$type; - $name = 'COM_HELLO_WORLD_DASHBOARD_'.Hello_worldHelper::safeString($name,'U'); + $url = 'index.php?option=com_hello_world&view=' . $name; + $image = $name . '.' . $type; + $name = 'COM_HELLO_WORLD_DASHBOARD_' . Hello_worldHelper::safeString($name,'U'); $hover = false; } } @@ -113,8 +123,8 @@ class Hello_worldModelHello_world extends JModelList { $viewName = $view; $alt = $view; - $url = 'index.php?option=com_hello_world&view='.$view; - $image = $view.'.png'; + $url = 'index.php?option=com_hello_world&view=' . $view; + $image = $view . '.png'; $name = ucwords($view).'

'; $hover = false; } @@ -126,7 +136,7 @@ class Hello_worldModelHello_world extends JModelList $dashboard_list = false; $accessTo = ''; $accessAdd = ''; - // acces checking start + // access checking start $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? Hello_worldHelper::checkString($viewAccess[$viewName.'.create']):false; $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? Hello_worldHelper::checkString($viewAccess[$viewName.'.access']):false; // set main controllers @@ -141,7 +151,7 @@ class Hello_worldModelHello_world extends JModelList { $accessAdd = 'core.create'; } - // check if acces to view is set + // check if access to view is set if ($accessAccess) { $accessTo = $viewAccess[$viewName.'.access']; diff --git a/admin/models/import.php b/admin/models/import.php index 3e746ae..ab0dd9e 100644 --- a/admin/models/import.php +++ b/admin/models/import.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage import.php @@ -435,7 +435,15 @@ class Hello_worldModelImport extends JModelLegacy $jinput = JFactory::getApplication()->input; foreach($target_headers as $header) { - $data['target_headers'][$header] = $jinput->getString($header, null); + if (($column = $jinput->getString($header, false)) !== false || + ($column = $jinput->getString(strtolower($header), false)) !== false) + { + $data['target_headers'][$header] = $column; + } + else + { + $data['target_headers'][$header] = null; + } } // set the data if(isset($package['dir'])) diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 4b82238..52eae53 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -27,13 +27,3 @@ CREATE TABLE IF NOT EXISTS `#__hello_world_greeting` ( ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; - --- --- Always insure this column rules is large enough for all the access control values. --- -ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.'; - --- --- Always insure this column name is large enough for long component and view names. --- -ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.'; diff --git a/admin/sql/uninstall.mysql.utf8.sql b/admin/sql/uninstall.mysql.utf8.sql index f02807f..a020b31 100644 --- a/admin/sql/uninstall.mysql.utf8.sql +++ b/admin/sql/uninstall.mysql.utf8.sql @@ -1 +1,2 @@ DROP TABLE IF EXISTS `#__hello_world_greeting`; + diff --git a/admin/tables/greeting.php b/admin/tables/greeting.php index aed01f0..9e81479 100644 --- a/admin/tables/greeting.php +++ b/admin/tables/greeting.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greeting.php diff --git a/admin/views/greeting/submitbutton.js b/admin/views/greeting/submitbutton.js index 0d9ab97..c2b2f5d 100644 --- a/admin/views/greeting/submitbutton.js +++ b/admin/views/greeting/submitbutton.js @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage submitbutton.js diff --git a/admin/views/greeting/tmpl/edit.php b/admin/views/greeting/tmpl/edit.php index ab77784..90caa86 100644 --- a/admin/views/greeting/tmpl/edit.php +++ b/admin/views/greeting/tmpl/edit.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage edit.php @@ -21,10 +21,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 ?> @@ -69,7 +69,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'greetingTab'; ?> - canDo->get('core.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('core.edit.state') || ($this->canDo->get('core.delete') && $this->canDo->get('core.edit.state'))) : ?>
diff --git a/admin/views/greeting/view.html.php b/admin/views/greeting/view.html.php index 45ed180..cce7791 100644 --- a/admin/views/greeting/view.html.php +++ b/admin/views/greeting/view.html.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage view.html.php diff --git a/admin/views/greetings/tmpl/default.php b/admin/views/greetings/tmpl/default.php index fb92932..7dbd55d 100644 --- a/admin/views/greetings/tmpl/default.php +++ b/admin/views/greetings/tmpl/default.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default.php @@ -19,76 +19,59 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +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', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_HELLO_WORLD_FILTER_SELECT_ACCESS') . ' -')); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_hello_world&task=greetings.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'greetingList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_HELLO_WORLD_GREETINGS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ + $this)); +?> +items)): ?> +
+ +
+ + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_HELLO_WORLD_GREETINGS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + +
+ + + + diff --git a/admin/views/greetings/tmpl/default_batch_body.php b/admin/views/greetings/tmpl/default_batch_body.php index 95f7590..bed8564 100644 --- a/admin/views/greetings/tmpl/default_batch_body.php +++ b/admin/views/greetings/tmpl/default_batch_body.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default_batch_body.php @@ -19,7 +19,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/greetings/tmpl/default_batch_footer.php b/admin/views/greetings/tmpl/default_batch_footer.php index ae2124c..d23075e 100644 --- a/admin/views/greetings/tmpl/default_batch_footer.php +++ b/admin/views/greetings/tmpl/default_batch_footer.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default_batch_footer.php @@ -19,7 +19,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/greetings/tmpl/default_body.php b/admin/views/greetings/tmpl/default_body.php index 759bd2d..6bc2aea 100644 --- a/admin/views/greetings/tmpl/default_body.php +++ b/admin/views/greetings/tmpl/default_body.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default_body.php @@ -19,7 +19,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit"; @@ -34,11 +34,8 @@ $edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit"; get('core.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/greetings/tmpl/default_foot.php b/admin/views/greetings/tmpl/default_foot.php index 5273146..e18f179 100644 --- a/admin/views/greetings/tmpl/default_foot.php +++ b/admin/views/greetings/tmpl/default_foot.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default_foot.php diff --git a/admin/views/greetings/tmpl/default_head.php b/admin/views/greetings/tmpl/default_head.php index 6cd3461..3eb4b0c 100644 --- a/admin/views/greetings/tmpl/default_head.php +++ b/admin/views/greetings/tmpl/default_head.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default_head.php @@ -25,7 +25,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> @@ -39,11 +39,11 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> @@ -51,6 +51,6 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/greetings/tmpl/default_toolbar.php b/admin/views/greetings/tmpl/default_toolbar.php index 469c034..8613219 100644 --- a/admin/views/greetings/tmpl/default_toolbar.php +++ b/admin/views/greetings/tmpl/default_toolbar.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default_toolbar.php diff --git a/admin/views/greetings/view.html.php b/admin/views/greetings/view.html.php index 46caf58..68abbeb 100644 --- a/admin/views/greetings/view.html.php +++ b/admin/views/greetings/view.html.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage view.html.php @@ -43,10 +43,14 @@ class Hello_worldViewGreetings 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', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -161,39 +165,26 @@ class Hello_worldViewGreetings extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_hello_world'); - } - - 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_HELLO_WORLD_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_HELLO_WORLD_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_HELLO_WORLD_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_HELLO_WORLD_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } @@ -238,7 +229,7 @@ class Hello_worldViewGreetings extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'a.greeting' => JText::_('COM_HELLO_WORLD_GREETING_GREETING_LABEL'), 'a.id' => JText::_('JGRID_HEADING_ID') diff --git a/admin/views/hello_world/tmpl/default.php b/admin/views/hello_world/tmpl/default.php index c364b44..2d00c09 100644 --- a/admin/views/hello_world/tmpl/default.php +++ b/admin/views/hello_world/tmpl/default.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default.php diff --git a/admin/views/hello_world/tmpl/default_main.php b/admin/views/hello_world/tmpl/default_main.php index 0f4be08..6c4df46 100644 --- a/admin/views/hello_world/tmpl/default_main.php +++ b/admin/views/hello_world/tmpl/default_main.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default_main.php diff --git a/admin/views/hello_world/tmpl/default_vdm.php b/admin/views/hello_world/tmpl/default_vdm.php index 426e5aa..f13499d 100644 --- a/admin/views/hello_world/tmpl/default_vdm.php +++ b/admin/views/hello_world/tmpl/default_vdm.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default_vdm.php diff --git a/admin/views/hello_world/view.html.php b/admin/views/hello_world/view.html.php index 60e2e44..179ec92 100644 --- a/admin/views/hello_world/view.html.php +++ b/admin/views/hello_world/view.html.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage view.html.php diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index 7a044c2..2d322b5 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default.php diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index f8cf2b6..d972358 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage view.html.php diff --git a/hello_world.xml b/hello_world.xml index bec5325..0d76581 100644 --- a/hello_world.xml +++ b/hello_world.xml @@ -1,15 +1,15 @@ COM_HELLO_WORLD - 30th May, 2020 + 4th January, 2021 Llewellyn joomla@vdm.io https://www.vdm.io Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 1.0.0 + 1.0.1 Hello World (v.1.0.0) +

Hello World (v.1.0.1)

Created by Llewellyn
Development started 20th September, 2017

@@ -97,6 +97,6 @@ - https://raw.githubusercontent.com/namibia/JCB-Hello-World/master/helloworld_updateserver.xml + https://raw.githubusercontent.com/Llewellynvdm/Joomla-Hello-World-Component/master/helloworld_updateserver.xml
\ No newline at end of file diff --git a/helloworld_updateserver.xml b/helloworld_updateserver.xml new file mode 100644 index 0000000..001f2e5 --- /dev/null +++ b/helloworld_updateserver.xml @@ -0,0 +1,19 @@ + + + Hello World + Hello World + com_hello_world + component + 1.0.1 + https://www.vdm.io + + https://github.com/Llewellynvdm/Joomla-Hello-World-Component/archive/master.zip + + + stable + + Llewellyn + https://www.vdm.io + + + \ No newline at end of file diff --git a/script.php b/script.php index 5b7954b..2390360 100644 --- a/script.php +++ b/script.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage script.php @@ -84,7 +84,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove greeting add queued success message. + // If successfully remove greeting add queued success message. $app->enqueueMessage(JText::_('The fields with type (com_hello_world.greeting) context was removed from the #__fields table')); } // Also Remove greeting field values @@ -98,7 +98,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove greeting add queued success message. + // If successfully remove greeting add queued success message. $app->enqueueMessage(JText::_('The fields values for greeting was removed from the #__fields_values table')); } } @@ -128,7 +128,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove greeting add queued success message. + // If successfully remove greeting add queued success message. $app->enqueueMessage(JText::_('The field groups with type (com_hello_world.greeting) context was removed from the #__fields_groups table')); } } @@ -160,7 +160,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove greeting add queued success message. + // If successfully remove greeting add queued success message. $app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the #__content_type table')); } @@ -175,7 +175,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove greeting add queued success message. + // If successfully remove greeting add queued success message. $app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the #__contentitem_tag_map table')); } @@ -190,7 +190,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove greeting add queued success message. + // If successfully removed greeting add queued success message. $app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the #__ucm_content table')); } @@ -246,7 +246,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove Greeting add queued success message. + // If successfully remove Greeting add queued success message. $app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the #__content_type table')); } @@ -261,7 +261,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove Greeting add queued success message. + // If successfully remove Greeting add queued success message. $app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the #__contentitem_tag_map table')); } @@ -276,7 +276,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove Greeting add queued success message. + // If successfully removed Greeting add queued success message. $app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the #__ucm_content table')); } @@ -320,7 +320,7 @@ class com_hello_worldInstallerScript $greeting_done = $db->execute(); if ($greeting_done) { - // If succesfully remove hello_world add queued success message. + // If successfully removed hello_world add queued success message. $app->enqueueMessage(JText::_('All related items was removed from the #__assets table')); } @@ -569,7 +569,7 @@ class com_hello_worldInstallerScript echo ' -

Upgrade to Version 1.0.0 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 1.0.1 Was Successful! Let us know if anything is not working as expected.

'; // Set db if not set already. if (!isset($db)) diff --git a/site/assets/css/greet.css b/site/assets/css/greet.css index 1088aff..5bf90e5 100644 --- a/site/assets/css/greet.css +++ b/site/assets/css/greet.css @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greet.css diff --git a/site/assets/css/greeting.css b/site/assets/css/greeting.css index 4c9fa7f..fba7b34 100644 --- a/site/assets/css/greeting.css +++ b/site/assets/css/greeting.css @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greeting.css diff --git a/site/assets/css/greetings.css b/site/assets/css/greetings.css index 25e7fd6..e873ad8 100644 --- a/site/assets/css/greetings.css +++ b/site/assets/css/greetings.css @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greetings.css diff --git a/site/assets/css/site.css b/site/assets/css/site.css index 0e42513..58619a1 100644 --- a/site/assets/css/site.css +++ b/site/assets/css/site.css @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage site.css diff --git a/site/assets/js/site.js b/site/assets/js/site.js index da9c802..cfac371 100644 --- a/site/assets/js/site.js +++ b/site/assets/js/site.js @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage site.js diff --git a/site/controller.php b/site/controller.php index 76bb7c5..7afa38a 100644 --- a/site/controller.php +++ b/site/controller.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage controller.php diff --git a/site/controllers/greeting.php b/site/controllers/greeting.php index 9a33e31..ded5a70 100644 --- a/site/controllers/greeting.php +++ b/site/controllers/greeting.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greeting.php diff --git a/site/hello_world.php b/site/hello_world.php index 1f5992b..c7e94e5 100644 --- a/site/hello_world.php +++ b/site/hello_world.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage hello_world.php @@ -20,6 +20,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + JHtml::_('behavior.tabstate'); // Set the component css/js @@ -28,7 +29,7 @@ $document->addStyleSheet('components/com_hello_world/assets/css/site.css'); $document->addScript('components/com_hello_world/assets/js/site.js'); // Require helper files -JLoader::register('Hello_worldHelper', __DIR__ . '/helpers/hello_world.php'); +JLoader::register('Hello_worldHelper', __DIR__ . '/helpers/hello_world.php'); JLoader::register('Hello_worldHelperRoute', __DIR__ . '/helpers/route.php'); // Get an instance of the controller prefixed by Hello_world diff --git a/site/helpers/category.php b/site/helpers/category.php index 43a6b51..998be1e 100644 --- a/site/helpers/category.php +++ b/site/helpers/category.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage category.php diff --git a/site/helpers/headercheck.php b/site/helpers/headercheck.php index f288cce..f352a15 100644 --- a/site/helpers/headercheck.php +++ b/site/helpers/headercheck.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage headercheck.php diff --git a/site/helpers/hello_world.php b/site/helpers/hello_world.php index e7c6dc6..3aa9155 100644 --- a/site/helpers/hello_world.php +++ b/site/helpers/hello_world.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage hello_world.php @@ -21,8 +21,9 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\CMS\Language\Language; -use Joomla\String\StringHelper; +use Joomla\CMS\Language\Language; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -44,7 +45,7 @@ abstract class Hello_worldHelper */ public static $langTag; -/***[INSERTED$$$$]***//*69*/ + /** * Write a file to the server * @@ -76,8 +77,8 @@ abstract class Hello_worldHelper } return $klaar; } -/***[/INSERTED$$$$]***/ -/***[INSERTED$$$$]***//*60*/ + + /** * get the content of a file * @@ -129,8 +130,8 @@ abstract class Hello_worldHelper } return $none; } -/***[/INSERTED$$$$]***/ -/***[INSERTED$$$$]***//*71*/ + + /** * Remove folders with files * @@ -203,7 +204,7 @@ abstract class Hello_worldHelper } return false; } -/***[/INSERTED$$$$]***/ + /** * Load the Composer Vendors diff --git a/site/helpers/route.php b/site/helpers/route.php index 897b0a2..09ae8e6 100644 --- a/site/helpers/route.php +++ b/site/helpers/route.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage route.php diff --git a/site/language/en-GB/en-GB.com_hello_world.ini b/site/language/en-GB/en-GB.com_hello_world.ini index ea0e6fb..b09bf2d 100644 --- a/site/language/en-GB/en-GB.com_hello_world.ini +++ b/site/language/en-GB/en-GB.com_hello_world.ini @@ -3,6 +3,8 @@ COM_HELLO_WORLD="Hello World" COM_HELLO_WORLD_CREATE_NEW_S="Create New %s" COM_HELLO_WORLD_EDIT="Edit" COM_HELLO_WORLD_EDIT_S="Edit %s" +COM_HELLO_WORLD_FILTER_GREETING_ASCENDING="Greeting ascending" +COM_HELLO_WORLD_FILTER_GREETING_DESCENDING="Greeting descending" COM_HELLO_WORLD_GREET="Greeting" COM_HELLO_WORLD_GREETING="Greeting" COM_HELLO_WORLD_GREETINGS="Greetings" @@ -16,6 +18,8 @@ COM_HELLO_WORLD_GREETINGS_N_ITEMS_CHECKED_IN_1="%d Greeting successfully checked COM_HELLO_WORLD_GREETINGS_N_ITEMS_CHECKED_IN_MORE="%d Greetings successfully checked in." COM_HELLO_WORLD_GREETINGS_N_ITEMS_DELETED="%s Greetings deleted." COM_HELLO_WORLD_GREETINGS_N_ITEMS_DELETED_1="%s Greeting deleted." +COM_HELLO_WORLD_GREETINGS_N_ITEMS_FAILED_PUBLISHING="%s Greetings failed publishing." +COM_HELLO_WORLD_GREETINGS_N_ITEMS_FAILED_PUBLISHING_1="%s Greeting failed publishing." COM_HELLO_WORLD_GREETINGS_N_ITEMS_FEATURED="%s Greetings featured." COM_HELLO_WORLD_GREETINGS_N_ITEMS_FEATURED_1="%s Greeting featured." COM_HELLO_WORLD_GREETINGS_N_ITEMS_PUBLISHED="%s Greetings published." diff --git a/site/layouts/greeting/details_left.php b/site/layouts/greeting/details_left.php index 81705c6..49f2333 100644 --- a/site/layouts/greeting/details_left.php +++ b/site/layouts/greeting/details_left.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage details_left.php diff --git a/site/layouts/greeting/metadata.php b/site/layouts/greeting/metadata.php index c3fbed0..1af483a 100644 --- a/site/layouts/greeting/metadata.php +++ b/site/layouts/greeting/metadata.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage metadata.php diff --git a/site/layouts/greeting/publishing.php b/site/layouts/greeting/publishing.php index 6bb8c12..e3d12cf 100644 --- a/site/layouts/greeting/publishing.php +++ b/site/layouts/greeting/publishing.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage publishing.php @@ -35,6 +35,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/site/models/forms/greeting.js b/site/models/forms/greeting.js index 3df9004..020e5df 100644 --- a/site/models/forms/greeting.js +++ b/site/models/forms/greeting.js @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greeting.js diff --git a/site/models/forms/greeting.xml b/site/models/forms/greeting.xml index 8f455f7..f71faac 100644 --- a/site/models/forms/greeting.xml +++ b/site/models/forms/greeting.xml @@ -102,6 +102,14 @@ rows="3" cols="30" /> + + + + getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWaring(404, $e->getMessage()); + JError::raiseWarning(404, $e->getMessage()); } else { diff --git a/site/models/greeting.php b/site/models/greeting.php index c35b6d8..ca3ca4d 100644 --- a/site/models/greeting.php +++ b/site/models/greeting.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greeting.php @@ -21,8 +21,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -204,23 +204,6 @@ class Hello_worldModelGreeting extends JModelAdmin // Disable fields while saving. $form->setFieldAttribute('created', 'filter', 'unset'); } - // Modify the form based on Edit Greeting access controls. - if ($id != 0 && (!$user->authorise('greeting.edit.greeting', 'com_hello_world.greeting.' . (int) $id)) - || ($id == 0 && !$user->authorise('greeting.edit.greeting', 'com_hello_world'))) - { - // Disable fields for display. - $form->setFieldAttribute('greeting', 'disabled', 'true'); - // Disable fields for display. - $form->setFieldAttribute('greeting', 'readonly', 'true'); - // If there is no value continue. - if (!$form->getValue('greeting')) - { - // Disable fields while saving. - $form->setFieldAttribute('greeting', 'filter', 'unset'); - // Disable fields while saving. - $form->setFieldAttribute('greeting', 'required', 'false'); - } - } // Only load these values if no id is found if (0 == $id) { diff --git a/site/models/greetings.php b/site/models/greetings.php index 251d814..07e4f8d 100644 --- a/site/models/greetings.php +++ b/site/models/greetings.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage greetings.php diff --git a/site/router.php b/site/router.php index 34373ce..27a6512 100644 --- a/site/router.php +++ b/site/router.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage router.php diff --git a/site/views/greet/tmpl/default.php b/site/views/greet/tmpl/default.php index c89e382..cdd63ab 100644 --- a/site/views/greet/tmpl/default.php +++ b/site/views/greet/tmpl/default.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default.php @@ -21,9 +21,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + ?> toolbar->render(); ?> - - -

item->greeting; ?>

- +

item->greeting; ?>

diff --git a/site/views/greet/view.html.php b/site/views/greet/view.html.php index b77cea6..fc8c06f 100644 --- a/site/views/greet/view.html.php +++ b/site/views/greet/view.html.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage view.html.php @@ -136,8 +136,6 @@ class Hello_worldViewGreet extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = Hello_worldHelper::getHelpUrl('greet'); diff --git a/site/views/greeting/submitbutton.js b/site/views/greeting/submitbutton.js index 0d9ab97..c2b2f5d 100644 --- a/site/views/greeting/submitbutton.js +++ b/site/views/greeting/submitbutton.js @@ -2,8 +2,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage submitbutton.js diff --git a/site/views/greeting/tmpl/edit.php b/site/views/greeting/tmpl/edit.php index 3e23fc9..5198c29 100644 --- a/site/views/greeting/tmpl/edit.php +++ b/site/views/greeting/tmpl/edit.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage edit.php @@ -21,15 +21,15 @@ // 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::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +JHtml::_('behavior.tabstate'); JHtml::_('behavior.calendar'); -$componentParams = $this->params; // will be removed just use $this->params instead ?> +
toolbar->render(); ?>
@@ -49,7 +49,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'greetingTab'; ?> - canDo->get('core.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('core.edit.state') || ($this->canDo->get('core.delete') && $this->canDo->get('core.edit.state'))) : ?>
@@ -89,3 +89,4 @@ $componentParams = $this->params; // will be removed just use $this->params inst
+
diff --git a/site/views/greeting/view.html.php b/site/views/greeting/view.html.php index 4c5bc73..d90d52e 100644 --- a/site/views/greeting/view.html.php +++ b/site/views/greeting/view.html.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage view.html.php @@ -86,10 +86,7 @@ class Hello_worldViewGreeting extends JViewLegacy * Setting the toolbar */ protected function addToolBar() - { - // adding the joomla edit toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); - JFactory::getApplication()->input->set('hidemainmenu', true); + {JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; diff --git a/site/views/greetings/tmpl/default.php b/site/views/greetings/tmpl/default.php index 4579817..9ef2300 100644 --- a/site/views/greetings/tmpl/default.php +++ b/site/views/greetings/tmpl/default.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage default.php @@ -19,20 +19,15 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); + -/***[JCBGUI.site_view.php_view.50.$$$$]***/ -$edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit";/***[/JCBGUI$$$$]***/ - - +$edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit"; ?> toolbar->render(); ?> - - - + diff --git a/site/views/greetings/view.html.php b/site/views/greetings/view.html.php index 68c3bd7..91851fa 100644 --- a/site/views/greetings/view.html.php +++ b/site/views/greetings/view.html.php @@ -3,8 +3,8 @@ VDM /-------------------------------------------------------------------------------------------------------/ - @version 1.0.0 - @build 30th May, 2020 + @version 1.0.1 + @build 4th January, 2021 @created 20th September, 2017 @package Hello World @subpackage view.html.php @@ -107,8 +107,6 @@ class Hello_worldViewGreetings extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = Hello_worldHelper::getHelpUrl('greetings');