我在一个项目中使用FCKeditor。
<textarea name="Content_Arabic" id="Content_Arabic" cols="35" rows="4" class="txtfield"><?php echo (stripslashes(stripslashes($_POST['Content'])));?></textarea>
<script type="text/javascript">
var editor = new ew_DHTMLEditor("Content_Arabic");
editor.create = function() {
var sBasePath = 'FCKeditor/';
var oFCKeditor = new FCKeditor('Content_Arabic', '100%', 350, 'Default');
oFCKeditor.BasePath = sBasePath;
oFCKeditor.ReplaceTextarea();
oFCKeditor.rtl;
oFCKeditor.ContentLangDirection='rtl';
this.active = true;
}
ew_DHTMLEditors[ew_DHTMLEditors.length] = editor;
ew_CreateEditor(); // Create DHTML editor(s)
//-->
</script>
这个编辑器加载了,但它仍然是英国风格。
我希望它加载为阿拉伯语风格,从右到左。
下面的解决方案假设您希望此配置静态地用于解决方案*中FCKEditor的所有实例。
只需编辑文件/path/to/your_fckeditor_installation_dir/fckeditor.js
并按如下方式更改以下属性:
FCKConfig.AutoDetectLanguage = false ;
FCKConfig.DefaultLanguage = 'ar' ;
编辑
从上面的代码中,您只需要以下几行(删除其余部分):
var oFCKeditor = new FCKeditor('Content_Arabic', '100%', 350, 'Default');
oFCKeditor.BasePath = 'FCKeditor/';
oFCKeditor.ReplaceTextarea();
仅此而已!
*如果你想动态地改变这一点,那么你应该按照这些指导方针改变你的方法