Fixed the compiler to allow edit views be build even if no other site views are set. Removed all the depreciated joomla jimport statments. Update the getModel method in the controller. Updated the getRedirectToItemAppend, cancel and save method in the controller to also use the return value if internal. Added the addTablePath to the getTable method in the model to insure table is found when called from outside the in another component. Updated the diplay method in the JViewLagacy class to also use the return value if not null. Updated the component core to use JAccessExceptionNotallowed instead of JError::raiseWaring when user not have access to core.

This commit is contained in:
Llewellyn van der Merwe 2018-08-07 14:25:26 +02:00
parent f5c6fa899d
commit 78208d1525
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
568 changed files with 4230 additions and 3609 deletions

View File

@ -125,11 +125,11 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 2nd August, 2018
+ *Last Build*: 7th August, 2018
+ *Version*: 2.8.5
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **186364**
+ *Line count*: **187020**
+ *Field count*: **1059**
+ *File count*: **1239**
+ *Folder count*: **197**

View File

@ -125,11 +125,11 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 2nd August, 2018
+ *Last Build*: 7th August, 2018
+ *Version*: 2.8.5
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **186364**
+ *Line count*: **187020**
+ *Field count*: **1059**
+ *File count*: **1239**
+ *Folder count*: **197**

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* ###Component### Controller
*/

View File

@ -29,10 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// 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');
/**
* ###Component### Model
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
/**
* ###Component### View class
*/

View File

@ -319,7 +319,7 @@ abstract class ###Component###Email
$body[] = "<head>";
$body[] = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
$body[] = "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>";
$body[] = "<title>".$subject."</title>";
$body[] = "<title>" . $subject . "</title>";
$body[] = "<style type=\"text/css\">";
$body[] = "#outlook a {padding:0;}";
$body[] = ".ExternalClass {width:100%;}";

View File

@ -29,23 +29,32 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* ###Views### Controller
*/
class ###Component###Controller###Views### extends JControllerAdmin
{
protected $text_prefix = 'COM_###COMPONENT###_###VIEWS###';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = '###View###', $prefix = '###Component###Model', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_###COMPONENT###_###VIEWS###';
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 = '###View###', $prefix = '###Component###Model', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}###CONTROLLEREXIMPORTMETHOD### ###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER### ###ADMIN_CUSTOM_BUTTONS_CONTROLLER_LIST###
}

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* ###SViews### Controller
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* ###View### Controller
*/
@ -46,6 +43,13 @@ class ###Component###Controller###View### 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 = '###Views###'; // safeguard for setting the return view listing to the main view.
@ -87,42 +91,25 @@ class ###Component###Controller###View### 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;
@ -161,17 +148,31 @@ class ###Component###Controller###View### 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -216,11 +217,15 @@ class ###Component###Controller###View### 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';
@ -228,27 +233,43 @@ class ###Component###Controller###View### extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### ###SView### Controller
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* ###View### Controller
*/
@ -46,6 +43,13 @@ class ###Component###Controller###View### 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 = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view.
@ -87,42 +91,25 @@ class ###Component###Controller###View### 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;
@ -161,17 +148,31 @@ class ###Component###Controller###View### 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -182,7 +183,7 @@ class ###Component###Controller###View### extends JControllerForm
}
elseif ($this->ref)
{
$redirect = '&view='.(string)$this->ref;
$redirect = '&view=' . (string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
@ -216,11 +217,15 @@ class ###Component###Controller###View### 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';
@ -228,27 +233,43 @@ class ###Component###Controller###View### extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
/**
* General Controller of ###Component### component
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### Ajax Controller
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### Ajax Controller
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### Help Controller
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### Help Controller
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
/**
* ###Component### Component Controller
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### ###SView### Controller
*/

View File

@ -31,9 +31,6 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
// import Joomla modelform library
jimport('joomla.application.component.modeladmin');
/**
* ###Component### ###View### Model
*/
@ -66,6 +63,9 @@ class ###Component###Model###View### extends JModelAdmin
*/
public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array())
{
// add table path for when model gets used from other component
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables');
// get instance of the table
return JTable::getInstance($type, $prefix, $config);
}###ADMIN_CUSTOM_BUTTONS_METHOD###

View File

@ -31,9 +31,6 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
// import Joomla modelform library
jimport('joomla.application.component.modeladmin');
/**
* ###Component### ###View### Model
*/
@ -66,6 +63,9 @@ class ###Component###Model###View### extends JModelAdmin
*/
public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array())
{
// add table path for when model gets used from other component
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables');
// get instance of the table
return JTable::getInstance($type, $prefix, $config);
}###ADMIN_CUSTOM_BUTTONS_METHOD###

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla modelitem library
jimport('joomla.application.component.modelitem');
/**
* ###Component### ###SView### Model
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla modelitem library
jimport('joomla.application.component.modelitem');
/**
* ###Component### ###SView### Model
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the Joomla modellist library
jimport('joomla.application.component.modellist');
/**
* ###Views### Model
*/

