本文整理汇总了PHP中SPLang::replacePlaceHolders方法的典型用法代码示例。如果您正苦于以下问题:PHP SPLang::replacePlaceHolders方法的具体用法?PHP SPLang::replacePlaceHolders怎么用?PHP SPLang::replacePlaceHolders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPLang
的用法示例。
在下文中一共展示了SPLang::replacePlaceHolders方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PaymentMethodView
/**
* 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'));
}
示例2: reject
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);
}
}
示例3: content
/**
* @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);
}