/** * Edit document. */ public function edit($key = null, $urlVar = null) { if (JFactory::getApplication()->isSite()) { JRequest::setVar('id', $this->getModel()->searchIdByPath(JoomDOCRequest::getPath()), 'post'); } parent::edit(); }
/** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). * * @return Boolean True if access level check and checkout passes, false otherwise. */ public function q1edit($key = null, $urlVar = 'sub_id') { $result = false; $Itemid = JRequest::getInt('Itemid'); $result = parent::edit($key, $urlVar); $this->getModel()->checkIn(JRequest::getInt($urlVar)); return $result; }
public function edit($key = null, $urlVar = 'sub_id') { $result = parent::edit($key, $urlVar); if (!$result) { // $this->setRedirect($this->getReturnPage()); } return $result; }
function edit($key = NULL, $urlVar = NULL) { $cid = JRequest::getVar('cid', array(), 'get', 'array'); if (count($cid)) { JRequest::setVar('cid', $cid, 'post', 'array'); } parent::edit(); }
public function edit($key = null, $urlVar = null) { $canDo = JvrelativesHelper::getActions(); if (!$canDo->get('core.admin')) { $this->setMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_jvrelatives&view=jvrelatives', false)); return false; } return parent::edit($key, $urlVar); }
public function edit($key = null, $urlVar = null) { $app = JFactory::getApplication(); $result = parent::edit(); if ($result) { $app->setUserState('com_heartcare.edit.waves.type', null); $app->setUserState('com_heartcare.edit.waves.link', null); } return $result; }
/** * Extend parent edit to check if the new image has a item defined */ public function edit($key = null, $urlVar = null) { // check item $id = JRequest::getInt('id', 0); $filters = JFactory::getApplication()->getUserState('com_jkit.images.filter'); $item = $filters['item']; if (!$id && !$item) { $this->setRedirect(JRoute::_('index.php?option=com_jkit&view=images', false), JText::_('COM_JKIT_IMAGE_SELECT_ITEM'), 'notice'); return; } parent::edit($key = null, $urlVar = null); }
/** * Method to edit an existing menu item. * * @return void * @since 1.6 */ public function edit($key = null, $urlVar = null) { // Initialise variables. $app = JFactory::getApplication(); $result = parent::edit(); if ($result) { // Push the new ancillary data into the session. $app->setUserState('com_menus.edit.adminitem.type', null); $app->setUserState('com_menus.edit.adminitem.link', null); } return true; }
/** * Extend parent edit to check if the new room has a hotel defined */ public function edit($key = null, $urlVar = null) { // check hotel $id = JRequest::getInt('id', 0); $filters = JFactory::getApplication()->getUserState('com_chpanel.rooms.filter'); $hotel = $filters['hotel']; if (!$id && !$hotel) { $this->setRedirect(JRoute::_('index.php?option=com_chpanel&view=rooms', false), JText::_('COM_CHPANEL_ANY_ERROR_SELECT_HOTEL'), 'notice'); return; } parent::edit($key = null, $urlVar = null); }
public function editRatePrices($key = null, $urlVar = null) { // Initialise variables. $app = JFactory::getApplication(); $result = parent::edit(); $recordId = JRequest::getInt('room_id'); $rateId = JRequest::getInt('rate_id'); // Save the data in the session. $app->setUserState('com_jhotelreservation.edit.room.roomid', $recordId); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=roomrateprices&layout=edit&rate_id=' . $rateId, false)); return true; }
public function edit($key = null, $url_var = null) { if (!JSession::checkToken('get') and !JSession::checkToken('post')) { jexit(JText::_('JINVALID_TOKEN')); } $rights = AimySitemapRightsHelper::getRights(); if (!$rights->get('core.edit')) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_aimysitemap&view=urls', false)); return false; } return parent::edit($key, $url_var); }
public function edit($key = null, $urlVar = null) { $app = JFactory::getApplication(); $cid = $app->input->get('cid', array(), 'array'); $recordId = count($cid) ? $cid[0] : 0; $parts = explode(',', $recordId); if (count($parts) == 2) { $cid = $parts[1]; $user_id = $parts[0]; $app->input->set('user_id', $user_id); $app->input->set('cid', array($cid)); $app->input->post->set('cid', array($cid)); $app->input->set('cid', array($cid)); @JRequest::setVar('cid', array($cid), 'post'); @JRequest::setVar('user_id', $user_id, 'post'); if (!$cid) { return $this->add(); } } return parent::edit($key, $urlVar); }
/** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key * (sometimes required to avoid router collisions). * * @since 3.1 * * @return boolean True if access level check and checkout passes, false otherwise. */ public function edit($key = null, $urlVar = null) { $this->option = 'com_fabrik'; return parent::edit($key, $urlVar); }
public function edit($key = null, $urlVar = null) { $model = $this->getModel(); $table = $model->getTable(); $cid = $this->input->post->get('cid', array(), 'array'); $context = "{$this->option}.edit.{$this->context}"; // Determine the name of the primary key for the data. if (empty($key)) { $key = $table->getKeyName(); } // To avoid data collisions the urlVar may be different from the primary key. if (empty($urlVar)) { $urlVar = $key; } // Get the previous record id (if any) and the current record id. $recordId = (int) (count($cid) ? $cid[0] : $this->input->getInt($urlVar)); $app = JFactory::getApplication('administration'); $app->setUserState('message.id', (int) $recordId); parent::edit($key, $urlVar); }
public function edit($key = 'id', $urlVar = 'id') { if (!$this->allowEdit(null, 'id')) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $return = 'index.php?option=com_smfaq&task=edit.edit&id=' . JRequest::getInt('id') . '&catid=' . JRequest::getInt('catid'); $this->setRedirect(JRoute::_('index.php?option=com_users&task=login&return=' . base64_encode($return))); return false; } parent::edit($key, $urlVar); }
/** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key * (sometimes required to avoid router collisions). * * @return boolean True if access level check and checkout passes, false otherwise. * */ public function edit($key = null, $urlVar = null) { $app = JFactory::getApplication(); $result = parent::edit(); return true; }
/** * Method to cancel and edit a record. for change profile. * * @return mixed True if the record can be added, a error object if not. */ public function canceledit() { $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; } return parent::edit(); }
public function edit($key = null, $urlVar = null) { $app = JFactory::getApplication(); $cat_id = $app->input->getInt('id', 0); $category = JUDirectoryHelper::getCategoryById($cat_id); if ($category->parent_id == 0) { $this->setRedirect("index.php?option=com_judirectory&view=listcats", JText::_('COM_JUDIRECTORY_YOU_CAN_NOT_EDIT_ROOT_CATEGORY'), "error"); } else { parent::edit($key = null, $urlVar = null); } }
/** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key * (sometimes required to avoid router collisions). * * @return boolean True if access level check and checkout passes, false otherwise. * * @since 1.6 */ public function edit($key = null, $urlVar = null) { // Initialise variables. $result = parent::edit(); if ($result) { // Push the new ancillary data into the session. User::setState('com_menus.edit.item.type', null); User::setState('com_menus.edit.item.link', null); } return true; }
function edit() { return parent::edit(); }
/** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). * * @return Boolean True if access level check and checkout passes, false otherwise. * @since 1.6 */ public function edit($key = null, $urlVar = 'a_id') { $result = parent::edit($key, $urlVar); return $result; }
/** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). * * @return boolean True if access level check and checkout passes, false otherwise. * * @since 1.6 */ public function edit($key = null, $urlVar = 'w_id') { return parent::edit($key, $urlVar); }
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(); } } } } } } } }
/** * Load data to autocreate subscriber row for J! user */ public function edit($key = null, $urlVar = null) { $sid = JRequest::getInt('subscriber_id'); if ($sid < 0) { $model = JModel::getInstance('Subscriber', 'NewsletterModelEntity'); $model->load($sid); JRequest::setVar('subscriber_id', $model->getId()); unset($model); } return parent::edit($key, $urlVar); }