View File

@ -29,8 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.helper');
/**
* ###Component### Ajax Model
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the Joomla modellist library
jimport('joomla.application.component.modellist');
/**
* ###Component### Model for ###SViews###
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the Joomla modellist library
jimport('joomla.application.component.modellist');
/**
* ###Component### Model for ###SViews###
*/

View File

@ -31,9 +31,6 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
// import Joomla table library
jimport('joomla.database.table');
/**
* ###Views### Table class
*/

View File

@ -27,10 +27,7 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');###CUSTOM_ADMIN_GET_MODULE_JIMPORT###
defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
/**
* ###Component### View class for the ###SView###

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');
/**
* ###View### View class
*/
@ -54,16 +51,24 @@ class ###Component###View###View### extends JViewLegacy
$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;
}###LINKEDVIEWITEMS###
// Set the toolbar

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');
/**
* ###View### View class
*/
@ -44,26 +41,34 @@ class ###Component###View###View### extends JViewLegacy
public function display($tpl = null)
{
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->script = $this->get('Script');
$this->state = $this->get('State');
$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 = ###Component###Helper::getActions('###view###',$this->item);
$this->canDo = ###Component###Helper::getActions('###view###',$this->item);
// get input
$jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$this->referral = '';
if ($this->refid)
$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 && $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;
}###LINKEDVIEWITEMS###
// Set the toolbar

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');
/**
* ###Component### Import View
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');
/**
* ###Component### ###View### View
*/

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');
/**
* ###Component### View class for the ###Views###
*/

View File

