Russian TYPO3 community

Russian TYPO3 community (http://forum.typo3.ru/index.php)
-   HTMLArea, RTE, tinymce_rte и другие визуальные редакторы (http://forum.typo3.ru/forumdisplay.php?f=24)
-   -   RTE в собственном модуле (http://forum.typo3.ru/showthread.php?t=3173)

nullxxx 20.04.2007 18:27

RTE в собственном модуле
 
Как засунуть активный(tinyrte)RTE в собственный модуль?

Всякие String input(<input type="text" name="'.$this->prefixId.'[input_field]" value="'.htmlspecialchars($this->piVars['input_field']).'">)
Kickstarter вставляет сам, а Text area with RET ему слабо. Как это сделать вручную?

void 20.04.2007 20:11

Модули - они в бекенде. Во фронтэнде - плагины. Соблюдайте терминологию, пожалуйста. Иначе очень сложно вас понять.

У любого TYPO3 RTE есть метод drawRTE, отрисовывающий RTE. В случае tinyrte это метод класса tx_tinyrte_base, находящегося в файле EXT:tinyrte/class.tx_tinyrte_base.php.

Однако не забудьте либо проверять доступность tinyrte (и использовать rtehtmlarea если он недоступен), либо выставить зависимость от него.

nullxxx 23.04.2007 12:37

Цитата:

Сообщение от void (Сообщение 11374)
Модули - они в бекенде. Во фронтэнде - плагины. Соблюдайте терминологию, пожалуйста. Иначе очень сложно вас понять.

Модули, плагины - не суть важно. Вопрос был: "как использовать tinyrte в своём(любом) коде?"
Цитата:

Сообщение от void (Сообщение 11374)
У любого TYPO3 RTE есть метод drawRTE, отрисовывающий RTE. В случае tinyrte это метод класса tx_tinyrte_base, находящегося в файле EXT:tinyrte/class.tx_tinyrte_base.php.

Пишу:
require_once('../../tinyrte/class.tx_tinyrte_base.php');
$myrte=new tx_tinyrte_base();
$content.=$myrte->drawRTE();

Получаю:
Warning: Missing argument 1 for drawrte() in /home/semiramida/data/www/semiramida.miraclehost.ru/typo3conf/ext/tinyrte/class.tx_tinyrte_base.php on line 32

Warning: Missing argument 2 for drawrte() in /home/semiramida/data/www/semiramida.miraclehost.ru/typo3conf/ext/tinyrte/class.tx_tinyrte_base.php on line 32


Может подскажите, что за параметры у
function drawRTE(&$pObj,$table,$field,$row,$PA,$specConf,$t hisConfig,$RTEtypeVal,$RTErelPath,$thePidValue)
?
Или укажите, где об этом можно почитать?

void 23.04.2007 17:51

PHP код:

    /**
     * Draws the RTE
     *
     * @param    object        Reference to parent object, which is an instance of the TCEforms.
     * @param    string        The table name
     * @param    string        The field name
     * @param    array        The current row from which field is being rendered
     * @param    array        Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
     * @param    array        "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
     * @param    array        Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
     * @param    string        Record "type" field value.
     * @param    string        Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
     * @param    integer        PID value of record (true parent page id)
     * @return    string        HTML code for RTE!
     */ 

Примеры использования можно посмотреть в admin_interface и cal.

nullxxx 24.04.2007 12:01

Цитата:

Сообщение от void (Сообщение 11450)
PHP код:

    /**
     * Draws the RTE
     *
     * @param    object        Reference to parent object, which is an instance of the TCEforms.
     * @param    string        The table name
     * @param    string        The field name
     * @param    array        The current row from which field is being rendered
     * @param    array        Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
     * @param    array        "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
     * @param    array        Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
     * @param    string        Record "type" field value.
     * @param    string        Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
     * @param    integer        PID value of record (true parent page id)
     * @return    string        HTML code for RTE!
     */ 

Примеры использования можно посмотреть в admin_interface и cal.

Прямо как один из преподавателей когда-то по программированию:
-А можно...?
-Можно
-А как?
-Читайте справку F1


Если не трудно, то разжуйте чуть подробнее про использование RTE с более конкретным примером.
TYPO3 я занимаюсь меньше месяца(см.Регистрация: 29.03.2007) и поэтому у меня неделя уйдёт, что бы понять: где этот пример использования в admin_interface, а уж понять, что такое cal и весь месяц. И ещё по неделе на разгадывание каждого параметра в Draws the RTE, где их взять и можно ли их заменить пустыми кавычками.

void 24.04.2007 18:14

Я знаю об этом методе не больше вашего, и могу судить только по примерам, найденным элементарным grep'ом в собственной тестовой инсталляции.

Вот пример кода из cal'a:
PHP код:

if(!$this->RTEObj)  $this->RTEObj t3lib_div::makeInstance('tx_rtehtmlarea_pi2');
                if(
$this->RTEObj->isAvailable() && $this->conf['rights.']['create.']['event.']['enableRTE']) {
                    
$this->RTEcounter++;
                    
$this->formName 'tx_cal_controller';
                    
$this->strEntryField 'description';
                    
$this->PA['itemFormElName'] = 'tx_cal_controller[description]';
                    
$this->PA['itemFormElValue'] = '';
                    
$this->thePidValue $GLOBALS['TSFE']->id;
                    
$RTEItem $this->RTEObj->drawRTE($this,'tx_cal_event',$this->strEntryField,$row=array(), $this->PA$this->specConf$this->thisConfig$this->RTEtypeVal''$this->thePidValue); 

Первый параметр - вызывающий метод объект, второй - имя таблицы, третий - поле этой таблицы, четвертый может быть пуст, пятый ясен из кода ^^, шестой может быть пуст, седьмой также может быть пуст, восьмой равен строке 'text', девятый - пустая строка, десятый равен $GLOBALS['TSFE']->id.


Часовой пояс GMT +4, время: 09:52.

Работает на vBulletin® версия 3.8.1.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot