input->get('itemtype', '', 'string')); $id = $this->input->get('id', 0, 'int'); // Check if reference item can be edited. if (!AssociationsHelper::allowEdit($extensionName, $typeName, $id)) { JFactory::getApplication()->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_associations&view=associations', false)); return false; } return parent::display(); } /** * Method for canceling the edit action * * @param string $key The name of the primary key of the URL variable. * * @return void * * @since 3.7.0 */ public function cancel($key = null) { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string')); // Only check in, if component item type allows to check out. if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName)) { $ids = array(); $targetId = $this->input->get('target-id', '', 'string'); if ($targetId !== '') { $ids = array_unique(explode(',', $targetId)); } $ids[] = $this->input->get('id', 0, 'int'); foreach ($ids as $key => $id) { AssociationsHelper::getItem($extensionName, $typeName, $id)->checkin(); } } $this->setRedirect(JRoute::_('index.php?option=com_associations&view=associations', false)); } }