2

基本的に、Joomla! ユーザーが特定のページをロードするときに、パラメーターに基づくエディター (JCE/TinyMCE) を有効または無効にすることができます。無効とは、コンテンツを編集できず、不透明な背景を設定する必要があることを意味します。

default.php で:

<?php
    $editor =& JFactory::getEditor();
    /*
    Parameter Type Default  Description
    $name string The control name
    $html string The contents of the text area
    $width string The width of the text area (px or %)
    $height string The height of the text area (px or %)
    $col int The number of columns for the textarea
    $row int The number of rows for the textarea
    $buttons boolean    true    True and the editor buttons will be displayed
    $params array array()   Associative array of editor parameters
    */
    echo $editor->display('emailText', $this->articleFullText, '960', '700', '20', '20', false);
?>

default.php (ビュー) でエディタの設定を行うことはできますか? (特定のパラメータは見つかりませんでした)

エディターを有効または無効にする次の関数を (stackoverflow のおかげで) 作成しました

function setEditorEditable(editable) {
    if (editable == 1) {
        tinymce.get(tinymce.activeEditor.id).getBody().setAttribute('contenteditable', 'true');
        J('#' + tinymce.activeEditor.id + '_parent').fadeTo(0, 1);
    } else {
        tinymce.get(tinymce.activeEditor.id).getBody().setAttribute('contenteditable', 'false');
        J('#' + tinymce.activeEditor.id + '_parent').fadeTo(0, 0.5);
    }
}

しかし、jQuery .ready 内で関数を呼び出すと、エディター DOM obj は null になります。

コードのどこで、どのようにエディタの設定を設定/変更できますか?

ありがとう!

4

1 に答える 1

1

これは、変更するエディター設定とその時点によって異なります。エディタの onInit でいくつかのパラメータを設定することができます。後で変更できないパラメータもあります。

于 2012-06-27T07:48:37.540 に答える