FCKeditor on XOOPS をカスタムブロック編集画面に組み込む。
「FCKeditor on XOOPS を試してみました。」 という記事へのコメントで、カスタムブロック編集画面への組み込みについてご質問いただいたので、さきほど実験してみました。
XOOPS Cube Legacy2.1.x なら、カスタムブロック編集画面のテンプレートを編集するだけで FCKEditor on XOOPS(以下 fckxoops) を組み込むことができます。
カスタムブロック編集画面のテンプレートファイルは、/modules/legacy/admin/templates/customblock_edit.html です。
このファイルの冒頭に以下を挿入します。
<script type="text/javascript" src="<{$xoops_url}>/common/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
function fckeditor_exec(width, height, url) {
var area_width = width;
var area_height = height;
var xoops_url = url;
var oFCKeditor = new FCKeditor( "content", area_width, area_height, "Default" );
oFCKeditor.BasePath = xoops_url + "/common/fckeditor/";
oFCKeditor.ReplaceTextarea();
}
</script>
つづいて、テキストエリア表示箇所を修正します。
<{xoops_dhtmltarea type=text name=content value=$actionForm->get('content') rows=20 cols=60}>
と書かれている行を
<textarea id="content" name="content"><{$actionForm->get('content')}></textarea><script>fckeditor_exec("100%", "350", "<{$xoops_url}>");</script><br />
に変更します。
これだけで、カスタムブロック編集に fckxoops を使えるようになります。
もちろん fckxoops は事前にインストールしておいてくださいね。
RSS feed for comments on this post.
Ȥ
ʤߥȤդ뤳ȤϽޤ
こんにちは。
これ↓と同じ現象が起きてます。http://www.xugj.org/modules/d3forum/index.php?post_id=1676
(コードが1行で・・、以下の部分です。)
Comment by eyesonly — 2007年11月16日(金曜日) @ 11時27分47秒
ご指摘ありがとうございます。
真似して、padding-bottom追加しました(^^;
Comment by Ryuji — 2007年11月16日(金曜日) @ 11時35分20秒
カスタムブロック編集画面にFCKeditor on XOOPSを組み込む
私が在籍するRYUSの龍司さんが、「FCKeditor on XOOPS をカスタムブロック編集画面に組み込む。」という記事を書いているのですが、legacyモジュールのファイルを直接編集するとモジュールアップデートの際に面倒なので、もう少し弄ってみました。
最初は、Altsysを使…
Trackback by ぐさぎ どっと こむ - ブログ — 2007年11月19日(月曜日) @ 12時29分29秒