Updated the component with the improvements made to JCB

This commit is contained in:
Llewellyn van der Merwe 2018-05-05 21:52:41 +02:00
parent 1306bc04f4
commit e683b47eb8
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
125 changed files with 200 additions and 179 deletions

View File

@ -12,14 +12,14 @@ Just a basic Questions & Answers.
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Questions and Answers](https://www.vdm.io/) + *Name*: [Questions and Answers](https://www.vdm.io/)
+ *First Build*: 30th January, 2017 + *First Build*: 30th January, 2017
+ *Last Build*: 24th April, 2018 + *Last Build*: 5th May, 2018
+ *Version*: 1.0.x + *Version*: 1.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
# Component Number # Component Number
+ *Line count*: **27783** + *Line count*: **28377**
+ *File count*: **201** + *File count*: **201**
+ *Folder count*: **62** + *Folder count*: **62**

View File

@ -12,14 +12,14 @@ Just a basic Questions & Answers.
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Questions and Answers](https://www.vdm.io/) + *Name*: [Questions and Answers](https://www.vdm.io/)
+ *First Build*: 30th January, 2017 + *First Build*: 30th January, 2017
+ *Last Build*: 24th April, 2018 + *Last Build*: 5th May, 2018
+ *Version*: 1.0.x + *Version*: 1.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
# Component Number # Component Number
+ *Line count*: **27783** + *Line count*: **28377**
+ *File count*: **201** + *File count*: **201**
+ *Folder count*: **62** + *Folder count*: **62**

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage admin.css @subpackage admin.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage dashboard.css @subpackage dashboard.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.css @subpackage help_document.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_documents.css @subpackage help_documents.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.css @subpackage question_and_answer.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questions_and_answers.css @subpackage questions_and_answers.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage admin.js @subpackage admin.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage controller.php @subpackage controller.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage ajax.json.php @subpackage ajax.json.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage download.php @subpackage download.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help.php @subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.php @subpackage help_document.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_documents.php @subpackage help_documents.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage import.php @subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.php @subpackage question_and_answer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questions_and_answers.php @subpackage questions_and_answers.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage headercheck.php @subpackage headercheck.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage batch_.php @subpackage batch_.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php
@ -2244,8 +2244,15 @@ abstract class QuestionsanswersHelper
return false; return false;
} }
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
{ {
// do some table foot work
$external = false;
if (strpos($table, '#__') !== false)
{
$external = true;
$table = str_replace('#__', '', $table);
}
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) if (json_last_error() === JSON_ERROR_NONE)
@ -2258,9 +2265,19 @@ abstract class QuestionsanswersHelper
$names = array(); $names = array();
foreach ($result as $val) foreach ($result as $val)
{ {
if ($name = self::getVar($table, $val, 'id', 'name')) if ($external)
{ {
$names[] = $name; if ($name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $name;
}
}
else
{
if ($name = self::getVar($table, $val, $id, $name))
{
$names[] = $name;
}
} }
} }
if (self::checkArray($names)) if (self::checkArray($names))

View File

@ -34,7 +34,7 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENTS_SUBMENU="Help Documents Submenu"
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to update the submenu of the help document" COM_QUESTIONSANSWERS_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to update the submenu of the help document"
COM_QUESTIONSANSWERS_IMPORT_DATA="Import Data" 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_MENU="» Questions and Answers" COM_QUESTIONSANSWERS_MENU="Questions and Answers"
COM_QUESTIONSANSWERS_MENU_CATEGORY_DESC="Questions and answers category" COM_QUESTIONSANSWERS_MENU_CATEGORY_DESC="Questions and answers category"
COM_QUESTIONSANSWERS_MENU_CATEGORY_OPTION="Q&A Category" COM_QUESTIONSANSWERS_MENU_CATEGORY_OPTION="Q&A Category"
COM_QUESTIONSANSWERS_MENU_CATEGORY_TITLE="Q&A Category" COM_QUESTIONSANSWERS_MENU_CATEGORY_TITLE="Q&A Category"

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage batchselection.php @subpackage batchselection.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_above.php @subpackage details_above.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_left.php @subpackage details_left.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_right.php @subpackage details_right.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_under.php @subpackage details_under.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage publishing.php @subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage publlshing.php @subpackage publlshing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_rightside.php @subpackage details_rightside.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_under.php @subpackage details_under.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage metadata.php @subpackage metadata.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage publishing.php @subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage ajax.php @subpackage ajax.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage adminviewfolderlist.php @subpackage adminviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage articles.php @subpackage articles.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage siteviewfolderlist.php @subpackage siteviewfolderlist.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.js @subpackage help_document.js

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.js @subpackage question_and_answer.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.php @subpackage help_document.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_documents.php @subpackage help_documents.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage import.php @subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.php @subpackage question_and_answer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questions_and_answers.php @subpackage questions_and_answers.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.php @subpackage help_document.php
@ -323,29 +323,29 @@ class QuestionsanswersTableHelp_document extends JTable
$asset->loadByName('com_questionsanswers'); $asset->loadByName('com_questionsanswers');
return $asset->id; return $asset->id;
} }
/** /**
* Generate a valid alias from title / date. * Generate a valid alias from title / date.
* Remains public to be able to check for duplicated alias before saving * Remains public to be able to check for duplicated alias before saving
* *
* @return string * @return string
*/ */
public function generateAlias() public function generateAlias()
{ {
if (empty($this->alias)) if (empty($this->alias))
{ {
$this->alias = $this->name; $this->alias = $this->title;
} }
$this->alias = JApplication::stringURLSafe($this->alias); $this->alias = JApplication::stringURLSafe($this->alias);
if (trim(str_replace('-', '', $this->alias)) == '') if (trim(str_replace('-', '', $this->alias)) == '')
{ {
$this->alias = JFactory::getDate()->format("Y-m-d-H-i-s"); $this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
} }
return $this->alias; return $this->alias;
} }
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.php @subpackage question_and_answer.php
@ -323,29 +323,16 @@ class QuestionsanswersTableQuestion_and_answer extends JTable
$asset->loadByName('com_questionsanswers'); $asset->loadByName('com_questionsanswers');
return $asset->id; return $asset->id;
} }
/** /**
* Generate a valid alias from title / date. * This view does not actually have an alias
* Remains public to be able to check for duplicated alias before saving *
* * @return bool
* @return string */
*/ public function generateAlias()
public function generateAlias() {
{ return false;
if (empty($this->alias))
{
$this->alias = $this->name;
}
$this->alias = JApplication::stringURLSafe($this->alias);
if (trim(str_replace('-', '', $this->alias)) == '')
{
$this->alias = JFactory::getDate()->format("Y-m-d-H-i-s");
}
return $this->alias;
} }
} }

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage submitbutton.js @subpackage submitbutton.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage edit.php @subpackage edit.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default.php @subpackage default.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_batch_body.php @subpackage default_batch_body.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_batch_footer.php @subpackage default_batch_footer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_body.php @subpackage default_body.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_foot.php @subpackage default_foot.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_head.php @subpackage default_head.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_toolbar.php @subpackage default_toolbar.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default.php @subpackage default.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage submitbutton.js @subpackage submitbutton.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage edit.php @subpackage edit.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default.php @subpackage default.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_batch_body.php @subpackage default_batch_body.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_batch_footer.php @subpackage default_batch_footer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_body.php @subpackage default_body.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_foot.php @subpackage default_foot.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_head.php @subpackage default_head.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_toolbar.php @subpackage default_toolbar.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default.php @subpackage default.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_main.php @subpackage default_main.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_readme_information.php @subpackage default_readme_information.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_vast_development_method_notice_board.php @subpackage default_vast_development_method_notice_board.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_vdm.php @subpackage default_vdm.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage A4.print.css @subpackage A4.print.css

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_QUESTIONSANSWERS</name> <name>COM_QUESTIONSANSWERS</name>
<creationDate>24th April, 2018</creationDate> <creationDate>5th May, 2018</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail> <authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl> <authorUrl>https://www.vdm.io/</authorUrl>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage script.php @subpackage script.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage category.css @subpackage category.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage downloads.css @subpackage downloads.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.css @subpackage question_and_answer.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questions_and_answers.css @subpackage questions_and_answers.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage site.css @subpackage site.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage site.js @subpackage site.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage controller.php @subpackage controller.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage ajax.json.php @subpackage ajax.json.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage download.php @subpackage download.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help.php @subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.php @subpackage question_and_answer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage category.php @subpackage category.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage categoryquestions_and_answers.php @subpackage categoryquestions_and_answers.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage headercheck.php @subpackage headercheck.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php
@ -1693,8 +1693,15 @@ abstract class QuestionsanswersHelper
return 'application/octet-stream'; return 'application/octet-stream';
} }
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
{ {
// do some table foot work
$external = false;
if (strpos($table, '#__') !== false)
{
$external = true;
$table = str_replace('#__', '', $table);
}
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) if (json_last_error() === JSON_ERROR_NONE)
@ -1707,9 +1714,19 @@ abstract class QuestionsanswersHelper
$names = array(); $names = array();
foreach ($result as $val) foreach ($result as $val)
{ {
if ($name = self::getVar($table, $val, 'id', 'name')) if ($external)
{ {
$names[] = $name; if ($name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $name;
}
}
else
{
if ($name = self::getVar($table, $val, $id, $name))
{
$names[] = $name;
}
} }
} }
if (self::checkArray($names)) if (self::checkArray($names))

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 24th April, 2018 @build 5th May, 2018
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage route.php @subpackage route.php

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