本文整理汇总了PHP中SPLang::currency方法的典型用法代码示例。如果您正苦于以下问题:PHP SPLang::currency方法的具体用法?PHP SPLang::currency怎么用?PHP SPLang::currency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPLang
的用法示例。
在下文中一共展示了SPLang::currency方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
protected function edit()
{
SPLoader::loadClass('html.tooltip');
$this->_type = 'entry_form';
$id = $this->get('entry.id');
if ($id) {
$this->addHidden($id, 'entry.id');
}
if (Sobi::Cfg('legacy.sigsiutree', false)) {
/* load the SigsiuTree class */
$tree = SPLoader::loadClass('mlo.tree');
/* create new instance */
$tree = new $tree(Sobi::Cfg('list.categories_ordering'));
$link = "javascript:SP_selectCat( '{sid}' )";
$tree->setHref($link);
$tree->setTask('category.chooser');
$tree->disable(Sobi::Section());
$tree->init(Sobi::Section());
$head = SPFactory::header();
$params = array();
$params['URL'] = Sobi::Url(array('task' => 'category.parents', 'out' => 'json'), true, false, true);
$params['MAXCATS'] = Sobi::Cfg('legacy.maxCats', '5');
$params['SEPARATOR'] = Sobi::Cfg('string.path_separator', ' > ');
$head->addJsVarFile('edit', md5(Sobi::Section() . Sobi::Section(true) . serialize($params)), $params);
}
$type = $this->key('template_type', 'xslt');
if ($type != 'php' && Sobi::Cfg('global.disable_xslt', false)) {
$type = 'php';
}
if ($type == 'xslt') {
$data = $this->entryData(false);
$fields = $this->get('fields');
$f = array();
if (count($fields)) {
foreach ($fields as $field) {
if ($field->enabled('form')) {
$pf = null;
$pfm = null;
if (!$field->get('isFree') && $field->get('fee') && !Sobi::Can('entry.payment.free')) {
$pf = SPLang::currency($field->get('fee'));
$pfm = Sobi::Txt('EN.FIELD_NOT_FREE_MSG', array('fee' => $pf, 'fieldname' => $field->get('name')));
}
$f[$field->get('nid')] = array('_complex' => 1, '_data' => array('label' => array('_complex' => 1, '_data' => $field->get('name'), '_attributes' => array('lang' => Sobi::Lang(false), 'show' => $field->__get('showEditLabel'))), 'data' => array('_complex' => 1, '_xml' => 1, '_data' => $field->field(true)), 'description' => array('_complex' => 1, '_xml' => 1, '_data' => $field->get('description')), 'fee' => $pf, 'fee_msg' => $pfm), '_attributes' => array('id' => $field->get('id'), 'type' => $field->get('type'), 'suffix' => $field->get('suffix'), 'position' => $field->get('position'), 'required' => $field->get('required'), 'css_edit' => $field->get('cssClassEdit'), 'width' => $field->get('bsWidth'), 'css_class' => strlen($field->get('cssClass')) ? $field->get('cssClass') : 'spField'));
}
}
}
$f['save_button'] = array('_complex' => 1, '_data' => array('data' => array('_complex' => 1, '_xml' => 1, '_data' => SPHtml_Input::submit('save', Sobi::Txt('EN.SAVE_ENTRY_BT')))));
$f['cancel_button'] = array('_complex' => 1, '_data' => array('data' => array('_complex' => 1, '_xml' => 1, '_data' => SPHtml_Input::button('cancel', Sobi::Txt('EN.CANCEL_BT'), array('onclick' => 'SPcancelEdit();')))));
if (Sobi::Cfg('legacy.sigsiutree', false)) {
$data['entry']['_data']['category_chooser'] = array('path' => array('_complex' => 1, '_xml' => 1, '_data' => SPHtml_Input::textarea('parent_path', $this->get('parent_path'), false, 500, 60, array('id' => 'entry.path', 'class' => 'inputbox required', 'readonly' => 'readonly'))), 'selected' => array('_complex' => 1, '_xml' => 1, '_data' => SPHtml_Input::text('entry.parent', $this->get('parents'), array('id' => 'entry.parent', 'size' => 15, 'maxlength' => 50, 'class' => 'inputbox required', 'readonly' => 'readonly', 'style' => 'text-align:center;'))));
}
$data['entry']['_data']['fields'] = array('_complex' => 1, '_data' => $f, '_attributes' => array('lang' => Sobi::Lang(false)));
if (Sobi::Cfg('legacy.sigsiutree', false)) {
$data['tree'] = array('_complex' => 1, '_xml' => 1, '_data' => SPLang::entities($tree->display(true), true));
}
$this->_attr = $data;
Sobi::Trigger($this->_type, ucfirst(__FUNCTION__), array(&$this->_attr));
}
}
示例2: onFieldEdit
public function onFieldEdit(&$view)
{
$this->loadType();
$this->editLimit = $this->editLimit > 0 ? $this->editLimit : 0;
$this->fee = SPLang::currency($this->fee, false);
if (is_array($this->allowedAttributes) && !is_string($this->allowedAttributes)) {
$this->allowedAttributes = implode(', ', $this->allowedAttributes);
}
if (is_array($this->allowedTags) && !is_string($this->allowedTags)) {
$this->allowedTags = implode(', ', $this->allowedTags);
}
if ($this->_type && method_exists($this->_type, 'onFieldEdit')) {
$this->_type->onFieldEdit($view);
}
}
示例3: currency
public static function currency($value)
{
return SPLang::currency($value);
}