PDA

Zobacz pełną wersję : Jak wywołać edytor korzystając z funkcji zawartej w pliku jce.php



Ambroz
24-09-2020, 09:36
Żeby nie tworzyć nowego tematu związanego z tym samym to chciałbym dopytać, w jaki sposób mogę wywołać edytor korzystając z funkcji zawartej w pliku jce.php, mianowicie (podaje skróconą wersje pliku):


class plgEditorJCE extends JPligin{

public function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null)
{
if (empty($id)) {
$id = $name;
}

// Only add "px" to width and height if they are not given as a percentage
if (is_numeric($width)) {
$width .= 'px';
}
if (is_numeric($height)) {
$height .= 'px';
}

if (empty($id)) {
$id = $name;
}
$editor = '<div class="editor wf-editor-container mb-2">';
$editor .= ' <div class="wf-editor-header"></div>';
$editor .= ' <textarea spellcheck="false" id="' . $id . '" name="' . $name . '" cols="' . $col . '" rows="' . $row . '" style="width:' . $width . ';height:' . $height . ';" class="wf-editor mce_editable" wrap="off">' . $content . '</textarea>';
$editor .= '</div>';
$editor .= $this->displayButtons($id, $buttons, $asset, $author);

return $editor;
}
}

Obecnie mam w ten sposób i pyszczy mi się o plgEditorJCE:


echo (new plgEditorJCE)->onDisplay('html', $this->content, '550', '400', '60', '20', false);



Dzięki za pomoc.