From fe2a157145fb04ec6b3d4b2f0e2840bfb1f5b163 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 14 Aug 2019 04:00:02 +0200 Subject: [PATCH] Updated with JCB v2.10.0 --- README.md | 4 +- admin/README.txt | 4 +- admin/assets/css/admin.css | 2 +- admin/assets/css/dashboard.css | 2 +- admin/assets/css/help_document.css | 2 +- admin/assets/css/help_documents.css | 2 +- admin/assets/css/question_and_answer.css | 2 +- admin/assets/css/questions_and_answers.css | 2 +- admin/assets/js/admin.js | 2 +- admin/controller.php | 2 +- admin/controllers/ajax.json.php | 4 +- admin/controllers/download.php | 2 +- admin/controllers/help.php | 2 +- admin/controllers/help_document.php | 2 +- admin/controllers/help_documents.php | 2 +- admin/controllers/import.php | 2 +- admin/controllers/question_and_answer.php | 2 +- admin/controllers/questions_and_answers.php | 2 +- admin/controllers/questionsanswers.php | 2 +- admin/helpers/headercheck.php | 2 +- admin/helpers/html/batch_.php | 2 +- admin/helpers/questionsanswers.php | 30 ++++---- .../en-GB/en-GB.com_questionsanswers.ini | 20 +++-- .../en-GB/en-GB.com_questionsanswers.sys.ini | 12 +-- admin/layouts/batchselection.php | 2 +- admin/layouts/help_document/details_above.php | 17 ++++- .../help_document/details_fullwidth.php | 17 ++++- admin/layouts/help_document/details_left.php | 17 ++++- admin/layouts/help_document/details_right.php | 17 ++++- admin/layouts/help_document/details_under.php | 17 ++++- admin/layouts/help_document/publishing.php | 17 ++++- admin/layouts/help_document/publlshing.php | 17 ++++- .../question_and_answer/details_fullwidth.php | 17 ++++- .../question_and_answer/details_rightside.php | 17 ++++- .../question_and_answer/details_under.php | 17 ++++- .../layouts/question_and_answer/metadata.php | 2 +- .../question_and_answer/publishing.php | 17 ++++- admin/models/ajax.php | 2 +- admin/models/fields/adminviewfolderlist.php | 2 +- admin/models/fields/articles.php | 2 +- admin/models/fields/siteviewfolderlist.php | 2 +- admin/models/forms/help_document.js | 31 ++------ admin/models/forms/help_document.xml | 1 - admin/models/forms/question_and_answer.js | 2 +- admin/models/help_document.php | 38 +++++++++- admin/models/help_documents.php | 2 +- admin/models/import.php | 2 +- admin/models/question_and_answer.php | 29 +++++++- admin/models/questions_and_answers.php | 2 +- admin/models/questionsanswers.php | 2 +- admin/questionsanswers.php | 2 +- admin/tables/help_document.php | 2 +- admin/tables/question_and_answer.php | 2 +- admin/views/help_document/submitbutton.js | 2 +- admin/views/help_document/tmpl/edit.php | 2 +- admin/views/help_document/view.html.php | 2 +- admin/views/help_documents/tmpl/default.php | 2 +- .../tmpl/default_batch_body.php | 2 +- .../tmpl/default_batch_footer.php | 2 +- .../help_documents/tmpl/default_body.php | 2 +- .../help_documents/tmpl/default_foot.php | 2 +- .../help_documents/tmpl/default_head.php | 2 +- .../help_documents/tmpl/default_toolbar.php | 2 +- admin/views/help_documents/view.html.php | 2 +- admin/views/import/tmpl/default.php | 2 +- admin/views/import/view.html.php | 2 +- .../views/question_and_answer/submitbutton.js | 2 +- admin/views/question_and_answer/tmpl/edit.php | 2 +- admin/views/question_and_answer/view.html.php | 2 +- .../questions_and_answers/tmpl/default.php | 2 +- .../tmpl/default_batch_body.php | 2 +- .../tmpl/default_batch_footer.php | 2 +- .../tmpl/default_body.php | 2 +- .../tmpl/default_foot.php | 2 +- .../tmpl/default_head.php | 2 +- .../tmpl/default_toolbar.php | 2 +- .../views/questions_and_answers/view.html.php | 2 +- admin/views/questionsanswers/tmpl/default.php | 2 +- .../questionsanswers/tmpl/default_main.php | 2 +- .../tmpl/default_readme_information.php | 2 +- ...t_vast_development_method_notice_board.php | 2 +- .../questionsanswers/tmpl/default_vdm.php | 2 +- admin/views/questionsanswers/view.html.php | 2 +- media/css/A4.print.css | 2 +- questionsanswers.xml | 11 +-- script.php | 73 +++++++++++-------- site/assets/css/category.css | 2 +- site/assets/css/downloads.css | 2 +- site/assets/css/question_and_answer.css | 2 +- site/assets/css/questions_and_answers.css | 2 +- site/assets/css/site.css | 2 +- site/assets/js/site.js | 2 +- site/controller.php | 2 +- site/controllers/ajax.json.php | 4 +- site/controllers/download.php | 2 +- site/controllers/help.php | 2 +- site/controllers/question_and_answer.php | 2 +- site/helpers/category.php | 2 +- .../helpers/categoryquestions_and_answers.php | 2 +- site/helpers/headercheck.php | 2 +- site/helpers/questionsanswers.php | 30 ++++---- site/helpers/route.php | 2 +- .../en-GB/en-GB.com_questionsanswers.ini | 10 +-- .../en-GB/en-GB.com_questionsanswers.sys.ini | 2 +- .../question_and_answer/details_fullwidth.php | 17 ++++- .../question_and_answer/details_rightside.php | 17 ++++- .../question_and_answer/details_under.php | 17 ++++- site/layouts/question_and_answer/metadata.php | 2 +- .../question_and_answer/publishing.php | 17 ++++- site/models/ajax.php | 2 +- site/models/category.php | 2 +- site/models/downloads.php | 2 +- site/models/forms/question_and_answer.js | 2 +- site/models/question_and_answer.php | 29 +++++++- site/models/questions_and_answers.php | 2 +- site/questionsanswers.php | 2 +- site/router.php | 4 +- site/views/category/tmpl/default.php | 2 +- .../views/category/tmpl/default_qna-table.php | 2 +- site/views/category/view.html.php | 2 +- site/views/downloads/tmpl/default.php | 2 +- .../tmpl/default_qna-downloads-table.php | 2 +- site/views/downloads/view.html.php | 2 +- .../views/question_and_answer/submitbutton.js | 2 +- site/views/question_and_answer/tmpl/edit.php | 2 +- site/views/question_and_answer/view.html.php | 2 +- .../questions_and_answers/tmpl/default.php | 2 +- .../tmpl/default_qna-table.php | 2 +- .../views/questions_and_answers/view.html.php | 2 +- 129 files changed, 524 insertions(+), 259 deletions(-) diff --git a/README.md b/README.md index de9919f..2e17cec 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ 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*: 12th June, 2019 ++ *Last Build*: 14th August, 2019 + *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*: **29039** ++ *Line count*: **29308** + *File count*: **201** + *Folder count*: **62** diff --git a/admin/README.txt b/admin/README.txt index de9919f..2e17cec 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,14 +12,14 @@ 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*: 12th June, 2019 ++ *Last Build*: 14th August, 2019 + *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*: **29039** ++ *Line count*: **29308** + *File count*: **201** + *Folder count*: **62** diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index b925996..800dbe6 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage admin.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 3d85f6c..30ce683 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage dashboard.css diff --git a/admin/assets/css/help_document.css b/admin/assets/css/help_document.css index 0dcc47b..0cd6e19 100644 --- a/admin/assets/css/help_document.css +++ b/admin/assets/css/help_document.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help_document.css diff --git a/admin/assets/css/help_documents.css b/admin/assets/css/help_documents.css index c4ec080..bff2db7 100644 --- a/admin/assets/css/help_documents.css +++ b/admin/assets/css/help_documents.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help_documents.css diff --git a/admin/assets/css/question_and_answer.css b/admin/assets/css/question_and_answer.css index 995b04e..572e22e 100644 --- a/admin/assets/css/question_and_answer.css +++ b/admin/assets/css/question_and_answer.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.css diff --git a/admin/assets/css/questions_and_answers.css b/admin/assets/css/questions_and_answers.css index 9c883d4..264c691 100644 --- a/admin/assets/css/questions_and_answers.css +++ b/admin/assets/css/questions_and_answers.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questions_and_answers.css diff --git a/admin/assets/js/admin.js b/admin/assets/js/admin.js index 0489265..4efe9b2 100644 --- a/admin/assets/js/admin.js +++ b/admin/assets/js/admin.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage admin.js diff --git a/admin/controller.php b/admin/controller.php index be66c7e..4cef07d 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage controller.php diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index abbe5f6..3c7bbc6 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage ajax.json.php @@ -50,7 +50,7 @@ class QuestionsanswersControllerAjax extends JControllerLegacy // Check Token! $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); - if($token == $call_token) + if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { $task = $this->getTask(); switch($task) diff --git a/admin/controllers/download.php b/admin/controllers/download.php index 39cce51..aab7916 100644 --- a/admin/controllers/download.php +++ b/admin/controllers/download.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage download.php diff --git a/admin/controllers/help.php b/admin/controllers/help.php index ca0b793..c975d43 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help.php diff --git a/admin/controllers/help_document.php b/admin/controllers/help_document.php index f2d8d23..846396c 100644 --- a/admin/controllers/help_document.php +++ b/admin/controllers/help_document.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help_document.php diff --git a/admin/controllers/help_documents.php b/admin/controllers/help_documents.php index 2e2e0b5..051ca6d 100644 --- a/admin/controllers/help_documents.php +++ b/admin/controllers/help_documents.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help_documents.php diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 8ea181c..235effb 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage import.php diff --git a/admin/controllers/question_and_answer.php b/admin/controllers/question_and_answer.php index 026168a..5d0ea60 100644 --- a/admin/controllers/question_and_answer.php +++ b/admin/controllers/question_and_answer.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.php diff --git a/admin/controllers/questions_and_answers.php b/admin/controllers/questions_and_answers.php index 895213e..1d7d248 100644 --- a/admin/controllers/questions_and_answers.php +++ b/admin/controllers/questions_and_answers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questions_and_answers.php diff --git a/admin/controllers/questionsanswers.php b/admin/controllers/questionsanswers.php index fc86021..458f186 100644 --- a/admin/controllers/questionsanswers.php +++ b/admin/controllers/questionsanswers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questionsanswers.php diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php index 28883c4..62e74e1 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage headercheck.php diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php index bdb4c4b..b69ebe7 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage batch_.php diff --git a/admin/helpers/questionsanswers.php b/admin/helpers/questionsanswers.php index 85898cb..7ebf81b 100644 --- a/admin/helpers/questionsanswers.php +++ b/admin/helpers/questionsanswers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 12th June, 2019 + @build 14th August, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questionsanswers.php @@ -2631,38 +2631,42 @@ abstract class QuestionsanswersHelper /** * Get any component's model **/ - public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'Questionsanswers', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = 'Questionsanswers', $config = array()) { // fix the name $name = self::safeString($name); - // full path - $fullPath = $path . '/models'; - // set prefix - $prefix = $component.'Model'; + // full path to models + $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPath, $prefix); + JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + // make sure the table path is loaded + if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + { + // This is the JCB default path to tables in Joomla 3.x + $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + } // get instance - $model = JModelLegacy::getInstance($name, $prefix, $config); + $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { jimport('joomla.filesystem.file'); // get file path - $filePath = $path.'/'.$name.'.php'; - $fullPath = $fullPath.'/'.$name.'.php'; + $filePath = $path . '/' . $name . '.php'; + $fullPathModel = $fullPathModels . '/' . $name . '.php'; // check if it exists if (JFile::exists($filePath)) { // get the file require_once $filePath; } - elseif (JFile::exists($fullPath)) + elseif (JFile::exists($fullPathModel)) { // get the file - require_once $fullPath; + require_once $fullPathModel; } // build class names - $modelClass = $prefix.$name; + $modelClass = $Component . 'Model' . $name; if (class_exists($modelClass)) { // initialize the model diff --git a/admin/language/en-GB/en-GB.com_questionsanswers.ini b/admin/language/en-GB/en-GB.com_questionsanswers.ini index b6afbba..5f5edc3 100644 --- a/admin/language/en-GB/en-GB.com_questionsanswers.ini +++ b/admin/language/en-GB/en-GB.com_questionsanswers.ini @@ -93,14 +93,14 @@ COM_QUESTIONSANSWERS_DATE="Date" COM_QUESTIONSANSWERS_DOES_NOT_HAVE_A_VALID_FILE_TYPE="Does not have a valid file type." COM_QUESTIONSANSWERS_DOWNLOAD="Download" COM_QUESTIONSANSWERS_EDIT_CREATED_BY="Edit Created By" -COM_QUESTIONSANSWERS_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by." +COM_QUESTIONSANSWERS_EDIT_CREATED_BY_DESC="Allows users in this group to edit created by." COM_QUESTIONSANSWERS_EDIT_CREATED_DATE="Edit Created Date" -COM_QUESTIONSANSWERS_EDIT_CREATED_DATE_DESC=" Allows users in this group to edit created date." +COM_QUESTIONSANSWERS_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date." COM_QUESTIONSANSWERS_EDIT_S="Edit %s" COM_QUESTIONSANSWERS_EDIT_VERSIONS="Edit Version" -COM_QUESTIONSANSWERS_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions." +COM_QUESTIONSANSWERS_EDIT_VERSIONS_DESC="Allows users in this group to edit versions." COM_QUESTIONSANSWERS_EXPORT_DATA="Export Data" -COM_QUESTIONSANSWERS_EXPORT_DATA_DESC=" Allows users in this group to export data." +COM_QUESTIONSANSWERS_EXPORT_DATA_DESC="Allows users in this group to export data." COM_QUESTIONSANSWERS_EXPORT_FAILED="Export Failed" COM_QUESTIONSANSWERS_HELP_DOCUMENT="Help Document" COM_QUESTIONSANSWERS_HELP_DOCUMENTS="Help Documents" @@ -203,7 +203,7 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENT_TITLE_MESSAGE="Error! Please add title here." COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE="Type" COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_DESCRIPTION="Select the help type." COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_LABEL="Type" -COM_QUESTIONSANSWERS_HELP_DOCUMENT_URL="Url" +COM_QUESTIONSANSWERS_HELP_DOCUMENT_URL="URL" COM_QUESTIONSANSWERS_HELP_DOCUMENT_URL_DESCRIPTION="Enter url" COM_QUESTIONSANSWERS_HELP_DOCUMENT_URL_HINT="http://www.example.com" COM_QUESTIONSANSWERS_HELP_DOCUMENT_URL_LABEL="URL" @@ -213,7 +213,7 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENT_VERSION_LABEL="Revision" COM_QUESTIONSANSWERS_HELP_MANAGER="Help" COM_QUESTIONSANSWERS_IMPORT_CONTINUE="Continue" COM_QUESTIONSANSWERS_IMPORT_DATA="Import Data" -COM_QUESTIONSANSWERS_IMPORT_DATA_DESC=" Allows users in this group to import data." +COM_QUESTIONSANSWERS_IMPORT_DATA_DESC="Allows users in this group to import data." COM_QUESTIONSANSWERS_IMPORT_ERROR="Import error." COM_QUESTIONSANSWERS_IMPORT_FAILED="Import Failed" COM_QUESTIONSANSWERS_IMPORT_FILE_COLUMNS="File Columns" @@ -324,8 +324,7 @@ COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_SUBMENU_DESC="Allows the users in thi COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER="Question and Answer" COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER="Answer" COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_DOCUMENTS="Answer Documents" -COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_DOCUMENTS_UPLOADER_DESCRIPTION=" -