true)) { $model = parent::getModel($name, $prefix, $config); return $model; } /** * logic for remove venues * * @access public */ public function remove() { // Check for token Session::checkToken() or jexit(Text::_('COM_JEM_GLOBAL_INVALID_TOKEN')); $app = Factory::getApplication(); $user = Factory::getApplication()->getIdentity(); $jinput = $app->input; $cid = $jinput->get('cid',array(),'array'); if (!is_array( $cid ) || count( $cid ) < 1) { throw new Exception(Text::_('COM_JEM_SELECT_AN_ITEM_TO_DELETE'), 500); } else { $model = $this->getModel('venue'); ArrayHelper::toInteger($cid); // trigger delete function in the model $result = $model->delete($cid); if($result['removed']) { $app->enqueueMessage(Text::plural($this->text_prefix.'_N_ITEMS_DELETED',$result['removedCount'])); } if($result['error']) { $app->enqueueMessage(Text::_('COM_JEM_VENUES_UNABLETODELETE'),'warning'); foreach ($result['error'] AS $error) { $html = array(); $html[] = ''.$error[0].''; $html[] = '
'; unset($error[0]); $html[] = implode('
', $error); $app->enqueueMessage(implode("\n",$html),'warning'); } } $this->postDeleteHook($model,$cid); } $cache = Factory::getCache('com_jem'); $cache->clean(); $this->setRedirect( 'index.php?option=com_jem&view=venues'); } }