Пример #1
0
 public function execute($task = null)
 {
     $app = JFactory::getApplication();
     $modelName = $app->input->get('model', 'Calendar');
     // 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 == 'deleteListDaytime') {
         $this->deleteListDaytime();
     } elseif ($task == 'cancel') {
         $this->cancel();
     } else {
         if ($task == 'apply') {
             parent::save();
             $app->enqueueMessage('Calendrier sauvé avec succès!');
             $app->redirect($_SERVER['HTTP_REFERER']);
         } else {
             if ($task == 'save') {
                 parent::save();
             } else {
                 $this->edit();
             }
         }
     }
 }
Пример #2
0
 /**
  * Save the configuration
  *
  * @return void
  * @since 1.0
  */
 function save()
 {
     $jform = JRequest::getVar('jform', array(), 'post', 'array');
     $iid = $jform['series_id'];
     $aid = $jform['automailing_id'];
     $msg = false;
     if (isset($jform['time_start']) && empty($jform['time_start'])) {
         $err = true;
         $msg = JText::_("COM_NEWSLETTER_START_TIME_IS_EMPTY");
     }
     //		if (isset($jform['time_offset']) && empty($jform['time_offset'])) {
     //			$err = true;
     //			$msg = JText::_("COM_NEWSLETTER_TIME_OFFSET_IS_EMPTY");
     //		}
     if (empty($err) && parent::save()) {
         // Set the redirect based on the task.
         switch ($this->getTask()) {
             case 'save':
                 $this->setRedirect(JRoute::_('index.php?option=com_newsletter&view=close&tmpl=component', false));
                 break;
         }
         return true;
     }
     $this->setRedirect(JRoute::_('index.php?option=com_newsletter&tmpl=component&view=' . $this->view_item . $this->getRedirectToItemAppend($iid, 'series_id') . '&automailing_id=' . $aid, false), $msg);
     return false;
 }
Пример #3
0
 public function save($key = NULL, $urlVar = NULL)
 {
     if (!parent::save($key = NULL, $urlVar = NULL)) {
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', JText::_('COM_HTRAININGLOGS_PORTLET_EXISTS')));
         $this->setMessage($this->getError(), 'error');
     }
 }
Пример #4
0
 public function save($key = null, $urlVar = null)
 {
     $data = $this->input->post->get('jform', array(), 'array');
     $model = $this->getModel();
     $table = $model->getTable();
     $url = $table->getKeyName();
     parent::save($key = $data['id'], $urlVar = $url);
 }
Пример #5
0
 /**
  * Save a template field
  *
  * @copyright
  * @author 		RolanD
  * @todo
  * @see
  * @access 		public
  * @param
  * @return
  * @since 		4.3
  */
 public function save($key = null, $urlVar = null)
 {
     if (parent::save($key, $urlVar)) {
         $this->setRedirect('');
         JFactory::getDocument()->addScriptDeclaration('window.parent.location.href = window.parent.location.href;');
         JFactory::getDocument()->addScriptDeclaration('window.parent.SqueezeBox.close();');
     }
 }
Пример #6
0
 public function save()
 {
     if (parent::save()) {
         $msg = JText::_('SL_SAVED');
     } else {
         $msg = JText::_('SL_ERROR_SAVE');
     }
     $this->setRedirect('index.php?option=com_slp&controller=slpedit', $msg);
 }
Пример #7
0
 public function save($key = null, $urlVar = null)
 {
     parent::save($key = null, $urlVar = null);
     // $this->input = $this->input->post->get('ziak_id', 0, 'int');
     // echo $this->input;
     $this->input = JFactory::getApplication()->input->getInt('trieda_id', 0);
     $this->setRedirect(JRoute::_('index.php?option=com_absolventi&view=ziacilist&trieda_id=' . $this->input, false));
     $this->redirect;
 }
Пример #8
0
 public function save($key = NULL, $urlVar = NULL)
 {
     //print_r($_POST);exit;
     if (!parent::save($key = NULL, $urlVar = NULL)) {
         //$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', JText::_('COM_HTRAININGLOGS_RECORDEXISTS')));
         $this->setMessage($this->getError(), 'error');
     }
     $this->setRedirect(JRoute::_('index.php?option=com_htraininglogs&view=sessions', false));
 }
 public function save($key = null, $urlVar = 'a_id')
 {
     $result = parent::save($key, $urlVar);
     // If ok, redirect to the return page.
     if ($result) {
         $this->setRedirect($this->getReturnPage());
     }
     return $result;
 }
