update to version 1.0.2
This commit is contained in:
parent
e683b47eb8
commit
aa78275365
@ -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*: 5th May, 2018
|
||||
+ *Last Build*: 27th December, 2018
|
||||
+ *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*: **28377**
|
||||
+ *Line count*: **29049**
|
||||
+ *File count*: **201**
|
||||
+ *Folder count*: **62**
|
||||
|
||||
|
@ -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*: 5th May, 2018
|
||||
+ *Last Build*: 27th December, 2018
|
||||
+ *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*: **28377**
|
||||
+ *Line count*: **29049**
|
||||
+ *File count*: **201**
|
||||
+ *Folder count*: **62**
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage admin.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage dashboard.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage admin.js
|
||||
|
@ -141,7 +141,8 @@
|
||||
description="COM_QUESTIONSANSWERS_CONFIG_DOCUMENT_FORMATS_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="true"
|
||||
filter="ARRAY">
|
||||
filter="ARRAY"
|
||||
default="">
|
||||
<!-- Option Set. -->
|
||||
<option value="doc">
|
||||
COM_QUESTIONSANSWERS_CONFIG_DOC</option>
|
||||
@ -180,7 +181,8 @@
|
||||
description="COM_QUESTIONSANSWERS_CONFIG_IMAGE_FORMATS_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="true"
|
||||
filter="ARRAY">
|
||||
filter="ARRAY"
|
||||
default="">
|
||||
<!-- Option Set. -->
|
||||
<option value="jpg">
|
||||
COM_QUESTIONSANSWERS_CONFIG_JPG</option>
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage controller.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controller library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* General Controller of Questionsanswers component
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage ajax.json.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* Questionsanswers Ajax Controller
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage download.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* Questionsanswers Help Controller
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Help_document Controller
|
||||
*/
|
||||
@ -43,6 +40,13 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Help_documents'; // safeguard for setting the return view listing to the main view.
|
||||
@ -60,14 +64,17 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
// Access check.
|
||||
$access = JFactory::getUser()->authorise('help_document.access', 'com_questionsanswers');
|
||||
$access = $user->authorise('help_document.access', 'com_questionsanswers');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('help_document.create', $this->option);
|
||||
return $user->authorise('help_document.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,9 +90,9 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
$user = JFactory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
@ -141,42 +148,25 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
@ -215,43 +205,45 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -270,11 +262,15 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
@ -282,9 +278,22 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
@ -293,9 +302,9 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.php
|
||||
@ -26,24 +26,33 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Help_documents Controller
|
||||
*/
|
||||
class QuestionsanswersControllerHelp_documents extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS_HELP_DOCUMENTS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Help_document', $prefix = 'QuestionsanswersModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS_HELP_DOCUMENTS';
|
||||
|
||||
return $model;
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Help_document', $prefix = 'QuestionsanswersModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage import.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Question_and_answer Controller
|
||||
*/
|
||||
@ -43,6 +40,13 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Questions_and_answers'; // safeguard for setting the return view listing to the main view.
|
||||
@ -60,14 +64,17 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
// Access check.
|
||||
$access = JFactory::getUser()->authorise('question_and_answer.access', 'com_questionsanswers');
|
||||
$access = $user->authorise('question_and_answer.access', 'com_questionsanswers');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('question_and_answer.create', $this->option);
|
||||
return $user->authorise('question_and_answer.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,9 +89,9 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{ // get user object.
|
||||
$user = JFactory::getUser();
|
||||
$user = JFactory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
@ -140,42 +147,25 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
@ -214,43 +204,45 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -269,11 +261,15 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
@ -281,9 +277,22 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
@ -292,9 +301,9 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.php
|
||||
@ -26,24 +26,33 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Questions_and_answers Controller
|
||||
*/
|
||||
class QuestionsanswersControllerQuestions_and_answers extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Question_and_answer', $prefix = 'QuestionsanswersModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS';
|
||||
|
||||
return $model;
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Question_and_answer', $prefix = 'QuestionsanswersModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Questionsanswers Controller
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage headercheck.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage batch_.php
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -113,7 +113,7 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENTS_BATCH_USE_DESC="Allows users in this group t
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_CREATE="Help Documents Create"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_CREATE_DESC="Allows the users in this group to create create help documents"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DASHBOARD_LIST="Help Documents Dashboard List"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the help document"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of help document"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DELETE="Help Documents Delete"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DELETE_DESC="Allows the users in this group to delete delete help documents"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_EDIT="Help Documents Edit"
|
||||
@ -146,7 +146,7 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_UNFEATURED_1="%s Help Document unfea
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_UNPUBLISHED="%s Help Documents unpublished."
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_UNPUBLISHED_1="%s Help Document unpublished."
|
||||
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 submenu of help document"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN="Admin"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW="Admin View"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW_DESCRIPTION="Select the view being target."
|
||||
@ -271,29 +271,29 @@ COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_BATCH_USE_DESC="Allows users in this
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_CREATE="Questions And Answers Create"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_CREATE_DESC="Allows the users in this group to create create questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_ADD="Questions And Answers Dashboard Add"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_LIST="Questions And Answers Dashboard List"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DELETE="Questions And Answers Delete"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DELETE_DESC="Allows the users in this group to delete delete questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT="Questions And Answers Edit"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER="Questions And Answers Edit Answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DESC="Allows the users in this group to update the edit answer of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DESC="Allows the users in this group to edit answer of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DOCUMENTS="Questions And Answers Edit Answer Documents"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DOCUMENTS_DESC="Allows the users in this group to update the edit answer documents of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DOCUMENTS_DESC="Allows the users in this group to edit answer documents of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CATID="Questions And Answers Edit Catid"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CATID_DESC="Allows the users in this group to update the edit catid of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CATID_DESC="Allows the users in this group to edit catid of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CREATED_BY="Questions And Answers Edit Created By"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CREATED_DATE="Questions And Answers Edit Created Date"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_DESC="Allows the users in this group to edit the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_MAIN_IMAGE_UPLOADER="Questions And Answers Edit Main Image Uploader"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_MAIN_IMAGE_UPLOADER_DESC="Allows the users in this group to update the edit main image uploader of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_MAIN_IMAGE_UPLOADER_DESC="Allows the users in this group to edit main image uploader of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_OWN="Questions And Answers Edit Own"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_OWN_DESC="Allows the users in this group to edit edit own questions and answers created by them"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_QUESTION="Questions And Answers Edit Question"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_QUESTION_DESC="Allows the users in this group to update the edit question of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_QUESTION_DESC="Allows the users in this group to edit question of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_STATE="Questions And Answers Edit State"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_STATE_DESC="Allows the users in this group to update the state of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_VERSION="Questions And Answers Edit Version"
|
||||
@ -320,11 +320,33 @@ COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_UNFEATURED_1="%s Question and
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_UNPUBLISHED="%s Questions and Answers unpublished."
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_UNPUBLISHED_1="%s Question and Answer unpublished."
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_SUBMENU="Questions And Answers Submenu"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_SUBMENU_DESC="Allows the users in this group to update the submenu of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_SUBMENU_DESC="Allows the users in this group to submenu of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER="Question and Answer"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER="Answer"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_DOCUMENTS="Answer Documents"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_DOCUMENTS_UPLOADER_DESCRIPTION="<div id='upload-drop-answer-documents' class='uk-placeholder'><br /><br /><i class='uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right'></i> Upload Your <strong>answer documents</span></strong> by dropping the file here or <a class='uk-form-file'>selecting the file from your computer<input id='upload-select-answer-documents' type='file'></a> (formates allowed: <span id='answer-documents-formats'></span>)<br /><br /><br /></div><div id='progressbar-answer-documents' class='uk-progress uk-hidden'><div class='uk-progress-bar' style='width: 0%;'>...</div></div>"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_DOCUMENTS_UPLOADER_DESCRIPTION="
|
||||
<div id='uikittwo-answer-documents-uploader' style='display:none'>
|
||||
<div id='uikittwo-upload-drop-answer-documents' class='uk-placeholder uk-text-center'>
|
||||
<br /><br />
|
||||
<i class='uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right'></i>
|
||||
Upload Your <strong>answer</strong> by dropping the file here or
|
||||
<a class='uk-form-file'>selecting the file from your device<input id='uikittwo-upload-select-answer-documents' type='file'></a> (formats allowed: <span id='answer-documents-formats'></span>)
|
||||
<br /><br /><br />
|
||||
</div>
|
||||
<div id='uikittwo-progressbar-answer-documents' class='uk-progress uk-hidden'><div class='uk-progress-bar' style='width: 0%;'>...</div></div>
|
||||
</div>
|
||||
<div id='uikitthree-answer-documents-uploader' style='display:none'>
|
||||
<div id='uikitthree-upload-answer-documents' class='uk-placeholder uk-text-center'>
|
||||
<span uk-icon='icon: cloud-upload'></span>
|
||||
<span class='uk-text-middle'>Upload Your <strong>answer</strong> by dropping the file here or
|
||||
<div uk-form-custom>
|
||||
<input type='file' multiple>
|
||||
<span class='uk-link'>selecting the file from your device</span> (formats allowed: <span id='answer-documents-formats'></span>)
|
||||
</div>
|
||||
</div>
|
||||
<progress id='uikitthree-progressbar-answer-documents' class='uk-progress' value='0' max='100' hidden></progress>
|
||||
</div>
|
||||
<div id='error-answer-documents-uploader'></div>"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_DOCUMENTS_UPLOADER_LABEL="Answer Documents"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_LABEL="Answer"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_CATID_DESCRIPTION="select one of the following categories"
|
||||
@ -338,7 +360,29 @@ COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_EDIT="Editing the Question and Answer"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ERROR_UNIQUE_ALIAS="Another Question and Answer has the same alias."
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ID="Id"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_MAIN_IMAGE="Main Image"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_MAIN_IMAGE_UPLOADER_DESCRIPTION="<div id='upload-drop-main-image' class='uk-placeholder'><br /><br /><i class='uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right'></i> Upload Your <strong>image <span id='size-main'></span></strong> by dropping the file here or <a class='uk-form-file'>selecting the file from your computer<input id='upload-select-main-image' type='file'></a> (formates allowed: <span id='main-image-formats'></span>)<br /><br /><br /></div><div id='progressbar-main-image' class='uk-progress uk-hidden'><div class='uk-progress-bar' style='width: 0%;'>...</div></div>"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_MAIN_IMAGE_UPLOADER_DESCRIPTION="
|
||||
<div id='uikittwo-main-image-uploader' style='display:none'>
|
||||
<div id='uikittwo-upload-drop-main-image' class='uk-placeholder uk-text-center'>
|
||||
<br /><br />
|
||||
<i class='uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right'></i>
|
||||
Upload Your <strong>main image <span id='size-main'></span></strong> by dropping the file here or
|
||||
<a class='uk-form-file'>selecting the file from your computer<input id='uikittwo-upload-select-main-image' type='file'></a> (formats allowed: <span id='main-image-formats'></span>)
|
||||
<br /><br /><br />
|
||||
</div>
|
||||
<div id='uikittwo-progressbar-main-image' class='uk-progress uk-hidden'><div class='uk-progress-bar' style='width: 0%;'>...</div></div>
|
||||
</div>
|
||||
<div id='uikitthree-main-image-uploader' style='display:none'>
|
||||
<div id='uikitthree-upload-main-image' class='uk-placeholder uk-text-center'>
|
||||
<span uk-icon='icon: cloud-upload'></span>
|
||||
<span class='uk-text-middle'>Upload Your <strong>main image <span id='size-main'></span></strong> by dropping the file here or</span>
|
||||
<div uk-form-custom>
|
||||
<input type='file' multiple>
|
||||
<span class='uk-link'>selecting the file from your computer</span> (formats allowed: <span id='main-image-formats'></span>)
|
||||
</div>
|
||||
</div>
|
||||
<progress id='uikitthree-progressbar-main-image' class='uk-progress' value='0' max='100' hidden></progress>
|
||||
</div>
|
||||
<div id='error-main-image-uploader'></div>"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_MAIN_IMAGE_UPLOADER_LABEL="Image"
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_MODIFIED_BY_DESC="The last user that modified this Question and Answer."
|
||||
COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_MODIFIED_BY_LABEL="Modified By"
|
||||
|
@ -15,7 +15,7 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENTS_BATCH_USE_DESC="Allows users in this group t
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_CREATE="Help Documents Create"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_CREATE_DESC="Allows the users in this group to create create help documents"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DASHBOARD_LIST="Help Documents Dashboard List"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the help document"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of help document"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DELETE="Help Documents Delete"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_DELETE_DESC="Allows the users in this group to delete delete help documents"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_EDIT="Help Documents Edit"
|
||||
@ -31,7 +31,7 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENTS_EXPORT_DESC="Allows the users in this group
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_IMPORT="Help Documents Import"
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_IMPORT_DESC="Allows the users in this group to import import help documents"
|
||||
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 submenu of help document"
|
||||
COM_QUESTIONSANSWERS_IMPORT_DATA="Import Data"
|
||||
COM_QUESTIONSANSWERS_IMPORT_DATA_DESC=" Allows users in this group to import data."
|
||||
COM_QUESTIONSANSWERS_MENU="Questions and Answers"
|
||||
@ -52,29 +52,29 @@ COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_BATCH_USE_DESC="Allows users in this
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_CREATE="Questions And Answers Create"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_CREATE_DESC="Allows the users in this group to create create questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_ADD="Questions And Answers Dashboard Add"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_LIST="Questions And Answers Dashboard List"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DELETE="Questions And Answers Delete"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_DELETE_DESC="Allows the users in this group to delete delete questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT="Questions And Answers Edit"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER="Questions And Answers Edit Answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DESC="Allows the users in this group to update the edit answer of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DESC="Allows the users in this group to edit answer of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DOCUMENTS="Questions And Answers Edit Answer Documents"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DOCUMENTS_DESC="Allows the users in this group to update the edit answer documents of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_ANSWER_DOCUMENTS_DESC="Allows the users in this group to edit answer documents of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CATID="Questions And Answers Edit Catid"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CATID_DESC="Allows the users in this group to update the edit catid of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CATID_DESC="Allows the users in this group to edit catid of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CREATED_BY="Questions And Answers Edit Created By"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CREATED_DATE="Questions And Answers Edit Created Date"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_DESC="Allows the users in this group to edit the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_MAIN_IMAGE_UPLOADER="Questions And Answers Edit Main Image Uploader"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_MAIN_IMAGE_UPLOADER_DESC="Allows the users in this group to update the edit main image uploader of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_MAIN_IMAGE_UPLOADER_DESC="Allows the users in this group to edit main image uploader of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_OWN="Questions And Answers Edit Own"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_OWN_DESC="Allows the users in this group to edit edit own questions and answers created by them"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_QUESTION="Questions And Answers Edit Question"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_QUESTION_DESC="Allows the users in this group to update the edit question of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_QUESTION_DESC="Allows the users in this group to edit question of question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_STATE="Questions And Answers Edit State"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_STATE_DESC="Allows the users in this group to update the state of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EDIT_VERSION="Questions And Answers Edit Version"
|
||||
@ -84,6 +84,6 @@ COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_EXPORT_DESC="Allows the users in this
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_IMPORT="Questions And Answers Import"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_IMPORT_DESC="Allows the users in this group to import import questions and answers"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_SUBMENU="Questions And Answers Submenu"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_SUBMENU_DESC="Allows the users in this group to update the submenu of the question and answer"
|
||||
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_SUBMENU_DESC="Allows the users in this group to submenu of question and answer"
|
||||
COM_QUESTIONSANSWERS_USE_BATCH="Use Batch"
|
||||
COM_QUESTIONSANSWERS_USE_BATCH_DESC=" Allows users in this group to use batch copy/update method."
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage batchselection.php
|
||||
@ -27,8 +27,8 @@
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
JHtmlBehavior::core();
|
||||
$divWrapper = range(1,120,2);
|
||||
$counter = 0;
|
||||
$divWrapper = range(1,120,2);
|
||||
$counter = 0;
|
||||
?>
|
||||
<?php if ($displayData->ListSelection) : ?>
|
||||
<div class="row-fluid">
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_above.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_fullwidth.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_left.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_right.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_under.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publishing.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publlshing.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_fullwidth.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_rightside.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_under.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage metadata.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publishing.php
|
||||
@ -24,7 +24,6 @@
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage ajax.php
|
||||
@ -26,8 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport('joomla.application.component.helper');
|
||||
|
||||
/**
|
||||
* Questionsanswers Ajax Model
|
||||
*/
|
||||
@ -56,6 +54,7 @@ class QuestionsanswersModelAjax extends JModelList
|
||||
$vdm = $jinput->get('vdm', null, 'WORD');
|
||||
if ($vdm)
|
||||
{
|
||||
// set view and id
|
||||
if ($view = QuestionsanswersHelper::get($vdm))
|
||||
{
|
||||
$current = (array) explode('__', $view);
|
||||
@ -68,6 +67,14 @@ class QuestionsanswersModelAjax extends JModelList
|
||||
);
|
||||
}
|
||||
}
|
||||
// set return if found
|
||||
if ($return = QuestionsanswersHelper::get($vdm . '__return'))
|
||||
{
|
||||
if (QuestionsanswersHelper::checkString($return))
|
||||
{
|
||||
$this->viewid[$call]['a_return'] = $return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($this->viewid[$call]))
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage adminviewfolderlist.php
|
||||
@ -45,9 +45,9 @@ class JFormFieldAdminviewfolderlist extends JFormFieldList
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
public function getOptions()
|
||||
protected function getOptions()
|
||||
{
|
||||
// get custom folder files
|
||||
$localfolder = JPATH_COMPONENT_ADMINISTRATOR.'/views';
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage articles.php
|
||||
@ -45,9 +45,9 @@ class JFormFieldArticles extends JFormFieldList
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
public function getOptions()
|
||||
protected function getOptions()
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage siteviewfolderlist.php
|
||||
@ -45,9 +45,9 @@ class JFormFieldSiteviewfolderlist extends JFormFieldList
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
public function getOptions()
|
||||
protected function getOptions()
|
||||
{
|
||||
// get custom folder files
|
||||
$localfolder = JPATH_COMPONENT_SITE.'/views';
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.js
|
||||
@ -59,6 +59,7 @@ function vvvvvvv(location_vvvvvvv)
|
||||
if (location_vvvvvvv == 1)
|
||||
{
|
||||
jQuery('#jform_admin_view').closest('.control-group').show();
|
||||
// add required attribute to admin_view field
|
||||
if (jform_vvvvvvvvvv_required)
|
||||
{
|
||||
updateFieldRequired('admin_view',0);
|
||||
@ -67,11 +68,11 @@ function vvvvvvv(location_vvvvvvv)
|
||||
jQuery('#jform_admin_view').addClass('required');
|
||||
jform_vvvvvvvvvv_required = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_admin_view').closest('.control-group').hide();
|
||||
// remove required attribute from admin_view field
|
||||
if (!jform_vvvvvvvvvv_required)
|
||||
{
|
||||
updateFieldRequired('admin_view',1);
|
||||
@ -90,6 +91,7 @@ function vvvvvvw(location_vvvvvvw)
|
||||
if (location_vvvvvvw == 2)
|
||||
{
|
||||
jQuery('#jform_site_view').closest('.control-group').show();
|
||||
// add required attribute to site_view field
|
||||
if (jform_vvvvvvwvvw_required)
|
||||
{
|
||||
updateFieldRequired('site_view',0);
|
||||
@ -98,11 +100,11 @@ function vvvvvvw(location_vvvvvvw)
|
||||
jQuery('#jform_site_view').addClass('required');
|
||||
jform_vvvvvvwvvw_required = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_site_view').closest('.control-group').hide();
|
||||
// remove required attribute from site_view field
|
||||
if (!jform_vvvvvvwvvw_required)
|
||||
{
|
||||
updateFieldRequired('site_view',1);
|
||||
@ -134,6 +136,7 @@ function vvvvvvx(type_vvvvvvx)
|
||||
if (type)
|
||||
{
|
||||
jQuery('#jform_url').closest('.control-group').show();
|
||||
// add required attribute to url field
|
||||
if (jform_vvvvvvxvvx_required)
|
||||
{
|
||||
updateFieldRequired('url',0);
|
||||
@ -142,11 +145,11 @@ function vvvvvvx(type_vvvvvvx)
|
||||
jQuery('#jform_url').addClass('required');
|
||||
jform_vvvvvvxvvx_required = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_url').closest('.control-group').hide();
|
||||
// remove required attribute from url field
|
||||
if (!jform_vvvvvvxvvx_required)
|
||||
{
|
||||
updateFieldRequired('url',1);
|
||||
@ -189,6 +192,7 @@ function vvvvvvy(type_vvvvvvy)
|
||||
if (type)
|
||||
{
|
||||
jQuery('#jform_article').closest('.control-group').show();
|
||||
// add required attribute to article field
|
||||
if (jform_vvvvvvyvvy_required)
|
||||
{
|
||||
updateFieldRequired('article',0);
|
||||
@ -197,11 +201,11 @@ function vvvvvvy(type_vvvvvvy)
|
||||
jQuery('#jform_article').addClass('required');
|
||||
jform_vvvvvvyvvy_required = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_article').closest('.control-group').hide();
|
||||
// remove required attribute from article field
|
||||
if (!jform_vvvvvvyvvy_required)
|
||||
{
|
||||
updateFieldRequired('article',1);
|
||||
@ -244,6 +248,7 @@ function vvvvvvz(type_vvvvvvz)
|
||||
if (type)
|
||||
{
|
||||
jQuery('#jform_content-lbl').closest('.control-group').show();
|
||||
// add required attribute to content field
|
||||
if (jform_vvvvvvzvvz_required)
|
||||
{
|
||||
updateFieldRequired('content',0);
|
||||
@ -252,11 +257,11 @@ function vvvvvvz(type_vvvvvvz)
|
||||
jQuery('#jform_content').addClass('required');
|
||||
jform_vvvvvvzvvz_required = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_content-lbl').closest('.control-group').hide();
|
||||
// remove required attribute from content field
|
||||
if (!jform_vvvvvvzvvz_required)
|
||||
{
|
||||
updateFieldRequired('content',1);
|
||||
@ -286,6 +291,7 @@ function vvvvvwa(target_vvvvvwa)
|
||||
if (target_vvvvvwa == 1)
|
||||
{
|
||||
jQuery('#jform_groups').closest('.control-group').show();
|
||||
// add required attribute to groups field
|
||||
if (jform_vvvvvwavwa_required)
|
||||
{
|
||||
updateFieldRequired('groups',0);
|
||||
@ -294,11 +300,11 @@ function vvvvvwa(target_vvvvvwa)
|
||||
jQuery('#jform_groups').addClass('required');
|
||||
jform_vvvvvwavwa_required = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_groups').closest('.control-group').hide();
|
||||
// remove required attribute from groups field
|
||||
if (!jform_vvvvvwavwa_required)
|
||||
{
|
||||
updateFieldRequired('groups',1);
|
||||
|
@ -101,7 +101,8 @@
|
||||
description="COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
required="true">
|
||||
required="true"
|
||||
default="">
|
||||
<!-- Option Set. -->
|
||||
<option value="">
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENT_SELECT_AN_OPTION</option>
|
||||
@ -128,6 +129,7 @@
|
||||
label="COM_QUESTIONSANSWERS_HELP_DOCUMENT_LOCATION_LABEL"
|
||||
description="COM_QUESTIONSANSWERS_HELP_DOCUMENT_LOCATION_DESCRIPTION"
|
||||
class="btn-group"
|
||||
default=""
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
@ -143,6 +145,7 @@
|
||||
description="COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default=""
|
||||
required="true"
|
||||
button="false"
|
||||
/>
|
||||
@ -154,6 +157,7 @@
|
||||
description="COM_QUESTIONSANSWERS_HELP_DOCUMENT_SITE_VIEW_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default=""
|
||||
required="true"
|
||||
button="false"
|
||||
/>
|
||||
@ -191,6 +195,7 @@
|
||||
label="COM_QUESTIONSANSWERS_HELP_DOCUMENT_URL_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
default=""
|
||||
description="COM_QUESTIONSANSWERS_HELP_DOCUMENT_URL_DESCRIPTION"
|
||||
class="text_area"
|
||||
required="true"
|
||||
@ -207,6 +212,7 @@
|
||||
label="COM_QUESTIONSANSWERS_HELP_DOCUMENT_TARGET_LABEL"
|
||||
description="COM_QUESTIONSANSWERS_HELP_DOCUMENT_TARGET_DESCRIPTION"
|
||||
class="btn-group"
|
||||
default=""
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.js
|
||||
@ -97,8 +97,12 @@ function setFile(filename, fileFormat, target, type){
|
||||
return true;
|
||||
}
|
||||
|
||||
function removeFileCheck(clearServer, target, type){
|
||||
UIkit.modal.confirm('Are you sure you want to delete this '+target+'?', function(){ removeFile(clearServer, target, 1, type); });
|
||||
function removeFileCheck(clearServer, target, type, uiVer){
|
||||
if (3 == uiVer) {
|
||||
UIkit.modal.confirm('Are you sure you want to delete this '+target+'?').then(function(){ removeFile(clearServer, target, 1, type); });
|
||||
} else {
|
||||
UIkit2.modal.confirm('Are you sure you want to delete this '+target+'?', function(){ removeFile(clearServer, target, 1, type); });
|
||||
}
|
||||
}
|
||||
|
||||
function removeFile(clearServer, target, flush, type){
|
||||
@ -135,16 +139,16 @@ function removeFile(clearServer, target, flush, type){
|
||||
}
|
||||
|
||||
function removeFile_server(currentFileName, target, flush, type){
|
||||
var getUrl = JRouter("index.php?option=com_questionsanswers&task=ajax.removeFile&format=json&vdm="+vastDevMod);
|
||||
var getUrl = JRouter("index.php?option=com_questionsanswers&task=ajax.removeFile&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && target.length > 0 && type.length > 0){
|
||||
var request = 'token='+token+'&filename='+currentFileName+'&target='+target+'&flush='+flush+'&type='+type;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
function isJsonString(str) {
|
||||
|
@ -110,6 +110,7 @@
|
||||
label="COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_QUESTION_LABEL"
|
||||
rows="2"
|
||||
cols="5"
|
||||
default=""
|
||||
description="COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_QUESTION_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="STRING"
|
||||
@ -121,6 +122,7 @@
|
||||
type="editor"
|
||||
name="answer"
|
||||
label="COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_LABEL"
|
||||
default=""
|
||||
width="100%"
|
||||
height="500"
|
||||
buttons="false"
|
||||
@ -134,6 +136,7 @@
|
||||
name="catid"
|
||||
label="COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_CATID_LABEL"
|
||||
extension="com_questionsanswers.questions_and_answers"
|
||||
default=""
|
||||
description="COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_CATID_DESCRIPTION"
|
||||
class="inputbox"
|
||||
/>
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@ -28,9 +28,6 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
// import Joomla modelform library
|
||||
jimport('joomla.application.component.modeladmin');
|
||||
|
||||
/**
|
||||
* Questionsanswers Help_document Model
|
||||
*/
|
||||
@ -63,6 +60,9 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
*/
|
||||
public function getTable($type = 'help_document', $prefix = 'QuestionsanswersTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_questionsanswers/tables');
|
||||
// get instance of the table
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
@ -116,15 +116,18 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true)
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_questionsanswers.help_document', 'help_document', array('control' => 'jform', 'load_data' => $loadData));
|
||||
$form = $this->loadForm('com_questionsanswers.help_document', 'help_document', $options);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
@ -185,17 +188,20 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
// Only load these values if no id is found
|
||||
if (0 == $id)
|
||||
{
|
||||
// Set redirected field name
|
||||
$redirectedField = $jinput->get('ref', null, 'STRING');
|
||||
// Set redirected field value
|
||||
$redirectedValue = $jinput->get('refid', 0, 'INT');
|
||||
// Set redirected view name
|
||||
$redirectedView = $jinput->get('ref', null, 'STRING');
|
||||
// Set field name (or fall back to view name)
|
||||
$redirectedField = $jinput->get('field', $redirectedView, 'STRING');
|
||||
// Set redirected view id
|
||||
$redirectedId = $jinput->get('refid', 0, 'INT');
|
||||
// Set field id (or fall back to redirected view id)
|
||||
$redirectedValue = $jinput->get('field_id', $redirectedId, 'INT');
|
||||
if (0 != $redirectedValue && $redirectedField)
|
||||
{
|
||||
// Now set the local-redirected field default value
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
@ -246,7 +252,7 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
protected function canEditState($record)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$recordId = (!empty($record->id)) ? $record->id : 0;
|
||||
$recordId = (!empty($record->id)) ? $record->id : 0;
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
@ -357,18 +363,18 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to validate the form data.
|
||||
*
|
||||
* @param JForm $form The form to validate against.
|
||||
* @param array $data The data to validate.
|
||||
* @param string $group The name of the field group to validate.
|
||||
*
|
||||
* @return mixed Array of filtered data if valid, false otherwise.
|
||||
*
|
||||
* @see JFormRule
|
||||
* @see JFilterInput
|
||||
* @since 12.2
|
||||
*/
|
||||
* Method to validate the form data.
|
||||
*
|
||||
* @param JForm $form The form to validate against.
|
||||
* @param array $data The data to validate.
|
||||
* @param string $group The name of the field group to validate.
|
||||
*
|
||||
* @return mixed Array of filtered data if valid, false otherwise.
|
||||
*
|
||||
* @see JFormRule
|
||||
* @see JFilterInput
|
||||
* @since 12.2
|
||||
*/
|
||||
public function validate($form, $data, $group = null)
|
||||
{
|
||||
// check if the not_required field is set
|
||||
@ -548,7 +554,7 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
*
|
||||
* @return mixed An array of new IDs on success, boolean false on failure.
|
||||
*
|
||||
* @since 12.2
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function batchCopy($values, $pks, $contexts)
|
||||
{
|
||||
@ -641,7 +647,7 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
$this->table->id = 0;
|
||||
|
||||
// TODO: Deal with ordering?
|
||||
// $this->table->ordering = 1;
|
||||
// $this->table->ordering = 1;
|
||||
|
||||
// Check the row.
|
||||
if (!$this->table->check())
|
||||
@ -686,7 +692,7 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 12.2
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function batchMove($values, $pks, $contexts)
|
||||
{
|
||||
@ -922,14 +928,14 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to change the title/s & alias.
|
||||
*
|
||||
* @param string $alias The alias.
|
||||
* @param string/array $title The title.
|
||||
*
|
||||
* @return array/string Contains the modified title/s and/or alias.
|
||||
*
|
||||
*/
|
||||
* Method to change the title/s & alias.
|
||||
*
|
||||
* @param string $alias The alias.
|
||||
* @param string/array $title The title.
|
||||
*
|
||||
* @return array/string Contains the modified title/s and/or alias.
|
||||
*
|
||||
*/
|
||||
protected function _generateNewTitle($alias, $title = null)
|
||||
{
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the Joomla modellist library
|
||||
jimport('joomla.application.component.modellist');
|
||||
|
||||
/**
|
||||
* Help_documents Model
|
||||
*/
|
||||
@ -122,11 +119,9 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
// set values to display correctly.
|
||||
if (QuestionsanswersHelper::checkArray($items))
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = ($user->authorise('help_document.access', 'com_questionsanswers.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_questionsanswers'));
|
||||
$access = (JFactory::getUser()->authorise('help_document.access', 'com_questionsanswers.help_document.' . (int) $item->id) && JFactory::getUser()->authorise('help_document.access', 'com_questionsanswers'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
@ -174,10 +169,10 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to convert selection values to translatable string.
|
||||
*
|
||||
* @return translatable string
|
||||
*/
|
||||
* Method to convert selection values to translatable string.
|
||||
*
|
||||
* @return translatable string
|
||||
*/
|
||||
public function selectionTranslation($value,$name)
|
||||
{
|
||||
// Array of type language strings
|
||||
@ -288,10 +283,10 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks)
|
||||
{
|
||||
// setup the query
|
||||
@ -325,11 +320,9 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
// set values to display correctly.
|
||||
if (QuestionsanswersHelper::checkArray($items))
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = ($user->authorise('help_document.access', 'com_questionsanswers.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_questionsanswers'));
|
||||
$access = (JFactory::getUser()->authorise('help_document.access', 'com_questionsanswers.help_document.' . (int) $item->id) && JFactory::getUser()->authorise('help_document.access', 'com_questionsanswers'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
@ -406,11 +399,11 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an SQL query to checkin all items left checked out longer then a set time.
|
||||
*
|
||||
* @return a bool
|
||||
*
|
||||
*/
|
||||
* Build an SQL query to checkin all items left checked out longer then a set time.
|
||||
*
|
||||
* @return a bool
|
||||
*
|
||||
*/
|
||||
protected function checkInNow()
|
||||
{
|
||||
// Get set check in time
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage import.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@ -28,9 +28,6 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
// import Joomla modelform library
|
||||
jimport('joomla.application.component.modeladmin');
|
||||
|
||||
/**
|
||||
* Questionsanswers Question_and_answer Model
|
||||
*/
|
||||
@ -63,6 +60,9 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
*/
|
||||
public function getTable($type = 'question_and_answer', $prefix = 'QuestionsanswersTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_questionsanswers/tables');
|
||||
// get instance of the table
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
@ -86,9 +86,14 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = QuestionsanswersHelper::randomkey(50);
|
||||
QuestionsanswersHelper::set($this->vastDevMod, 'question_and_answer__'.$id);
|
||||
QuestionsanswersHelper::set('question_and_answer__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
QuestionsanswersHelper::set($this->vastDevMod . '__return', $return);
|
||||
}
|
||||
}
|
||||
return $this->vastDevMod;
|
||||
@ -156,9 +161,14 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = QuestionsanswersHelper::randomkey(50);
|
||||
QuestionsanswersHelper::set($this->vastDevMod, 'question_and_answer__'.$id);
|
||||
QuestionsanswersHelper::set('question_and_answer__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
QuestionsanswersHelper::set($this->vastDevMod . '__return', $return);
|
||||
}
|
||||
// build download links
|
||||
$item->links = array();
|
||||
@ -209,15 +219,18 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true)
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_questionsanswers.question_and_answer', 'question_and_answer', array('control' => 'jform', 'load_data' => $loadData));
|
||||
$form = $this->loadForm('com_questionsanswers.question_and_answer', 'question_and_answer', $options);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
@ -285,6 +298,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$form->setFieldAttribute('question', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('question', 'readonly', 'true');
|
||||
// If there is no value continue.
|
||||
if (!$form->getValue('question'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
@ -301,6 +315,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$form->setFieldAttribute('answer', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('answer', 'readonly', 'true');
|
||||
// If there is no value continue.
|
||||
if (!$form->getValue('answer'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
@ -317,6 +332,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$form->setFieldAttribute('catid', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('catid', 'readonly', 'true');
|
||||
// If there is no value continue.
|
||||
if (!$form->getValue('catid'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
@ -333,6 +349,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$form->setFieldAttribute('answer_documents', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('answer_documents', 'readonly', 'true');
|
||||
// If there is no value continue.
|
||||
if (!$form->getValue('answer_documents'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
@ -349,6 +366,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$form->setFieldAttribute('main_image_uploader', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('main_image_uploader', 'readonly', 'true');
|
||||
// If there is no value continue.
|
||||
if (!$form->getValue('main_image_uploader'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
@ -360,17 +378,20 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
// Only load these values if no id is found
|
||||
if (0 == $id)
|
||||
{
|
||||
// Set redirected field name
|
||||
$redirectedField = $jinput->get('ref', null, 'STRING');
|
||||
// Set redirected field value
|
||||
$redirectedValue = $jinput->get('refid', 0, 'INT');
|
||||
// Set redirected view name
|
||||
$redirectedView = $jinput->get('ref', null, 'STRING');
|
||||
// Set field name (or fall back to view name)
|
||||
$redirectedField = $jinput->get('field', $redirectedView, 'STRING');
|
||||
// Set redirected view id
|
||||
$redirectedId = $jinput->get('refid', 0, 'INT');
|
||||
// Set field id (or fall back to redirected view id)
|
||||
$redirectedValue = $jinput->get('field_id', $redirectedId, 'INT');
|
||||
if (0 != $redirectedValue && $redirectedField)
|
||||
{
|
||||
// Now set the local-redirected field default value
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
@ -421,7 +442,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
protected function canEditState($record)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$recordId = (!empty($record->id)) ? $record->id : 0;
|
||||
$recordId = (!empty($record->id)) ? $record->id : 0;
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
@ -687,7 +708,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
*
|
||||
* @return mixed An array of new IDs on success, boolean false on failure.
|
||||
*
|
||||
* @since 12.2
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function batchCopy($values, $pks, $contexts)
|
||||
{
|
||||
@ -794,7 +815,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$this->table->id = 0;
|
||||
|
||||
// TODO: Deal with ordering?
|
||||
// $this->table->ordering = 1;
|
||||
// $this->table->ordering = 1;
|
||||
|
||||
// Check the row.
|
||||
if (!$this->table->check())
|
||||
@ -839,7 +860,7 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 12.2
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function batchMove($values, $pks, $contexts)
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the Joomla modellist library
|
||||
jimport('joomla.application.component.modellist');
|
||||
|
||||
/**
|
||||
* Questions_and_answers Model
|
||||
*/
|
||||
@ -110,11 +107,9 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
// set values to display correctly.
|
||||
if (QuestionsanswersHelper::checkArray($items))
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = ($user->authorise('question_and_answer.access', 'com_questionsanswers.question_and_answer.' . (int) $item->id) && $user->authorise('question_and_answer.access', 'com_questionsanswers'));
|
||||
$access = (JFactory::getUser()->authorise('question_and_answer.access', 'com_questionsanswers.question_and_answer.' . (int) $item->id) && JFactory::getUser()->authorise('question_and_answer.access', 'com_questionsanswers'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
@ -224,10 +219,10 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks)
|
||||
{
|
||||
// setup the query
|
||||
@ -272,11 +267,9 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
// set values to display correctly.
|
||||
if (QuestionsanswersHelper::checkArray($items))
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = ($user->authorise('question_and_answer.access', 'com_questionsanswers.question_and_answer.' . (int) $item->id) && $user->authorise('question_and_answer.access', 'com_questionsanswers'));
|
||||
$access = (JFactory::getUser()->authorise('question_and_answer.access', 'com_questionsanswers.question_and_answer.' . (int) $item->id) && JFactory::getUser()->authorise('question_and_answer.access', 'com_questionsanswers'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
@ -360,11 +353,11 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an SQL query to checkin all items left checked out longer then a set time.
|
||||
*
|
||||
* @return a bool
|
||||
*
|
||||
*/
|
||||
* Build an SQL query to checkin all items left checked out longer then a set time.
|
||||
*
|
||||
* @return a bool
|
||||
*
|
||||
*/
|
||||
protected function checkInNow()
|
||||
{
|
||||
// Get set check in time
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@ -26,10 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the Joomla modellist library
|
||||
jimport('joomla.application.component.modellist');
|
||||
jimport('joomla.application.component.helper');
|
||||
|
||||
/**
|
||||
* Questionsanswers Model
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@ -25,33 +25,26 @@
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
JHtml::_('behavior.tabstate');
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.manage', 'com_questionsanswers'))
|
||||
{
|
||||
return JError::raiseWaring(404, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
|
||||
};
|
||||
|
||||
// Load cms libraries
|
||||
JLoader::registerPrefix('J', JPATH_PLATFORM . '/cms');
|
||||
// Load joomla libraries without overwrite
|
||||
JLoader::registerPrefix('J', JPATH_PLATFORM . '/joomla',false);
|
||||
|
||||
// Add CSS file for all pages
|
||||
$document = JFactory::getDocument();
|
||||
$document->addStyleSheet('components/com_questionsanswers/assets/css/admin.css');
|
||||
$document->addScript('components/com_questionsanswers/assets/js/admin.js');
|
||||
|
||||
// require helper files
|
||||
JLoader::register('QuestionsanswersHelper', dirname(__FILE__) . '/helpers/questionsanswers.php');
|
||||
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
|
||||
JLoader::register('QuestionsanswersHelper', __DIR__ . '/helpers/questionsanswers.php');
|
||||
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');
|
||||
|
||||
// Triger the Global Admin Event
|
||||
QuestionsanswersHelper::globalEvent($document);
|
||||
|
||||
// import joomla controller library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
// Get an instance of the controller prefixed by Questionsanswers
|
||||
$controller = JControllerLegacy::getInstance('Questionsanswers');
|
||||
|
||||
|
@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_question_and_answer` (
|
||||
KEY `idx_modifiedby` (`modified_by`),
|
||||
KEY `idx_state` (`published`),
|
||||
KEY `idx_catid` (`catid`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__questionsanswers_help_document` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
@ -67,7 +67,7 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_help_document` (
|
||||
KEY `idx_article` (`article`),
|
||||
KEY `idx_target` (`target`),
|
||||
KEY `idx_alias` (`alias`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@ -28,9 +28,6 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
// import Joomla table library
|
||||
jimport('joomla.database.table');
|
||||
|
||||
/**
|
||||
* Help_documents Table class
|
||||
*/
|
||||
@ -237,7 +234,7 @@ class QuestionsanswersTableHelp_document extends JTable
|
||||
{
|
||||
// asset alread set so use saved rules
|
||||
$assetId = (int) $db->loadResult();
|
||||
return JAccess::getAssetRules($assetId);
|
||||
return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||
}
|
||||
// try again
|
||||
elseif ($try)
|
||||
@ -326,11 +323,11 @@ class QuestionsanswersTableHelp_document extends JTable
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a valid alias from title / date.
|
||||
* Remains public to be able to check for duplicated alias before saving
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
* Generate a valid alias from title / date.
|
||||
* Remains public to be able to check for duplicated alias before saving
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generateAlias()
|
||||
{
|
||||
if (empty($this->alias))
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@ -28,9 +28,6 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
// import Joomla table library
|
||||
jimport('joomla.database.table');
|
||||
|
||||
/**
|
||||
* Questions_and_answers Table class
|
||||
*/
|
||||
@ -237,7 +234,7 @@ class QuestionsanswersTableQuestion_and_answer extends JTable
|
||||
{
|
||||
// asset alread set so use saved rules
|
||||
$assetId = (int) $db->loadResult();
|
||||
return JAccess::getAssetRules($assetId);
|
||||
return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||
}
|
||||
// try again
|
||||
elseif ($try)
|
||||
@ -326,10 +323,10 @@ class QuestionsanswersTableQuestion_and_answer extends JTable
|
||||
}
|
||||
|
||||
/**
|
||||
* This view does not actually have an alias
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
* This view does not actually have an alias
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function generateAlias()
|
||||
{
|
||||
return false;
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage submitbutton.js
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage edit.php
|
||||
@ -31,7 +31,7 @@ JHtml::_('behavior.tooltip');
|
||||
JHtml::_('behavior.formvalidation');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
JHtml::_('behavior.keepalive');
|
||||
$componentParams = JComponentHelper::getParams('com_questionsanswers');
|
||||
$componentParams = $this->params; // will be removed just use $this->params instead
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
// waiting spinner
|
||||
@ -56,7 +56,7 @@ $componentParams = JComponentHelper::getParams('com_questionsanswers');
|
||||
});
|
||||
</script>
|
||||
<div id="questionsanswers_loader" style="display: none;">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
|
||||
<?php echo JLayoutHelper::render('help_document.details_above', $this); ?>
|
||||
<div class="form-horizontal">
|
||||
@ -79,6 +79,10 @@ $componentParams = JComponentHelper::getParams('com_questionsanswers');
|
||||
</div>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
|
||||
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
|
||||
<?php $this->tab_name = 'help_documentTab'; ?>
|
||||
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
|
||||
|
||||
<?php if ($this->canDo->get('help_document.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('help_document.edit.state') || $this->canDo->get('core.edit.created')) : ?>
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'help_documentTab', 'publishing', JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_PUBLISHING', true)); ?>
|
||||
<div class="row-fluid form-horizontal-desktop">
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* Help_document View class
|
||||
*/
|
||||
@ -40,27 +37,37 @@ class QuestionsanswersViewHelp_document extends JViewLegacy
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// set params
|
||||
$this->params = JComponentHelper::getParams('com_questionsanswers');
|
||||
// Assign the variables
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->script = $this->get('Script');
|
||||
$this->state = $this->get('State');
|
||||
// get action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('help_document',$this->item);
|
||||
$this->canDo = QuestionsanswersHelper::getActions('help_document', $this->item);
|
||||
// get input
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$this->ref = $jinput->get('ref', 0, 'word');
|
||||
$this->refid = $jinput->get('refid', 0, 'int');
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
// set the referral string
|
||||
$this->referral = '';
|
||||
if ($this->refid)
|
||||
if ($this->refid && $this->ref)
|
||||
{
|
||||
// return to the item that refered to this item
|
||||
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
|
||||
// return to the item that referred to this item
|
||||
$this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid;
|
||||
}
|
||||
elseif($this->ref)
|
||||
{
|
||||
// return to the list view that refered to this item
|
||||
$this->referral = '&ref='.(string)$this->ref;
|
||||
// return to the list view that referred to this item
|
||||
$this->referral = '&ref=' . (string)$this->ref;
|
||||
}
|
||||
// check return value
|
||||
if (!is_null($return))
|
||||
{
|
||||
// add the return value
|
||||
$this->referral .= '&return=' . (string)$return;
|
||||
}
|
||||
|
||||
// Set the toolbar
|
||||
@ -92,7 +99,7 @@ class QuestionsanswersViewHelp_document extends JViewLegacy
|
||||
|
||||
JToolbarHelper::title( JText::_($isNew ? 'COM_QUESTIONSANSWERS_HELP_DOCUMENT_NEW' : 'COM_QUESTIONSANSWERS_HELP_DOCUMENT_EDIT'), 'pencil-2 article-add');
|
||||
// Built the actions for new and existing records.
|
||||
if ($this->refid || $this->ref)
|
||||
if (QuestionsanswersHelper::checkString($this->referral))
|
||||
{
|
||||
if ($this->canDo->get('help_document.create') && $isNew)
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_body.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_footer.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_body.php
|
||||
@ -75,16 +75,16 @@ $edit = "index.php?option=com_questionsanswers&view=help_documents&task=help_doc
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="nowrap">
|
||||
<?php if ($canDo->get('help_document.edit')): ?>
|
||||
<div class="name">
|
||||
<div class="name">
|
||||
<?php if ($canDo->get('help_document.edit')): ?>
|
||||
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->title); ?></a>
|
||||
<?php if ($item->checked_out): ?>
|
||||
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'help_documents.', $canCheckin); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="name"><?php echo $this->escape($item->title); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php echo $this->escape($item->title); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
<?php echo JText::_($item->type); ?>
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_foot.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_head.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_toolbar.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* Questionsanswers View class for the Help_documents
|
||||
*/
|
||||
@ -54,6 +51,8 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
|
||||
$this->listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$this->listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$this->saveOrder = $this->listOrder == 'ordering';
|
||||
// set the return here value
|
||||
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
||||
// get global action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('help_document');
|
||||
$this->canEdit = $this->canDo->get('help_document.edit');
|
||||
@ -246,7 +245,7 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
|
||||
}
|
||||
|
||||
// Set Admin View Selection
|
||||
$this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->getOptions();
|
||||
$this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->options;
|
||||
if ($this->admin_viewOptions)
|
||||
{
|
||||
// Admin View Filter
|
||||
@ -268,7 +267,7 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
|
||||
}
|
||||
|
||||
// Set Site View Selection
|
||||
$this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->getOptions();
|
||||
$this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->options;
|
||||
if ($this->site_viewOptions)
|
||||
{
|
||||
// Site View Filter
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* Questionsanswers Import View
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage submitbutton.js
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage edit.php
|
||||
@ -31,7 +31,7 @@ JHtml::_('behavior.tooltip');
|
||||
JHtml::_('behavior.formvalidation');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
JHtml::_('behavior.keepalive');
|
||||
$componentParams = JComponentHelper::getParams('com_questionsanswers');
|
||||
$componentParams = $this->params; // will be removed just use $this->params instead
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
// waiting spinner
|
||||
@ -56,7 +56,7 @@ $componentParams = JComponentHelper::getParams('com_questionsanswers');
|
||||
});
|
||||
</script>
|
||||
<div id="questionsanswers_loader" style="display: none;">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="span9">
|
||||
@ -73,6 +73,10 @@ $componentParams = JComponentHelper::getParams('com_questionsanswers');
|
||||
</div>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
|
||||
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
|
||||
<?php $this->tab_name = 'question_and_answerTab'; ?>
|
||||
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
|
||||
|
||||
<?php if ($this->canDo->get('question_and_answer.delete') || $this->canDo->get('question_and_answer.edit.created_by') || $this->canDo->get('question_and_answer.edit.state') || $this->canDo->get('question_and_answer.edit.created')) : ?>
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'question_and_answerTab', 'publishing', JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_PUBLISHING', true)); ?>
|
||||
<div class="row-fluid form-horizontal-desktop">
|
||||
@ -126,110 +130,277 @@ $componentParams = JComponentHelper::getParams('com_questionsanswers');
|
||||
|
||||
|
||||
|
||||
<?php if ($formats = $componentParams->get('image_formats', null)) : ?>
|
||||
jQuery(function($){
|
||||
var progressbar = $("#progressbar-main-image"),
|
||||
bar = progressbar.find('.uk-progress-bar'),
|
||||
settings = {
|
||||
<?php if ($formats = $this->params->get('image_formats', null)) : ?>
|
||||
<?php $uikitVersion = $this->params->get('uikit_version', 2); // get Uikit Version ?>
|
||||
// set some details
|
||||
var sizeNotice = '';
|
||||
<?php if ($resize = $this->params->get('crop_main', null)) : ?>
|
||||
var sizemain = '(';
|
||||
<?php if ($width = $this->params->get('main_width', null)): ?>
|
||||
sizemain += 'width: <?php echo $width; ?>px';
|
||||
<?php else: ?>
|
||||
sizemain += 'width: <?php echo JText::_('COM_QUESTIONSANSWERS_PROPORTIONALLY'); ?>';
|
||||
<?php endif; ?>
|
||||
<?php if ($height = $this->params->get('main_height', null)): ?>
|
||||
sizemain += ' height: <?php echo $height; ?>px';
|
||||
<?php else: ?>
|
||||
sizemain += ' height: <?php echo JText::_('COM_QUESTIONSANSWERS_PROPORTIONALLY'); ?>';
|
||||
<?php endif; ?>
|
||||
sizemain += ')';
|
||||
<?php if (2 == $uikitVersion) : ?>
|
||||
sizeNotice = '<span data-uk-tooltip title="<?php echo JText::_('COM_QUESTIONSANSWERS_THE_MAIN_WILL_BE_CROPPED_TO_THIS_SIZE'); ?>">'+sizemain+'</span>';
|
||||
<?php else: ?>
|
||||
sizeNotice = '<span uk-tooltip title="<?php echo JText::_('COM_QUESTIONSANSWERS_THE_MAIN_WILL_BE_CROPPED_TO_THIS_SIZE'); ?>">'+sizemain+'</span>';
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
// load the UIKIT script
|
||||
<?php if (2 == $uikitVersion) : ?>
|
||||
// load uikit 2 uploader script
|
||||
jQuery(function($){
|
||||
// prep the placeholder uploading divs
|
||||
$('#uikittwo-main-image-uploader').show();
|
||||
$('#uikitthree-main-image-uploader').remove();
|
||||
$('#error-main-image-uploader').remove();
|
||||
$('#size-main').html(sizeNotice);
|
||||
$('#main-image-formats').html('<b><?php echo implode(', ', $formats); ?></b>');
|
||||
// get progressbar
|
||||
var progressbar = $("#uikittwo-progressbar-main-image"),
|
||||
bar = progressbar.find('.uk-progress-bar'),
|
||||
settings = {
|
||||
|
||||
action: JRouter('index.php?option=com_questionsanswers&task=ajax.uploadfile&format=json&type=image&target=main&raw=true&token='+token+'&vdm='+vastDevMod), // upload url
|
||||
action: JRouter('index.php?option=com_questionsanswers&task=ajax.uploadfile&format=json&type=image&target=main&raw=true&token='+token+'&vdm='+vastDevMod), // upload url
|
||||
|
||||
allow : '*.(<?php echo implode('|', $formats); ?>)', // allow uploads
|
||||
allow : '*.(<?php echo implode('|', $formats); ?>)', // allow uploads
|
||||
|
||||
loadstart: function() {
|
||||
jQuery(".success-main-image-8768").remove();
|
||||
bar.css("width", "0%").text("0%");
|
||||
progressbar.removeClass("uk-hidden");
|
||||
},
|
||||
loadstart: function() {
|
||||
jQuery(".success-main-image-8768").remove();
|
||||
bar.css("width", "0%").text("0%");
|
||||
progressbar.removeClass("uk-hidden");
|
||||
},
|
||||
|
||||
progress: function(percent) {
|
||||
percent = Math.ceil(percent);
|
||||
bar.css("width", percent+"%").text(percent+"%");
|
||||
},
|
||||
progress: function(percent) {
|
||||
percent = Math.ceil(percent);
|
||||
bar.css("width", percent+"%").text(percent+"%");
|
||||
},
|
||||
|
||||
allcomplete: function(response) {
|
||||
bar.css("width", "100%").text("100%");
|
||||
response = JSON.parse(response);
|
||||
setTimeout(function(){
|
||||
progressbar.addClass("uk-hidden");
|
||||
}, 250);
|
||||
if (response.error){
|
||||
alert(response.error);
|
||||
} else if (response.success) {
|
||||
// set the new file name and if another is found delete it
|
||||
setFilekey(response.success, response.fileformat, 'main', 'image');
|
||||
allcomplete: function(response) {
|
||||
bar.css("width", "100%").text("100%");
|
||||
response = JSON.parse(response);
|
||||
setTimeout(function(){
|
||||
progressbar.addClass("uk-hidden");
|
||||
}, 250);
|
||||
if (response.error){
|
||||
alert(response.error);
|
||||
} else if (response.success) {
|
||||
// set the new file name and if another is found delete it
|
||||
setFilekey(response.success, response.fileformat, 'main', 'image');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var select = UIkit.uploadSelect($("#upload-select-main-image"), settings),
|
||||
drop = UIkit.uploadDrop($("#upload-drop-main-image"), settings);
|
||||
});
|
||||
jQuery('#main-image-formats').html('<b><?php echo implode(', ', $formats); ?></b>');
|
||||
<?php if ($resize = $componentParams->get('crop_main', null)) : ?>
|
||||
var sizemain = '(';
|
||||
<?php if ($width = $componentParams->get('main_width', null)): ?>
|
||||
sizemain += 'width: <?php echo $width; ?>px';
|
||||
var select = UIkit2.uploadSelect($("#uikittwo-upload-select-main-image"), settings),
|
||||
drop = UIkit2.uploadDrop($("#uikittwo-upload-drop-main-image"), settings);
|
||||
});
|
||||
<?php else: ?>
|
||||
sizemain += 'width: <?php echo JText::_('COM_QUESTIONSANSWERS_PROPORTIONALLY'); ?>';
|
||||
// load uikit 3 uploader script
|
||||
jQuery(function($){
|
||||
// prep the placeholder uploading divs
|
||||
$('#uikitthree-main-image-uploader').show();
|
||||
$('#uikittwo-main-image-uploader').remove();
|
||||
$('#error-main-image-uploader').remove();
|
||||
$('#size-main').html(sizeNotice);
|
||||
$('#main-image-formats').html('<b><?php echo implode(', ', $formats); ?></b>');
|
||||
// get progressbar
|
||||
var bar = document.getElementById('uikitthree-progressbar-main-image');
|
||||
UIkit.upload('#uikitthree-upload-main-image', {
|
||||
|
||||
url: JRouter('index.php?option=com_questionsanswers&task=ajax.uploadfile&format=json&type=image&target=main&raw=true&token='+token+'&vdm='+vastDevMod), // upload url
|
||||
multiple: true,
|
||||
allow : '*.(<?php echo implode('|', $formats); ?>)', // allow uploads
|
||||
|
||||
beforeSend: function (environment) {
|
||||
// console.log('beforeSend', arguments);
|
||||
|
||||
// The environment object can still be modified here.
|
||||
// var {data, method, headers, xhr, responseType} = environment;
|
||||
},
|
||||
beforeAll: function () {
|
||||
// console.log('beforeAll', arguments);
|
||||
},
|
||||
load: function () {
|
||||
// console.log('load', arguments);
|
||||
},
|
||||
error: function () {
|
||||
// console.log('error', arguments);
|
||||
},
|
||||
complete: function () {
|
||||
// console.log('complete', arguments);
|
||||
},
|
||||
|
||||
loadStart: function (e) {
|
||||
jQuery(".success-main-image-8768").remove();
|
||||
|
||||
bar.removeAttribute('hidden');
|
||||
bar.max = e.total;
|
||||
bar.value = e.loaded;
|
||||
},
|
||||
|
||||
progress: function (e) {
|
||||
bar.max = e.total;
|
||||
bar.value = e.loaded;
|
||||
},
|
||||
|
||||
loadEnd: function (e) {
|
||||
bar.max = e.total;
|
||||
bar.value = e.loaded;
|
||||
},
|
||||
|
||||
completeAll: function (response) {
|
||||
setTimeout(function () {
|
||||
bar.setAttribute('hidden', 'hidden');
|
||||
}, 250);
|
||||
// act upon the response
|
||||
if (response.response) {
|
||||
response = JSON.parse(response.response);
|
||||
if (response.error){
|
||||
alert(response.error);
|
||||
} else if (response.success) {
|
||||
// set the new file name and if another is found delete it
|
||||
setFilekey(response.success, response.fileformat, 'main', 'image');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
<?php endif; ?>
|
||||
<?php if ($height = $componentParams->get('main_height', null)): ?>
|
||||
sizemain += ' height: <?php echo $height; ?>px';
|
||||
<?php else: ?>
|
||||
sizemain += ' height: <?php echo JText::_('COM_QUESTIONSANSWERS_PROPORTIONALLY'); ?>';
|
||||
<?php endif; ?>
|
||||
sizemain += ')';
|
||||
sizeNotice = '<span data-uk-tooltip title="<?php echo JText::_('COM_QUESTIONSANSWERS_THE_MAIN_WILL_BE_CROPPED_TO_THIS_SIZE'); ?>">'+sizemain+'</span>';
|
||||
jQuery('#size-main').html(sizeNotice);
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
jQuery('#upload-drop-main-image').html('<b><?php echo JText::_('COM_QUESTIONSANSWERS_ALLOWED_IMAGE_FORMATS_ARE_NOT_SET_IN_THE_GLOBAL_SETTINGS_PLEASE_NOTIFY_YOUR_SYSTEM_ADMINISTRATOR'); ?></b>');
|
||||
jQuery('#error-main-image-uploader').html('<b><?php echo JText::_('COM_QUESTIONSANSWERS_ALLOWED_IMAGE_FORMATS_ARE_NOT_SET_IN_THE_GLOBAL_SETTINGS_PLEASE_NOTIFY_YOUR_SYSTEM_ADMINISTRATOR'); ?></b>');
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($formats = $componentParams->get('document_formats', null)) : ?>
|
||||
jQuery(function($){
|
||||
var progressbar = $("#progressbar-answer-documents"),
|
||||
bar = progressbar.find('.uk-progress-bar'),
|
||||
settings = {
|
||||
<?php if ($formats = $this->params->get('document_formats', null)) : ?>
|
||||
<?php $uikitVersion = $this->params->get('uikit_version', 2); // get Uikit Version ?>
|
||||
// load the UIKIT script
|
||||
<?php if (2 == $uikitVersion) : ?>
|
||||
// load uikit 2 uploader script
|
||||
jQuery(function($){
|
||||
// prep the placeholder uploading divs
|
||||
$('#uikittwo-answer-documents-uploader').show();
|
||||
$('#uikitthree-answer-documents-uploader').remove();
|
||||
$('#error-answer-documents-uploader').remove();
|
||||
$('#answer-documents-formats').html('<b><?php echo implode(', ', $formats); ?></b>');
|
||||
// get progressbar
|
||||
var progressbar = $("#uikittwo-progressbar-answer-documents"),
|
||||
bar = progressbar.find('.uk-progress-bar'),
|
||||
settings = {
|
||||
|
||||
action: JRouter('index.php?option=com_questionsanswers&task=ajax.uploadfile&format=json&type=documents&target=answer&raw=true&token='+token+'&vdm='+vastDevMod), // upload url
|
||||
action: JRouter('index.php?option=com_questionsanswers&task=ajax.uploadfile&format=json&type=documents&target=answer&raw=true&token='+token+'&vdm='+vastDevMod), // upload url
|
||||
|
||||
allow : '*.(<?php echo implode('|', $formats); ?>)', // allow uploads
|
||||
allow : '*.(<?php echo implode('|', $formats); ?>)', // allow uploads
|
||||
|
||||
loadstart: function() {
|
||||
jQuery(".success-answer-documents-8768").remove();
|
||||
bar.css("width", "0%").text("0%");
|
||||
progressbar.removeClass("uk-hidden");
|
||||
},
|
||||
loadstart: function() {
|
||||
jQuery(".success-answer-documents-8768").remove();
|
||||
bar.css("width", "0%").text("0%");
|
||||
progressbar.removeClass("uk-hidden");
|
||||
},
|
||||
|
||||
progress: function(percent) {
|
||||
percent = Math.ceil(percent);
|
||||
bar.css("width", percent+"%").text(percent+"%");
|
||||
},
|
||||
progress: function(percent) {
|
||||
percent = Math.ceil(percent);
|
||||
bar.css("width", percent+"%").text(percent+"%");
|
||||
},
|
||||
|
||||
allcomplete: function(response) {
|
||||
bar.css("width", "100%").text("100%");
|
||||
response = JSON.parse(response);
|
||||
setTimeout(function(){
|
||||
progressbar.addClass("uk-hidden");
|
||||
}, 250);
|
||||
if (response.error){
|
||||
alert(response.error);
|
||||
} else if (response.success) {
|
||||
// load the link to the document links object
|
||||
documentsLinks[response.key] = response.link;
|
||||
// set the new file name and if another is found delete it
|
||||
setFilekey(response.success, response.fileformat, 'answer', 'documents');
|
||||
allcomplete: function(response) {
|
||||
bar.css("width", "100%").text("100%");
|
||||
response = JSON.parse(response);
|
||||
setTimeout(function(){
|
||||
progressbar.addClass("uk-hidden");
|
||||
}, 250);
|
||||
if (response.error){
|
||||
alert(response.error);
|
||||
} else if (response.success) {
|
||||
// set the new file name and if another is found delete it
|
||||
setFilekey(response.success, response.fileformat, 'answer', 'documents');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var select = UIkit.uploadSelect($("#upload-select-answer-documents"), settings),
|
||||
drop = UIkit.uploadDrop($("#upload-drop-answer-documents"), settings);
|
||||
});
|
||||
jQuery('#answer-documents-formats').html('<b><?php echo implode(', ', $formats); ?></b>');
|
||||
var select = UIkit2.uploadSelect($("#uikittwo-upload-select-answer-documents"), settings),
|
||||
drop = UIkit2.uploadDrop($("#uikittwo-upload-drop-answer-documents"), settings);
|
||||
});
|
||||
<?php else: ?>
|
||||
// load uikit 3 uploader script
|
||||
jQuery(function($){
|
||||
// prep the placeholder uploading divs
|
||||
$('#uikitthree-answer-documents-uploader').show();
|
||||
$('#uikittwo-answer-documents-uploader').remove();
|
||||
$('#error-answer-documents-uploader').remove();
|
||||
$('#answer-documents-formats').html('<b><?php echo implode(', ', $formats); ?></b>');
|
||||
// get progressbar
|
||||
var bar = document.getElementById('uikitthree-progressbar-answer-documents');
|
||||
UIkit.upload('#uikitthree-upload-answer-documents', {
|
||||
|
||||
url: JRouter('index.php?option=com_questionsanswers&task=ajax.uploadfile&format=json&type=documents&target=answer&raw=true&token='+token+'&vdm='+vastDevMod), // upload url
|
||||
multiple: true,
|
||||
allow : '*.(<?php echo implode('|', $formats); ?>)', // allow uploads
|
||||
|
||||
beforeSend: function (environment) {
|
||||
// console.log('beforeSend', arguments);
|
||||
|
||||
// The environment object can still be modified here.
|
||||
// var {data, method, headers, xhr, responseType} = environment;
|
||||
},
|
||||
beforeAll: function () {
|
||||
// console.log('beforeAll', arguments);
|
||||
},
|
||||
load: function () {
|
||||
// console.log('load', arguments);
|
||||
},
|
||||
error: function () {
|
||||
// console.log('error', arguments);
|
||||
},
|
||||
complete: function () {
|
||||
// console.log('complete', arguments);
|
||||
},
|
||||
|
||||
loadStart: function (e) {
|
||||
jQuery(".success-answer-documents-8768").remove();
|
||||
|
||||
bar.removeAttribute('hidden');
|
||||
bar.max = e.total;
|
||||
bar.value = e.loaded;
|
||||
},
|
||||
|
||||
progress: function (e) {
|
||||
bar.max = e.total;
|
||||
bar.value = e.loaded;
|
||||
},
|
||||
|
||||
loadEnd: function (e) {
|
||||
bar.max = e.total;
|
||||
bar.value = e.loaded;
|
||||
},
|
||||
|
||||
completeAll: function (response) {
|
||||
setTimeout(function () {
|
||||
bar.setAttribute('hidden', 'hidden');
|
||||
}, 250);
|
||||
// act upon the response
|
||||
if (response.response) {
|
||||
response = JSON.parse(response.response);
|
||||
if (response.error){
|
||||
alert(response.error);
|
||||
} else if (response.success) {
|
||||
// set the new file name and if another is found delete it
|
||||
setFilekey(response.success, response.fileformat, 'answer', 'documents');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
jQuery('#upload-drop-answer-documents').html('<b><?php echo JText::_('COM_QUESTIONSANSWERS_ALLOWED_DOCUMENT_FORMATS_ARE_NOT_SET_IN_THE_GLOBAL_SETTINGS_PLEASE_NOTIFY_YOUR_SYSTEM_ADMINISTRATOR'); ?></b>');
|
||||
jQuery('#error-answer-documents-uploader').html('<b><?php echo JText::_('COM_QUESTIONSANSWERS_ALLOWED_DOCUMENT_FORMATS_ARE_NOT_SET_IN_THE_GLOBAL_SETTINGS_PLEASE_NOTIFY_YOUR_SYSTEM_ADMINISTRATOR'); ?></b>');
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
@ -250,12 +421,14 @@ function JRouter(link) {
|
||||
}
|
||||
|
||||
function getFile(filename, fileFormat, target, type){
|
||||
// set uikit version
|
||||
var uiVer = <?php echo (int) $this->params->get('uikit_version', 2); ?>;
|
||||
// set the link
|
||||
var link = '<?php echo QuestionsanswersHelper::getFolderPath('url'); ?>';
|
||||
// build the return
|
||||
if (type === 'image') {
|
||||
var thePath = link+filename+'.'+fileFormat;
|
||||
var thedelete = '<button onclick="removeFileCheck(\''+filename+'\', \''+target+'\', \''+type+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+target+' '+type+'</button></div>';
|
||||
var thedelete = '<button onclick="removeFileCheck(\''+filename+'\', \''+target+'\', \''+type+'\', \''+uiVer+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+target+' '+type+'</button></div>';
|
||||
return '<img alt="'+target+' Image" src="'+thePath+'" /><br /><br />'+thedelete;
|
||||
} else if (type === 'images') {
|
||||
var imageNum = filename.length;
|
||||
@ -275,7 +448,7 @@ function getFile(filename, fileFormat, target, type){
|
||||
imagesBox += '<div class="uk-panel">';
|
||||
var fileFormat = item.split('_')[2];
|
||||
var thePath = link+item+'.'+fileFormat;
|
||||
var thedelete = '<button onclick="removeFileCheck(\''+item+'\', \''+target+'\', \''+type+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+target+' '+type+'</button>';
|
||||
var thedelete = '<button onclick="removeFileCheck(\''+item+'\', \''+target+'\', \''+type+'\', \''+uiVer+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+target+' '+type+'</button>';
|
||||
imagesBox += '<img alt="'+target+' Image" src="'+thePath+'" /><br /><br />'+thedelete;
|
||||
if (perRow == counter) {
|
||||
counter = 0;
|
||||
@ -316,7 +489,7 @@ function getFile(filename, fileFormat, target, type){
|
||||
if (documentsLinks.hasOwnProperty(item)) {
|
||||
thedownload = '<a href="'+JRouter(documentsLinks[item])+'" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-success"><i class="uk-icon-download"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_DOWNLOAD'); ?> '+fileName+'</a>';
|
||||
}
|
||||
var thedelete = '<button onclick="removeFileCheck(\''+item+'\', \''+target+'\', \''+type+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+fileName+'</button>';
|
||||
var thedelete = '<button onclick="removeFileCheck(\''+item+'\', \''+target+'\', \''+type+'\', \''+uiVer+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+fileName+'</button>';
|
||||
fileBox += theplaceholder+thedownload+thedelete;
|
||||
if (perRow == counter) {
|
||||
counter = 0;
|
||||
@ -342,7 +515,7 @@ function getFile(filename, fileFormat, target, type){
|
||||
if (documentsLinks.hasOwnProperty(filename)) {
|
||||
thedownload = '<a href="'+JRouter(documentsLinks[filename])+'" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-success"><i class="uk-icon-download"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_DOWNLOAD'); ?> '+fileName+'</a>';
|
||||
}
|
||||
var thedelete = '<button onclick="removeFileCheck(\''+filename+'\', \''+target+'\', \''+type+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+fileName+'</button>';
|
||||
var thedelete = '<button onclick="removeFileCheck(\''+filename+'\', \''+target+'\', \''+type+'\', \''+uiVer+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+fileName+'</button>';
|
||||
return theplaceholder+thedownload+thedelete + '</div>';
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* Question_and_answer View class
|
||||
*/
|
||||
@ -40,27 +37,37 @@ class QuestionsanswersViewQuestion_and_answer extends JViewLegacy
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// set params
|
||||
$this->params = JComponentHelper::getParams('com_questionsanswers');
|
||||
// Assign the variables
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->script = $this->get('Script');
|
||||
$this->state = $this->get('State');
|
||||
// get action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('question_and_answer',$this->item);
|
||||
$this->canDo = QuestionsanswersHelper::getActions('question_and_answer', $this->item);
|
||||
// get input
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$this->ref = $jinput->get('ref', 0, 'word');
|
||||
$this->refid = $jinput->get('refid', 0, 'int');
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
// set the referral string
|
||||
$this->referral = '';
|
||||
if ($this->refid)
|
||||
if ($this->refid && $this->ref)
|
||||
{
|
||||
// return to the item that refered to this item
|
||||
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
|
||||
// return to the item that referred to this item
|
||||
$this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid;
|
||||
}
|
||||
elseif($this->ref)
|
||||
{
|
||||
// return to the list view that refered to this item
|
||||
$this->referral = '&ref='.(string)$this->ref;
|
||||
// return to the list view that referred to this item
|
||||
$this->referral = '&ref=' . (string)$this->ref;
|
||||
}
|
||||
// check return value
|
||||
if (!is_null($return))
|
||||
{
|
||||
// add the return value
|
||||
$this->referral .= '&return=' . (string)$return;
|
||||
}
|
||||
|
||||
// Set the toolbar
|
||||
@ -92,7 +99,7 @@ class QuestionsanswersViewQuestion_and_answer extends JViewLegacy
|
||||
|
||||
JToolbarHelper::title( JText::_($isNew ? 'COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_NEW' : 'COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_EDIT'), 'pencil-2 article-add');
|
||||
// Built the actions for new and existing records.
|
||||
if ($this->refid || $this->ref)
|
||||
if (QuestionsanswersHelper::checkString($this->referral))
|
||||
{
|
||||
if ($this->canDo->get('question_and_answer.create') && $isNew)
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_body.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_footer.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_body.php
|
||||
@ -75,16 +75,16 @@ $edit = "index.php?option=com_questionsanswers&view=questions_and_answers&task=q
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="nowrap">
|
||||
<?php if ($canDo->get('question_and_answer.edit')): ?>
|
||||
<div class="name">
|
||||
<div class="name">
|
||||
<?php if ($canDo->get('question_and_answer.edit')): ?>
|
||||
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->question); ?></a>
|
||||
<?php if ($item->checked_out): ?>
|
||||
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'questions_and_answers.', $canCheckin); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="name"><?php echo $this->escape($item->question); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php echo $this->escape($item->question); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
<?php echo $this->escape($item->answer); ?>
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_foot.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_head.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_toolbar.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* Questionsanswers View class for the Questions_and_answers
|
||||
*/
|
||||
@ -54,6 +51,8 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
|
||||
$this->listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$this->listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$this->saveOrder = $this->listOrder == 'ordering';
|
||||
// set the return here value
|
||||
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
||||
// get global action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('question_and_answer');
|
||||
$this->canEdit = $this->canDo->get('question_and_answer.edit');
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_main.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_readme_information.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_vast_development_method_notice_board.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_vdm.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* Questionsanswers View class
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage A4.print.css
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="3.2" method="upgrade">
|
||||
<name>COM_QUESTIONSANSWERS</name>
|
||||
<creationDate>5th May, 2018</creationDate>
|
||||
<creationDate>27th December, 2018</creationDate>
|
||||
<author>Llewellyn van der Merwe</author>
|
||||
<authorEmail>joomla@vdm.io</authorEmail>
|
||||
<authorUrl>https://www.vdm.io/</authorUrl>
|
||||
@ -53,6 +53,9 @@
|
||||
<filename>index.html</filename>
|
||||
<filename>router.php</filename>
|
||||
<filename>questionsanswers.php</filename>
|
||||
<filename>questionsanswers.php</filename>
|
||||
<filename>router.php</filename>
|
||||
<filename>controller.php</filename>
|
||||
<folder>assets</folder>
|
||||
<folder>helpers</folder>
|
||||
<folder>controllers</folder>
|
||||
@ -75,9 +78,14 @@
|
||||
<files folder="admin">
|
||||
<filename>access.xml</filename>
|
||||
<filename>config.xml</filename>
|
||||
<filename>controller.php</filename>###WHMCS_ENCRYPT_FILE###
|
||||
<filename>controller.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>questionsanswers.php</filename>
|
||||
<filename>access.xml</filename>
|
||||
<filename>config.xml</filename>
|
||||
<filename>controller.php</filename>
|
||||
<filename>questionsanswers.php</filename>
|
||||
<filename>README.txt</filename>
|
||||
<filename>README.txt</filename>
|
||||
<folder>assets</folder>
|
||||
<folder>controllers</folder>
|
||||
|
24
script.php
24
script.php
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage script.php
|
||||
@ -27,8 +27,6 @@
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHTML::_('behavior.modal');
|
||||
jimport('joomla.installer.installer');
|
||||
jimport('joomla.installer.helper');
|
||||
|
||||
/**
|
||||
* Script File of Questionsanswers Component
|
||||
@ -83,7 +81,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Question_and_answer items
|
||||
$question_and_answer_done = $db->execute();
|
||||
if ($question_and_answer_done);
|
||||
if ($question_and_answer_done)
|
||||
{
|
||||
// If succesfully remove Question_and_answer add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__content_type</b> table'));
|
||||
@ -98,7 +96,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Question_and_answer items
|
||||
$question_and_answer_done = $db->execute();
|
||||
if ($question_and_answer_done);
|
||||
if ($question_and_answer_done)
|
||||
{
|
||||
// If succesfully remove Question_and_answer add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
|
||||
@ -113,7 +111,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Question_and_answer items
|
||||
$question_and_answer_done = $db->execute();
|
||||
if ($question_and_answer_done);
|
||||
if ($question_and_answer_done)
|
||||
{
|
||||
// If succesfully remove Question_and_answer add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__ucm_content</b> table'));
|
||||
@ -169,7 +167,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Question_and_answer catid items
|
||||
$question_and_answer_catid_done = $db->execute();
|
||||
if ($question_and_answer_catid_done);
|
||||
if ($question_and_answer_catid_done)
|
||||
{
|
||||
// If succesfully remove Question_and_answer catid add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.questions_and_answers.category) type alias was removed from the <b>#__content_type</b> table'));
|
||||
@ -184,7 +182,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Question_and_answer catid items
|
||||
$question_and_answer_catid_done = $db->execute();
|
||||
if ($question_and_answer_catid_done);
|
||||
if ($question_and_answer_catid_done)
|
||||
{
|
||||
// If succesfully remove Question_and_answer catid add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.questions_and_answers.category) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
|
||||
@ -199,7 +197,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Question_and_answer catid items
|
||||
$question_and_answer_catid_done = $db->execute();
|
||||
if ($question_and_answer_catid_done);
|
||||
if ($question_and_answer_catid_done)
|
||||
{
|
||||
// If succesfully remove Question_and_answer catid add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.questions_and_answers.category) type alias was removed from the <b>#__ucm_content</b> table'));
|
||||
@ -255,7 +253,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Help_document items
|
||||
$help_document_done = $db->execute();
|
||||
if ($help_document_done);
|
||||
if ($help_document_done)
|
||||
{
|
||||
// If succesfully remove Help_document add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__content_type</b> table'));
|
||||
@ -270,7 +268,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Help_document items
|
||||
$help_document_done = $db->execute();
|
||||
if ($help_document_done);
|
||||
if ($help_document_done)
|
||||
{
|
||||
// If succesfully remove Help_document add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
|
||||
@ -285,7 +283,7 @@ class com_questionsanswersInstallerScript
|
||||
$db->setQuery($query);
|
||||
// Execute the query to remove Help_document items
|
||||
$help_document_done = $db->execute();
|
||||
if ($help_document_done);
|
||||
if ($help_document_done)
|
||||
{
|
||||
// If succesfully remove Help_document add queued success message.
|
||||
$app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__ucm_content</b> table'));
|
||||
@ -329,7 +327,7 @@ class com_questionsanswersInstallerScript
|
||||
$query->where($questionsanswers_condition);
|
||||
$db->setQuery($query);
|
||||
$help_document_done = $db->execute();
|
||||
if ($help_document_done);
|
||||
if ($help_document_done)
|
||||
{
|
||||
// If succesfully remove questionsanswers add queued success message.
|
||||
$app->enqueueMessage(JText::_('All related items was removed from the <b>#__assets</b> table'));
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage category.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage downloads.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage site.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage site.js
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage controller.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controller library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* Questionsanswers Component Controller
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage ajax.json.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* Questionsanswers Ajax Controller
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage download.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* Questionsanswers Help Controller
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 5th May, 2018
|
||||
@build 27th December, 2018
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@ -26,9 +26,6 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Question_and_answer Controller
|
||||
*/
|
||||
@ -43,6 +40,13 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'questions_and_answers'; // safeguard for setting the return view listing to the default site view.
|
||||
@ -60,14 +64,17 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
// Access check.
|
||||
$access = JFactory::getUser()->authorise('question_and_answer.access', 'com_questionsanswers');
|
||||
$access = $user->authorise('question_and_answer.access', 'com_questionsanswers');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('question_and_answer.create', $this->option);
|
||||
return $user->authorise('question_and_answer.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,9 +89,9 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{ // get user object.
|
||||
$user = JFactory::getUser();
|
||||
$user = JFactory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
@ -140,42 +147,25 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
@ -214,43 +204,45 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -269,11 +261,15 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
@ -281,9 +277,22 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
@ -292,9 +301,9 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user