public static function generateWidgetTitlesContentTab($field, $lang, $tabName, $model)
{
$isCKEditor = false;
$activeLang = Lang::getActiveLangs(true);
$countActiveLang = count($activeLang);
$fieldId = 'id_' . $tabName . '_' . $lang;
$value = '';
if (isset($model->{$tabName}) && !empty($model->{$tabName})) {
$arr = $model->{$tabName};
if (isset($arr[$lang])) {
$value = $arr[$lang];
}
}
$html = '';
if ($countActiveLang > 1) {
$html .= '<div class="translate_button" >';
$html .= '<span class="t_loader_' . $tabName . '" style="display: none;"><img src="' . Yii::app()->theme->baseUrl . '/images/ajax-loader.gif" alt="Переводим"></span>';
$html .= CHtml::button(tc('Translate'), array(
'onClick' => "translateField('widgetSubTitle[{$tabName}]', '{$lang}', '{$isCKEditor}', " . CJavaScript::encode($tabName) . ")"
));
$html .= '</div>';
$html .= '<div class="copylang_button">';
$html .= CHtml::button(tc('Copy to all languages'), array(
'onClick' => "copyField('widgetSubTitle[{$tabName}]', '{$lang}', '{$isCKEditor}', " . CJavaScript::encode($tabName) . ")"
));
$html .= '</div>';
}
$html .= '<div class="form-group">';
$html .= CHtml::label($model->getAttributeLabel($tabName), null, array());
$html .= CHtml::textField($field, $value, array(
'class' => 'width300 form-control',
'maxlength' => 255,
'id' => $fieldId
));
$html .= '</div>';
return $html;
}
Yii::app()->clientScript->registerScriptFile($baseUrl . '/carousel_ck/js/jquery.mobile.min.js', CClientScript::POS_END);
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 5