Updated with JCB v2.12.4

This commit is contained in:
Llewellyn van der Merwe 2021-01-06 15:56:35 +02:00
parent f043be8516
commit 5168e0ef24
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
132 changed files with 920 additions and 656 deletions

View File

@ -2,7 +2,7 @@
This is a [Joomla 3.x](http://www.joomla.org/) component.
![Questions and Answers image](https://raw.githubusercontent.com/vdm-io/Joomla-Questions-and-Answers/master/admin/assets/images/vdm-component.jpg "The Questions and Answers")
![Questions and Answers image](https://github.com/Llewellynvdm/Joomla-Questions-and-Answers/raw/master/admin/assets/images/vdm-component.jpg "The Questions and Answers")
Just a basic Questions & Answers.
@ -12,23 +12,52 @@ Just a basic Questions & Answers.
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Questions and Answers](https://www.vdm.io/)
+ *First Build*: 30th January, 2017
+ *Last Build*: 30th May, 2020
+ *Last Build*: 6th January, 2021
+ *Version*: 1.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
# Component Number
+ *Line count*: **30682**
+ *Line count*: **30948**
+ *File count*: **202**
+ *Folder count*: **63**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/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/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

@ -2,7 +2,7 @@
This is a [Joomla 3.x](http://www.joomla.org/) component.
![Questions and Answers image](https://raw.githubusercontent.com/vdm-io/Joomla-Questions-and-Answers/master/admin/assets/images/vdm-component.jpg "The Questions and Answers")
![Questions and Answers image](https://github.com/Llewellynvdm/Joomla-Questions-and-Answers/raw/master/admin/assets/images/vdm-component.jpg "The Questions and Answers")
Just a basic Questions & Answers.
@ -12,23 +12,52 @@ Just a basic Questions & Answers.
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Questions and Answers](https://www.vdm.io/)
+ *First Build*: 30th January, 2017
+ *Last Build*: 30th May, 2020
+ *Last Build*: 6th January, 2021
+ *Version*: 1.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
# Component Number
+ *Line count*: **30682**
+ *Line count*: **30948**
+ *File count*: **202**
+ *Folder count*: **63**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/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/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

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage admin.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage dashboard.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help_document.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help_documents.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage question_and_answer.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage questions_and_answers.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage admin.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage controller.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage ajax.json.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage download.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help_document.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help_documents.php
@ -69,7 +69,7 @@ class QuestionsanswersControllerHelp_documents 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('Help_documents');
// get the data to export

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage question_and_answer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage questions_and_answers.php
@ -69,7 +69,7 @@ class QuestionsanswersControllerQuestions_and_answers 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('Questions_and_answers');
// get the data to export

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage questionsanswers.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage headercheck.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage batch_.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage questionsanswers.php
@ -26,8 +26,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;
@ -470,9 +471,9 @@ abstract class QuestionsanswersHelper
/**
* Change to nice fancy date
*/
public static function fancyDate($date)
public static function fancyDate($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -482,9 +483,9 @@ abstract class QuestionsanswersHelper
/**
* get date based in period past
*/
public static function fancyDynamicDate($date)
public static function fancyDynamicDate($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -508,9 +509,9 @@ abstract class QuestionsanswersHelper
/**
* Change to nice fancy day time and date
*/
public static function fancyDayTimeDate($time)
public static function fancyDayTimeDate($time, $check_stamp = true)
{
if (!self::isValidTimeStamp($time))
if ($check_stamp && !self::isValidTimeStamp($time))
{
$time = strtotime($time);
}
@ -520,9 +521,9 @@ abstract class QuestionsanswersHelper
/**
* Change to nice fancy time and date
*/
public static function fancyDateTime($time)
public static function fancyDateTime($time, $check_stamp = true)
{
if (!self::isValidTimeStamp($time))
if ($check_stamp && !self::isValidTimeStamp($time))
{
$time = strtotime($time);
}
@ -532,9 +533,9 @@ abstract class QuestionsanswersHelper
/**
* Change to nice hour:minutes time
*/
public static function fancyTime($time)
public static function fancyTime($time, $check_stamp = true)
{
if (!self::isValidTimeStamp($time))
if ($check_stamp && !self::isValidTimeStamp($time))
{
$time = strtotime($time);
}
@ -544,9 +545,9 @@ abstract class QuestionsanswersHelper
/**
* set the date day as Sunday through Saturday
*/
public static function setDayName($date)
public static function setDayName($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -556,9 +557,9 @@ abstract class QuestionsanswersHelper
/**
* set the date month as January through December
*/
public static function setMonthName($date)
public static function setMonthName($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -568,9 +569,9 @@ abstract class QuestionsanswersHelper
/**
* set the date day as 1st
*/
public static function setDay($date)
public static function setDay($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -580,9 +581,9 @@ abstract class QuestionsanswersHelper
/**
* set the date month as 5
*/
public static function setMonth($date)
public static function setMonth($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -592,9 +593,9 @@ abstract class QuestionsanswersHelper
/**
* set the date year as 2004 (for charts)
*/
public static function setYear($date)
public static function setYear($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -604,9 +605,9 @@ abstract class QuestionsanswersHelper
/**
* set the date as 2004/05 (for charts)
*/
public static function setYearMonth($date, $spacer = '/')
public static function setYearMonth($date, $spacer = '/', $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -616,15 +617,27 @@ abstract class QuestionsanswersHelper
/**
* set the date as 2004/05/03 (for charts)
*/
public static function setYearMonthDay($date, $spacer = '/')
public static function setYearMonthDay($date, $spacer = '/', $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
return date('Y' . $spacer . 'm' . $spacer . 'd', $date);
}
/**
* set the date as 03/05/2004
*/
public static function setDayMonthYear($date, $spacer = '/', $check_stamp = true)
{
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
return date('d' . $spacer . 'm' . $spacer . 'Y', $date);
}
/**
* Check if string is a valid time stamp
*/
@ -635,6 +648,16 @@ abstract class QuestionsanswersHelper
&& ($timestamp >= ~PHP_INT_MAX);
}
/**
* Check if string is a valid date
* https://www.php.net/manual/en/function.checkdate.php#113205
*/
public static function isValidateDate($date, $format = 'Y-m-d H:i:s')
{
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
}
/**
* prepare base64 string for url
@ -2259,6 +2282,8 @@ abstract class QuestionsanswersHelper
->setLastModifiedBy($modified)
->setTitle($title)
->setSubject($subjectTab);
// The file type
$file_type = 'Xls';
// set description
if ($description)
{
@ -2298,21 +2323,46 @@ abstract class QuestionsanswersHelper
));
// 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++;
}
@ -2332,7 +2382,7 @@ abstract class QuestionsanswersHelper
// 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');
@ -2343,7 +2393,7 @@ abstract class QuestionsanswersHelper
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

@ -122,6 +122,8 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_CHECKED_IN_1="%d Help Document succe
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_CHECKED_IN_MORE="%d Help Documents successfully checked in."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_DELETED="%s Help Documents deleted."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_DELETED_1="%s Help Document deleted."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FAILED_PUBLISHING="%s Help Documents failed publishing."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FAILED_PUBLISHING_1="%s Help Document failed publishing."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FEATURED="%s Help Documents featured."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FEATURED_1="%s Help Document featured."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_PUBLISHED="%s Help Documents published."
@ -168,7 +170,6 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENT_MODIFIED_DATE_LABEL="Modified Date"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_NEW="A New Help Document"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_NOT_REQUIRED="Not Required"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_ORDERING_LABEL="Ordering"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_PERMISSION="Permissions"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_PUBLISHING="Publishing"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Help Document to customise the alias."
COM_QUESTIONSANSWERS_HELP_DOCUMENT_SELECT_AN_OPTION="Select an option"
@ -296,6 +297,8 @@ COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_CHECKED_IN_1="%d Question and
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_CHECKED_IN_MORE="%d Questions and Answers successfully checked in."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_DELETED="%s Questions and Answers deleted."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_DELETED_1="%s Question and Answer deleted."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FAILED_PUBLISHING="%s Questions and Answers failed publishing."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FAILED_PUBLISHING_1="%s Question and Answer failed publishing."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FEATURED="%s Questions and Answers featured."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FEATURED_1="%s Question and Answer featured."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_PUBLISHED="%s Questions and Answers published."

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage batchselection.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage details_above.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage details_left.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage details_right.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage details_under.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage publlshing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage details_rightside.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage details_under.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage metadata.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage publishing.php
@ -40,6 +40,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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage ajax.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage adminviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage alloweddocumentformats.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage allowedimageformats.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage articles.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage siteviewfolderlist.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help_document.js

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage question_and_answer.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="questionsanswers question_and_answer"
/>
<!-- Dynamic Fields. -->
<!-- Question Field. Type: Textarea. (joomla) -->
<field

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help_document.php
@ -26,8 +26,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;
/**
@ -429,7 +429,7 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (QuestionsanswersHelper::checkString($data['not_required']))
if (isset($data['not_required']) && QuestionsanswersHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help_documents.php
@ -43,21 +43,27 @@ class QuestionsanswersModelHelp_documents extends JModelList
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by',
'a.title','title',
'a.type','type',
'a.location','location',
'g.',
'h.'
'a.admin_view','admin_view',
'a.site_view','site_view',
'a.title','title'
);
}
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)
{
@ -67,9 +73,25 @@ class QuestionsanswersModelHelp_documents extends JModelList
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
$title = $this->getUserStateFromRequest($this->context . '.filter.title', 'filter_title');
$this->setState('filter.title', $title);
}
$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);
$type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type');
$this->setState('filter.type', $type);
@ -81,25 +103,10 @@ class QuestionsanswersModelHelp_documents extends JModelList
$this->setState('filter.admin_view', $admin_view);
$site_view = $this->getUserStateFromRequest($this->context . '.filter.site_view', 'filter_site_view');
$this->setState('filter.site_view', $site_view);
$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);
$this->setState('filter.site_view', $site_view);
$title = $this->getUserStateFromRequest($this->context . '.filter.title', 'filter_title');
$this->setState('filter.title', $title);
// List state information.
parent::populateState($ordering, $direction);
@ -250,29 +257,77 @@ class QuestionsanswersModelHelp_documents extends JModelList
}
// Filter by Type.
if ($type = $this->getState('filter.type'))
$_type = $this->getState('filter.type');
if (is_numeric($_type))
{
$query->where('a.type = ' . $db->quote($db->escape($type)));
if (is_float($_type))
{
$query->where('a.type = ' . (float) $_type);
}
else
{
$query->where('a.type = ' . (int) $_type);
}
}
elseif (QuestionsanswersHelper::checkString($_type))
{
$query->where('a.type = ' . $db->quote($db->escape($_type)));
}
// Filter by Location.
if ($location = $this->getState('filter.location'))
$_location = $this->getState('filter.location');
if (is_numeric($_location))
{
$query->where('a.location = ' . $db->quote($db->escape($location)));
if (is_float($_location))
{
$query->where('a.location = ' . (float) $_location);
}
else
{
$query->where('a.location = ' . (int) $_location);
}
}
// Filter by admin_view.
if ($admin_view = $this->getState('filter.admin_view'))
elseif (QuestionsanswersHelper::checkString($_location))
{
$query->where('a.admin_view = ' . $db->quote($db->escape($admin_view)));
$query->where('a.location = ' . $db->quote($db->escape($_location)));
}
// Filter by site_view.
if ($site_view = $this->getState('filter.site_view'))
// Filter by Admin_view.
$_admin_view = $this->getState('filter.admin_view');
if (is_numeric($_admin_view))
{
$query->where('a.site_view = ' . $db->quote($db->escape($site_view)));
if (is_float($_admin_view))
{
$query->where('a.admin_view = ' . (float) $_admin_view);
}
else
{
$query->where('a.admin_view = ' . (int) $_admin_view);
}
}
elseif (QuestionsanswersHelper::checkString($_admin_view))
{
$query->where('a.admin_view = ' . $db->quote($db->escape($_admin_view)));
}
// Filter by Site_view.
$_site_view = $this->getState('filter.site_view');
if (is_numeric($_site_view))
{
if (is_float($_site_view))
{
$query->where('a.site_view = ' . (float) $_site_view);
}
else
{
$query->where('a.site_view = ' . (int) $_site_view);
}
}
elseif (QuestionsanswersHelper::checkString($_site_view))
{
$query->where('a.site_view = ' . $db->quote($db->escape($_site_view)));
}
// 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));
@ -292,7 +347,7 @@ class QuestionsanswersModelHelp_documents extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (QuestionsanswersHelper::checkArray($pks))
if (($pks_size = QuestionsanswersHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -310,7 +365,24 @@ class QuestionsanswersModelHelp_documents extends JModelList
// From the questionsanswers_help_document table
$query->from($db->quoteName('#__questionsanswers_help_document', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');
@ -395,11 +467,11 @@ class QuestionsanswersModelHelp_documents extends JModelList
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');
$id .= ':' . $this->getState('filter.title');
$id .= ':' . $this->getState('filter.type');
$id .= ':' . $this->getState('filter.location');
$id .= ':' . $this->getState('filter.admin_view');
$id .= ':' . $this->getState('filter.site_view');
$id .= ':' . $this->getState('filter.site_view');
$id .= ':' . $this->getState('filter.title');
return parent::getStoreId($id);
}

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage import.php
@ -440,7 +440,15 @@ class QuestionsanswersModelImport 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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage question_and_answer.php
@ -26,8 +26,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;
/**

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage questions_and_answers.php
@ -40,24 +40,31 @@ class QuestionsanswersModelQuestions_and_answers 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',
'a.question','question',
'a.answer','answer',
'c.title','category_title',
'c.id', 'category_id',
'a.catid', 'catid'
'a.catid','catid',
'a.question','question',
'a.answer','answer'
);
}
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)
{
@ -67,12 +74,25 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
$question = $this->getUserStateFromRequest($this->context . '.filter.question', 'filter_question');
$this->setState('filter.question', $question);
}
$answer = $this->getUserStateFromRequest($this->context . '.filter.answer', 'filter_answer');
$this->setState('filter.answer', $answer);
$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);
$category = $app->getUserStateFromRequest($this->context . '.filter.category', 'filter_category');
$this->setState('filter.category', $category);
@ -80,26 +100,14 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id');
$this->setState('filter.category_id', $categoryId);
$catid = $app->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid');
$this->setState('filter.catid', $catid);
$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);
$catid = $this->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid');
$this->setState('filter.catid', $catid);
$question = $this->getUserStateFromRequest($this->context . '.filter.question', 'filter_question');
$this->setState('filter.question', $question);
$answer = $this->getUserStateFromRequest($this->context . '.filter.answer', 'filter_answer');
$this->setState('filter.answer', $answer);
// List state information.
parent::populateState($ordering, $direction);
@ -179,9 +187,17 @@ class QuestionsanswersModelQuestions_and_answers 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 (QuestionsanswersHelper::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_questionsanswers'))
@ -221,9 +237,9 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
}
elseif (is_array($categoryId))
{
ArrayHelper::toInteger($categoryId);
$categoryId = ArrayHelper::toInteger($categoryId);
$categoryId = implode(',', $categoryId);
$query->where('a.category IN (' . $categoryId . ')');
$query->where('a.catid IN (' . $categoryId . ')');
}
@ -249,7 +265,7 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (QuestionsanswersHelper::checkArray($pks))
if (($pks_size = QuestionsanswersHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -267,7 +283,24 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
// From the questionsanswers_question_and_answer table
$query->from($db->quoteName('#__questionsanswers_question_and_answer', '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_questionsanswers'))
{
@ -370,14 +403,15 @@ class QuestionsanswersModelQuestions_and_answers 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');
$id .= ':' . $this->getState('filter.question');
$id .= ':' . $this->getState('filter.answer');
$id .= ':' . $this->getState('filter.category');
$id .= ':' . $this->getState('filter.category_id');
$id .= ':' . $this->getState('filter.catid');
$id .= ':' . $this->getState('filter.catid');
$id .= ':' . $this->getState('filter.question');
$id .= ':' . $this->getState('filter.answer');
return parent::getStoreId($id);
}

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage questionsanswers.php
@ -39,7 +39,7 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
$icons = array();
// view groups array
$viewGroups = array(
'main' => array('png.question_and_answer.add', 'png.questions_and_answers', 'png.questions_and_answers.catid', 'png.help_documents')
'main' => array('png.question_and_answer.add', 'png.questions_and_answers', 'png.questions_and_answers.catid_qpo0O0oqp_com_questionsanswers_po0O0oq_question_and_answer', 'png.help_documents')
);
// view access array
$viewAccess = array(
@ -73,8 +73,8 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
$viewName = $name;
$alt = $name;
$url = $url;
$image = $name.'.'.$type;
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_'.QuestionsanswersHelper::safeString($name,'U');
$image = $name . '.' . $type;
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U');
}
}
// internal views
@ -96,17 +96,27 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
switch($action)
{
case 'add':
$url = 'index.php?option=com_questionsanswers&view='.$name.'&layout=edit';
$image = $name.'_'.$action.'.'.$type;
$alt = $name.'&nbsp;'.$action;
$url = 'index.php?option=com_questionsanswers&view=' . $name . '&layout=edit';
$image = $name . '_' . $action. '.' . $type;
$alt = $name . '&nbsp;' . $action;
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_'.QuestionsanswersHelper::safeString($name,'U').'_ADD';
$add = true;
break;
default:
$url = 'index.php?option=com_categories&view=categories&extension=com_questionsanswers.'.$name;
$image = $name.'_'.$action.'.'.$type;
$alt = $name.'&nbsp;'.$action;
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_'.QuestionsanswersHelper::safeString($name,'U').'_'.QuestionsanswersHelper::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_questionsanswers.' . $name;
}
$url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
$image = $name . '_' . $action . '.' . $type;
$alt = $viewName . '&nbsp;' . $action;
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U') . '_' . QuestionsanswersHelper::safeString($action,'U');
break;
}
}
@ -114,9 +124,9 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
{
$viewName = $name;
$alt = $name;
$url = 'index.php?option=com_questionsanswers&view='.$name;
$image = $name.'.'.$type;
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_'.QuestionsanswersHelper::safeString($name,'U');
$url = 'index.php?option=com_questionsanswers&view=' . $name;
$image = $name . '.' . $type;
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U');
$hover = false;
}
}
@ -124,8 +134,8 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
{
$viewName = $view;
$alt = $view;
$url = 'index.php?option=com_questionsanswers&view='.$view;
$image = $view.'.png';
$url = 'index.php?option=com_questionsanswers&view=' . $view;
$image = $view . '.png';
$name = ucwords($view).'<br /><br />';
$hover = false;
}
@ -137,7 +147,7 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
$dashboard_list = false;
$accessTo = '';
$accessAdd = '';
// acces checking start
// access checking start
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.create']):false;
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.access']):false;
// set main controllers
@ -152,7 +162,7 @@ class QuestionsanswersModelQuestionsanswers 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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage questionsanswers.php
@ -25,6 +25,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tabstate');
// Access check.

View File

@ -69,13 +69,3 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_help_document` (
) 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,2 +1,3 @@
DROP TABLE IF EXISTS `#__questionsanswers_question_and_answer`;
DROP TABLE IF EXISTS `#__questionsanswers_help_document`;

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help_document.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage question_and_answer.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage submitbutton.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage edit.php
@ -26,10 +26,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 = 'help_documentTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('help_document.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('help_document.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('help_document.edit.state') || ($this->canDo->get('help_document.delete') && $this->canDo->get('help_document.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'help_documentTab', 'publishing', JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
@ -96,25 +96,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'help_documentTab', 'permissions', JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
<div class="adminformlist">
<?php foreach ($this->form->getFieldset('accesscontrol') as $field): ?>
<div>
<?php echo $field->label; echo $field->input;?>
</div>
<div class="clearfix"></div>
<?php endforeach; ?>
</div>
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<div>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage view.html.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default.php
@ -24,76 +24,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_questionsanswers&task=help_documents.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'help_documentList', '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_questionsanswers&view=help_documents'); ?>" 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="help_documentList">
<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_QUESTIONSANSWERS_HELP_DOCUMENTS_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_questionsanswers&view=help_documents'); ?>" 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="help_documentList">
<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_QUESTIONSANSWERS_HELP_DOCUMENTS_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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_batch_body.php
@ -24,7 +24,7 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
?>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_batch_footer.php
@ -24,7 +24,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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_body.php
@ -24,7 +24,7 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
$edit = "index.php?option=com_questionsanswers&view=help_documents&task=help_document.edit";
@ -39,11 +39,8 @@ $edit = "index.php?option=com_questionsanswers&view=help_documents&task=help_doc
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('help_document.edit.state')): ?>
<?php
if ($this->saveOrder)
{
$iconClass = ' inactive';
}
else
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_foot.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_head.php
@ -30,7 +30,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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_toolbar.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage view.html.php
@ -50,8 +50,8 @@ class QuestionsanswersViewHelp_documents 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
@ -166,39 +166,16 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_questionsanswers');
}
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_QUESTIONSANSWERS_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_QUESTIONSANSWERS_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)
);
}
// Set Type Selection
@ -219,16 +196,6 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
'filter_type',
JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Type Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_LABEL').' -',
'batch[type]',
JHtml::_('select.options', $this->typeOptions, 'value', 'text')
);
}
}
// Set Location Selection
@ -249,16 +216,6 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
'filter_location',
JHtml::_('select.options', $this->locationOptions, 'value', 'text', $this->state->get('filter.location'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Location Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_LOCATION_LABEL').' -',
'batch[location]',
JHtml::_('select.options', $this->locationOptions, 'value', 'text')
);
}
}
// Set Admin View Selection
@ -275,20 +232,10 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
{
// Admin View Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -',
'- Select ' . JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW_LABEL') . ' -',
'filter_admin_view',
JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text', $this->state->get('filter.admin_view'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Admin View Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -',
'batch[admin_view]',
JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text')
);
}
}
// Set Site View Selection
@ -305,20 +252,64 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
{
// Site View Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_SITE_VIEW_LABEL').' -',
'- Select ' . JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_SITE_VIEW_LABEL') . ' -',
'filter_site_view',
JHtml::_('select.options', $this->site_viewOptions, 'value', 'text', $this->state->get('filter.site_view'))
);
}
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Site View Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_SITE_VIEW_LABEL').' -',
'batch[site_view]',
JHtml::_('select.options', $this->site_viewOptions, 'value', 'text')
);
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_QUESTIONSANSWERS_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
// Only load Type batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Type Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_LABEL').' -',
'batch[type]',
JHtml::_('select.options', $this->typeOptions, 'value', 'text')
);
}
// Only load Location batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Location Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_LOCATION_LABEL').' -',
'batch[location]',
JHtml::_('select.options', $this->locationOptions, 'value', 'text')
);
}
// Only load Admin View batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Admin View Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -',
'batch[admin_view]',
JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text')
);
}
// Only load Site View batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Site View Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_SITE_VIEW_LABEL').' -',
'batch[site_view]',
JHtml::_('select.options', $this->site_viewOptions, 'value', 'text')
);
}
}
@ -363,7 +354,7 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
protected function getSortFields()
{
return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.title' => JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_TITLE_LABEL'),
'a.type' => JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_LABEL'),
@ -391,13 +382,13 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
$db->setQuery($query);
$results = $db->loadColumn();
$_filter = array();
if ($results)
{
// get model
$model = $this->getModel();
$results = array_unique($results);
$_filter = array();
foreach ($results as $type)
{
// Translate the type selection
@ -405,9 +396,8 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
// Now add the type and its text to the options array
$_filter[] = JHtml::_('select.option', $type, JText::_($text));
}
return $_filter;
}
return false;
return $_filter;
}
protected function getTheLocationSelections()
@ -427,13 +417,13 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
$db->setQuery($query);
$results = $db->loadColumn();
$_filter = array();
if ($results)
{
// get model
$model = $this->getModel();
$results = array_unique($results);
$_filter = array();
foreach ($results as $location)
{
// Translate the location selection
@ -441,8 +431,7 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
// Now add the location and its text to the options array
$_filter[] = JHtml::_('select.option', $location, JText::_($text));
}
return $_filter;
}
return false;
return $_filter;
}
}

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage view.html.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage submitbutton.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage edit.php
@ -26,10 +26,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
?>
@ -77,7 +77,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'question_and_answerTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('question_and_answer.delete') || $this->canDo->get('question_and_answer.edit.created_by') || $this->canDo->get('question_and_answer.edit.state') || $this->canDo->get('question_and_answer.edit.created')) : ?>
<?php if ($this->canDo->get('question_and_answer.edit.created_by') || $this->canDo->get('question_and_answer.edit.created') || $this->canDo->get('question_and_answer.edit.state') || ($this->canDo->get('question_and_answer.delete') && $this->canDo->get('question_and_answer.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'question_and_answerTab', 'publishing', JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
@ -422,7 +422,7 @@ function JRouter(link) {
function getFile(filename, fileFormat, target, type){
// set uikit version
var uiVer = <?php echo (int) $this->params->get('uikit_version', 2); ?>;
var uiVer = <?php echo (int) $this->params->get('uikit_version', 3); ?>;
// set the link
var link = '<?php echo QuestionsanswersHelper::getFolderPath('url'); ?>';
// build the return
@ -486,7 +486,7 @@ function getFile(filename, fileFormat, target, type){
var theplaceholder = '<div class="uk-width-1-1"><div class="uk-panel uk-panel-box"><center><code>[DOCLINK='+fileName+']</code> <?php echo JText::_('COM_QUESTIONSANSWERS_OR'); ?> <code>[DOCBUTTON='+fileName+']</code><br /><?php echo JText::_('COM_QUESTIONSANSWERS_ADD_ONE_OF_THESE_PLACEHOLDERS_IN_TEXT_FOR_CUSTOM_DOWNLOAD_PLACEMENT'); ?>.</center></div></div>';
// get the download link if set
var thedownload = '';
if (documentsLinks.hasOwnProperty(item)) {
if (typeof documentsLinks !== 'undefined' && documentsLinks.hasOwnProperty(item)) {
thedownload = '<a href="'+JRouter(documentsLinks[item])+'" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-success"><i class="uk-icon-download"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_DOWNLOAD'); ?> '+fileName+'</a>';
}
var thedelete = '<button onclick="removeFileCheck(\''+item+'\', \''+target+'\', \''+type+'\', \''+uiVer+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+fileName+'</button>';

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage view.html.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default.php
@ -24,76 +24,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_questionsanswers&task=questions_and_answers.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'question_and_answerList', '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_questionsanswers&view=questions_and_answers'); ?>" 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="question_and_answerList">
<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_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_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_questionsanswers&view=questions_and_answers'); ?>" 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="question_and_answerList">
<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_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_batch_body.php
@ -24,7 +24,7 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
?>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_batch_footer.php
@ -24,7 +24,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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_body.php
@ -24,7 +24,7 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
$edit = "index.php?option=com_questionsanswers&view=questions_and_answers&task=question_and_answer.edit";
@ -39,11 +39,8 @@ $edit = "index.php?option=com_questionsanswers&view=questions_and_answers&task=q
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('question_and_answer.edit.state')): ?>
<?php
if ($this->saveOrder)
{
$iconClass = ' inactive';
}
else
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_foot.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_head.php
@ -30,7 +30,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

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_toolbar.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage view.html.php
@ -51,7 +51,7 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
// 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', 'desc'));
$this->saveOrder = $this->listOrder == 'ordering';
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
@ -166,41 +166,24 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_questionsanswers');
}
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_QUESTIONSANSWERS_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_QUESTIONSANSWERS_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'))
);
// Category Filter.
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_CATEGORY'),
@ -208,6 +191,26 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
JHtml::_('select.options', JHtml::_('category.options', 'com_questionsanswers.question_and_answer'), 'value', 'text', $this->state->get('filter.category_id'))
);
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_QUESTIONSANSWERS_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_QUESTIONSANSWERS_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Category Batch selection.
@ -260,7 +263,7 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
protected function getSortFields()
{
return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.question' => JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_QUESTION_LABEL'),
'a.answer' => JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_LABEL'),

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_main.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_readme_information.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_vast_development_method_notice_board.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage default_vdm.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage view.html.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage A4.print.css

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_QUESTIONSANSWERS</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>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage script.php
@ -89,7 +89,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_done = $db->execute();
if ($question_and_answer_done)
{
// If succesfully remove Question_and_answer add queued success message.
// If successfully remove Question_and_answer add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__content_type</b> table'));
}
@ -104,7 +104,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_done = $db->execute();
if ($question_and_answer_done)
{
// If succesfully remove Question_and_answer add queued success message.
// If successfully remove Question_and_answer add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -119,7 +119,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_done = $db->execute();
if ($question_and_answer_done)
{
// If succesfully remove Question_and_answer add queued success message.
// If successfully removed Question_and_answer add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -175,7 +175,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_catid_done = $db->execute();
if ($question_and_answer_catid_done)
{
// If succesfully remove Question_and_answer catid add queued success message.
// If successfully remove Question_and_answer catid add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__content_type</b> table'));
}
@ -190,7 +190,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_catid_done = $db->execute();
if ($question_and_answer_catid_done)
{
// If succesfully remove Question_and_answer catid add queued success message.
// If successfully remove Question_and_answer catid add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -205,7 +205,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_catid_done = $db->execute();
if ($question_and_answer_catid_done)
{
// If succesfully remove Question_and_answer catid add queued success message.
// If successfully removed Question_and_answer catid add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -261,7 +261,7 @@ class com_questionsanswersInstallerScript
$help_document_done = $db->execute();
if ($help_document_done)
{
// If succesfully remove Help_document add queued success message.
// If successfully remove Help_document add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__content_type</b> table'));
}
@ -276,7 +276,7 @@ class com_questionsanswersInstallerScript
$help_document_done = $db->execute();
if ($help_document_done)
{
// If succesfully remove Help_document add queued success message.
// If successfully remove Help_document add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -291,7 +291,7 @@ class com_questionsanswersInstallerScript
$help_document_done = $db->execute();
if ($help_document_done)
{
// If succesfully remove Help_document add queued success message.
// If successfully removed Help_document add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -335,10 +335,31 @@ class com_questionsanswersInstallerScript
$help_document_done = $db->execute();
if ($help_document_done)
{
// If succesfully remove questionsanswers add queued success message.
// If successfully removed questionsanswers 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))
@ -602,9 +623,9 @@ class com_questionsanswersInstallerScript
$help_document->type_title = 'Questionsanswers Help_document';
$help_document->type_alias = 'com_questionsanswers.help_document';
$help_document->table = '{"special": {"dbtable": "#__questionsanswers_help_document","key": "id","type": "Help_document","prefix": "questionsanswersTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}';
$help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}';
$help_document->router = 'QuestionsanswersHelperRoute::getHelp_documentRoute';
$help_document->content_history_options = '{"formFile": "administrator/components/com_questionsanswers/models/forms/help_document.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","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}';
$help_document->content_history_options = '{"formFile": "administrator/components/com_questionsanswers/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}';
// Set the object into the content types table.
$help_document_Inserted = $db->insertObject('#__content_types', $help_document);
@ -624,6 +645,22 @@ class com_questionsanswersInstallerScript
$db->setQuery($query);
$allDone = $db->execute();
// 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 <= 7520)
{
// 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="Questions and Answers">
<img src="components/com_questionsanswers/assets/images/vdm-component.jpg"/>
</a>';
@ -744,9 +781,9 @@ class com_questionsanswersInstallerScript
$help_document->type_title = 'Questionsanswers Help_document';
$help_document->type_alias = 'com_questionsanswers.help_document';
$help_document->table = '{"special": {"dbtable": "#__questionsanswers_help_document","key": "id","type": "Help_document","prefix": "questionsanswersTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}';
$help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}';
$help_document->router = 'QuestionsanswersHelperRoute::getHelp_documentRoute';
$help_document->content_history_options = '{"formFile": "administrator/components/com_questionsanswers/models/forms/help_document.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","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}';
$help_document->content_history_options = '{"formFile": "administrator/components/com_questionsanswers/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}';
// Check if help_document type is already in content_type DB.
$help_document_id = null;

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage category.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage downloads.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage question_and_answer.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage questions_and_answers.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage site.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage site.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage controller.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage ajax.json.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage download.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x
@build 30th May, 2020
@build 6th January, 2021
@created 30th January, 2017
@package Questions and Answers
@subpackage question_and_answer.php

Some files were not shown because too many files have changed in this diff Show More