Пример #10
0
 function save($key = NULL, $urlVar = NULL)
 {
     parent::save();
     if (JRequest::getVar('fc_doajax_submit')) {
         JFactory::getApplication()->enqueueMessage(JText::_('FLEXI_ITEM_SAVED'), 'message');
         echo flexicontent_html::get_system_messages_html();
         exit;
         // Ajax submit, do not rerender the view
     }
 }
Пример #11
0
 function save($key = null, $urlVar = null)
 {
     if (parent::save($key = null, $urlVar = null)) {
         $post = JFactory::getApplication()->input->getArray($_POST);
         if ($post['config_currency_auto']) {
             $model = $this->getModel('currencies');
             $model->updateCurrencies(true);
         }
     }
 }
Пример #12
0
 /**
  * Method to save a 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 successful, false otherwise.
  *
  * @since   11.1
  */
 public function save($key = null, $urlVar = null)
 {
     $app = JFactory::getApplication();
     $brb = $app->input->post->get('brb');
     if ($brb) {
         self::save2($key, $urlVar, $brb);
     } else {
         return parent::save($key, $urlVar);
     }
 }
Пример #13
0
 /**
  * Overrides parent save method to check the submitted passwords match.
  *
  * @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 successful, false otherwise.
  *
  * @since   3.2
  */
 public function save($key = null, $urlVar = null)
 {
     $this->setRedirect(JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id=' . JFactory::getUser()->id, false));
     $return = parent::save();
     if ($this->getTask() != 'apply') {
         // Redirect to the main page.
         $this->setRedirect(JRoute::_('index.php', false));
     }
     return $return;
 }
Пример #14
0
 /**
  * Method to save a record.
  *
  * @param     string     $key        The name of the primary key of the URL variable.
  * @param     string     $url_var    The name of the URL variable if different from the primary key.
  *
  * @return    boolean                True if successful, false otherwise.
  */
 public function save($key = null, $url_var = 'id')
 {
     $result = parent::save($key, $url_var);
     $project = JRequest::getUint('filter_project', 0);
     $parent = JRequest::getUint('filter_parent_id', 0);
     // If ok, redirect to the return page.
     if ($result) {
         $this->setRedirect($this->getReturnPage($parent, $project));
     }
     return $result;
 }
Пример #15
0
 function save($key = null, $urlVar = null)
 {
     if (parent::save($key, $urlVar)) {
         require_once JPATH_SITE . '/components/com_j2store/helpers/cart.php';
         $storeprofile = J2StoreHelperCart::getStoreAddress();
         if ($storeprofile->config_currency_auto) {
             $model = $this->getModel('currencies');
             $model->updateCurrencies(true);
         }
     }
 }
Пример #16
0
 /**
  * 
  * save and rediret to the url
  */
 public function save($key = null, $urlVar = null)
 {
     parent::save($key, $urlVar);
     $task = $this->getTask();
     switch ($task) {
         case "save":
             $this->setRedirectToSlides();
             break;
     }
     return false;
 }
Пример #17
0
 /**
  * save a record (and redirect to main page)
  * @return void
  */
 function save($key = null, $urlVar = null)
 {
     $model = $this->getModel('tarif');
     if (parent::save('tarif.save')) {
         $msg = JText::_('tarif Saved!');
     } else {
         $msg = JText::_('Error Saving tarif');
     }
     // Check the table in so it can be edited.... we are done with it anyway
     $link = 'index.php?option=com_tsj&view=tarifs';
     $this->setRedirect($link, $msg);
 }
Пример #18
0
 /**
  * Save action
  */
 public function save()
 {
     $form = JRequest::getVar('jform');
     $model = JModel::getInstance('Smtpprofile', 'NewsletterModelEntity');
     $model->load($form['smtp_profile_id']);
     if ($model->isJoomlaProfile()) {
         $buffer = array_merge($model->toArray(), $form);
         $buffer['params'] = array_merge((array) $model->params, $form['params']);
         JRequest::setVar('jform', $buffer, 'post');
     }
     parent::save();
     $this->setRedirect('index.php?option=com_newsletter&view=close&tmpl=component');
 }
Пример #19
0
 /**
  * Overrides parent save method to check the submitted passwords match.
  *
  * @return	mixed	Boolean or JError.
  * @since	1.6
  */
 public function save($key = null, $urlVar = null)
 {
     $data = JRequest::getVar('jform', array(), 'post', 'array');
     // TODO: JForm should really have a validation handler for this.
     if (isset($data['password']) && isset($data['password2'])) {
         // Check the passwords match.
         if ($data['password'] != $data['password2']) {
             $this->setMessage(JText::_('JLIB_USER_ERROR_PASSWORD_NOT_MATCH'), 'warning');
             $this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));
         }
         unset($data['password2']);
     }
     return parent::save();
 }
