case FormDesigner::TYPE_TEXT_AREA_WS:
if ($row['is_i18n']) {
Yii::app()->controller->widget('application.modules.lang.components.langFieldWidget', array(
'model' => $model,
'field' => $row['field'],
'type' => 'text-editor'
));
} else {
// даем пользователям ограниченый набор форматирования
$toolbar = array(
//array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'),
array('Cut', 'Copy', 'PasteText', '-', 'Undo', 'Redo'),
array('NumberedList', 'BulletedList'),
//array('Styles', 'Format', 'Font', 'FontSize', 'TextColor', 'BGColor'),
//array('Image', 'Link', 'Unlink', 'SpecialChar'),
);
$filebrowserImageUploadUrl = '';
if (Yii::app()->user->checkAccess('backend_access')) { // if admin - enable upload image
$filebrowserImageUploadUrl = Yii::app()->createAbsoluteUrl('/site/uploadimage', array('type' => 'imageUpload', Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken));
$toolbar = array(
array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'),
array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'),
array('NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'),
array('Styles', 'Format', 'Font', 'FontSize', 'TextColor', 'BGColor'),
array('Image', 'Link', 'Unlink', 'SpecialChar'),
);
}
Yii::app()->controller->widget('application.extensions.editMe.widgets.ExtEditMe', array(
'model' => $model,
'attribute' => $row['field'],
'toolbar' => $toolbar,
'filebrowserImageUploadUrl' => $filebrowserImageUploadUrl,
'htmlOptions' => array('id' => $model->id)
));
}
break;
case 'text-editor':
$html .= '<div class="clear"></div>';
$filebrowserBrowseUrl = $filebrowserImageBrowseUrl = $filebrowserFlashBrowseUrl = '';
$filebrowserUploadUrl = $filebrowserImageUploadUrl = $filebrowserFlashUploadUrl = '';
$allowedContent = false;
if (Yii::app()->user->checkAccess('upload_from_wysiwyg')) { // if admin - enable upload image
//$filebrowserImageUploadUrl = Yii::app()->createAbsoluteUrl('/site/uploadimage', array('type' => 'imageUpload', Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken));
$filebrowserBrowseUrl = Yii::app()->getBaseUrl(true).'/re_kcfinder/browse.php?opener=ckeditor&type=files';
$filebrowserImageBrowseUrl = Yii::app()->getBaseUrl(true).'/re_kcfinder/browse.php?opener=ckeditor&type=images';
$filebrowserFlashBrowseUrl = Yii::app()->getBaseUrl(true).'/re_kcfinder/browse.php?opener=ckeditor&type=flash';
$filebrowserUploadUrl = Yii::app()->getBaseUrl(true).'/re_kcfinder/upload.php?opener=ckeditor&type=files';
$filebrowserImageUploadUrl = Yii::app()->getBaseUrl(true).'/re_kcfinder/upload.php?opener=ckeditor&type=images';
$filebrowserFlashUploadUrl = Yii::app()->getBaseUrl(true).'/re_kcfinder/upload.php?opener=ckeditor&type=flash';
$allowedContent = true;
}
$html .= $this->widget('application.extensions.editMe.widgets.ExtEditMe', array(
'model' => $this->model,
'attribute' => $field,
'toolbar' => array(
array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'),
array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'),
array('NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'),
array('Styles', 'Format', 'Font', 'FontSize', 'TextColor', 'BGColor'),
array('Image', 'Link', 'Unlink', 'SpecialChar'),
),
'allowedContent' => $allowedContent,
'filebrowserBrowseUrl' => $filebrowserBrowseUrl,
'filebrowserImageBrowseUrl' => $filebrowserImageBrowseUrl,
'filebrowserFlashBrowseUrl' => $filebrowserFlashBrowseUrl,
'filebrowserUploadUrl' => $filebrowserUploadUrl,
'filebrowserImageUploadUrl' => $filebrowserImageUploadUrl,
'filebrowserFlashUploadUrl' => $filebrowserFlashUploadUrl,
'htmlOptions' => array('id' => $fieldId)
), true);
break;
Вернуться в Вопросы и помощь по изменениям
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 16