2012-06-27 3 views
2

기본적으로 Joomla! 매개 변수에 기반한 편집기 (JCE/TinyMCE)는 사용자가 특정 페이지를로드 할 때 활성화 또는 비활성화 할 수 있습니다. 비활성화 됨 : 내용을 편집 할 수 없으며 불투명 배경을 설정해야합니다. default.php에서줌라! 1.5.26 JEditor 또는 Javascript의 TinyMCE 초기화

:

<?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 (보기)에서 편집기 설정을 할 수 있습니까? (나는 특정 매개 변수를 찾을 수 없습니다)

는 내가 jQuery를이를 .ready에서 나는 함수를 호출하는 경우, 활성화 또는 비활성화 편집기

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); 
    } 
} 

을하지만, 다음과 같은 기능 (유래하는 감사를) 생성 편집기 DOM obj가 null입니다.

코드에서 어떻게 편집기 설정을 설정/변경할 수 있습니까?

감사합니다.

답변

1

변경하려는 편집기 설정과 시간에 따라 다릅니다. 편집기의 일부 매개 변수를 설정할 수 있습니다. 나중에 다른 매개 변수를 변경할 수 없습니다.

+0

기본적으로 doc [link] (http://docs.joomla.org/JEditor/1.5) (매우 열악 함)를 읽으면 view.html에 설정된 사용자 정의 PHP 매개 변수를 기반으로 JCE CSS를 설정할 수 없습니다 내 구성 요소의. 나는 jQuery 레벨에서 그것을하기로 결정했다. 물론 jQuery .ready()에서 DOM의 jEditor obj가 아직 정의되지 않았다. 불가능한 임무? – Daviddd

+0

그래서 기본적으로 사용자 정의 스타일 시트를 편집기에 추가하고 싶습니까? – Thariama

+0

해결 방법이 될 수 있습니다. default.php (MVC 패턴의 Joomla! HTML 템플릿)에서 테마를 사용하지 않도록 설정할 수 있었지만 (editable 매개 변수를 false로 설정하는 방법과 편집기에서 다른 CSS를로드하는 방법을 모르겠습니다. PHP 레벨 (echo $ editor-> display ('emailText', $ this-> articleFullText, '960', '700', '20', '20', false);) ...). 간단히 말해, 모델에서 가져온 PHP 변수에 따라 비활성화 된 편집기를로드해야합니다. 그렇지 않으면 기본 편집기를로드합니다 ... – Daviddd