Example #1
0
 public function save(&$attr)
 {
     $data = array('key' => $this->nid . '-viewInfo', 'value' => $attr['viewInfo'], 'type' => 'field_information', 'fid' => $this->fid, 'id' => Sobi::Section(), 'section' => Sobi::Section());
     SPLang::saveValues($data);
     $data = array('key' => $this->nid . '-entryInfo', 'value' => $attr['entryInfo'], 'type' => 'field_information', 'fid' => $this->fid, 'id' => Sobi::Section(), 'section' => Sobi::Section());
     SPLang::saveValues($data);
     $attr['required'] = 0;
     $attr['fee'] = 0;
     $attr['isFree'] = 1;
     parent::save($attr);
 }
Example #2
0
 protected function save()
 {
     if (!SPFactory::mainframe()->checkToken()) {
         Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
     }
     $data = SPRequest::string('bankdata', null, true);
     $data = array('key' => 'bankdata', 'value' => $data, 'type' => 'application', 'id' => Sobi::Section(), 'section' => Sobi::Section());
     try {
         SPLang::saveValues($data);
     } catch (SPException $x) {
         $message = SPLang::e('DB_REPORTS_ERR', $x->getMessage());
         Sobi::Error('SPPaymentBt', $message, SPC::WARNING, 0, __LINE__, __FILE__);
         $this->response(Sobi::Back(), $message, false, 'error');
     }
     $this->response(Sobi::Back(), Sobi::Txt('MSG.ALL_CHANGES_SAVED'), false, 'success');
 }
Example #3
0
 /**
  * @param $attr
  * @return mixed
  * @throws SPException
  */
 protected function saveAttr(&$attr)
 {
     if ($this->nid) {
         $this->nid = $attr['nid'];
     }
     if (!isset($attr['viewInfo'])) {
         $attr['viewInfo'] = $this->viewInfo;
         $attr['entryInfo'] = $this->entryInfo;
     }
     $data = array('key' => $this->nid . '-viewInfo', 'value' => $attr['viewInfo'], 'type' => 'field_information', 'fid' => $this->fid, 'id' => Sobi::Section(), 'section' => Sobi::Section());
     SPLang::saveValues($data);
     $data = array('key' => $this->nid . '-entryInfo', 'value' => $attr['entryInfo'], 'type' => 'field_information', 'fid' => $this->fid, 'id' => Sobi::Section(), 'section' => Sobi::Section());
     SPLang::saveValues($data);
     $attr['required'] = 0;
     $attr['fee'] = 0;
     $attr['isFree'] = 1;
     return $attr;
 }
Example #4
0
 protected function save()
 {
     if (!SPFactory::mainframe()->checkToken()) {
         Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
     }
     $this->validate('extensions.paypal', array('task' => 'paypal', 'pid' => Sobi::Section()));
     SPFactory::registry()->saveDBSection(array(array('key' => 'ppurl', 'value' => SPRequest::string('ppurl')), array('key' => 'ppemail', 'value' => SPRequest::string('ppemail')), array('key' => 'ppcc', 'value' => SPRequest::string('ppcc')), array('key' => 'pprurl', 'value' => SPRequest::string('pprurl'))), 'paypal_' . Sobi::Section());
     $data = array('key' => 'ppexpl', 'value' => SPRequest::string('ppexpl', null, true), 'type' => 'application', 'id' => Sobi::Section(), 'section' => Sobi::Section());
     try {
         SPLang::saveValues($data);
         $data['key'] = 'ppsubject';
         $data['value'] = SPRequest::string('ppsubject', true);
         SPLang::saveValues($data);
     } catch (SPException $x) {
         $message = SPLang::e('DB_REPORTS_ERR', $x->getMessage());
         Sobi::Error('SPPaymentBt', $message, SPC::WARNING, 0, __LINE__, __FILE__);
         $this->response(Sobi::Back(), $message, false, 'error');
     }
     $this->response(Sobi::Back(), Sobi::Txt('MSG.ALL_CHANGES_SAVED'), false, 'success');
 }
Example #5
0
 protected function saveRejectionTpl()
 {
     if (!SPFactory::mainframe()->checkToken()) {
         Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
     }
     $templates = $this->getRejectionsTemplates();
     $id = SPLang::nid(SPRequest::string('templateName'));
     $templates[$id] = array('params' => SPConfig::serialize(array('trigger.unpublish' => SPRequest::bool('trigger_unpublish'), 'trigger.unapprove' => SPRequest::bool('trigger_unapprove'), 'unpublish' => SPRequest::bool('unpublish'), 'discard' => SPRequest::bool('discard'))), 'key' => $id, 'value' => SPRequest::string('templateName'), 'options' => array());
     foreach ($templates as $tid => $template) {
         unset($templates[$tid]['description']);
     }
     SPFactory::registry()->saveDBSection($templates, 'rejections-templates_' . Sobi::Section());
     $data = array('key' => $id, 'value' => SPRequest::string('reason', null, true, 'post'), 'type' => 'rejections-templates', 'id' => Sobi::Section(), 'section' => Sobi::Section(), 'options' => SPRequest::string('templateName'));
     SPLang::saveValues($data);
     $this->response(Sobi::Back(), Sobi::Txt('ENTRY_REJECT_SAVED_TPL'), false, SPC::SUCCESS_MSG);
 }