Updated with JCB v2.12.4

This commit is contained in:
Llewellyn van der Merwe 2021-01-04 19:48:41 +02:00
parent b520d8860c
commit d89afa702e
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
83 changed files with 737 additions and 459 deletions

View File

@ -1,4 +1,4 @@
# Hello World (1.0.0)
# Hello World (1.0.1)
@ -8,24 +8,24 @@
+ *Author*: [Llewellyn](mailto:joomla@vdm.io)
+ *Name*: [Hello World](https://www.vdm.io)
+ *First Build*: 20th September, 2017
+ *Last Build*: 30th May, 2020
+ *Version*: 1.0.0
+ *Last Build*: 4th January, 2021
+ *Version*: 1.0.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time
**40 Hours** or **5 Eight Hour Days** (actual time the author saved -
**41 Hours** or **5 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](http://joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **14355**
+ *File count*: **136**
+ *Line count*: **14632**
+ *File count*: **139**
+ *Folder count*: **55**
**27 Hours** or **3 Eight Hour Days** (the actual time the author spent)
**27 Hours** or **4 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @10hours** = codingtime / 4;
@ -33,20 +33,49 @@ due to [Automated Component Builder](http://joomlacomponentbuilder.com))
> **mapping @4hours** = codingtime / 10;
> **office @7hours** = codingtime / 6;)
**67 Hours** or **8 Eight Hour Days**
**68 Hours** or **9 Eight Hour Days**
(a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: **1.6 weeks** or **0.3 months**
Project duration: **1.8 weeks** or **0.4 months**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
## Donations
## Contributors
This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
If you want to support this project, please consider donating:
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief)
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218
[![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 @@
# Hello World (1.0.0)
# Hello World (1.0.1)
@ -8,24 +8,24 @@
+ *Author*: [Llewellyn](mailto:joomla@vdm.io)
+ *Name*: [Hello World](https://www.vdm.io)
+ *First Build*: 20th September, 2017
+ *Last Build*: 30th May, 2020
+ *Version*: 1.0.0
+ *Last Build*: 4th January, 2021
+ *Version*: 1.0.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time
**40 Hours** or **5 Eight Hour Days** (actual time the author saved -
**41 Hours** or **5 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](http://joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **14355**
+ *File count*: **136**
+ *Line count*: **14632**
+ *File count*: **139**
+ *Folder count*: **55**
**27 Hours** or **3 Eight Hour Days** (the actual time the author spent)
**27 Hours** or **4 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @10hours** = codingtime / 4;
@ -33,20 +33,49 @@ due to [Automated Component Builder](http://joomlacomponentbuilder.com))
> **mapping @4hours** = codingtime / 10;
> **office @7hours** = codingtime / 6;)
**67 Hours** or **8 Eight Hour Days**
**68 Hours** or **9 Eight Hour Days**
(a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: **1.6 weeks** or **0.3 months**
Project duration: **1.8 weeks** or **0.4 months**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
## Donations
## Contributors
This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
If you want to support this project, please consider donating:
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief)
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218
[![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

@ -22,14 +22,12 @@
<action name="greeting.batch" title="COM_HELLO_WORLD_GREETINGS_BATCH_USE" description="COM_HELLO_WORLD_GREETINGS_BATCH_USE_DESC" />
<action name="greeting.dashboard_add" title="COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD" description="COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD_DESC" />
<action name="greeting.dashboard_list" title="COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST" description="COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST_DESC" />
<action name="greeting.edit.greeting" title="COM_HELLO_WORLD_GREETINGS_EDIT_GREETING" description="COM_HELLO_WORLD_GREETINGS_EDIT_GREETING_DESC" />
<action name="greeting.version" title="COM_HELLO_WORLD_GREETINGS_EDIT_VERSION" description="COM_HELLO_WORLD_GREETINGS_EDIT_VERSION_DESC" />
<action name="greeting.export" title="COM_HELLO_WORLD_GREETINGS_EXPORT" description="COM_HELLO_WORLD_GREETINGS_EXPORT_DESC" />
<action name="greeting.import" title="COM_HELLO_WORLD_GREETINGS_IMPORT" description="COM_HELLO_WORLD_GREETINGS_IMPORT_DESC" />
<action name="greeting.submenu" title="COM_HELLO_WORLD_GREETINGS_SUBMENU" description="COM_HELLO_WORLD_GREETINGS_SUBMENU_DESC" />
</section>
<section name="greeting">
<action name="greeting.edit.greeting" title="COM_HELLO_WORLD_GREETINGS_EDIT_GREETING" description="COM_HELLO_WORLD_GREETINGS_EDIT_GREETING_DESC" />
<action name="greeting.version" title="COM_HELLO_WORLD_GREETINGS_EDIT_VERSION" description="COM_HELLO_WORLD_GREETINGS_EDIT_VERSION_DESC" />
</section>
<section name="fieldgroup">

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage admin.css

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage dashboard.css

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.css

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greetings.css

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage admin.js

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage controller.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greetings.php
@ -64,7 +64,7 @@ class Hello_worldControllerGreetings extends JControllerAdmin
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
ArrayHelper::toInteger($pks);
$pks = ArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Greetings');
// get the data to export

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage import.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php
@ -20,6 +20,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tabstate');
// Access check.

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage headercheck.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php
@ -21,8 +21,9 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Language;
use Joomla\String\StringHelper;
use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
@ -47,7 +48,7 @@ abstract class Hello_worldHelper
*/
public static $langTag;
/***[INSERTED$$$$]***//*69*/
/**
* Write a file to the server
*
@ -79,8 +80,8 @@ abstract class Hello_worldHelper
}
return $klaar;
}
/***[/INSERTED$$$$]***/
/***[INSERTED$$$$]***//*60*/
/**
* get the content of a file
*
@ -132,8 +133,8 @@ abstract class Hello_worldHelper
}
return $none;
}
/***[/INSERTED$$$$]***/
/***[INSERTED$$$$]***//*71*/
/**
* Remove folders with files
*
@ -206,7 +207,7 @@ abstract class Hello_worldHelper
}
return false;
}
/***[/INSERTED$$$$]***/
/**
* Load the Composer Vendors
@ -464,6 +465,8 @@ abstract class Hello_worldHelper
->setLastModifiedBy($modified)
->setTitle($title)
->setSubject($subjectTab);
// The file type
$file_type = 'Xls';
// set description
if ($description)
{
@ -503,21 +506,46 @@ abstract class Hello_worldHelper
));
// Add some data
if (self::checkArray($rows))
if (($size = self::checkArray($rows)) !== false)
{
$i = 1;
foreach ($rows as $array){
// Based on data size we adapt the behaviour.
$xls_mode = 1;
if ($size > 3000)
{
$xls_mode = 3;
$file_type = 'Csv';
}
elseif ($size > 2000)
{
$xls_mode = 2;
}
// Set active sheet and get it.
$active_sheet = $spreadsheet->setActiveSheetIndex(0);
foreach ($rows as $array)
{
$a = 'A';
foreach ($array as $value){
$spreadsheet->setActiveSheetIndex(0)->setCellValue($a.$i, $value);
if ($i == 1){
$spreadsheet->getActiveSheet()->getColumnDimension($a)->setAutoSize(true);
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($headerStyles);
$spreadsheet->getActiveSheet()->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
} elseif ($a === 'A'){
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($sideStyles);
} else {
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($normalStyles);
foreach ($array as $value)
{
$active_sheet->setCellValue($a.$i, $value);
if ($xls_mode != 3)
{
if ($i == 1)
{
$active_sheet->getColumnDimension($a)->setAutoSize(true);
$active_sheet->getStyle($a.$i)->applyFromArray($headerStyles);
$active_sheet->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
}
elseif ($a === 'A')
{
$active_sheet->getStyle($a.$i)->applyFromArray($sideStyles);
}
elseif ($xls_mode == 1)
{
$active_sheet->getStyle($a.$i)->applyFromArray($normalStyles);
}
}
$a++;
}
@ -537,7 +565,7 @@ abstract class Hello_worldHelper
// Redirect output to a client's web browser (Excel5)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$fileName.'.xls"');
header('Content-Disposition: attachment;filename="' . $fileName . '.' . strtolower($file_type) .'"');
header('Cache-Control: max-age=0');
// If you're serving to IE 9, then the following may be needed
header('Cache-Control: max-age=1');
@ -548,7 +576,7 @@ abstract class Hello_worldHelper
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
header ('Pragma: public'); // HTTP/1.0
$writer = IOFactory::createWriter($spreadsheet, 'Xls');
$writer = IOFactory::createWriter($spreadsheet, $file_type);
$writer->save('php://output');
jexit();
}

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage batch_.php

View File

@ -1,5 +1,6 @@
COM_HELLO_WORLD="Hello World"
COM_HELLO_WORLD_ARCHIVED="Archived"
COM_HELLO_WORLD_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS="Are you sure you want to delete? Confirming will permanently delete the selected item(s)!"
COM_HELLO_WORLD_AUTHOR="Author"
COM_HELLO_WORLD_BACK="Back"
COM_HELLO_WORLD_CLOSE_NEW="Close & New"
@ -51,9 +52,18 @@ COM_HELLO_WORLD_EDIT_CREATED_DATE_DESC="Allows users in this group to edit creat
COM_HELLO_WORLD_EDIT_S="Edit %s"
COM_HELLO_WORLD_EDIT_VERSIONS="Edit Version"
COM_HELLO_WORLD_EDIT_VERSIONS_DESC="Allows users in this group to edit versions."
COM_HELLO_WORLD_EMPTY_TRASH="Empty trash"
COM_HELLO_WORLD_EXIT_TRASH="Exit trash"
COM_HELLO_WORLD_EXPORT_DATA="Export Data"
COM_HELLO_WORLD_EXPORT_DATA_DESC="Allows users in this group to export data."
COM_HELLO_WORLD_EXPORT_FAILED="Export Failed"
COM_HELLO_WORLD_FILTER_GREETING_ASCENDING="Greeting ascending"
COM_HELLO_WORLD_FILTER_GREETING_DESCENDING="Greeting descending"
COM_HELLO_WORLD_FILTER_PUBLISHED="Status"
COM_HELLO_WORLD_FILTER_PUBLISHED_GREETINGS="Status options for greetings"
COM_HELLO_WORLD_FILTER_SEARCH="Searchgreetings"
COM_HELLO_WORLD_FILTER_SEARCH_GREETINGS="Search the greeting items. Prefix with ID: to search for an item by ID."
COM_HELLO_WORLD_FILTER_SELECT_ACCESS="Select Access"
COM_HELLO_WORLD_GREETING="Greeting"
COM_HELLO_WORLD_GREETINGS="Greetings"
COM_HELLO_WORLD_GREETINGS_ACCESS="Greetings Access"
@ -68,8 +78,6 @@ COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD="Greetings Dashboard Add"
COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of greeting"
COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST="Greetings Dashboard List"
COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of greeting"
COM_HELLO_WORLD_GREETINGS_EDIT_GREETING="Greetings Edit Greeting"
COM_HELLO_WORLD_GREETINGS_EDIT_GREETING_DESC="Allows the users in this group to edit greeting of greeting"
COM_HELLO_WORLD_GREETINGS_EDIT_VERSION="Greetings Edit Version"
COM_HELLO_WORLD_GREETINGS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version greetings"
COM_HELLO_WORLD_GREETINGS_EXPORT="Greetings Export"
@ -83,6 +91,8 @@ COM_HELLO_WORLD_GREETINGS_N_ITEMS_CHECKED_IN_1="%d Greeting successfully checked
COM_HELLO_WORLD_GREETINGS_N_ITEMS_CHECKED_IN_MORE="%d Greetings successfully checked in."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_DELETED="%s Greetings deleted."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_DELETED_1="%s Greeting deleted."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_FAILED_PUBLISHING="%s Greetings failed publishing."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_FAILED_PUBLISHING_1="%s Greeting failed publishing."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_FEATURED="%s Greetings featured."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_FEATURED_1="%s Greeting featured."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_PUBLISHED="%s Greetings published."
@ -176,8 +186,12 @@ COM_HELLO_WORLD_SUBMENU_GREETINGS="Greetings"
COM_HELLO_WORLD_SUBMENU_GREETINGS_FIELDS="Greetings Fields"
COM_HELLO_WORLD_SUBMENU_GREETINGS_FIELDS_GROUPS="Greetings Field Groups"
COM_HELLO_WORLD_TRASHED="Trashed"
COM_HELLO_WORLD_TRASHED_ITEMS="Trashed items"
COM_HELLO_WORLD_TRASH_AREA="Trash Area"
COM_HELLO_WORLD_TYPE_GREETING="Greeting"
COM_HELLO_WORLD_USE_BATCH="Use Batch"
COM_HELLO_WORLD_USE_BATCH_DESC="Allows users in this group to use batch copy/update method."
COM_HELLO_WORLD_VERSION="Version"
COM_HELLO_WORLD_WEBSITE="Website"
COM_HELLO_WORLD_WEBSITE="Website"
COM_HELLO_WORLD_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items."
COM_HELLO_WORLD_YOU_ARE_CURRENTLY_VIEWING_THE_TRASH_AREA_AND_YOU_DONT_HAVE_ANY_ITEMS_IN_TRASH_AT_THE_MOMENT="You are currently viewing the trash area, and you don't have any items in trash at the moment!"

View File

@ -18,8 +18,6 @@ COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD="Greetings Dashboard Add"
COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of greeting"
COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST="Greetings Dashboard List"
COM_HELLO_WORLD_GREETINGS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of greeting"
COM_HELLO_WORLD_GREETINGS_EDIT_GREETING="Greetings Edit Greeting"
COM_HELLO_WORLD_GREETINGS_EDIT_GREETING_DESC="Allows the users in this group to edit greeting of greeting"
COM_HELLO_WORLD_GREETINGS_EDIT_VERSION="Greetings Edit Version"
COM_HELLO_WORLD_GREETINGS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version greetings"
COM_HELLO_WORLD_GREETINGS_EXPORT="Greetings Export"

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage batchselection.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage details_left.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage metadata.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage publishing.php
@ -35,6 +35,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1];
// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created',
'created_by',
'modified',

View File

@ -0,0 +1,82 @@
<?php
/*----------------------------------------------------------------------------------| www.vdm.io |----/
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage trashhelper.php
@author Llewellyn <https://www.vdm.io>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('JPATH_BASE') or die('Restricted access');
?>
<?php if ($displayData->state->get('filter.published') == -2 && ($displayData->canState && $displayData->canDelete)) : ?>
<script>
// change the class of the delete button
jQuery("#toolbar-delete button").toggleClass("btn-danger");
// function to empty the trash
function emptyTrash() {
if (document.adminForm.boxchecked.value == 0) {
// select all the items visable
document.adminForm.elements['checkall-toggle'].checked=1;
Joomla.checkAll(document.adminForm.elements['checkall-toggle']);
// check to confirm the deletion
if(confirm('<?= JText::_("COM_HELLO_WORLD_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS") ?>')) {
Joomla.submitbutton('<?= $displayData->get("name") ?>.delete');
} else {
document.adminForm.elements['checkall-toggle'].checked=0;
Joomla.checkAll(document.adminForm.elements['checkall-toggle']);
}
} else {
// confirm deletion of those selected
if (confirm('<?= JText::_("COM_HELLO_WORLD_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS") ?>')) {
Joomla.submitbutton('<?= $displayData->get("name") ?>.delete');
};
}
return false;
}
// function to exit the tash state
function exitTrash() {
document.adminForm.filter_published.selectedIndex = 0;
document.adminForm.submit();
return false;
}
</script>
<div class="alert alert-error">
<?php if (empty($displayData->items)): ?>
<h4 class="alert-heading">
<span class="icon-trash"></span>
<?= JText::_("COM_HELLO_WORLD_TRASH_AREA") ?>
</h4>
<p><?= JText::_("COM_HELLO_WORLD_YOU_ARE_CURRENTLY_VIEWING_THE_TRASH_AREA_AND_YOU_DONT_HAVE_ANY_ITEMS_IN_TRASH_AT_THE_MOMENT") ?></p>
<?php else: ?>
<h4 class="alert-heading">
<span class="icon-trash"></span>
<?= JText::_("COM_HELLO_WORLD_TRASHED_ITEMS") ?>
</h4>
<p><?= JText::_("COM_HELLO_WORLD_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS") ?></p>
<button onclick="emptyTrash();" class="btn btn-small btn-danger">
<span class="icon-delete" aria-hidden="true"></span>
<?= JText::_("COM_HELLO_WORLD_EMPTY_TRASH") ?>
</button>
<?php endif; ?>
<button onclick="exitTrash();" class="btn btn-small">
<span class="icon-back" aria-hidden="true"></span>
<?= JText::_("COM_HELLO_WORLD_EXIT_TRASH") ?>
</button>
</div>
<?php endif; ?>

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_hello_world/models/rules"
addfieldpath="/administrator/components/com_hello_world/models/fields"
>
<fields name="filter">
<field
type="text"
name="search"
inputmode="search"
label="COM_HELLO_WORLD_FILTER_SEARCH"
description="COM_HELLO_WORLD_FILTER_SEARCH_GREETINGS"
hint="JSEARCH_FILTER"
/>
<field
type="status"
name="published"
label="COM_HELLO_WORLD_FILTER_PUBLISHED"
description="COM_HELLO_WORLD_FILTER_PUBLISHED_GREETINGS"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
<field
type="accesslevel"
name="access"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
multiple="true"
class="multipleAccessLevels"
onchange="this.form.submit();"
/>
<input type="hidden" name="form_submited" value="1"/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.id DESC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.greeting ASC">COM_HELLO_WORLD_FILTER_GREETING_ASCENDING</option>
<option value="a.greeting DESC">COM_HELLO_WORLD_FILTER_GREETING_DESCENDING</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="COM_CONTENT_LIST_LIMIT"
description="COM_CONTENT_LIST_LIMIT_DESC"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.js

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="hello_world greeting"
/>
<!-- Dynamic Fields. -->
<!-- Greeting Field. Type: Text. (joomla) -->
<field

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.php
@ -21,8 +21,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
/**
@ -204,23 +204,6 @@ class Hello_worldModelGreeting extends JModelAdmin
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// Modify the form based on Edit Greeting access controls.
if ($id != 0 && (!$user->authorise('greeting.edit.greeting', 'com_hello_world.greeting.' . (int) $id))
|| ($id == 0 && !$user->authorise('greeting.edit.greeting', 'com_hello_world')))
{
// Disable fields for display.
$form->setFieldAttribute('greeting', 'disabled', 'true');
// Disable fields for display.
$form->setFieldAttribute('greeting', 'readonly', 'true');
// If there is no value continue.
if (!$form->getValue('greeting'))
{
// Disable fields while saving.
$form->setFieldAttribute('greeting', 'filter', 'unset');
// Disable fields while saving.
$form->setFieldAttribute('greeting', 'required', 'false');
}
}
// Only load these values if no id is found
if (0 == $id)
{

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greetings.php
@ -35,6 +35,7 @@ class Hello_worldModelGreetings extends JModelList
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.access','access',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by',
@ -44,11 +45,17 @@ class Hello_worldModelGreetings extends JModelList
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
*/
protected function populateState($ordering = null, $direction = null)
{
@ -58,27 +65,39 @@ class Hello_worldModelGreetings extends JModelList
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
}
// Check if the form was submitted
$formSubmited = $app->input->post->get('form_submited');
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
if ($formSubmited)
{
$access = $app->input->post->get('access');
$this->setState('filter.access', $access);
}
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$greeting = $this->getUserStateFromRequest($this->context . '.filter.greeting', 'filter_greeting');
$this->setState('filter.greeting', $greeting);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
if ($formSubmited)
{
$greeting = $app->input->post->get('greeting');
$this->setState('filter.greeting', $greeting);
}
// List state information.
parent::populateState($ordering, $direction);
@ -135,9 +154,17 @@ class Hello_worldModelGreetings extends JModelList
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
$_access = $this->getState('filter.access');
if ($_access && is_numeric($_access))
{
$query->where('a.access = ' . (int) $access);
$query->where('a.access = ' . (int) $_access);
}
elseif (Hello_worldHelper::checkArray($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
// Filter by the Access Array.
$query->where('a.access IN (' . implode(',', $_access) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_hello_world'))
@ -163,7 +190,7 @@ class Hello_worldModelGreetings extends JModelList
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
$orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '')
{
$query->order($db->escape($orderCol . ' ' . $orderDirn));
@ -183,7 +210,7 @@ class Hello_worldModelGreetings extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (Hello_worldHelper::checkArray($pks))
if (($pks_size = Hello_worldHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -201,7 +228,24 @@ class Hello_worldModelGreetings extends JModelList
// From the hello_world_greeting table
$query->from($db->quoteName('#__hello_world_greeting', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_hello_world'))
{
@ -281,6 +325,18 @@ class Hello_worldModelGreetings extends JModelList
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
// Check if the value is an array
$_access = $this->getState('filter.access');
if (Hello_worldHelper::checkArray($_access))
{
$id .= ':' . implode(':', $_access);
}
// Check if this is only an number or string
elseif (is_numeric($_access)
|| Hello_worldHelper::checkString($_access))
{
$id .= ':' . $_access;
}
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php
@ -62,8 +62,8 @@ class Hello_worldModelHello_world extends JModelList
$viewName = $name;
$alt = $name;
$url = $url;
$image = $name.'.'.$type;
$name = 'COM_HELLO_WORLD_DASHBOARD_'.Hello_worldHelper::safeString($name,'U');
$image = $name . '.' . $type;
$name = 'COM_HELLO_WORLD_DASHBOARD_' . Hello_worldHelper::safeString($name,'U');
}
}
// internal views
@ -85,17 +85,27 @@ class Hello_worldModelHello_world extends JModelList
switch($action)
{
case 'add':
$url = 'index.php?option=com_hello_world&view='.$name.'&layout=edit';
$image = $name.'_'.$action.'.'.$type;
$alt = $name.'&nbsp;'.$action;
$url = 'index.php?option=com_hello_world&view=' . $name . '&layout=edit';
$image = $name . '_' . $action. '.' . $type;
$alt = $name . '&nbsp;' . $action;
$name = 'COM_HELLO_WORLD_DASHBOARD_'.Hello_worldHelper::safeString($name,'U').'_ADD';
$add = true;
break;
default:
$url = 'index.php?option=com_categories&view=categories&extension=com_hello_world.'.$name;
$image = $name.'_'.$action.'.'.$type;
$alt = $name.'&nbsp;'.$action;
$name = 'COM_HELLO_WORLD_DASHBOARD_'.Hello_worldHelper::safeString($name,'U').'_'.Hello_worldHelper::safeString($action,'U');
// check for new convention (more stable)
if (strpos($action, '_qpo0O0oqp_') !== false)
{
list($action, $extension) = (array) explode('_qpo0O0oqp_', $action);
$extension = str_replace('_po0O0oq_', '.', $extension);
}
else
{
$extension = 'com_hello_world.' . $name;
}
$url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
$image = $name . '_' . $action . '.' . $type;
$alt = $viewName . '&nbsp;' . $action;
$name = 'COM_HELLO_WORLD_DASHBOARD_' . Hello_worldHelper::safeString($name,'U') . '_' . Hello_worldHelper::safeString($action,'U');
break;
}
}
@ -103,9 +113,9 @@ class Hello_worldModelHello_world extends JModelList
{
$viewName = $name;
$alt = $name;
$url = 'index.php?option=com_hello_world&view='.$name;
$image = $name.'.'.$type;
$name = 'COM_HELLO_WORLD_DASHBOARD_'.Hello_worldHelper::safeString($name,'U');
$url = 'index.php?option=com_hello_world&view=' . $name;
$image = $name . '.' . $type;
$name = 'COM_HELLO_WORLD_DASHBOARD_' . Hello_worldHelper::safeString($name,'U');
$hover = false;
}
}
@ -113,8 +123,8 @@ class Hello_worldModelHello_world extends JModelList
{
$viewName = $view;
$alt = $view;
$url = 'index.php?option=com_hello_world&view='.$view;
$image = $view.'.png';
$url = 'index.php?option=com_hello_world&view=' . $view;
$image = $view . '.png';
$name = ucwords($view).'<br /><br />';
$hover = false;
}
@ -126,7 +136,7 @@ class Hello_worldModelHello_world extends JModelList
$dashboard_list = false;
$accessTo = '';
$accessAdd = '';
// acces checking start
// access checking start
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? Hello_worldHelper::checkString($viewAccess[$viewName.'.create']):false;
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? Hello_worldHelper::checkString($viewAccess[$viewName.'.access']):false;
// set main controllers
@ -141,7 +151,7 @@ class Hello_worldModelHello_world extends JModelList
{
$accessAdd = 'core.create';
}
// check if acces to view is set
// check if access to view is set
if ($accessAccess)
{
$accessTo = $viewAccess[$viewName.'.access'];

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage import.php
@ -435,7 +435,15 @@ class Hello_worldModelImport extends JModelLegacy
$jinput = JFactory::getApplication()->input;
foreach($target_headers as $header)
{
$data['target_headers'][$header] = $jinput->getString($header, null);
if (($column = $jinput->getString($header, false)) !== false ||
($column = $jinput->getString(strtolower($header), false)) !== false)
{
$data['target_headers'][$header] = $column;
}
else
{
$data['target_headers'][$header] = null;
}
}
// set the data
if(isset($package['dir']))

View File

@ -27,13 +27,3 @@ CREATE TABLE IF NOT EXISTS `#__hello_world_greeting` (
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
--
-- Always insure this column rules is large enough for all the access control values.
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.';
--
-- Always insure this column name is large enough for long component and view names.
--
ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.';

View File

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

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.php

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage submitbutton.js

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage edit.php
@ -21,10 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
@ -69,7 +69,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'greetingTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('core.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.state') || $this->canDo->get('core.edit.created')) : ?>
<?php if ($this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('core.edit.state') || ($this->canDo->get('core.delete') && $this->canDo->get('core.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'greetingTab', 'publishing', JText::_('COM_HELLO_WORLD_GREETING_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage view.html.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default.php
@ -19,76 +19,59 @@
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_HELLO_WORLD_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_hello_world&task=greetings.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'greetingList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<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_hello_world&view=greetings'); ?>" 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="greetingList">
<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_HELLO_WORLD_GREETINGS_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>
<form action="<?php echo JRoute::_('index.php?option=com_hello_world&view=greetings'); ?>" 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
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="greetingList">
<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_HELLO_WORLD_GREETINGS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<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 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default_batch_body.php
@ -19,7 +19,7 @@
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
?>

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default_batch_footer.php
@ -19,7 +19,7 @@
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
?>
<!-- clear the batch values if cancel -->

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default_body.php
@ -19,7 +19,7 @@
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
$edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit";
@ -34,11 +34,8 @@ $edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit";
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('core.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 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default_foot.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default_head.php
@ -25,7 +25,7 @@ defined('_JEXEC') or die('Restricted access');
<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::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
@ -39,11 +39,11 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_HELLO_WORLD_GREETING_GREETING_LABEL', 'a.greeting', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_HELLO_WORLD_GREETING_GREETING_LABEL', 'a.greeting', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('grid.sort', 'COM_HELLO_WORLD_GREETING_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_HELLO_WORLD_GREETING_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
@ -51,6 +51,6 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_HELLO_WORLD_GREETING_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_HELLO_WORLD_GREETING_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default_toolbar.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage view.html.php
@ -43,10 +43,14 @@ class Hello_worldViewGreetings extends JViewLegacy
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
$this->activeFilters = $this->get('ActiveFilters');
// Add the list ordering clause.
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'asc'));
$this->saveOrder = $this->listOrder == 'ordering';
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
@ -161,39 +165,26 @@ class Hello_worldViewGreetings extends JViewLegacy
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_hello_world');
}
if ($this->canState)
{
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);
// only load if batch allowed
if ($this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_HELLO_WORLD_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
}
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'),
'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_HELLO_WORLD_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_HELLO_WORLD_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
// Only load access batch if create, edit and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_HELLO_WORLD_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
}
@ -238,7 +229,7 @@ class Hello_worldViewGreetings extends JViewLegacy
protected function getSortFields()
{
return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.greeting' => JText::_('COM_HELLO_WORLD_GREETING_GREETING_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default_main.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default_vdm.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage view.html.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage view.html.php

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_HELLO_WORLD</name>
<creationDate>30th May, 2020</creationDate>
<creationDate>4th January, 2021</creationDate>
<author>Llewellyn</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>1.0.0</version>
<version>1.0.1</version>
<description><![CDATA[
<h1>Hello World (v.1.0.0)</h1>
<h1>Hello World (v.1.0.1)</h1>
<div style="clear: both;"></div>
<p></p>
<p>Created by <a href="https://www.vdm.io" target="_blank">Llewellyn</a><br /><small>Development started 20th September, 2017</small></p>
@ -97,6 +97,6 @@
</administration>
<updateservers>
<server type="extension" enabled="1" element="com_hello_world" name="Hello World">https://raw.githubusercontent.com/namibia/JCB-Hello-World/master/helloworld_updateserver.xml</server>
<server type="extension" enabled="1" element="com_hello_world" name="Hello World">https://raw.githubusercontent.com/Llewellynvdm/Joomla-Hello-World-Component/master/helloworld_updateserver.xml</server>
</updateservers>
</extension>

View File

@ -0,0 +1,19 @@
<updates>
<update>
<name>Hello World</name>
<description>Hello World</description>
<element>com_hello_world</element>
<type>component</type>
<version>1.0.1</version>
<infourl title="Hello World!">https://www.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/Llewellynvdm/Joomla-Hello-World-Component/archive/master.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn</maintainer>
<maintainerurl>https://www.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage script.php
@ -84,7 +84,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove greeting add queued success message.
// If successfully remove greeting add queued success message.
$app->enqueueMessage(JText::_('The fields with type (com_hello_world.greeting) context was removed from the <b>#__fields</b> table'));
}
// Also Remove greeting field values
@ -98,7 +98,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove greeting add queued success message.
// If successfully remove greeting add queued success message.
$app->enqueueMessage(JText::_('The fields values for greeting was removed from the <b>#__fields_values</b> table'));
}
}
@ -128,7 +128,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove greeting add queued success message.
// If successfully remove greeting add queued success message.
$app->enqueueMessage(JText::_('The field groups with type (com_hello_world.greeting) context was removed from the <b>#__fields_groups</b> table'));
}
}
@ -160,7 +160,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove greeting add queued success message.
// If successfully remove greeting add queued success message.
$app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the <b>#__content_type</b> table'));
}
@ -175,7 +175,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove greeting add queued success message.
// If successfully remove greeting add queued success message.
$app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -190,7 +190,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove greeting add queued success message.
// If successfully removed greeting add queued success message.
$app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -246,7 +246,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove Greeting add queued success message.
// If successfully remove Greeting add queued success message.
$app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the <b>#__content_type</b> table'));
}
@ -261,7 +261,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove Greeting add queued success message.
// If successfully remove Greeting add queued success message.
$app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -276,7 +276,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove Greeting add queued success message.
// If successfully removed Greeting add queued success message.
$app->enqueueMessage(JText::_('The (com_hello_world.greeting) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -320,7 +320,7 @@ class com_hello_worldInstallerScript
$greeting_done = $db->execute();
if ($greeting_done)
{
// If succesfully remove hello_world add queued success message.
// If successfully removed hello_world add queued success message.
$app->enqueueMessage(JText::_('All related items was removed from the <b>#__assets</b> table'));
}
@ -569,7 +569,7 @@ class com_hello_worldInstallerScript
echo '<a target="_blank" href="https://www.vdm.io" title="Hello World">
<img src="components/com_hello_world/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 1.0.0 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 1.0.1 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 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greet.css

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.css

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greetings.css

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage site.css

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage site.js

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage controller.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php
@ -20,6 +20,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tabstate');
// Set the component css/js
@ -28,7 +29,7 @@ $document->addStyleSheet('components/com_hello_world/assets/css/site.css');
$document->addScript('components/com_hello_world/assets/js/site.js');
// Require helper files
JLoader::register('Hello_worldHelper', __DIR__ . '/helpers/hello_world.php');
JLoader::register('Hello_worldHelper', __DIR__ . '/helpers/hello_world.php');
JLoader::register('Hello_worldHelperRoute', __DIR__ . '/helpers/route.php');
// Get an instance of the controller prefixed by Hello_world

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage category.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage headercheck.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php
@ -21,8 +21,9 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Language;
use Joomla\String\StringHelper;
use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
/**
@ -44,7 +45,7 @@ abstract class Hello_worldHelper
*/
public static $langTag;
/***[INSERTED$$$$]***//*69*/
/**
* Write a file to the server
*
@ -76,8 +77,8 @@ abstract class Hello_worldHelper
}
return $klaar;
}
/***[/INSERTED$$$$]***/
/***[INSERTED$$$$]***//*60*/
/**
* get the content of a file
*
@ -129,8 +130,8 @@ abstract class Hello_worldHelper
}
return $none;
}
/***[/INSERTED$$$$]***/
/***[INSERTED$$$$]***//*71*/
/**
* Remove folders with files
*
@ -203,7 +204,7 @@ abstract class Hello_worldHelper
}
return false;
}
/***[/INSERTED$$$$]***/
/**
* Load the Composer Vendors

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage route.php

View File

@ -3,6 +3,8 @@ COM_HELLO_WORLD="Hello World"
COM_HELLO_WORLD_CREATE_NEW_S="Create New %s"
COM_HELLO_WORLD_EDIT="Edit"
COM_HELLO_WORLD_EDIT_S="Edit %s"
COM_HELLO_WORLD_FILTER_GREETING_ASCENDING="Greeting ascending"
COM_HELLO_WORLD_FILTER_GREETING_DESCENDING="Greeting descending"
COM_HELLO_WORLD_GREET="Greeting"
COM_HELLO_WORLD_GREETING="Greeting"
COM_HELLO_WORLD_GREETINGS="Greetings"
@ -16,6 +18,8 @@ COM_HELLO_WORLD_GREETINGS_N_ITEMS_CHECKED_IN_1="%d Greeting successfully checked
COM_HELLO_WORLD_GREETINGS_N_ITEMS_CHECKED_IN_MORE="%d Greetings successfully checked in."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_DELETED="%s Greetings deleted."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_DELETED_1="%s Greeting deleted."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_FAILED_PUBLISHING="%s Greetings failed publishing."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_FAILED_PUBLISHING_1="%s Greeting failed publishing."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_FEATURED="%s Greetings featured."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_FEATURED_1="%s Greeting featured."
COM_HELLO_WORLD_GREETINGS_N_ITEMS_PUBLISHED="%s Greetings published."

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage details_left.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage metadata.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage publishing.php
@ -35,6 +35,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1];
// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created',
'created_by',
'modified',

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.js

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="hello_world greeting"
/>
<!-- Dynamic Fields. -->
<!-- Greeting Field. Type: Text. (joomla) -->
<field

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greet.php
@ -149,7 +149,7 @@ class Hello_worldModelGreet 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 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greeting.php
@ -21,8 +21,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
/**
@ -204,23 +204,6 @@ class Hello_worldModelGreeting extends JModelAdmin
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// Modify the form based on Edit Greeting access controls.
if ($id != 0 && (!$user->authorise('greeting.edit.greeting', 'com_hello_world.greeting.' . (int) $id))
|| ($id == 0 && !$user->authorise('greeting.edit.greeting', 'com_hello_world')))
{
// Disable fields for display.
$form->setFieldAttribute('greeting', 'disabled', 'true');
// Disable fields for display.
$form->setFieldAttribute('greeting', 'readonly', 'true');
// If there is no value continue.
if (!$form->getValue('greeting'))
{
// Disable fields while saving.
$form->setFieldAttribute('greeting', 'filter', 'unset');
// Disable fields while saving.
$form->setFieldAttribute('greeting', 'required', 'false');
}
}
// Only load these values if no id is found
if (0 == $id)
{

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage greetings.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage router.php

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default.php
@ -21,9 +21,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<?php echo $this->toolbar->render(); ?>
<!--[JCBGUI.site_view.default.51.$$$$]-->
<h2><?php echo $this->item->greeting; ?></h2><!--[/JCBGUI$$$$]-->
<h2><?php echo $this->item->greeting; ?></h2>

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage view.html.php
@ -136,8 +136,6 @@ class Hello_worldViewGreet extends JViewLegacy
*/
protected function addToolBar()
{
// adding the joomla toolbar to the front
JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php');
// set help url for this view if found
$help_url = Hello_worldHelper::getHelpUrl('greet');

View File

@ -2,8 +2,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage submitbutton.js

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage edit.php
@ -21,15 +21,15 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tabstate');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tabstate');
JHtml::_('behavior.calendar');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<div class="hello_world-greeting">
<?php echo $this->toolbar->render(); ?>
<form action="<?php echo JRoute::_('index.php?option=com_hello_world&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
@ -49,7 +49,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'greetingTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('core.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.state') || $this->canDo->get('core.edit.created')) : ?>
<?php if ($this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('core.edit.state') || ($this->canDo->get('core.delete') && $this->canDo->get('core.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'greetingTab', 'publishing', JText::_('COM_HELLO_WORLD_GREETING_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
@ -89,3 +89,4 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</div>
</div>
</form>
</div>

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage view.html.php
@ -86,10 +86,7 @@ class Hello_worldViewGreeting extends JViewLegacy
* Setting the toolbar
*/
protected function addToolBar()
{
// adding the joomla edit toolbar to the front
JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php');
JFactory::getApplication()->input->set('hidemainmenu', true);
{JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage default.php
@ -19,20 +19,15 @@
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
/***[JCBGUI.site_view.php_view.50.$$$$]***/
$edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit";/***[/JCBGUI$$$$]***/
$edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit";
?>
<?php echo $this->toolbar->render(); ?>
<!--[JCBGUI.site_view.default.50.$$$$]-->
<ul class="uk-list uk-list-striped">
<?php foreach ($this->items as $item): ?>
<li><?php echo JText::_('COM_HELLO_WORLD_GREETING'); ?>: <a href="<?php echo JRoute::_(Hello_worldHelperRoute::getGreetRoute($item->slug)); ?>"><?php echo $item->greeting; ?></a> <a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo JText::_('COM_HELLO_WORLD_EDIT'); ?></a></li>
<?php endforeach; ?>
</ul><!--[/JCBGUI$$$$]-->
</ul>

View File

@ -3,8 +3,8 @@
VDM
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
@build 30th May, 2020
@version 1.0.1
@build 4th January, 2021
@created 20th September, 2017
@package Hello World
@subpackage view.html.php
@ -107,8 +107,6 @@ class Hello_worldViewGreetings extends JViewLegacy
*/
protected function addToolBar()
{
// adding the joomla toolbar to the front
JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php');
// set help url for this view if found
$help_url = Hello_worldHelper::getHelpUrl('greetings');