/** * Method to add a new record. * * @return boolean True if the article can be added, false if not. * @since 1.6 */ public function add() { if (!parent::add()) { // Redirect to the return page. $this->setRedirect($this->getReturnPage()); } }
public function add() { $app = JFactory::getApplication(); $context = 'com_jbusinessdirectory.edit.billingdetails'; $result = parent::add(); if ($result) { $this->setRedirect(JRoute::_('index.php?option=com_jbusinessdirectory&view=billingdetails' . $this->getRedirectToItemAppend(), false)); } return $result; }
public function add() { $app = JFactory::getApplication(); $context = 'com_jhotelreservation.edit.paymentprocessor'; $result = parent::add(); if ($result) { $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&view=paymentprocessor' . $this->getRedirectToItemAppend(), false)); } return $result; }
/** * Method to add a new record. * * @return mixed True if the record can be added, a error object if not. * * @since 1.6 */ public function add() { if (!parent::add()) { // Set the internal error and also the redirect error. $this->setError(JText::_('COM_SIBDIET_ERROR_YOU_HAVE_ACTIVE_REQUEST')); $this->setMessage($this->getError(), 'notice'); // Redirect to the return page. $this->setRedirect($this->getReturnPage()); } }
public function add() { $app = JFactory::getApplication(); // Parent Method $result = parent::add(); if (JError::isError($result)) { return $result; } // Additional Vars $app->setUserState(CCK_COM . '.edit.template.mode', $app->input->getString('mode', '')); }
public function add() { $app = JFactory::getApplication(); $context = 'com_jhotelreservation.edit.extraoption'; $result = parent::add(); if ($result) { $sourceId = JRequest::getInt('sourceId'); $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&view=extraoption&sourceId=' . $sourceId . $this->getRedirectToItemAppend(), false)); } return $result; }
/** * Method to add a new menu item. * * @return mixed True if the record can be added, a JError object if not. * * @since 1.6 */ public function add() { $app = JFactory::getApplication(); $context = 'com_menus.edit.item'; $result = parent::add(); if ($result) { $app->setUserState($context . '.type', null); $app->setUserState($context . '.link', null); $menuType = $app->getUserStateFromRequest($this->context . '.filter.menutype', 'menutype', 'mainmenu', 'cmd'); $this->setRedirect(JRoute::_('index.php?option=com_menus&view=item&menutype=' . $menuType . $this->getRedirectToItemAppend(), false)); } return $result; }
public function add() { // Initialise variables. $app = JFactory::getApplication(); $context = 'com_jhotelreservation.edit.room'; $result = parent::add(); if ($result) { $hotelId = $app->getUserStateFromRequest('filter.hotel_id', 'hotel_id', '1', 'cmd'); //dmp("H: ".$hotelId); $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&view=room&hotel_id=' . $hotelId . $this->getRedirectToItemAppend(), false)); } return $result; }
public function add() { $db = JFactory::getDbo(); $query = "SELECT id FROM #__categories WHERE `extension`='com_smfaq' AND `published`!='-2'"; $db->setQuery($query); $categoryCheck = $db->loadResult(); if (!$categoryCheck) { $this->setError(JText::_('COM_SMFAQ_NO_CATEGORY_ERROR'), 'error'); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list)); return; } parent::add(); }
/** * Override parent add method. */ public function add() { // Initialise variables. $app = JFactory::getApplication(); // Get the result of the parent method. If an error, just return it. $result = parent::add(); if (JError::isError($result)) { return $result; } // Look for the Extension ID. $extensionId = JRequest::getInt('eid'); if (empty($extensionId)) { $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit', false)); return JError::raiseWarning(500, JText::_('COM_MODULES_ERROR_INVALID_EXTENSION')); } $app->setUserState('com_modules.add.module.extension_id', $extensionId); }
public function add() { $app = JFactory::getApplication(); // Parent Method $result = parent::add(); if (JError::isError($result)) { return $result; } // Additional Vars $app->setUserState('com_cck.add.box.validation', $app->input->getInt('validation', 0)); $app->setUserState('com_cck.add.box.file', $app->input->getString('file', '')); $app->setUserState('com_cck.add.box.function', $app->input->getString('function', '')); $app->setUserState('com_cck.add.box.bx.id', $app->input->get('id', '')); $app->setUserState('com_cck.add.box.bx.title', $app->input->getString('title', '')); $app->setUserState('com_cck.add.box.bx.name', $app->input->get('name', '')); $app->setUserState('com_cck.add.box.bx.type', $app->input->getString('type', '')); $app->setUserState('com_cck.add.box.bx.params', $app->input->getString('params', '')); }
/** * Method to add widget to load form. * * @return void * * @since 3.0 */ public function add() { $app = JFactory::getApplication(); $result = parent::add(); if ($result instanceof Exception) { return $result; } $type = $app->input->get('wgtype', 0, 'string'); $title = $app->input->get('title', 0, 'string'); if (empty($type)) { $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit', false)); return JError::raiseWarning(500, JText::_('COM_BT_SOCIALCONNECT_ERROR_INVALID_EXTENSION')); } $app->setUserState('com_bt_socialconnect.add.widget.wgtype', $type); $app->setUserState('com_bt_socialconnect.add.widget.title', $title); $app->setUserState('com_bt_socialconnect.add.widget.params', null); $params = $app->input->get('params', array(), 'array'); $app->setUserState('com_bt_socialconnect.add.widget.params', $params); }
/** * Override parent add method. * * @return mixed True if the record can be added, a JError object if not. * * @since 1.6 */ public function add() { $app = JFactory::getApplication(); // Get the result of the parent method. If an error, just return it. $result = parent::add(); if ($result instanceof Exception) { return $result; } // Look for the Extension ID. $extensionId = $app->input->get('eid', 0, 'int'); if (empty($extensionId)) { $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit', false)); return JError::raiseWarning(500, JText::_('COM_MODULES_ERROR_INVALID_EXTENSION')); } $app->setUserState('com_modules.add.module.extension_id', $extensionId); $app->setUserState('com_modules.add.module.params', null); // Parameters could be coming in for a new item, so let's set them. $params = $app->input->get('params', array(), 'array'); $app->setUserState('com_modules.add.module.params', $params); }
/** * Override parent add method. * * @throws Exception * @return mixed True if the record can be added, a JError object if not. * * @since 1.6 */ public function add() { // Initialise variables. $app = JFactory::getApplication(); // Get the result of the parent method. If an error, just return it. $result = parent::add(); if ($result instanceof Exception) { return $result; } // Look for the Extension ID. $extensionId = $app->input->get('eid', 0, 'int'); if (empty($extensionId)) { $this->setRedirect(JRoute::_(sprintf('index.php?option=%s&view=modules', RokSprocket_Helper::getRedirectionOption()), false)); throw new Exception(JText::_('COM_MODULES_ERROR_INVALID_EXTENSION', 500)); } $app->setUserState('com_modules.add.module.extension_id', $extensionId); $app->setUserState('com_modules.add.module.params', null); // Parameters could be coming in for a new item, so let's set them. $params = $app->input->get('params', array(), 'array'); $app->setUserState('com_modules.add.module.params', $params); }
public function execute($task = null) { $app = JFactory::getApplication(); $modelName = $app->input->get('model', 'Member'); // Required objects $input = JFactory::getApplication()->input; // Get the form data $this->formData = new JRegistry($input->get('jform', '', 'array')); //Get model class $this->model = $this->getModel($modelName); if ($task == 'deleteAvailibility') { $member_daytime_id = $input->get('member_daytime_id'); $this->deleteAvailibility($member_daytime_id); } else { if ($task == 'delete') { $member_id = $input->get('member_id'); $this->delete($member_id); } else { if ($task == 'add') { parent::add(); } else { if ($task == 'edit') { parent::edit(); } else { if ($task == 'apply') { if ($this->formData['member_id'] == null) { $result = EstivoleHelpersUser::registerUser($this->formData['profilestivole.firstname'] . ' ' . $this->formData['profilestivole.lastname'], $this->formData['username'], $this->formData['email'], 'est1val3', null, $this->formData); } else { $result = EstivoleHelpersUser::updateUser($this->formData['profilestivole.firstname'] . ' ' . $this->formData['profilestivole.lastname'], $this->formData['username'], $this->formData['email'], $this->formData); } if ($result->success) { $app->enqueueMessage('Profil enregistré avec succès!'); $app->redirect('index.php?option=com_estivole&view=member&layout=edit&task=member.edit&controller=member&member_id=' . $result->member_id); } else { $app->enqueueMessage($result->message, 'error'); $app->redirect($_SERVER['HTTP_REFERER']); } } else { if ($task == 'save') { if ($this->formData['member_id'] == null) { $result = EstivoleHelpersUser::registerUser($this->formData['profilestivole.firstname'] . ' ' . $this->formData['profilestivole.lastname'], $this->formData['username'], $this->formData['email'], 'est1val3', null, $this->formData); } else { $result = EstivoleHelpersUser::updateUser($this->formData['profilestivole.firstname'] . ' ' . $this->formData['profilestivole.lastname'], $this->formData['username'], $this->formData['email'], $this->formData); } if ($result->success) { $app->enqueueMessage('Profil enregistré avec succès!'); $app->redirect('index.php?option=com_estivole&view=members'); } else { $app->enqueueMessage($result->message, 'error'); $app->redirect($_SERVER['HTTP_REFERER']); } } else { if ($task == 'cancel') { parent::cancel(); } else { $this->display(); } } } } } } } }
/** * Overwrite for method to add a new record for a test-recipient * * @since 1.0.1 */ public function add_test() { // set state for test-recipient… JFactory::getApplication()->setUserState('com_bwpostman.subscriber.new_test', '9'); parent::add(); }
public function add() { $context = "{$this->option}.edit.{$this->context}"; $app = JFactory::getApplication(); $app->setUserState($context . '.data', null); $app->setUserState($context . '.fieldsdata', null); $app->setUserState($context . '.related_listings', null); return parent::add(); }
/** * Add new document. */ public function add() { JFactory::getApplication()->setUserState('path', JoomDOCRequest::getPath()); parent::add(); }
/** * Method to send some filter values to the item. * * @access public * @return void */ public function add() { CkJSession::checkToken() or CkJSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN')); if (!$this->allowAdd()) { $result = false; } else { $result = parent::add(); } //This redirection is also applying the filters followers used when a new item is created $this->applyRedirection($result, array('com_rtiprint.' . $this->view_list . '.default', 'com_rtiprint.' . $this->view_item . '.' . $this->getLayout('edit'))); }
function add() { parent::add(); }
/** * Method to cancel and add new record. for change profile. * * @return mixed True if the record can be added, a error object if not. */ public function canceladd() { $model = $this->getModel(); $table = $model->getTable(); $checkin = property_exists($table, 'checked_out'); $key = $table->getKeyName(); $urlVar = $key; $recordId = $this->input->getInt($urlVar); // Check-in the original row. if ($recordId && $checkin && $model->checkin($recordId) === false) { // Check-in failed. Go back to the item and display a notice. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false)); return false; } $data = $this->input->post->get('jform', array(), 'array'); $app = JFactory::getApplication(); $filters = $app->getUserState('com_sibdiet.requests.filter'); $filters['profiles_id'] = $data['profiles_id']; $app->setUserState('com_sibdiet.requests.filter', $filters); return parent::add(); }
public function add() { $context = "{$this->option}.edit.{$this->context}"; $app = JFactory::getApplication(); $app->setUserState($context . '.data', null); $app->setUserState($context . '.fieldsdata', null); $app->setUserState($context . '.changelogs', null); $app->setUserState($context . '.versions', null); $app->setUserState($context . '.files', null); $app->setUserState($context . '.related_documents', null); return parent::add(); }