本文整理汇总了PHP中I18n::__方法的典型用法代码示例。如果您正苦于以下问题:PHP I18n::__方法的具体用法?PHP I18n::__怎么用?PHP I18n::__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类I18n
的用法示例。
在下文中一共展示了I18n::__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderHeader
/**
* Render header
*
* @param string $name Element name
* @return string HTML code
*/
public function renderHeader($name)
{
if ($this->getOption('tabbed')) {
return strtr('<ul><li><a onclick="blur()" href="#%id%-1">%label_associated%</a></li><li>' . '<a onclick="blur()" href="#%id%-2">%label_unassociated%</a></li></ul>', array('%id%' => $this->generateId($name), '%label_associated%' => I18n::__($this->parent->getFormFormatter()->getTranslationCatalogue() . '.' . $this->getOption('label_associated')), '%label_unassociated%' => I18n::__($this->parent->getFormFormatter()->getTranslationCatalogue() . '.' . $this->getOption('label_unassociated'))));
}
return '';
}
示例2: render
/**
* Render field
* @param string $name Element name
* @param string $value Field value [optional]
* @param array $attributes HTML attributes [optional]
* @param array $errors Field errors [optional]
* @return string XHTML compliant tag
*/
public function render($name, $value = null, $attributes = array(), $errors = array())
{
$textarea = parent::render($name, $value, $attributes, $errors);
$genId = $this->generateId($name);
$init[] = "tinyMCE.init({mode:'none',elements:'" . $genId . "',";
$init[] = "theme:'" . $this->getOption('theme') . "',";
$init[] = $this->getOption('width') ? "width:'" . $this->getOption('width') . "px'," : '';
$init[] = $this->getOption('height') ? "height:'" . $this->getOption('height') . "px'," : '';
$init[] = "theme_advanced_toolbar_location:'top',theme_advanced_toolbar_align:'left',";
$init[] = "theme_advanced_statusbar_location:'bottom',theme_advanced_resizing:true";
$init[] = $this->getOption('config') ? "," . $this->getOption('config') : '';
$init[] = "});";
$fix[] = "if(tinyMCE.get('" . $genId . "'))tinyMCE.remove(tinyMCE.get('" . $genId . "'));";
$fix[] = "setTimeout('tinyMCE.execCommand(\\'mceAddControl\\',false,\\'" . $genId . "\\');', 100);";
// remove this shit
if (!$this->getOption('activate')) {
$ext[] = '<a id="tmcAct' . $genId . '" class="tinymce_activation" ';
$ext[] = 'href="javascript:void(0)" onclick="tmcActivation' . $genId . '()" title="';
$ext[] = I18n::__('admin.labels.tmcActivation') . '"></a>';
}
$ext[] = '<script type="text/javascript">';
if (!$this->getOption('activate')) {
$ext[] = 'if(typeof jQuery!=\'undefined\'){';
$ext[] = '$(\'#tmcAct' . $genId . "').button({icons:{primary:'ui-icon-contact'},text:false});";
$ext[] = "function tmcActivation" . $genId . '(){$(\'#tmcAct' . $genId . "').hide();";
$ext[] = implode($init) . implode($fix) . '}}';
} else {
$ext[] = implode($init) . implode($fix);
}
$ext[] = "</script>";
return $textarea . implode($ext);
}
示例3: renderRange
/**
* Render range block
*
* @return string XHTML compliant
*/
protected function renderRange($name, $value = null, $attributes = array(), $errors = array())
{
//TODO: add no i18n way
$values = array_merge(array('min' => '', 'max' => ''), is_array($value) ? $value : array());
$dict = $this->parent->getFormFormatter()->getTranslationCatalogue();
return strtr($this->getOption('template'), array('%min_label%' => I18n::__($dict . '.labels.min'), '%max_label%' => I18n::__($dict . '.labels.max'), '%min%' => $this->getOption('min')->render($name . '[min]', $value['min'], $attributes), '%max%' => $this->getOption('max')->render($name . '[max]', $value['max'], $attributes)));
}
示例4: isset
?>
<li class="item<?php
echo isset($item['class']) ? ' ' . $item['class'] : '';
?>
">
<?php
echo Url::link('<sub></sub>' . I18n::__('menu.labels.item.' . $title), $item['url'], array('ajax' => 'action', 'onfocus' => 'blur()'));
?>
</li>
<?php
}
?>
</ul>
</li>
<?php
} else {
?>
<li class="node">
<?php
echo Url::link(I18n::__('menu.labels.category.' . $name), $category['url'], array('ajax' => 'action'));
?>
</li>
<?php
}
?>
<?php
}
?>
</ul>
<?php
}
示例5: setTitlePart
/**
* Set title part
*
* @param string $name Name of title part
* @param string $value Value of title part
* @param boolean $isI18n Is part need to translate [optional, default false]
* @return dinWebResponse
*/
public function setTitlePart($name, $value, $isI18n = false)
{
$this->titleParts['%' . $name . '%'] = $isI18n ? I18n::__($value) : $value;
return $this;
}
示例6: array
?>
<?php
if ($sf_user->isAuthenticated()) {
?>
<div id="logout">
[<?php
echo Url::link(I18n::__('messages.labels.logout'), '@logout', array('ajax' => 'action', 'dest' => 'logout'));
?>
]
<?php
echo $sf_user->getNickname();
?>
</div>
<?php
}
?>
<div class="clear"></div>
</div>
<?php
if (sfConfig::get('app_admin_include_path', true)) {
?>
<div id="sf_admin_path" class="ui-widget">
<strong><?php
echo Url::link(I18n::__('messages.labels.home'), '@homepage');
?>
</strong>
<div id="breadcrumbs"></div>
</div>
<?php
}
}
示例7: checkAll
</tr>
<?php
}
?>
<?php
}
?>
</tbody>
</table>
</div>
<div id="dialog-del-obj" style="display:none" title="<?php
echo I18n::__('admin.label.deleteObjectConfirm');
?>
">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><?php
echo I18n::__('admin.text.deleteObjectConfirm');
?>
</p>
</div>
<script type="text/javascript">
function checkAll(){var boxes=document.getElementsByTagName('input');for(var index=0;index<boxes.length;index++){box=boxes[index];if(box.type=='checkbox'&&box.className=='sf_admin_batch_checkbox')box.checked=document.getElementById('sf_admin_list_batch_checkbox').checked}return true;}
$(document).ready(function(){
$('#tree_list').treeTable({treeColumn:1,indent:16,initialState:'expanded'});
$('table#tree_list tbody tr').mousedown(function(){$('tr.ui-state-hover').removeClass('ui-state-hover');$(this).addClass('ui-state-hover');});
$('table#tree_list tbody tr span').mousedown(function(){$($(this).parents('tr')[0]).trigger('mousedown');});
});
</script>
示例8: linkToSaveAndAdd
/**
* Link to save and add
*
* @param object $object Object
* @param array $params Params for generation
* @return string Generated xhtml compliant
*/
public function linkToSaveAndAdd($object, $params)
{
if (!$object->isNew()) {
return '';
}
return '<li class="sf_admin_action_save_and_add"><script type="text/javascript">if(typeof jQuery!=\'undefined\'){$(function(){' . '$(".sf_admin_action_save_and_add button").button({icons:{primary:\'ui-icon-copy\'}})' . '});$(".sf_admin_action_save_and_add button").click(function(){$(".sf_admin_action_save_and_add")' . '.prepend(\'<input type="hidden" name="_save_and_add" value="1" />\');});}</script>' . '<button type="submit" name="_save_and_add">' . I18n::__($this->dictionary . 'labels.saveAndAdd') . '</button></li>';
}
示例9: render
/**
* Render field
*
* @param string $name Element name
* @param string $value Field value [optional]
* @param array $attributes HTML attributes [optional]
* @param array $errors Field errors [optional]
* @return string XHTML compliant tag
*/
public function render($name, $value = null, $attributes = array(), $errors = array())
{
$values = array_merge(array('from' => '', 'to' => '', 'is_empty' => ''), is_array($value) ? $value : array());
$dict = $this->parent->getFormFormatter()->getTranslationCatalogue();
return strtr($this->getOption('template'), array('%from%' => I18n::__($dict . '.labels.fromDate'), '%to%' => I18n::__($dict . '.labels.toDate'), '%from_date%' => $this->getOption('from_date')->render($name . '[from]', $value['from'], $attributes), '%to_date%' => $this->getOption('to_date')->render($name . '[to]', $value['to'], $attributes)));
}