0

メニューの説明のために、Joomla1.5メニューにカスタムフィールドを作成しました。component.xmlを編集administrator\components\com_menus\models\metadataしましたが、通常のテキストボックスの代わりにテキストエディタを配置したいと思います。これにアプローチする方法はありますか?

4

1 に答える 1

0

エディタータイプの要素を作成する必要があります。

要素を作成する方法とデータを保存する方法を学ぶ

class JElementMyeditor extends JElement
{
    var $_name = 'Myeditor';

    /**
     * @param $name
     * @param $value
     * @param $node
     * @param $control_name
     */
    function fetchElement($name, $value, &$node, $control_name)
    {
        $editor = JFactory::getEditor();

        $width  = $node->attributes('width');
        $height = $node->attributes('height');
        $col    = $node->attributes('col');
        $row    = $node->attributes('row');

        //  ($name, $html, $width, $height, $col, $row, $buttons = true, $params = array())
        return $editor->display($control_name.'['.$name.']',
                                htmlspecialchars($value, ENT_QUOTES),
                                $width, $height, $col, $row,
                                array('pagebreak', 'readmore') ) ;
    }
}

そして、これをxmlで次のように使用できます

<param  name="custom_param" 
        width="300" 
        height="150"
        type="myeditor" 
        label="LABEL"  
        description="DESC" 
        />
于 2012-01-18T09:20:52.907 に答える