Пример #20
0
 /**
  * Overrides parent save method to check the submitted passwords match.
  */
 public function save()
 {
     $data = JRequest::getVar('jform', array(), 'post', 'array');
     // TODO: JForm should really have a validation handler for this.
     if (isset($data['password']) && isset($data['password2'])) {
         // Check the passwords match.
         if ($data['password'] != $data['password2']) {
             $this->setError('Users_Error_Password_mismatch');
             return false;
         }
         unset($data['password2']);
     }
     return parent::save();
 }
Пример #21
0
 public function save($key = null, $urlVar = null)
 {
     $membership_fields = JRequest::getVar('rsm_membership_fields', array(), 'post', 'array');
     $last_transaction_id = JRequest::getVar('last_transaction_id', '', 'post');
     $data = JRequest::getVar('jform', array(), 'post', 'array');
     $model = $this->getModel();
     $checkMembershipFields = $model->checkMembershipFields($membership_fields, $last_transaction_id, $data['membership_id']);
     if ($checkMembershipFields != '') {
         JError::raiseWarning(500, $checkMembershipFields);
         $this->setRedirect(JRoute::_('index.php?option=com_rsmembership&task=membership_subscriber.edit&id=' . $data['id'] . $this->getRedirectToItemAppend(), false));
         return false;
     }
     parent::save($key, $urlVar);
 }
Пример #22
0
 /**
  * Method to save a 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 successful, false otherwise.
  *
  * @since   11.1
  */
 public function save($key = null, $urlVar = null)
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $data = $input->post->get('jform', array(), 'array');
     // For Fields group
     // Convert jform[fields_group][field] to jform[field] or JTable cannot bind data.
     // ==========================================================================================
     $data = AKHelper::_('array.pivotFromTwoDimension', $data);
     $input->post->set('jform', $data);
     $input->set('jform', $data);
     JRequest::setVar('jform', $data);
     return parent::save($key, $urlVar);
 }
Пример #23
0
 public function save($key = null, $urlVar = null)
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Fill the form data with checkbox values
     $data = $this->input->post->get('jform', array(), 'array');
     $data['url'] = array_key_exists('url', $data) ? trim($data['url']) : '.';
     $data['case_sensitive'] = array_key_exists('case_sensitive', $data) ? 1 : 0;
     $data['request_only'] = array_key_exists('request_only', $data) ? 1 : 0;
     $data['decode_url'] = array_key_exists('decode_url', $data) ? 1 : 0;
     $data['last_rule'] = array_key_exists('last_rule', $data) ? 1 : 0;
     $data['synonyms_weight'] = array_key_exists('synonyms_weight', $data) ? 1 : 0;
     $data = $this->input->post->set('jform', $data);
     return parent::save($key, $urlVar);
 }
Пример #24
0
 public function save($key = null, $urlVar = null)
 {
     $app = JFactory::getApplication();
     $task = $app->input->get('task');
     $form = $app->input->post->get("jform", array(), 'array');
     $cat_id = $form['parent_id'];
     parent::save($key = null, $urlVar = null);
     if ($task == 'save') {
         if (!$cat_id) {
             $this->setRedirect("index.php?option=com_judirectory&view=listcats");
         } else {
             $this->setRedirect("index.php?option=com_judirectory&view=listcats&cat_id=" . $cat_id);
         }
     }
 }
