Updated with JCB v2.12.4

This commit is contained in:
Llewellyn van der Merwe 2021-01-06 15:52:28 +02:00
parent c0f7b2c0a6
commit 9e2e5e6583
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
88 changed files with 629 additions and 410 deletions

View File

@ -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
[![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)

View File

@ -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
[![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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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();
}

View File

@ -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

View File

@ -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

View File

@ -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."

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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',

View File

@ -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).'<br /><br />';
$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'];

View File

@ -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

View File

@ -102,6 +102,14 @@
rows="3"
cols="30"
/>
<!-- Was added due to Permissions JS needing a Title field -->
<!-- Let us know at gh-629 should this change -->
<!-- https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235 -->
<field
name="title"
type="hidden"
default="demo look"
/>
<!-- Dynamic Fields. -->
<!-- Name Field. Type: Text. (joomla) -->
<field

View File

@ -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
@ -435,7 +435,15 @@ class DemoModelImport 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']))

View File

@ -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);

View File

@ -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');

View File

@ -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.';

View File

@ -1 +1,2 @@
DROP TABLE IF EXISTS `#__demo_look`;

View File

@ -0,0 +1 @@
ALTER TABLE `#__demo_look` CHANGE `image` `image` VARCHAR(255) NOT NULL DEFAULT '';

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
<?php $this->tab_name = 'lookTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('look.delete') || $this->canDo->get('look.edit.created_by') || $this->canDo->get('look.edit.state') || $this->canDo->get('look.edit.created')) : ?>
<?php if ($this->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'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'lookTab', 'publishing', JText::_('COM_DEMO_LOOK_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">

View File

@ -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

View File

@ -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);
}
?>
<script type="text/javascript">
Joomla.orderTable = function()
{
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $this->listOrder; ?>')
{
dirn = 'asc';
}
else
{
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_demo&view=looks'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php if (empty($this->items)): ?>
<?php echo $this->loadTemplate('toolbar');?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php echo $this->loadTemplate('toolbar');?>
<table class="table table-striped" id="lookList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php //Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_DEMO_LOOKS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="filter_order" value="<?php echo $this->listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->listDirn; ?>" />
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
<script type="text/javascript">
Joomla.orderTable = function()
{
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $this->listOrder; ?>')
{
dirn = 'asc';
}
else
{
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_demo&view=looks'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php if (empty($this->items)): ?>
<?php echo $this->loadTemplate('toolbar');?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php echo $this->loadTemplate('toolbar');?>
<table class="table table-striped" id="lookList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_DEMO_LOOKS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="filter_order" value="<?php echo $this->listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->listDirn; ?>" />
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>

View File

@ -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');
?>

View File

@ -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');
?>
<!-- clear the batch values if cancel -->

View File

@ -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";
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('look.edit.state')): ?>
<?php
if ($this->saveOrder)
{
$iconClass = ' inactive';
}
else
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}

View File

@ -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

View File

@ -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');
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>

View File

@ -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

View File

@ -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'),

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_DEMO</name>
<creationDate>30th May, 2020</creationDate>
<creationDate>6th January, 2021</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.0.2</version>
<version>2.0.3</version>
<description><![CDATA[
<h1>Demo (v.2.0.2)</h1>
<h1>Demo (v.2.0.3)</h1>
<div style="clear: both;"></div>
<p>Just a basic demo of the most basic implementations of the [Joomla](http://www.joomla.org) Component Builder's ability.</p>
<p>Created by <a href="https://www.vdm.io/" target="_blank">Llewellyn van der Merwe</a><br /><small>Development started 18th October, 2016</small></p>

View File

@ -33,4 +33,21 @@
<maintainerurl>https://www.vdm.io/</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Demo</name>
<description>Demo Component</description>
<element>com_demo</element>
<type>component</type>
<version>2.0.3</version>
<infourl title="Demo!">https://www.vdm.io/</infourl>
<downloads>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://www.vdm.io/</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -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 <b>#__fields</b> 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 <b>#__fields_values</b> 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 <b>#__fields_groups</b> 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 <b>#__content_type</b> 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 <b>#__contentitem_tag_map</b> 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 <b>#__ucm_content</b> 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 <b>#__content_type</b> 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 <b>#__contentitem_tag_map</b> 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 <b>#__ucm_content</b> 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 <b>#__assets</b> 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 <b>#__assets</b> table rules column back to its default size of varchar(5120)'));
}
else
{
$app->enqueueMessage(JText::_('Could not revert the <b>#__assets</b> 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 <a href="http://vdm.bz/component-builder" taget="_balnk" title="Joomla Component Builder">JCB</a>! You can build more components like this with JCB, checkout our page on <a href="https://github.com/vdm-io/Joomla-Component-Builder" taget="_balnk" title="Joomla Component Builder">github</a> for more info. The future of <a href="http://vdm.bz/component-builder" taget="_balnk" title="Joomla Component Builder">Joomla Component Development</a> 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 <b>#__assets</b> table rules column was resized to the TEXT datatype for the components possible large permission rules.'));
}
}
echo '<a target="_blank" href="https://www.vdm.io/" title="Demo">
<img src="components/com_demo/assets/images/vdm-component.jpg"/>
</a>';
@ -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 '<a target="_blank" href="https://www.vdm.io/" title="Demo">
<img src="components/com_demo/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.0.2 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.0.3 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;
/**

View File

@ -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

View File

@ -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

View File

@ -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."

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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',

View File

@ -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

View File

@ -102,6 +102,14 @@
rows="3"
cols="30"
/>
<!-- Was added due to Permissions JS needing a Title field -->
<!-- Let us know at gh-629 should this change -->
<!-- https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235 -->
<field
name="title"
type="hidden"
default="demo look"
/>
<!-- Dynamic Fields. -->
<!-- Name Field. Type: Text. (joomla) -->
<field

View File

@ -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);

View File

@ -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 looking.php
@ -161,7 +161,7 @@ class DemoModelLooking extends JModelItem
if ($e->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
{

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
?>
<div class="demo-look">
<?php echo $this->toolbar->render(); ?>
<form action="<?php echo JRoute::_('index.php?option=com_demo&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
@ -63,7 +63,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'lookTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('look.delete') || $this->canDo->get('look.edit.created_by') || $this->canDo->get('look.edit.state') || $this->canDo->get('look.edit.created')) : ?>
<?php if ($this->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'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'lookTab', 'publishing', JText::_('COM_DEMO_LOOK_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
@ -105,7 +105,8 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div class="clearfix"></div>
<?php echo JLayoutHelper::render('look.details_under', $this); ?>
</form>
</form>
</div>
<script type="text/javascript">

View File

@ -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
@ -86,10 +86,7 @@ class DemoViewLook 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;

View File

@ -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
@ -21,6 +21,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<div class="uk-clearfix"><div class="uk-float-right"><?php echo $this->toolbar->render(); ?></div></div>
<article class="uk-comment">

View File

@ -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
@ -200,8 +200,6 @@ class DemoViewLooking 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 = DemoHelper::getHelpUrl('looking');

View File

@ -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
@ -21,6 +21,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<form action="<?php echo JRoute::_('index.php?option=com_demo'); ?>" method="post" name="adminForm" id="adminForm">
<table class="uk-table uk-table-hover">

View File

@ -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
@ -135,8 +135,6 @@ class DemoViewLooks 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 = DemoHelper::getHelpUrl('looks');