@ -27,10 +27,7 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');###CUSTOM_ADMIN_GET_MODULE_JIMPORT###
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
/**
* ###Component### View class for the ###SViews###

View File

@ -27,10 +27,7 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');###SITE_GET_MODULE_JIMPORT###
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
/**
* ###Component### View class for the ###SViews###

View File

@ -27,10 +27,7 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');###SITE_GET_MODULE_JIMPORT###
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
/**
* ###Component### View class for the ###SView###

View File

@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### Ajax Controller
*/
@ -50,11 +47,11 @@ class ###Component###ControllerAjax extends JControllerLegacy
public function ajax()
{
$user = JFactory::getUser();
$jinput = JFactory::getApplication()->input;
$user = JFactory::getUser();
$jinput = JFactory::getApplication()->input;
// Check Token!
$token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM');
$token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM');
if($user->id != 0 && $token == $call_token)
{
$task = $this->getTask();

View File

@ -29,8 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.helper');
/**
* ###Component### Ajax Model
*/
@ -42,16 +40,15 @@ class ###Component###ModelAjax extends JModelList
{
parent::__construct();
// get params
$this->app_params = JComponentHelper::getParams('com_###component###');
$this->app_params = JComponentHelper::getParams('com_###component###');
}
public function setFieldRequired($name,$form,$status)
{
// get the session
$session = JFactory::getSession();
$session = JFactory::getSession();
// get this forms set fields
$fields = $session->get($form.'_requiredFieldFix');
$fields = $session->get($form.'_requiredFieldFix');
if(###Component###Helper::checkArray($fields))
{
if ($status == 1)
@ -62,7 +59,8 @@ class ###Component###ModelAjax extends JModelList
else
{
// remove from array
if(($key = array_search($name, $fields)) !== false) {
if(($key = array_search($name, $fields)) !== false)
{
unset($fields[$key]);
}
}

View File

@ -30,8 +30,8 @@ defined('_JEXEC') or die('Restricted access');
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">

View File

@ -28,29 +28,22 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tabstate');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_###component###'))
{
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_###component###/assets/css/admin.css');
$document->addScript('components/com_###component###/assets/js/admin.js');
// require helper files
JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php'); ###HELPER_EMAIL###
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT### ###ADMIN_GLOBAL_EVENT###
// import joomla controller library
jimport('joomla.application.component.controller');
JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php'); ###HELPER_EMAIL###
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT### ###ADMIN_GLOBAL_EVENT###
// Get an instance of the controller prefixed by ###Component###
$controller = JControllerLegacy::getInstance('###Component###');

View File

@ -28,6 +28,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tabstate');
// Set the component css/js
$document = JFactory::getDocument();
@ -35,18 +36,14 @@ $document->addStyleSheet('components/com_###component###/assets/css/site.css');
$document->addScript('components/com_###component###/assets/js/site.js');
// Require helper files
JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php'); ###HELPER_EMAIL###
JLoader::register('###Component###HelperRoute', dirname(__FILE__) . '/helpers/route.php');###LICENSE_LOCKED_INT### ###SITE_GLOBAL_EVENT###
// import joomla controller library
jimport('joomla.application.component.controller');
JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php'); ###HELPER_EMAIL###
JLoader::register('###Component###HelperRoute', __DIR__ . '/helpers/route.php');###LICENSE_LOCKED_INT### ###SITE_GLOBAL_EVENT###
// Get an instance of the controller prefixed by ###Component###
$controller = JControllerLegacy::getInstance('###Component###');
// Perform the request task
$jinput = JFactory::getApplication()->input;
$controller->execute($jinput->get('task', null, 'CMD'));
$controller->execute(JFactory::getApplication()->input->get('task'));
// Redirect if set by the controller
$controller->redirect();

View File

@ -37,7 +37,7 @@ JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_###component###');
?>
###EDITBODYFADEIN###
<form action="<?php echo JRoute::_('index.php?option=com_###component###&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_###component###&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
###EDITBODY###
</form>
</div>###EDITBODYSCRIPT###

View File

@ -39,6 +39,6 @@ JHtml::_('behavior.calendar');
$componentParams = JComponentHelper::getParams('com_###component###');
?>
<?php echo $this->toolbar->render(); ?>
<form action="<?php echo JRoute::_('index.php?option=com_###component###&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_###component###&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
###EDITBODY###
</form>###EDITBODYSCRIPT###

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('JPATH_BASE') or die('Restricted access');###CUSTOM_ADMIN_LAYOUT_CODE###
?>###CUSTOM_ADMIN_LAYOUT_BODY###

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('JPATH_BASE') or die('Restricted access');###SITE_LAYOUT_CODE###
?>###SITE_LAYOUT_BODY###

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// set the defaults

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();

View File

@ -27,7 +27,6 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();

View File

@ -29,10 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Component Helper
jimport('joomla.application.component.helper');
jimport('joomla.application.categories');
/**
* ###Component### Route Helper
**/

View File

@ -30,8 +30,6 @@ defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.modal');
jimport('joomla.installer.installer');
jimport('joomla.installer.helper');
/**
* Script File of ###Component### Component

View File

@ -11,34 +11,27 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tabstate');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_componentbuilder'))
{
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_componentbuilder/assets/css/admin.css');
$document->addScript('components/com_componentbuilder/assets/js/admin.js');
// require helper files
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
JLoader::register('ComponentbuilderHelper', __DIR__ . '/helpers/componentbuilder.php');
JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php');
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');
// Triger the Global Admin Event
ComponentbuilderHelper::globalEvent($document);
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by Componentbuilder
$controller = JControllerLegacy::getInstance('Componentbuilder');

View File

@ -12,9 +12,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 Componentbuilder component
*/

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Admin_fields Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerAdmin_fields 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 = 'Admins_fields'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerAdmin_fields 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerAdmin_fields 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerAdmin_fields 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Admin_fields_conditions Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerAdmin_fields_conditions 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 = 'Admins_fields_conditions'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerAdmin_fields_conditions 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerAdmin_fields_conditions 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerAdmin_fields_conditions 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Admin_fields_relations Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerAdmin_fields_relations 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 = 'Admins_fields_relations'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerAdmin_fields_relations 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerAdmin_fields_relations 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerAdmin_fields_relations 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerAdmin_fields_relations extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Admin_view Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerAdmin_view 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 = 'Admin_views'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerAdmin_view 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerAdmin_view 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerAdmin_view 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,24 +12,33 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Admin_views Controller
*/
class ComponentbuilderControllerAdmin_views extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMIN_VIEWS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Admin_view', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMIN_VIEWS';
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 = 'Admin_view', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
public function exportData()

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Admins_fields Controller
*/
class ComponentbuilderControllerAdmins_fields extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Admin_fields', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS';
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 = 'Admin_fields', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Admins_fields_conditions Controller
*/
class ComponentbuilderControllerAdmins_fields_conditions extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Admin_fields_conditions', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS';
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 = 'Admin_fields_conditions', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Admins_fields_relations Controller
*/
class ComponentbuilderControllerAdmins_fields_relations extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Admin_fields_relations', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS';
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 = 'Admin_fields_relations', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* Componentbuilder Ajax Controller
*/

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Compiler Controller
*/

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_admin_views Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_admin_views 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 = 'Components_admin_views'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_admin_views 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_admin_views 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_admin_views 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_config Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_config 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 = 'Components_config'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_config 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_config 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_config 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_config extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_custom_admin_menus Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
*/
protected $task;
/**
* Class constructor.
*
* @param array $config A named array of configuration variables.
*
* @since 1.6
*/
public function __construct($config = array())
{
$this->view_list = 'Components_custom_admin_menus'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
*
* @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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
*/
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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
*/
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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_custom_admin_views Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
*/
protected $task;
/**
* Class constructor.
*
* @param array $config A named array of configuration variables.
*
* @since 1.6
*/
public function __construct($config = array())
{
$this->view_list = 'Components_custom_admin_views'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
*
* @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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
*/
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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
*/
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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_dashboard Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_dashboard 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 = 'Components_dashboard'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_dashboard 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_dashboard 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_dashboard 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_files_folders Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_files_folders 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 = 'Components_files_folders'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_files_folders 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_files_folders 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_files_folders 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_mysql_tweaks Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_mysql_tweaks 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 = 'Components_mysql_tweaks'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_mysql_tweaks 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_mysql_tweaks 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_mysql_tweaks 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_site_views Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_site_views 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 = 'Components_site_views'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_site_views 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_site_views 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_site_views 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Component_updates Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerComponent_updates 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 = 'Components_updates'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerComponent_updates 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerComponent_updates 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerComponent_updates 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Componentbuilder Controller
*/

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_admin_views Controller
*/
class ComponentbuilderControllerComponents_admin_views extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_admin_views', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS';
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 = 'Component_admin_views', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_config Controller
*/
class ComponentbuilderControllerComponents_config extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_CONFIG';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_config', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_CONFIG';
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 = 'Component_config', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_custom_admin_menus Controller
*/
class ComponentbuilderControllerComponents_custom_admin_menus extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_custom_admin_menus', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS';
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 = 'Component_custom_admin_menus', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_custom_admin_views Controller
*/
class ComponentbuilderControllerComponents_custom_admin_views extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_custom_admin_views', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS';
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 = 'Component_custom_admin_views', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_dashboard Controller
*/
class ComponentbuilderControllerComponents_dashboard extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_dashboard', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD';
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 = 'Component_dashboard', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_files_folders Controller
*/
class ComponentbuilderControllerComponents_files_folders extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_files_folders', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS';
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 = 'Component_files_folders', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_mysql_tweaks Controller
*/
class ComponentbuilderControllerComponents_mysql_tweaks extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_mysql_tweaks', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS';
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 = 'Component_mysql_tweaks', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_site_views Controller
*/
class ComponentbuilderControllerComponents_site_views extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_site_views', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS';
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 = 'Component_site_views', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,23 +12,32 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Components_updates Controller
*/
class ComponentbuilderControllerComponents_updates extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_UPDATES';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Component_updates', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_UPDATES';
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 = 'Component_updates', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Custom_admin_view Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerCustom_admin_view 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 = 'Custom_admin_views'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerCustom_admin_view 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerCustom_admin_view 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerCustom_admin_view 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,24 +12,33 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Custom_admin_views Controller
*/
class ComponentbuilderControllerCustom_admin_views extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Custom_admin_view', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS';
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 = 'Custom_admin_view', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
public function exportData()

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Custom_code Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerCustom_code 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 = 'Custom_codes'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerCustom_code 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerCustom_code 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerCustom_code 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerCustom_code extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,24 +12,33 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Custom_codes Controller
*/
class ComponentbuilderControllerCustom_codes extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_CUSTOM_CODES';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Custom_code', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_CUSTOM_CODES';
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 = 'Custom_code', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
public function exportData()

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Dynamic_get Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerDynamic_get 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 = 'Dynamic_gets'; // safeguard for setting the return view listing to the main view.
@ -127,42 +131,25 @@ class ComponentbuilderControllerDynamic_get 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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerDynamic_get 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerDynamic_get 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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,24 +12,33 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Dynamic_gets Controller
*/
class ComponentbuilderControllerDynamic_gets extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_DYNAMIC_GETS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Dynamic_get', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_DYNAMIC_GETS';
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 = 'Dynamic_get', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
public function exportData()

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Field Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerField 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 = 'Fields'; // safeguard for setting the return view listing to the main view.
@ -126,42 +130,25 @@ class ComponentbuilderControllerField 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;
@ -200,17 +187,31 @@ class ComponentbuilderControllerField 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -255,11 +256,15 @@ class ComponentbuilderControllerField 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';
@ -267,27 +272,43 @@ class ComponentbuilderControllerField extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,24 +12,33 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Fields Controller
*/
class ComponentbuilderControllerFields extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_FIELDS';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Field', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_FIELDS';
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 = 'Field', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
public function exportData()

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Fieldtype Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerFieldtype 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 = 'Fieldtypes'; // safeguard for setting the return view listing to the main view.
@ -126,42 +130,25 @@ class ComponentbuilderControllerFieldtype 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;
@ -200,17 +187,31 @@ class ComponentbuilderControllerFieldtype 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -255,11 +256,15 @@ class ComponentbuilderControllerFieldtype 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';
@ -267,27 +272,43 @@ class ComponentbuilderControllerFieldtype extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,24 +12,33 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Fieldtypes Controller
*/
class ComponentbuilderControllerFieldtypes extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_FIELDTYPES';
/**
* Proxy for getModel.
* @since 2.5
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
public function getModel($name = 'Fieldtype', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_FIELDTYPES';
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 = 'Fieldtype', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
public function exportData()

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Get_snippets Controller
*/

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* Componentbuilder Help Controller
*/

View File

@ -12,9 +12,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
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerHelp_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.
@ -127,42 +131,25 @@ class ComponentbuilderControllerHelp_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;
@ -201,17 +188,31 @@ class ComponentbuilderControllerHelp_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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -256,11 +257,15 @@ class ComponentbuilderControllerHelp_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';
@ -268,27 +273,43 @@ class ComponentbuilderControllerHelp_document extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

View File

@ -12,24 +12,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 ComponentbuilderControllerHelp_documents extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_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 = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
protected $text_prefix = 'COM_COMPONENTBUILDER_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 = 'ComponentbuilderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
public function exportData()

View File

@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Joomla_component Controller
*/
@ -29,6 +26,13 @@ class ComponentbuilderControllerJoomla_component 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 = 'Joomla_components'; // safeguard for setting the return view listing to the main view.
@ -152,42 +156,25 @@ class ComponentbuilderControllerJoomla_component 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;
@ -226,17 +213,31 @@ class ComponentbuilderControllerJoomla_component 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 ($this->refid)
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
{
$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(
@ -281,11 +282,15 @@ class ComponentbuilderControllerJoomla_component 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';
@ -293,27 +298,43 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
if ($saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// 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 = base64_decode($return);
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// 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 list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
// 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
)
);
}
}
return $saved;
}

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