/** * This function have to add own string into the given array * Basically: $methods[ $this->id ] = "Some String To Output"; * Optionally the value can be also SobiPro Arr2XML array. * Check the documentation for more information * @param array $methods * @param SPEntry $entry * @param array $payment * @return void */ public function PaymentMethodView(&$methods, $entry, &$payment) { $bankdata = SPLang::getValue('bankdata', 'plugin', Sobi::Section()); $bankdata = SPLang::replacePlaceHolders($bankdata, array('entry' => $entry)); $methods[$this->id] = array('content' => SPLang::clean($bankdata), 'title' => Sobi::Txt('APP.PBT.PAY_TITLE')); }
protected function reject() { if (!SPFactory::mainframe()->checkToken()) { Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__); } if ($this->authorise('manage')) { $changes = array(); $objects = array('entry' => $this->_model, 'user' => SPFactory::user(), 'author' => SPFactory::Instance('cms.base.user', $this->_model->get('owner'))); $messages =& SPFactory::registry()->get('messages'); $reason = SPLang::replacePlaceHolders(SPRequest::string('reason', null, true, 'post'), $objects); $objects['reason'] = nl2br($reason); $messages['rejection'] = $objects; SPFactory::registry()->set('messages', $messages); $this->_model->setMessage($reason, 'reason'); if (SPRequest::bool('unpublish', false, 'post')) { $this->_model->changeState(0, $reason, false); $changes[] = 'unpublish'; } if (SPRequest::bool('trigger_unpublish', false, 'post')) { Sobi::Trigger('Entry', 'AfterChangeState', array($this->_model, 0, 'messages' => $this->_model->get('messages'))); } if (SPRequest::bool('discard', false, 'post')) { $changes[] = 'discard'; $data = $this->_model->discard(false); } if (SPRequest::bool('trigger_unapprove', false, 'post')) { Sobi::Trigger('Entry', 'AfterUnapprove', array($this->_model, 0)); } Sobi::Trigger('Entry', 'AfterReject', array($this->_model, 0)); SPFactory::message()->logAction('reject', $this->_model->get('id'), $data, $reason); $this->response(Sobi::Back(), Sobi::Txt('ENTRY_REJECTED', $this->_model->get('name')), true, SPC::SUCCESS_MSG); } }
/** * @param array $config * @param array $values * @return string */ private function content($config, $values) { $out = "\n"; $out .= $values['expl']; $out .= "\n"; $out .= '<form action="' . $values['ppurl'] . '" method="post">' . "\n"; foreach ($config['fields'] as $field => $value) { $out .= '<input name="' . $field . '" value="' . SPLang::replacePlaceHolders($value, $values) . '" type="hidden"/>' . "\n"; } $img = SPLang::replacePlaceHolders($config['general']['image']); $out .= '<input src="' . $img . '" name="submit" alt="" type="image"/>' . "\n"; $out .= '</form>' . "\n"; return SPLang::clean($out); }