diff --git a/README.md b/README.md index 4dd7bd8..8222c88 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Demo (2.0.2) +# Demo (2.0.3) ![Demo image](https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/admin/assets/images/vdm-component.jpg "The Demo") @@ -10,21 +10,21 @@ Just a basic demo of the most basic implementations of the [Joomla](http://www.j + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Demo](https://www.vdm.io/) + *First Build*: 18th October, 2016 -+ *Last Build*: 30th May, 2020 -+ *Version*: 2.0.2 ++ *Last Build*: 6th January, 2021 ++ *Version*: 2.0.3 + *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 -**46 Hours** or **6 Eight Hour Days** (actual time the author saved - +**47 Hours** or **6 Eight Hour Days** (actual time the author saved - due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder)) > (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*: **16459** -+ *File count*: **151** ++ *Line count*: **16679** ++ *File count*: **154** + *Folder count*: **57** **30 Hours** or **4 Eight Hour Days** (the actual time the author spent) @@ -35,7 +35,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > **mapping @5hours** = codingtime / 10; > **office @8hours** = codingtime / 6;) -**76 Hours** or **10 Eight Hour Days** +**77 Hours** or **10 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**, @@ -46,9 +46,38 @@ Project duration: **2 weeks** or **0.4 months** > This **component** was build with a Joomla [Automated Component Builder](https://www.vdm.io/joomla-component-builder). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) -## 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/payvdm](https://www.paypal.me/payvdm) -* Bitcoin: 1FLxiT6wyxgZ3boeviLkYJ1DRpp41uzpxa -* Ethereum: 0x243392daa3c9c8bc841fcacf7c7f72541cb16823 \ 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 4dd7bd8..8222c88 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Demo (2.0.2) +# Demo (2.0.3) ![Demo image](https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/admin/assets/images/vdm-component.jpg "The Demo") @@ -10,21 +10,21 @@ Just a basic demo of the most basic implementations of the [Joomla](http://www.j + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Demo](https://www.vdm.io/) + *First Build*: 18th October, 2016 -+ *Last Build*: 30th May, 2020 -+ *Version*: 2.0.2 ++ *Last Build*: 6th January, 2021 ++ *Version*: 2.0.3 + *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 -**46 Hours** or **6 Eight Hour Days** (actual time the author saved - +**47 Hours** or **6 Eight Hour Days** (actual time the author saved - due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder)) > (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*: **16459** -+ *File count*: **151** ++ *Line count*: **16679** ++ *File count*: **154** + *Folder count*: **57** **30 Hours** or **4 Eight Hour Days** (the actual time the author spent) @@ -35,7 +35,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > **mapping @5hours** = codingtime / 10; > **office @8hours** = codingtime / 6;) -**76 Hours** or **10 Eight Hour Days** +**77 Hours** or **10 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**, @@ -46,9 +46,38 @@ Project duration: **2 weeks** or **0.4 months** > This **component** was build with a Joomla [Automated Component Builder](https://www.vdm.io/joomla-component-builder). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) -## 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/payvdm](https://www.paypal.me/payvdm) -* Bitcoin: 1FLxiT6wyxgZ3boeviLkYJ1DRpp41uzpxa -* Ethereum: 0x243392daa3c9c8bc841fcacf7c7f72541cb16823 \ 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/assets/css/admin.css b/admin/assets/css/admin.css index 7846f86..e92abe3 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage admin.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index fd642cf..8b2242b 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage dashboard.css diff --git a/admin/assets/css/look.css b/admin/assets/css/look.css index dccbae9..c9bc968 100644 --- a/admin/assets/css/look.css +++ b/admin/assets/css/look.css @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage look.css diff --git a/admin/assets/css/looks.css b/admin/assets/css/looks.css index f6570f6..0e70b6a 100644 --- a/admin/assets/css/looks.css +++ b/admin/assets/css/looks.css @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage looks.css diff --git a/admin/assets/js/admin.js b/admin/assets/js/admin.js index c0fd2fc..d59919c 100644 --- a/admin/assets/js/admin.js +++ b/admin/assets/js/admin.js @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage admin.js diff --git a/admin/controller.php b/admin/controller.php index f43a8a8..01e5ebf 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage controller.php diff --git a/admin/controllers/demo.php b/admin/controllers/demo.php index 2ea7912..dd371cc 100644 --- a/admin/controllers/demo.php +++ b/admin/controllers/demo.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage demo.php diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 29224df..17cfe28 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage import.php diff --git a/admin/controllers/look.php b/admin/controllers/look.php index 86b7eaf..e330f2b 100644 --- a/admin/controllers/look.php +++ b/admin/controllers/look.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage look.php diff --git a/admin/controllers/looks.php b/admin/controllers/looks.php index 644e67d..afca8dc 100644 --- a/admin/controllers/looks.php +++ b/admin/controllers/looks.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage looks.php @@ -64,7 +64,7 @@ class DemoControllerLooks 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('Looks'); // get the data to export diff --git a/admin/demo.php b/admin/demo.php index 94bbe5e..98233eb 100644 --- a/admin/demo.php +++ b/admin/demo.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage demo.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/demo.php b/admin/helpers/demo.php index ca9cd82..3a9eb3b 100644 --- a/admin/helpers/demo.php +++ b/admin/helpers/demo.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage demo.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; @@ -508,6 +509,8 @@ abstract class DemoHelper ->setLastModifiedBy($modified) ->setTitle($title) ->setSubject($subjectTab); + // The file type + $file_type = 'Xls'; // set description if ($description) { @@ -547,21 +550,46 @@ abstract class DemoHelper )); // 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++; } @@ -581,7 +609,7 @@ abstract class DemoHelper // 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'); @@ -592,7 +620,7 @@ abstract class DemoHelper 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/headercheck.php b/admin/helpers/headercheck.php index 5515472..cc6ed6e 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage headercheck.php diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php index 85efba9..904dd69 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage batch_.php diff --git a/admin/language/en-GB/en-GB.com_demo.ini b/admin/language/en-GB/en-GB.com_demo.ini index b79450e..2d38250 100644 --- a/admin/language/en-GB/en-GB.com_demo.ini +++ b/admin/language/en-GB/en-GB.com_demo.ini @@ -139,6 +139,8 @@ COM_DEMO_LOOKS_N_ITEMS_CHECKED_IN_1="%d Look successfully checked in." COM_DEMO_LOOKS_N_ITEMS_CHECKED_IN_MORE="%d Looks successfully checked in." COM_DEMO_LOOKS_N_ITEMS_DELETED="%s Looks deleted." COM_DEMO_LOOKS_N_ITEMS_DELETED_1="%s Look deleted." +COM_DEMO_LOOKS_N_ITEMS_FAILED_PUBLISHING="%s Looks failed publishing." +COM_DEMO_LOOKS_N_ITEMS_FAILED_PUBLISHING_1="%s Look failed publishing." COM_DEMO_LOOKS_N_ITEMS_FEATURED="%s Looks featured." COM_DEMO_LOOKS_N_ITEMS_FEATURED_1="%s Look featured." COM_DEMO_LOOKS_N_ITEMS_PUBLISHED="%s Looks published." diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 805c471..b2e0851 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage batchselection.php diff --git a/admin/layouts/look/details_above.php b/admin/layouts/look/details_above.php index 27719ae..d7e6486 100644 --- a/admin/layouts/look/details_above.php +++ b/admin/layouts/look/details_above.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage details_above.php diff --git a/admin/layouts/look/details_fullwidth.php b/admin/layouts/look/details_fullwidth.php index 28d2103..fec77af 100644 --- a/admin/layouts/look/details_fullwidth.php +++ b/admin/layouts/look/details_fullwidth.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage details_fullwidth.php diff --git a/admin/layouts/look/details_under.php b/admin/layouts/look/details_under.php index 825e9ec..4751e53 100644 --- a/admin/layouts/look/details_under.php +++ b/admin/layouts/look/details_under.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage details_under.php diff --git a/admin/layouts/look/metadata.php b/admin/layouts/look/metadata.php index fef27e5..2e9643c 100644 --- a/admin/layouts/look/metadata.php +++ b/admin/layouts/look/metadata.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage metadata.php diff --git a/admin/layouts/look/more_left.php b/admin/layouts/look/more_left.php index bdc240e..f15f140 100644 --- a/admin/layouts/look/more_left.php +++ b/admin/layouts/look/more_left.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage more_left.php diff --git a/admin/layouts/look/more_right.php b/admin/layouts/look/more_right.php index 9eb66a0..b7c633c 100644 --- a/admin/layouts/look/more_right.php +++ b/admin/layouts/look/more_right.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage more_right.php diff --git a/admin/layouts/look/publishing.php b/admin/layouts/look/publishing.php index 348035b..ca6fdf4 100644 --- a/admin/layouts/look/publishing.php +++ b/admin/layouts/look/publishing.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @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/models/demo.php b/admin/models/demo.php index 558b58f..dd3df21 100644 --- a/admin/models/demo.php +++ b/admin/models/demo.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage demo.php @@ -63,8 +63,8 @@ class DemoModelDemo extends JModelList $viewName = $name; $alt = $name; $url = $url; - $image = $name.'.'.$type; - $name = 'COM_DEMO_DASHBOARD_'.DemoHelper::safeString($name,'U'); + $image = $name . '.' . $type; + $name = 'COM_DEMO_DASHBOARD_' . DemoHelper::safeString($name,'U'); } } // internal views @@ -86,17 +86,27 @@ class DemoModelDemo extends JModelList switch($action) { case 'add': - $url = 'index.php?option=com_demo&view='.$name.'&layout=edit'; - $image = $name.'_'.$action.'.'.$type; - $alt = $name.' '.$action; + $url = 'index.php?option=com_demo&view=' . $name . '&layout=edit'; + $image = $name . '_' . $action. '.' . $type; + $alt = $name . ' ' . $action; $name = 'COM_DEMO_DASHBOARD_'.DemoHelper::safeString($name,'U').'_ADD'; $add = true; break; default: - $url = 'index.php?option=com_categories&view=categories&extension=com_demo.'.$name; - $image = $name.'_'.$action.'.'.$type; - $alt = $name.' '.$action; - $name = 'COM_DEMO_DASHBOARD_'.DemoHelper::safeString($name,'U').'_'.DemoHelper::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_demo.' . $name; + } + $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; + $image = $name . '_' . $action . '.' . $type; + $alt = $viewName . ' ' . $action; + $name = 'COM_DEMO_DASHBOARD_' . DemoHelper::safeString($name,'U') . '_' . DemoHelper::safeString($action,'U'); break; } } @@ -104,9 +114,9 @@ class DemoModelDemo extends JModelList { $viewName = $name; $alt = $name; - $url = 'index.php?option=com_demo&view='.$name; - $image = $name.'.'.$type; - $name = 'COM_DEMO_DASHBOARD_'.DemoHelper::safeString($name,'U'); + $url = 'index.php?option=com_demo&view=' . $name; + $image = $name . '.' . $type; + $name = 'COM_DEMO_DASHBOARD_' . DemoHelper::safeString($name,'U'); $hover = false; } } @@ -114,8 +124,8 @@ class DemoModelDemo extends JModelList { $viewName = $view; $alt = $view; - $url = 'index.php?option=com_demo&view='.$view; - $image = $view.'.png'; + $url = 'index.php?option=com_demo&view=' . $view; + $image = $view . '.png'; $name = ucwords($view).'