Пример #25
0
 /**
  * Save the configuration
  * @return	boolean
  * @since	1.0
  */
 function save()
 {
     if (parent::save()) {
         // Set the redirect based on the task.
         switch ($this->getTask()) {
             case 'save':
                 $this->setRedirect('index.php?option=com_newsletter&view=close&tmpl=component');
                 break;
         }
         return true;
     } else {
         $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $key), false));
     }
     return false;
 }
Пример #26
0
 public function save($key = null, $urlVar = null)
 {
     print_r($this);
     $file = $this->input->files->get('jform')['tablo_url'];
     $form = $this->input->post->get('jform', array(), 'array');
     //pridanie nazvu suboru do zapisu
     $this->input->post->set('jform', array_merge($form, array('tablo_url' => $file['name'])));
     // upload suboru
     if (!$this->upload($file)) {
         echo JText::_('ERROR MOVING FILE');
     }
     parent::save($key = null, $urlVar = null);
     $this->setRedirect('index.php?option=com_absolventi');
     $this->redirect;
 }
Пример #27
0
 public function send($key = null, $urlVar = null)
 {
     // Check for request forgeries
     JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
     // Save data
     $return = parent::save($key, $urlVar);
     // Set redirect
     $this->setRedirect(JRoute::_('index.php?option=com_issnregistry&view=message&layout=send_result&tmpl=component', false));
     // Update response message based on save function's result
     if ($return) {
         $this->setMessage(JText::_('COM_ISSNREGISTRY_FORM_MESSAGE_SENT'), 'message');
     } else {
         $this->setMessage(JText::_('COM_ISSNREGISTRY_FORM_MESSAGE_SENT_FAILED'), 'error');
     }
     return $return;
 }
Пример #28
0
 /**
  * Method to save a 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 successful, false otherwise.
  */
 public function save($key = null, $urlVar = null)
 {
     parent::save();
     $redirectUrl = $this->_input->get('redirect_url', '', 'STR');
     $redirectUrlForm = $this->_input->get('redirect_url_form', '', 'STR');
     $openArticle = $this->_input->get('open_article', '', 'STR');
     if ($redirectUrl) {
         $this->setRedirect(JRoute::_($redirectUrl, false), "");
     }
     if ($openArticle) {
         $this->setRedirect($this->redirect . '&opentarticle=open');
     }
     if ($redirectUrlForm) {
         $this->setRedirect($this->redirect . $redirectUrlForm);
     }
 }
Пример #29
0
 /**
  * Controller save users set user_fields in data
  */
 public function save($key = null, $urlVar = 'id')
 {
     $jinput = JFactory::getApplication()->input;
     $data = $jinput->post->get('jform', array(), 'array');
     $data['user_id'] = $data['id'];
     $user_fields = $jinput->post->get('user_fields', array(), 'array');
     $data['user_fields'] = $user_fields;
     JRequest::setVar('jform', $data, 'post');
     $jinput->post->set('jform', $data);
     if (isset($data['password']) && isset($data['password2'])) {
         if ($data['password'] != $data['password2']) {
             $this->setMessage(JText::_('JLIB_USER_ERROR_PASSWORD_NOT_MATCH'), 'warning');
             $this->setRedirect(JRoute::_('index.php?option=com_bt_socialconnect&view=socialconnect&layout=edit', false));
         }
         unset($data['password2']);
     }
     return parent::save($key, $urlVar);
 }
Пример #30
0
 /**
  * Save the configuration
  *
  * @return void
  * @since 1.0
  */
 function save()
 {
     $aid = JRequest::getInt('automailing_id');
     $isNew = empty($aid);
     JRequest::setVar('layout', $isNew ? 'default' : 'edit');
     if (parent::save()) {
         // Set the redirect based on the task.
         switch ($this->getTask()) {
             case 'save':
                 $this->setRedirect(JRoute::_('index.php?option=com_newsletter&view=close&tmpl=component', false));
                 break;
         }
         return true;
     } else {
         $this->setRedirect(JRoute::_('index.php?option=com_newsletter&tmpl=component&view=' . $this->view_item . $this->getRedirectToItemAppend($aid, 'automailing_id'), false));
     }
     return false;
 }