From 1e24b977413542975c2855c7ea5cd3fcf97106ce Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 4 Apr 2019 13:57:56 +0200 Subject: [PATCH] Updated with JCB v2.9.14 --- 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 | 2 +- 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 | 28 ++++++++++++++++++- admin/layouts/batchselection.php | 2 +- admin/layouts/help_document/details_above.php | 15 ++++++---- .../help_document/details_fullwidth.php | 20 ++++++------- admin/layouts/help_document/details_left.php | 26 ++++++----------- admin/layouts/help_document/details_right.php | 26 ++++++----------- admin/layouts/help_document/details_under.php | 15 ++++++---- admin/layouts/help_document/publishing.php | 27 ++++++------------ admin/layouts/help_document/publlshing.php | 27 ++++++------------ .../question_and_answer/details_fullwidth.php | 20 ++++++------- .../question_and_answer/details_rightside.php | 26 ++++++----------- .../question_and_answer/details_under.php | 15 ++++++---- .../layouts/question_and_answer/metadata.php | 2 +- .../question_and_answer/publishing.php | 27 ++++++------------ admin/models/ajax.php | 24 ++++++++-------- admin/models/fields/adminviewfolderlist.php | 2 +- admin/models/fields/articles.php | 2 +- admin/models/fields/siteviewfolderlist.php | 2 +- admin/models/forms/help_document.js | 2 +- admin/models/forms/question_and_answer.js | 2 +- admin/models/help_document.php | 2 +- admin/models/help_documents.php | 2 +- admin/models/import.php | 2 +- admin/models/question_and_answer.php | 6 ++-- admin/models/questions_and_answers.php | 2 +- admin/models/questionsanswers.php | 2 +- admin/questionsanswers.php | 2 +- admin/sql/install.mysql.utf8.sql | 10 +++---- admin/tables/help_document.php | 2 +- admin/tables/question_and_answer.php | 2 +- admin/views/help_document/submitbutton.js | 16 ++--------- 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 | 16 ++--------- 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 | 2 +- script.php | 2 +- 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 | 2 +- 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 | 28 ++++++++++++++++++- site/helpers/route.php | 2 +- .../question_and_answer/details_fullwidth.php | 20 ++++++------- .../question_and_answer/details_rightside.php | 26 ++++++----------- .../question_and_answer/details_under.php | 15 ++++++---- site/layouts/question_and_answer/metadata.php | 2 +- .../question_and_answer/publishing.php | 27 ++++++------------ site/models/ajax.php | 24 ++++++++-------- site/models/category.php | 2 +- site/models/downloads.php | 2 +- site/models/forms/question_and_answer.js | 2 +- site/models/question_and_answer.php | 6 ++-- site/models/questions_and_answers.php | 2 +- site/questionsanswers.php | 2 +- site/router.php | 2 +- 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 | 16 ++--------- site/views/question_and_answer/tmpl/edit.php | 2 +- site/views/question_and_answer/view.html.php | 19 +++++++++---- .../questions_and_answers/tmpl/default.php | 2 +- .../tmpl/default_qna-table.php | 2 +- .../views/questions_and_answers/view.html.php | 2 +- 125 files changed, 343 insertions(+), 384 deletions(-) diff --git a/README.md b/README.md index 0ef21d7..8f0a979 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*: 27th December, 2018 ++ *Last Build*: 4th April, 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*: **29049** ++ *Line count*: **29008** + *File count*: **201** + *Folder count*: **62** diff --git a/admin/README.txt b/admin/README.txt index 0ef21d7..8f0a979 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*: 27th December, 2018 ++ *Last Build*: 4th April, 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*: **29049** ++ *Line count*: **29008** + *File count*: **201** + *Folder count*: **62** diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index 528d8ed..0a56057 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 bbb8a3c..5b74a9e 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 cdce6f3..c09ba78 100644 --- a/admin/assets/css/help_document.css +++ b/admin/assets/css/help_document.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 ca05d33..c03ef7b 100644 --- a/admin/assets/css/help_documents.css +++ b/admin/assets/css/help_documents.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 3361207..14e14ad 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 27th December, 2018 + @build 4th April, 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 8d2f0f4..5a775d0 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 27th December, 2018 + @build 4th April, 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 882a196..e89d7d6 100644 --- a/admin/assets/js/admin.js +++ b/admin/assets/js/admin.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage admin.js diff --git a/admin/controller.php b/admin/controller.php index e4ec118..41b81e0 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 4ae08c2..3698a86 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage ajax.json.php diff --git a/admin/controllers/download.php b/admin/controllers/download.php index 1cfd59f..28351ea 100644 --- a/admin/controllers/download.php +++ b/admin/controllers/download.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 43a383c..6367087 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 0dedc68..89ebc9f 100644 --- a/admin/controllers/help_document.php +++ b/admin/controllers/help_document.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 b0e598a..f2a5e02 100644 --- a/admin/controllers/help_documents.php +++ b/admin/controllers/help_documents.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 e106ed0..ab9bb34 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 85db451..9b23411 100644 --- a/admin/controllers/question_and_answer.php +++ b/admin/controllers/question_and_answer.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 14692d4..57b43c7 100644 --- a/admin/controllers/questions_and_answers.php +++ b/admin/controllers/questions_and_answers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 1a057cb..424317c 100644 --- a/admin/controllers/questionsanswers.php +++ b/admin/controllers/questionsanswers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 544d303..48d0874 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 e2c3ba1..0210a1b 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 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 d839659..fd30bed 100644 --- a/admin/helpers/questionsanswers.php +++ b/admin/helpers/questionsanswers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questionsanswers.php @@ -459,6 +459,32 @@ abstract class QuestionsanswersHelper return date('jS \o\f F Y',$date); } + /** + * get date based in period past + */ + public static function fancyDynamicDate($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + // older then year + $lastyear = date("Y", strtotime("-1 year")); + $tragetyear = date("Y", $date); + if ($tragetyear <= $lastyear) + { + return date('m/d/y', $date); + } + // same day + $yesterday = strtotime("-1 day"); + if ($date > $yesterday) + { + return date('g:i A', $date); + } + // just month day + return date('M j', $date); + } + /** * Change to nice fancy day time and date */ diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 6f1eddb..1bd3efd 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage batchselection.php diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php index 2d0eeb1..4e12c88 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_above.php @@ -28,14 +28,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'title', 'alias' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php index bf3e575..809b8ba 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_fullwidth.php @@ -32,16 +32,14 @@ $fields = $displayData->get('fields') ?: array( 'content' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php index 1c040bf..4054611 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_left.php @@ -38,20 +38,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php index d516860..b29a010 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_right.php @@ -36,20 +36,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php index e04d520..336cdb9 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_under.php @@ -28,13 +28,18 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'not_required' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php index c229060..7744eb6 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage publishing.php @@ -26,7 +26,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -38,20 +37,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/publlshing.php b/admin/layouts/help_document/publlshing.php index 7b2c7c2..252bbe8 100644 --- a/admin/layouts/help_document/publlshing.php +++ b/admin/layouts/help_document/publlshing.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage publlshing.php @@ -26,7 +26,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -39,20 +38,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/question_and_answer/details_fullwidth.php b/admin/layouts/question_and_answer/details_fullwidth.php index 14a973c..71e26c7 100644 --- a/admin/layouts/question_and_answer/details_fullwidth.php +++ b/admin/layouts/question_and_answer/details_fullwidth.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_fullwidth.php @@ -35,16 +35,14 @@ $fields = $displayData->get('fields') ?: array( 'answer_documents_uploader' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/question_and_answer/details_rightside.php b/admin/layouts/question_and_answer/details_rightside.php index a7ba948..96f40c9 100644 --- a/admin/layouts/question_and_answer/details_rightside.php +++ b/admin/layouts/question_and_answer/details_rightside.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_rightside.php @@ -34,20 +34,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/question_and_answer/details_under.php b/admin/layouts/question_and_answer/details_under.php index efa74ba..e7d0a0b 100644 --- a/admin/layouts/question_and_answer/details_under.php +++ b/admin/layouts/question_and_answer/details_under.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_under.php @@ -28,14 +28,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'main_image', 'answer_documents' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/question_and_answer/metadata.php b/admin/layouts/question_and_answer/metadata.php index ba29c78..924aa0f 100644 --- a/admin/layouts/question_and_answer/metadata.php +++ b/admin/layouts/question_and_answer/metadata.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage metadata.php diff --git a/admin/layouts/question_and_answer/publishing.php b/admin/layouts/question_and_answer/publishing.php index 994d125..046703b 100644 --- a/admin/layouts/question_and_answer/publishing.php +++ b/admin/layouts/question_and_answer/publishing.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage publishing.php @@ -26,7 +26,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -44,20 +43,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/models/ajax.php b/admin/models/ajax.php index b9a3759..1ac18a7 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage ajax.php @@ -197,7 +197,7 @@ class QuestionsanswersModelAjax extends JModelList { QuestionsanswersHelper::resizeImage($this->fileName, $this->fileFormat, $this->target, $this->folderPath, $this->fullPath); } - // Get the basic encription. + // Get the basic encryption. $basickey = QuestionsanswersHelper::getCryptKey('basic'); $basic = null; // set link options @@ -430,8 +430,8 @@ class QuestionsanswersModelAjax extends JModelList protected function _getPackageFromUpload() { // Get the uploaded file information - $app = JFactory::getApplication(); - $input = $app->input; + $app = JFactory::getApplication(); + $input = $app->input; // See JInputFiles::get. $userfiles = $input->files->get('files', null, 'array'); @@ -465,9 +465,9 @@ class QuestionsanswersModelAjax extends JModelList } // Build the appropriate paths - $config = JFactory::getConfig(); - $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; - $tmp_src = $userfile['tmp_name']; + $config = JFactory::getConfig(); + $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; + $tmp_src = $userfile['tmp_name']; // Move uploaded file jimport('joomla.filesystem.file'); @@ -537,12 +537,12 @@ class QuestionsanswersModelAjax extends JModelList } } - $config = JFactory::getConfig(); + $config = JFactory::getConfig(); // set Package Name - $check['packagename'] = $archivename; + $check['packagename'] = $archivename; // set directory - $check['dir'] = $config->get('tmp_path'). '/' .$archivename; + $check['dir'] = $config->get('tmp_path'). '/' .$archivename; return $check; } @@ -559,8 +559,8 @@ class QuestionsanswersModelAjax extends JModelList { jimport('joomla.filesystem.file'); - $config = JFactory::getConfig(); - $package = $config->get('tmp_path'). '/' .$package; + $config = JFactory::getConfig(); + $package = $config->get('tmp_path'). '/' .$package; // Is the package file a valid file? if (is_file($package)) diff --git a/admin/models/fields/adminviewfolderlist.php b/admin/models/fields/adminviewfolderlist.php index 052f28d..7564249 100644 --- a/admin/models/fields/adminviewfolderlist.php +++ b/admin/models/fields/adminviewfolderlist.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage adminviewfolderlist.php diff --git a/admin/models/fields/articles.php b/admin/models/fields/articles.php index 5e99fae..4bab1ad 100644 --- a/admin/models/fields/articles.php +++ b/admin/models/fields/articles.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage articles.php diff --git a/admin/models/fields/siteviewfolderlist.php b/admin/models/fields/siteviewfolderlist.php index cf5d46d..da87d09 100644 --- a/admin/models/fields/siteviewfolderlist.php +++ b/admin/models/fields/siteviewfolderlist.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage siteviewfolderlist.php diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index 4ee28f1..95b3610 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help_document.js diff --git a/admin/models/forms/question_and_answer.js b/admin/models/forms/question_and_answer.js index cdeade6..e6a482f 100644 --- a/admin/models/forms/question_and_answer.js +++ b/admin/models/forms/question_and_answer.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.js diff --git a/admin/models/help_document.php b/admin/models/help_document.php index 60334bb..9e546f7 100644 --- a/admin/models/help_document.php +++ b/admin/models/help_document.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help_document.php diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index 45fd871..1492ac5 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help_documents.php diff --git a/admin/models/import.php b/admin/models/import.php index 484332b..ab107df 100644 --- a/admin/models/import.php +++ b/admin/models/import.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage import.php diff --git a/admin/models/question_and_answer.php b/admin/models/question_and_answer.php index 4a5807b..47cf58a 100644 --- a/admin/models/question_and_answer.php +++ b/admin/models/question_and_answer.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.php @@ -78,7 +78,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin else { $id = 0; - } + } // set the id and view name to session if ($vdm = QuestionsanswersHelper::get('question_and_answer__'.$id)) { @@ -153,7 +153,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin else { $id = $item->id; - } + } // set the id and view name to session if ($vdm = QuestionsanswersHelper::get('question_and_answer__'.$id)) { diff --git a/admin/models/questions_and_answers.php b/admin/models/questions_and_answers.php index 741afa1..e0339d9 100644 --- a/admin/models/questions_and_answers.php +++ b/admin/models/questions_and_answers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questions_and_answers.php diff --git a/admin/models/questionsanswers.php b/admin/models/questionsanswers.php index 9026ea0..11666de 100644 --- a/admin/models/questionsanswers.php +++ b/admin/models/questionsanswers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questionsanswers.php diff --git a/admin/questionsanswers.php b/admin/questionsanswers.php index 5a3f6fc..d06b8fe 100644 --- a/admin/questionsanswers.php +++ b/admin/questionsanswers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questionsanswers.php diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 1021f7c..d9bfc55 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_question_and_answer` ( `catid` INT(11) NOT NULL DEFAULT 0, `main_image` TEXT NOT NULL, `question` TEXT NOT NULL, - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -18,9 +18,9 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_question_and_answer` ( `hits` INT(10) unsigned NOT NULL DEFAULT 0, `access` INT(10) unsigned NOT NULL DEFAULT 0, `ordering` INT(11) NOT NULL DEFAULT 0, - `metakey` TEXT NOT NULL DEFAULT '', - `metadesc` TEXT NOT NULL DEFAULT '', - `metadata` TEXT NOT NULL DEFAULT '', + `metakey` TEXT NOT NULL, + `metadesc` TEXT NOT NULL, + `metadata` TEXT NOT NULL, PRIMARY KEY (`id`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), @@ -45,7 +45,7 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_help_document` ( `title` CHAR(64) NOT NULL DEFAULT '', `type` TINYINT(1) NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, diff --git a/admin/tables/help_document.php b/admin/tables/help_document.php index b87642c..b888960 100644 --- a/admin/tables/help_document.php +++ b/admin/tables/help_document.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help_document.php diff --git a/admin/tables/question_and_answer.php b/admin/tables/question_and_answer.php index 0311f20..3f6fc8d 100644 --- a/admin/tables/question_and_answer.php +++ b/admin/tables/question_and_answer.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.php diff --git a/admin/views/help_document/submitbutton.js b/admin/views/help_document/submitbutton.js index a51cdb9..f7b3216 100644 --- a/admin/views/help_document/submitbutton.js +++ b/admin/views/help_document/submitbutton.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage submitbutton.js @@ -27,19 +27,9 @@ Joomla.submitbutton = function(task) if (task == ''){ return false; } else { - var isValid=true; var action = task.split('.'); - if (action[1] != 'cancel' && action[1] != 'close'){ - var forms = $$('form.form-validate'); - for (var i=0;i COM_QUESTIONSANSWERS - 27th December, 2018 + 4th April, 2019 Llewellyn van der Merwe joomla@vdm.io https://www.vdm.io/ diff --git a/script.php b/script.php index ab73a47..7db867a 100644 --- a/script.php +++ b/script.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage script.php diff --git a/site/assets/css/category.css b/site/assets/css/category.css index b8eb4d7..f85d74f 100644 --- a/site/assets/css/category.css +++ b/site/assets/css/category.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage category.css diff --git a/site/assets/css/downloads.css b/site/assets/css/downloads.css index ef865b8..d27d7b3 100644 --- a/site/assets/css/downloads.css +++ b/site/assets/css/downloads.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage downloads.css diff --git a/site/assets/css/question_and_answer.css b/site/assets/css/question_and_answer.css index 3361207..14e14ad 100644 --- a/site/assets/css/question_and_answer.css +++ b/site/assets/css/question_and_answer.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.css diff --git a/site/assets/css/questions_and_answers.css b/site/assets/css/questions_and_answers.css index 5efe6c9..ad8be71 100644 --- a/site/assets/css/questions_and_answers.css +++ b/site/assets/css/questions_and_answers.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questions_and_answers.css diff --git a/site/assets/css/site.css b/site/assets/css/site.css index 8de23c1..9c4c32e 100644 --- a/site/assets/css/site.css +++ b/site/assets/css/site.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage site.css diff --git a/site/assets/js/site.js b/site/assets/js/site.js index 2b48861..a3f0d30 100644 --- a/site/assets/js/site.js +++ b/site/assets/js/site.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage site.js diff --git a/site/controller.php b/site/controller.php index d7d7c06..886818f 100644 --- a/site/controller.php +++ b/site/controller.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage controller.php diff --git a/site/controllers/ajax.json.php b/site/controllers/ajax.json.php index 4ba3c2c..9e0d1ad 100644 --- a/site/controllers/ajax.json.php +++ b/site/controllers/ajax.json.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage ajax.json.php diff --git a/site/controllers/download.php b/site/controllers/download.php index 1cfd59f..28351ea 100644 --- a/site/controllers/download.php +++ b/site/controllers/download.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage download.php diff --git a/site/controllers/help.php b/site/controllers/help.php index b7fe93d..e88492d 100644 --- a/site/controllers/help.php +++ b/site/controllers/help.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage help.php diff --git a/site/controllers/question_and_answer.php b/site/controllers/question_and_answer.php index 6c523ab..03bcb4a 100644 --- a/site/controllers/question_and_answer.php +++ b/site/controllers/question_and_answer.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.php diff --git a/site/helpers/category.php b/site/helpers/category.php index beeedb8..d9d90d9 100644 --- a/site/helpers/category.php +++ b/site/helpers/category.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage category.php diff --git a/site/helpers/categoryquestions_and_answers.php b/site/helpers/categoryquestions_and_answers.php index db380a9..9e41bdb 100644 --- a/site/helpers/categoryquestions_and_answers.php +++ b/site/helpers/categoryquestions_and_answers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage categoryquestions_and_answers.php diff --git a/site/helpers/headercheck.php b/site/helpers/headercheck.php index 544d303..48d0874 100644 --- a/site/helpers/headercheck.php +++ b/site/helpers/headercheck.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage headercheck.php diff --git a/site/helpers/questionsanswers.php b/site/helpers/questionsanswers.php index db734aa..cde5934 100644 --- a/site/helpers/questionsanswers.php +++ b/site/helpers/questionsanswers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questionsanswers.php @@ -459,6 +459,32 @@ abstract class QuestionsanswersHelper return date('jS \o\f F Y',$date); } + /** + * get date based in period past + */ + public static function fancyDynamicDate($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + // older then year + $lastyear = date("Y", strtotime("-1 year")); + $tragetyear = date("Y", $date); + if ($tragetyear <= $lastyear) + { + return date('m/d/y', $date); + } + // same day + $yesterday = strtotime("-1 day"); + if ($date > $yesterday) + { + return date('g:i A', $date); + } + // just month day + return date('M j', $date); + } + /** * Change to nice fancy day time and date */ diff --git a/site/helpers/route.php b/site/helpers/route.php index 12400e1..efbc629 100644 --- a/site/helpers/route.php +++ b/site/helpers/route.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage route.php diff --git a/site/layouts/question_and_answer/details_fullwidth.php b/site/layouts/question_and_answer/details_fullwidth.php index 14a973c..71e26c7 100644 --- a/site/layouts/question_and_answer/details_fullwidth.php +++ b/site/layouts/question_and_answer/details_fullwidth.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_fullwidth.php @@ -35,16 +35,14 @@ $fields = $displayData->get('fields') ?: array( 'answer_documents_uploader' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/site/layouts/question_and_answer/details_rightside.php b/site/layouts/question_and_answer/details_rightside.php index a7ba948..96f40c9 100644 --- a/site/layouts/question_and_answer/details_rightside.php +++ b/site/layouts/question_and_answer/details_rightside.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_rightside.php @@ -34,20 +34,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/site/layouts/question_and_answer/details_under.php b/site/layouts/question_and_answer/details_under.php index efa74ba..e7d0a0b 100644 --- a/site/layouts/question_and_answer/details_under.php +++ b/site/layouts/question_and_answer/details_under.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage details_under.php @@ -28,14 +28,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'main_image', 'answer_documents' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/site/layouts/question_and_answer/metadata.php b/site/layouts/question_and_answer/metadata.php index ba29c78..924aa0f 100644 --- a/site/layouts/question_and_answer/metadata.php +++ b/site/layouts/question_and_answer/metadata.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage metadata.php diff --git a/site/layouts/question_and_answer/publishing.php b/site/layouts/question_and_answer/publishing.php index 994d125..046703b 100644 --- a/site/layouts/question_and_answer/publishing.php +++ b/site/layouts/question_and_answer/publishing.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage publishing.php @@ -26,7 +26,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -44,20 +43,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/site/models/ajax.php b/site/models/ajax.php index 81656ff..687aac1 100644 --- a/site/models/ajax.php +++ b/site/models/ajax.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage ajax.php @@ -199,7 +199,7 @@ class QuestionsanswersModelAjax extends JModelList { QuestionsanswersHelper::resizeImage($this->fileName, $this->fileFormat, $this->target, $this->folderPath, $this->fullPath); } - // Get the basic encription. + // Get the basic encryption. $basickey = QuestionsanswersHelper::getCryptKey('basic'); $basic = null; // set link options @@ -432,8 +432,8 @@ class QuestionsanswersModelAjax extends JModelList protected function _getPackageFromUpload() { // Get the uploaded file information - $app = JFactory::getApplication(); - $input = $app->input; + $app = JFactory::getApplication(); + $input = $app->input; // See JInputFiles::get. $userfiles = $input->files->get('files', null, 'array'); @@ -467,9 +467,9 @@ class QuestionsanswersModelAjax extends JModelList } // Build the appropriate paths - $config = JFactory::getConfig(); - $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; - $tmp_src = $userfile['tmp_name']; + $config = JFactory::getConfig(); + $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; + $tmp_src = $userfile['tmp_name']; // Move uploaded file jimport('joomla.filesystem.file'); @@ -539,12 +539,12 @@ class QuestionsanswersModelAjax extends JModelList } } - $config = JFactory::getConfig(); + $config = JFactory::getConfig(); // set Package Name - $check['packagename'] = $archivename; + $check['packagename'] = $archivename; // set directory - $check['dir'] = $config->get('tmp_path'). '/' .$archivename; + $check['dir'] = $config->get('tmp_path'). '/' .$archivename; return $check; } @@ -561,8 +561,8 @@ class QuestionsanswersModelAjax extends JModelList { jimport('joomla.filesystem.file'); - $config = JFactory::getConfig(); - $package = $config->get('tmp_path'). '/' .$package; + $config = JFactory::getConfig(); + $package = $config->get('tmp_path'). '/' .$package; // Is the package file a valid file? if (is_file($package)) diff --git a/site/models/category.php b/site/models/category.php index 8f8758a..3cbbf60 100644 --- a/site/models/category.php +++ b/site/models/category.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage category.php diff --git a/site/models/downloads.php b/site/models/downloads.php index 901b071..2c3ea6d 100644 --- a/site/models/downloads.php +++ b/site/models/downloads.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage downloads.php diff --git a/site/models/forms/question_and_answer.js b/site/models/forms/question_and_answer.js index cdeade6..e6a482f 100644 --- a/site/models/forms/question_and_answer.js +++ b/site/models/forms/question_and_answer.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.js diff --git a/site/models/question_and_answer.php b/site/models/question_and_answer.php index 4a5807b..47cf58a 100644 --- a/site/models/question_and_answer.php +++ b/site/models/question_and_answer.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage question_and_answer.php @@ -78,7 +78,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin else { $id = 0; - } + } // set the id and view name to session if ($vdm = QuestionsanswersHelper::get('question_and_answer__'.$id)) { @@ -153,7 +153,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin else { $id = $item->id; - } + } // set the id and view name to session if ($vdm = QuestionsanswersHelper::get('question_and_answer__'.$id)) { diff --git a/site/models/questions_and_answers.php b/site/models/questions_and_answers.php index 95cb9b2..317202a 100644 --- a/site/models/questions_and_answers.php +++ b/site/models/questions_and_answers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questions_and_answers.php diff --git a/site/questionsanswers.php b/site/questionsanswers.php index 02b0358..a09e240 100644 --- a/site/questionsanswers.php +++ b/site/questionsanswers.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage questionsanswers.php diff --git a/site/router.php b/site/router.php index 2e87d19..b09003b 100644 --- a/site/router.php +++ b/site/router.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage router.php diff --git a/site/views/category/tmpl/default.php b/site/views/category/tmpl/default.php index 0728a1d..c9dcfe6 100644 --- a/site/views/category/tmpl/default.php +++ b/site/views/category/tmpl/default.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage default.php diff --git a/site/views/category/tmpl/default_qna-table.php b/site/views/category/tmpl/default_qna-table.php index 09c9b02..3a29d41 100644 --- a/site/views/category/tmpl/default_qna-table.php +++ b/site/views/category/tmpl/default_qna-table.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage default_qna-table.php diff --git a/site/views/category/view.html.php b/site/views/category/view.html.php index 7a738d9..f203f8d 100644 --- a/site/views/category/view.html.php +++ b/site/views/category/view.html.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage view.html.php diff --git a/site/views/downloads/tmpl/default.php b/site/views/downloads/tmpl/default.php index 789d0d1..9f08632 100644 --- a/site/views/downloads/tmpl/default.php +++ b/site/views/downloads/tmpl/default.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage default.php diff --git a/site/views/downloads/tmpl/default_qna-downloads-table.php b/site/views/downloads/tmpl/default_qna-downloads-table.php index 81a6738..9ecb1a4 100644 --- a/site/views/downloads/tmpl/default_qna-downloads-table.php +++ b/site/views/downloads/tmpl/default_qna-downloads-table.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage default_qna-downloads-table.php diff --git a/site/views/downloads/view.html.php b/site/views/downloads/view.html.php index 267e649..9760b87 100644 --- a/site/views/downloads/view.html.php +++ b/site/views/downloads/view.html.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage view.html.php diff --git a/site/views/question_and_answer/submitbutton.js b/site/views/question_and_answer/submitbutton.js index 60ab197..f69d8fe 100644 --- a/site/views/question_and_answer/submitbutton.js +++ b/site/views/question_and_answer/submitbutton.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage submitbutton.js @@ -27,19 +27,9 @@ Joomla.submitbutton = function(task) if (task == ''){ return false; } else { - var isValid=true; var action = task.split('.'); - if (action[1] != 'cancel' && action[1] != 'close'){ - var forms = $$('form.form-validate'); - for (var i=0;i 30) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. @@ -205,15 +205,22 @@ class QuestionsanswersViewQuestion_and_answer extends JViewLegacy $this->document = JFactory::getDocument(); } $this->document->setTitle(JText::_($isNew ? 'COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_NEW' : 'COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_EDIT')); - // we need this to fix the form display (TODO) - $this->document->addStyleSheet(JURI::root()."administrator/templates/isis/css/template.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); - $this->document->addScript(JURI::root()."administrator/templates/isis/js/template.js", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + // only add the ISIS template css & js if needed (default is 1 = true) + // you can override this in the global component options + // just add a (radio yes/no field) with a name called add_isis_template + // to your components config area + if ($this->params->get('add_isis_template', 1)) + { + // we need this to fix the form display (TODO) + $this->document->addStyleSheet(JURI::root() . "administrator/templates/isis/css/template.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->addScript(JURI::root() . "administrator/templates/isis/js/template.js", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + } // the default style of this view $this->document->addStyleSheet(JURI::root()."components/com_questionsanswers/assets/css/question_and_answer.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); // Add Ajax Token $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); // default javascript of this view - $this->document->addScript(JURI::root().$this->script, (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->document->addScript(JURI::root(). $this->script, (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root(). "components/com_questionsanswers/views/question_and_answer/submitbutton.js", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); // add JavaScripts $this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit/js/uikit.min.js' ); diff --git a/site/views/questions_and_answers/tmpl/default.php b/site/views/questions_and_answers/tmpl/default.php index 0728a1d..c9dcfe6 100644 --- a/site/views/questions_and_answers/tmpl/default.php +++ b/site/views/questions_and_answers/tmpl/default.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage default.php diff --git a/site/views/questions_and_answers/tmpl/default_qna-table.php b/site/views/questions_and_answers/tmpl/default_qna-table.php index 7bb3f91..bfea0f2 100644 --- a/site/views/questions_and_answers/tmpl/default_qna-table.php +++ b/site/views/questions_and_answers/tmpl/default_qna-table.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage default_qna-table.php diff --git a/site/views/questions_and_answers/view.html.php b/site/views/questions_and_answers/view.html.php index c873d12..3915385 100644 --- a/site/views/questions_and_answers/view.html.php +++ b/site/views/questions_and_answers/view.html.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version 1.0.x - @build 27th December, 2018 + @build 4th April, 2019 @created 30th January, 2017 @package Questions and Answers @subpackage view.html.php