'; $hover = false; } @@ -127,7 +137,7 @@ class DemoModelDemo extends JModelList $dashboard_list = false; $accessTo = ''; $accessAdd = ''; - // acces checking start + // access checking start $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? DemoHelper::checkString($viewAccess[$viewName.'.create']):false; $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? DemoHelper::checkString($viewAccess[$viewName.'.access']):false; // set main controllers @@ -142,7 +152,7 @@ class DemoModelDemo 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/forms/look.js b/admin/models/forms/look.js index 21f3a01..2796c28 100644 --- a/admin/models/forms/look.js +++ b/admin/models/forms/look.js @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage look.js diff --git a/admin/models/forms/look.xml b/admin/models/forms/look.xml index 19953c4..def7a2e 100644 --- a/admin/models/forms/look.xml +++ b/admin/models/forms/look.xml @@ -102,6 +102,14 @@ rows="3" cols="30" /> + + + + 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/models/look.php b/admin/models/look.php index 137e6c5..ad3309f 100644 --- a/admin/models/look.php +++ b/admin/models/look.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage look.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; /** @@ -420,7 +420,7 @@ class DemoModelLook extends JModelAdmin public function validate($form, $data, $group = null) { // check if the not_required field is set - if (DemoHelper::checkString($data['not_required'])) + if (isset($data['not_required']) && DemoHelper::checkString($data['not_required'])) { $requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = array_unique($requiredFields); diff --git a/admin/models/looks.php b/admin/models/looks.php index 4bbde90..6ee9985 100644 --- a/admin/models/looks.php +++ b/admin/models/looks.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage looks.php @@ -35,6 +35,7 @@ class DemoModelLooks 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', @@ -45,11 +46,17 @@ class DemoModelLooks 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) { @@ -59,30 +66,31 @@ class DemoModelLooks extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $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); + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); $this->setState('filter.name', $name); $description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description'); $this->setState('filter.description', $description); - - $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); // List state information. parent::populateState($ordering, $direction); @@ -160,9 +168,17 @@ class DemoModelLooks 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 (DemoHelper::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_demo')) @@ -188,7 +204,7 @@ class DemoModelLooks 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)); @@ -208,7 +224,7 @@ class DemoModelLooks extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (DemoHelper::checkArray($pks)) + if (($pks_size = DemoHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -226,7 +242,24 @@ class DemoModelLooks extends JModelList // From the demo_look table $query->from($db->quoteName('#__demo_look', '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_demo')) { @@ -313,7 +346,7 @@ class DemoModelLooks extends JModelList public function getPrivacyExport($pks, $user = null) { // setup the query - if (DemoHelper::checkArray($pks)) + if (($pks_size = DemoHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is privacy method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_privacy = true; @@ -331,7 +364,24 @@ class DemoModelLooks extends JModelList // From the demo_look table $query->from($db->quoteName('#__demo_look', '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) . ')'); + } // Get global switch to activate text only export $export_text_only = JComponentHelper::getParams('com_demo')->get('export_text_only', 0); // Implement View Level Access @@ -389,6 +439,7 @@ class DemoModelLooks extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.access'); $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index cfae255..096bed3 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS `#__demo_look` ( `dateofbirth` DATE NOT NULL DEFAULT '0000-00-00', `description` TEXT NOT NULL, `email` VARCHAR(255) NOT NULL DEFAULT '', - `image` CHAR(64) NOT NULL DEFAULT '', + `image` VARCHAR(255) NOT NULL DEFAULT '', `mobile_phone` VARCHAR(64) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL DEFAULT '', `website` VARCHAR(255) NOT NULL DEFAULT '', @@ -37,13 +37,3 @@ CREATE TABLE IF NOT EXISTS `#__demo_look` ( ) 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 360d3cd..ccf94c0 100644 --- a/admin/sql/uninstall.mysql.utf8.sql +++ b/admin/sql/uninstall.mysql.utf8.sql @@ -1 +1,2 @@ DROP TABLE IF EXISTS `#__demo_look`; + diff --git a/admin/sql/updates/mysql/2.0.2.sql b/admin/sql/updates/mysql/2.0.2.sql new file mode 100644 index 0000000..528e5cd --- /dev/null +++ b/admin/sql/updates/mysql/2.0.2.sql @@ -0,0 +1 @@ +ALTER TABLE `#__demo_look` CHANGE `image` `image` VARCHAR(255) NOT NULL DEFAULT ''; diff --git a/admin/tables/look.php b/admin/tables/look.php index 154d60a..784050f 100644 --- a/admin/tables/look.php +++ b/admin/tables/look.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage look.php diff --git a/admin/views/demo/tmpl/default.php b/admin/views/demo/tmpl/default.php index 177a973..a056aac 100644 --- a/admin/views/demo/tmpl/default.php +++ b/admin/views/demo/tmpl/default.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage default.php diff --git a/admin/views/demo/tmpl/default_main.php b/admin/views/demo/tmpl/default_main.php index fe9386d..c15ec9c 100644 --- a/admin/views/demo/tmpl/default_main.php +++ b/admin/views/demo/tmpl/default_main.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage default_main.php diff --git a/admin/views/demo/tmpl/default_vdm.php b/admin/views/demo/tmpl/default_vdm.php index ce8f1ad..ca66481 100644 --- a/admin/views/demo/tmpl/default_vdm.php +++ b/admin/views/demo/tmpl/default_vdm.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage default_vdm.php diff --git a/admin/views/demo/view.html.php b/admin/views/demo/view.html.php index 6756154..bf073b1 100644 --- a/admin/views/demo/view.html.php +++ b/admin/views/demo/view.html.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage view.html.php diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index 81ba53c..138c882 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage default.php diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index ffc47c7..86fcec2 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage view.html.php diff --git a/admin/views/look/submitbutton.js b/admin/views/look/submitbutton.js index e3816ef..30231e9 100644 --- a/admin/views/look/submitbutton.js +++ b/admin/views/look/submitbutton.js @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage submitbutton.js diff --git a/admin/views/look/tmpl/edit.php b/admin/views/look/tmpl/edit.php index be55085..707b092 100644 --- a/admin/views/look/tmpl/edit.php +++ b/admin/views/look/tmpl/edit.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @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 ?> @@ -83,7 +83,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'lookTab'; ?> - canDo->get('look.delete') || $this->canDo->get('look.edit.created_by') || $this->canDo->get('look.edit.state') || $this->canDo->get('look.edit.created')) : ?> + canDo->get('look.edit.created_by') || $this->canDo->get('look.edit.created') || $this->canDo->get('look.edit.state') || ($this->canDo->get('look.delete') && $this->canDo->get('look.edit.state'))) : ?>
diff --git a/admin/views/look/view.html.php b/admin/views/look/view.html.php index 1f32449..6ef4483 100644 --- a/admin/views/look/view.html.php +++ b/admin/views/look/view.html.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage view.html.php diff --git a/admin/views/looks/tmpl/default.php b/admin/views/looks/tmpl/default.php index 9f89567..d11580e 100644 --- a/admin/views/looks/tmpl/default.php +++ b/admin/views/looks/tmpl/default.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage default.php @@ -19,76 +19,73 @@ /------------------------------------------------------------------------------------------------------*/ // 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', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_demo&task=looks.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'lookList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_DEMO_LOOKS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_DEMO_LOOKS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/looks/tmpl/default_batch_body.php b/admin/views/looks/tmpl/default_batch_body.php index dce86a9..9ee1d9f 100644 --- a/admin/views/looks/tmpl/default_batch_body.php +++ b/admin/views/looks/tmpl/default_batch_body.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @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/looks/tmpl/default_batch_footer.php b/admin/views/looks/tmpl/default_batch_footer.php index fed0e1a..11e5cb9 100644 --- a/admin/views/looks/tmpl/default_batch_footer.php +++ b/admin/views/looks/tmpl/default_batch_footer.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @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/looks/tmpl/default_body.php b/admin/views/looks/tmpl/default_body.php index 722fd19..a4f41c4 100644 --- a/admin/views/looks/tmpl/default_body.php +++ b/admin/views/looks/tmpl/default_body.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @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_demo&view=looks&task=look.edit"; @@ -34,11 +34,8 @@ $edit = "index.php?option=com_demo&view=looks&task=look.edit"; get('look.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/looks/tmpl/default_foot.php b/admin/views/looks/tmpl/default_foot.php index 1d99e08..4c8993e 100644 --- a/admin/views/looks/tmpl/default_foot.php +++ b/admin/views/looks/tmpl/default_foot.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage default_foot.php diff --git a/admin/views/looks/tmpl/default_head.php b/admin/views/looks/tmpl/default_head.php index 15c1e3e..ba98d16 100644 --- a/admin/views/looks/tmpl/default_head.php +++ b/admin/views/looks/tmpl/default_head.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @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'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/looks/tmpl/default_toolbar.php b/admin/views/looks/tmpl/default_toolbar.php index 9bef3d9..0b18dbf 100644 --- a/admin/views/looks/tmpl/default_toolbar.php +++ b/admin/views/looks/tmpl/default_toolbar.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage default_toolbar.php diff --git a/admin/views/looks/view.html.php b/admin/views/looks/view.html.php index 2bf92e0..afee04e 100644 --- a/admin/views/looks/view.html.php +++ b/admin/views/looks/view.html.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage view.html.php @@ -45,8 +45,8 @@ class DemoViewLooks extends JViewLegacy $this->user = JFactory::getUser(); // 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 +161,42 @@ class DemoViewLooks extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_demo'); - } - - 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_DEMO_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_DEMO_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_DEMO_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_DEMO_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } @@ -238,7 +241,7 @@ class DemoViewLooks extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'a.name' => JText::_('COM_DEMO_LOOK_NAME_LABEL'), 'a.description' => JText::_('COM_DEMO_LOOK_DESCRIPTION_LABEL'), diff --git a/demo.xml b/demo.xml index 847f8c0..1735358 100644 --- a/demo.xml +++ b/demo.xml @@ -1,15 +1,15 @@ COM_DEMO - 30th May, 2020 + 6th January, 2021 Llewellyn van der Merwe 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 - 2.0.2 + 2.0.3 Demo (v.2.0.2) +

Demo (v.2.0.3)

Just a basic demo of the most basic implementations of the [Joomla](http://www.joomla.org) Component Builder's ability.

Created by Llewellyn van der Merwe
Development started 18th October, 2016

diff --git a/demo_updateserver.xml b/demo_updateserver.xml index add4310..7cc5b42 100644 --- a/demo_updateserver.xml +++ b/demo_updateserver.xml @@ -33,4 +33,21 @@ https://www.vdm.io/ + + Demo + Demo Component + com_demo + component + 2.0.3 + https://www.vdm.io/ + + http://domain.com/demo.zip + + + stable + + Llewellyn van der Merwe + https://www.vdm.io/ + + \ No newline at end of file diff --git a/script.php b/script.php index c0955f5..e901d17 100644 --- a/script.php +++ b/script.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage script.php @@ -84,7 +84,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove look add queued success message. + // If successfully remove look add queued success message. $app->enqueueMessage(JText::_('The fields with type (com_demo.look) context was removed from the #__fields table')); } // Also Remove look field values @@ -98,7 +98,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove look add queued success message. + // If successfully remove look add queued success message. $app->enqueueMessage(JText::_('The fields values for look was removed from the #__fields_values table')); } } @@ -128,7 +128,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove look add queued success message. + // If successfully remove look add queued success message. $app->enqueueMessage(JText::_('The field groups with type (com_demo.look) context was removed from the #__fields_groups table')); } } @@ -160,7 +160,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove look add queued success message. + // If successfully remove look add queued success message. $app->enqueueMessage(JText::_('The (com_demo.look) type alias was removed from the #__content_type table')); } @@ -175,7 +175,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove look add queued success message. + // If successfully remove look add queued success message. $app->enqueueMessage(JText::_('The (com_demo.look) type alias was removed from the #__contentitem_tag_map table')); } @@ -190,7 +190,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove look add queued success message. + // If successfully removed look add queued success message. $app->enqueueMessage(JText::_('The (com_demo.look) type alias was removed from the #__ucm_content table')); } @@ -246,7 +246,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove Look add queued success message. + // If successfully remove Look add queued success message. $app->enqueueMessage(JText::_('The (com_demo.look) type alias was removed from the #__content_type table')); } @@ -261,7 +261,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove Look add queued success message. + // If successfully remove Look add queued success message. $app->enqueueMessage(JText::_('The (com_demo.look) type alias was removed from the #__contentitem_tag_map table')); } @@ -276,7 +276,7 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove Look add queued success message. + // If successfully removed Look add queued success message. $app->enqueueMessage(JText::_('The (com_demo.look) type alias was removed from the #__ucm_content table')); } @@ -320,10 +320,31 @@ class com_demoInstallerScript $look_done = $db->execute(); if ($look_done) { - // If succesfully remove demo add queued success message. + // If successfully removed demo add queued success message. $app->enqueueMessage(JText::_('All related items was removed from the #__assets table')); } + // Get the biggest rule column in the assets table at this point. + $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $db->setQuery($get_rule_length); + if ($db->execute()) + { + $rule_length = $db->loadResult(); + // Check the size of the rules column + if ($rule_length < 5120) + { + // Revert the assets table rules column back to the default + $revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';"; + $db->setQuery($revert_rule); + $db->execute(); + $app->enqueueMessage(JText::_('Reverted the #__assets table rules column back to its default size of varchar(5120)')); + } + else + { + + $app->enqueueMessage(JText::_('Could not revert the #__assets table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.')); + } + } // Set db if not set already. if (!isset($db)) @@ -460,9 +481,9 @@ class com_demoInstallerScript $look->type_title = 'Demo Look'; $look->type_alias = 'com_demo.look'; $look->table = '{"special": {"dbtable": "#__demo_look","key": "id","type": "Look","prefix": "demoTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $look->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","image":"image","dateofbirth":"dateofbirth","mobile_phone":"mobile_phone","email":"email","add":"add","not_required":"not_required","alias":"alias"}}'; + $look->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","image":"image","dateofbirth":"dateofbirth","mobile_phone":"mobile_phone","email":"email","add":"add","alias":"alias"}}'; $look->router = 'DemoHelperRoute::getLookRoute'; - $look->content_history_options = '{"formFile": "administrator/components/com_demo/models/forms/look.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $look->content_history_options = '{"formFile": "administrator/components/com_demo/models/forms/look.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $look_Inserted = $db->insertObject('#__content_types', $look); @@ -500,6 +521,22 @@ class com_demoInstallerScript // Get Application object $app = JFactory::getApplication(); $app->enqueueMessage('This is a demo component developed in JCB! You can build more components like this with JCB, checkout our page on github for more info. The future of Joomla Component Development is Here!', 'Info'); + // Get the biggest rule column in the assets table at this point. + $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $db->setQuery($get_rule_length); + if ($db->execute()) + { + $rule_length = $db->loadResult(); + // Check the size of the rules column + if ($rule_length <= 5600) + { + // Fix the assets table rules column size + $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` TEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to TEXT by JCB';"; + $db->setQuery($fix_rules_size); + $db->execute(); + $app->enqueueMessage(JText::_('The #__assets table rules column was resized to the TEXT datatype for the components possible large permission rules.')); + } + } echo ' '; @@ -545,9 +582,9 @@ class com_demoInstallerScript $look->type_title = 'Demo Look'; $look->type_alias = 'com_demo.look'; $look->table = '{"special": {"dbtable": "#__demo_look","key": "id","type": "Look","prefix": "demoTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $look->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","image":"image","dateofbirth":"dateofbirth","mobile_phone":"mobile_phone","email":"email","add":"add","not_required":"not_required","alias":"alias"}}'; + $look->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","image":"image","dateofbirth":"dateofbirth","mobile_phone":"mobile_phone","email":"email","add":"add","alias":"alias"}}'; $look->router = 'DemoHelperRoute::getLookRoute'; - $look->content_history_options = '{"formFile": "administrator/components/com_demo/models/forms/look.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $look->content_history_options = '{"formFile": "administrator/components/com_demo/models/forms/look.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if look type is already in content_type DB. $look_id = null; @@ -573,7 +610,7 @@ class com_demoInstallerScript echo ' -

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

'; +

Upgrade to Version 2.0.3 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/look.css b/site/assets/css/look.css index dccbae9..c9bc968 100644 --- a/site/assets/css/look.css +++ b/site/assets/css/look.css @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage look.css diff --git a/site/assets/css/looking.css b/site/assets/css/looking.css index 0f6bb83..40642b9 100644 --- a/site/assets/css/looking.css +++ b/site/assets/css/looking.css @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage looking.css diff --git a/site/assets/css/looks.css b/site/assets/css/looks.css index f6570f6..0e70b6a 100644 --- a/site/assets/css/looks.css +++ b/site/assets/css/looks.css @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage looks.css diff --git a/site/assets/css/site.css b/site/assets/css/site.css index edb2dbe..bb0e79d 100644 --- a/site/assets/css/site.css +++ b/site/assets/css/site.css @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage site.css diff --git a/site/assets/js/site.js b/site/assets/js/site.js index 9829fe5..7b3b9c1 100644 --- a/site/assets/js/site.js +++ b/site/assets/js/site.js @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage site.js diff --git a/site/controller.php b/site/controller.php index f84af03..785ce88 100644 --- a/site/controller.php +++ b/site/controller.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage controller.php diff --git a/site/controllers/look.php b/site/controllers/look.php index 38c9444..29f7e58 100644 --- a/site/controllers/look.php +++ b/site/controllers/look.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage look.php diff --git a/site/demo.php b/site/demo.php index 38b5e14..9eb4dc1 100644 --- a/site/demo.php +++ b/site/demo.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage demo.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_demo/assets/css/site.css'); $document->addScript('components/com_demo/assets/js/site.js'); // Require helper files -JLoader::register('DemoHelper', __DIR__ . '/helpers/demo.php'); +JLoader::register('DemoHelper', __DIR__ . '/helpers/demo.php'); JLoader::register('DemoHelperRoute', __DIR__ . '/helpers/route.php'); // Get an instance of the controller prefixed by Demo diff --git a/site/helpers/category.php b/site/helpers/category.php index a65edc9..b57ad87 100644 --- a/site/helpers/category.php +++ b/site/helpers/category.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage category.php diff --git a/site/helpers/demo.php b/site/helpers/demo.php index bb5b31d..3ef5e78 100644 --- a/site/helpers/demo.php +++ b/site/helpers/demo.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage demo.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; /** diff --git a/site/helpers/headercheck.php b/site/helpers/headercheck.php index 5515472..cc6ed6e 100644 --- a/site/helpers/headercheck.php +++ b/site/helpers/headercheck.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage headercheck.php diff --git a/site/helpers/route.php b/site/helpers/route.php index 0c6ee71..92ed59f 100644 --- a/site/helpers/route.php +++ b/site/helpers/route.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage route.php diff --git a/site/language/en-GB/en-GB.com_demo.ini b/site/language/en-GB/en-GB.com_demo.ini index b7de3ec..a63e1ac 100644 --- a/site/language/en-GB/en-GB.com_demo.ini +++ b/site/language/en-GB/en-GB.com_demo.ini @@ -22,6 +22,8 @@ COM_DEMO_LOOKS_N_ITEMS_CHECKED_IN_1="%d Look successfully checked in." COM_DEMO_LOOKS_N_ITEMS_CHECKED_IN_MORE="%d Looks successfully checked in." COM_DEMO_LOOKS_N_ITEMS_DELETED="%s Looks deleted." COM_DEMO_LOOKS_N_ITEMS_DELETED_1="%s Look deleted." +COM_DEMO_LOOKS_N_ITEMS_FAILED_PUBLISHING="%s Looks failed publishing." +COM_DEMO_LOOKS_N_ITEMS_FAILED_PUBLISHING_1="%s Look failed publishing." COM_DEMO_LOOKS_N_ITEMS_FEATURED="%s Looks featured." COM_DEMO_LOOKS_N_ITEMS_FEATURED_1="%s Look featured." COM_DEMO_LOOKS_N_ITEMS_PUBLISHED="%s Looks published." diff --git a/site/layouts/look/details_above.php b/site/layouts/look/details_above.php index 27719ae..d7e6486 100644 --- a/site/layouts/look/details_above.php +++ b/site/layouts/look/details_above.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage details_above.php diff --git a/site/layouts/look/details_fullwidth.php b/site/layouts/look/details_fullwidth.php index 28d2103..fec77af 100644 --- a/site/layouts/look/details_fullwidth.php +++ b/site/layouts/look/details_fullwidth.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage details_fullwidth.php diff --git a/site/layouts/look/details_under.php b/site/layouts/look/details_under.php index 825e9ec..4751e53 100644 --- a/site/layouts/look/details_under.php +++ b/site/layouts/look/details_under.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage details_under.php diff --git a/site/layouts/look/metadata.php b/site/layouts/look/metadata.php index fef27e5..2e9643c 100644 --- a/site/layouts/look/metadata.php +++ b/site/layouts/look/metadata.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage metadata.php diff --git a/site/layouts/look/more_left.php b/site/layouts/look/more_left.php index bdc240e..f15f140 100644 --- a/site/layouts/look/more_left.php +++ b/site/layouts/look/more_left.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage more_left.php diff --git a/site/layouts/look/more_right.php b/site/layouts/look/more_right.php index 9eb66a0..b7c633c 100644 --- a/site/layouts/look/more_right.php +++ b/site/layouts/look/more_right.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage more_right.php diff --git a/site/layouts/look/publishing.php b/site/layouts/look/publishing.php index 348035b..ca6fdf4 100644 --- a/site/layouts/look/publishing.php +++ b/site/layouts/look/publishing.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @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/look.js b/site/models/forms/look.js index 21f3a01..2796c28 100644 --- a/site/models/forms/look.js +++ b/site/models/forms/look.js @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage look.js diff --git a/site/models/forms/look.xml b/site/models/forms/look.xml index 19953c4..def7a2e 100644 --- a/site/models/forms/look.xml +++ b/site/models/forms/look.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/looks.php b/site/models/looks.php index 97260b9..bde94c8 100644 --- a/site/models/looks.php +++ b/site/models/looks.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage looks.php diff --git a/site/router.php b/site/router.php index 7aaac85..bfc1b06 100644 --- a/site/router.php +++ b/site/router.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage router.php diff --git a/site/views/look/submitbutton.js b/site/views/look/submitbutton.js index e3816ef..30231e9 100644 --- a/site/views/look/submitbutton.js +++ b/site/views/look/submitbutton.js @@ -2,8 +2,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @subpackage submitbutton.js diff --git a/site/views/look/tmpl/edit.php b/site/views/look/tmpl/edit.php index 1eb20ec..c4c406e 100644 --- a/site/views/look/tmpl/edit.php +++ b/site/views/look/tmpl/edit.php @@ -3,8 +3,8 @@ Vast Development Method /-------------------------------------------------------------------------------------------------------/ - @version 2.0.2 - @build 30th May, 2020 + @version 2.0.3 + @build 6th January, 2021 @created 18th October, 2016 @package Demo @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(); ?>
@@ -63,7 +63,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'lookTab'; ?> - canDo->get('look.delete') || $this->canDo->get('look.edit.created_by') || $this->canDo->get('look.edit.state') || $this->canDo->get('look.edit.created')) : ?> + canDo->get('look.edit.created_by') || $this->canDo->get('look.edit.created') || $this->canDo->get('look.edit.state') || ($this->canDo->get('look.delete') && $this->canDo->get('look.edit.state'))) : ?>
@@ -105,7 +105,8 @@ $componentParams = $this->params; // will be removed just use $this->params inst
- + +