| Cute Editor for PHP |
You can easily add your own custom buttons to the CuteEditor toolbar using the following method:
|
Add your own custom buttons into the custom button holder
Example: <?php
$editor=new CuteEditor(); $editor->ID="Editor1"; $editor->Text="Type here..";
$editor->FilesPath="CuteEditor_Files"; $editor->TemplateItemList="G_start,Bold,Italic,Underline,Separator,JustifyLeft,JustifyCenter,JustifyRight,G_end";
$editor->CustomAddons = "<img title=\"Using oncommand\" class=\"CuteEditorButton\" onmouseover=\"CuteEditor_ButtonCommandOver(this)\" onmouseout=\"CuteEditor_ButtonCommandOut(this)\" onmousedown=\"CuteEditor_ButtonCommandDown(this)\" onmouseup=\"CuteEditor_ButtonCommandUp(this)\" ondragstart=\"CuteEditor_CancelEvent()\" Command=\"MyCmd\" src=\"CuteEditor_Files/Images/contact.gif\" />";
$editor->Draw(); $ClientID=$editor->ClientID(); $editor=null;
//use $_POST["Editor1"]to catch the data ?> <br /> <input type="submit" value="Submit" ID="Submit1" NAME="Submit1" /><br />
<script language="JavaScript" type="text/javascript" >
var editor1=document.getElementById("<?php echo $ClientID;?>"); function CuteEditor_OnCommand(editor,command,ui,value) { //handle the command by yourself if(command=="MyCmd") { // editor.ExecCommand("InsertTable"); editor1.PasteHTML("Hello World"); return true; } }
</script> |