Here Goes....
TESTED ON KAYAKO E-Support V3.04.10
BACKUP THE FILES BEFORE YOU EDIT THEM ! I WILL NOT BE HELD RESPONSIBLE FOR ANY PROBLEMS, If an error occurs you will then be able to re-upload your original files !!!
EDIT FILE : themes/admin_default/cpheader.tpl
Locate the following lines (41 - 58)
CHANGE the following code
Code:
<{if $htmlarea eq true}>
var _editor_lang = "en";
var _editor_url = "<{$swiftpath}>includes/htmlArea/";
var editor = null;
<{if $htmlareanotable neq true}>var loadTablePlugin = false;<{else}>var loadTablePlugin = true;<{/if}>
<{/if}>
</script>
<{if $htmlarea eq true}>
<script type="text/javascript" src="<{$swiftpath}>includes/htmlArea/htmlarea.js"></script>
<{/if}>
<{processCPMenu area=$area}>
<script language="Javascript">
//HTMLArea.loadPlugin("TableOperations");
function loadAllData() { preloadMenuImages(); <{if $htmlarea eq true}>
editor = new HTMLArea("contents");
// editor.registerPlugin(TableOperations);
editor.generate();
<{/if}> to this (this will allow the new html editor area defined for the reply box to be used
Code:
<{if $htmlarea eq true || $htmlarea2 eq true }>
var _editor_lang = "en";
var _editor_url = "<{$swiftpath}>includes/htmlArea/";
var editor = null;
<{if $htmlareanotable eq true}>var loadTablePlugin = false;<{else}>var loadTablePlugin = true;<{/if}>
<{/if}></script>
<{if $htmlarea eq true || $htmlarea2 eq true}>
<script type="text/javascript" src="<{$swiftpath}>includes/htmlArea/htmlarea.js"></script>
<{/if}>
<{processCPMenu area=$area}>
<script language="Javascript">
//HTMLArea.loadPlugin("TableOperations");
function loadAllData() { preloadMenuImages();
<{if $htmlarea eq true}>
editor = new HTMLArea("contents");
// editor.registerPlugin(TableOperations);
editor.generate();
<{/if}>
Next you need to add the following lines between :
so you end up with : (this allows your custome Javascript function to initialise the window only when required
otherwise the size will not be defined correctly.
Code:
</script> // script as shown above
<script language="Javascript">
function EDITORON(){
editor = new HTMLArea("replycontents");
// editor.registerPlugin(TableOperations);
editor.generate();
}
</script>
</head> // head as shown above *****************************************
EDIT FILE : modules/tickets/staff_viewticket.php
On or around Line 84
$template->assign("isviewticket", true);
Add this code Above that line
Code:
$template->assign("htmlarea2", true); On or around Line 478 add the following code as highlighted in RED
Code:
printDescRow($_SWIFT["language"]["contents"]);
$colarray = array();
$colarray[0]["align"] = "left";
$colarray[0]["valign"] = "top";
$colarray[0]["colspan"] = "2";
$colarray[0]["nowrap"] = true;
$colarray[0]["value"] = '<textarea style="WIDTH:100%;" name="replycontents" class="swifttextarea" id="replycontents" cols="100" rows="15" tabindex="99" onselect="javascript:storeCaret(this);" onclick="javascript:storeCaret(this);" onkeyup="javascript:storeCaret(this);">'. htmlspecialchars(iif(!empty($_ticket["draft"]), $_ticket["draft"], $_POST["replycontents"])) .'</textarea>'.SWIFT_CRLF;
$colarray[0]["class"] = getRowBG();
printDataRow($colarray);
Just below above code add the following highlighted in RED
This creates a link to initialise the HTML editor, so its not ALWAYS ON
Code:
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><a href="javascript:voide(0);" OnClick="EDITORON();">| Editor |</a></td><td width="180" nowrap><span class="smalltext">'. $_SWIFT["language"]["pdue"] .'<input type="text" name="opt_due" id="f_date_c" size="12" readonly="1" value="" class="swifttext"/>
If you would like it always on, find the line approx 146 and add the code in RED
IF YOU ADD THIS, SKIP THE STEP ABOVE AS THE LINK WILL NOT BE REQIREd
Code:
<li><a href="#" onClick="this.blur(); switchGridTab(\'ttpostreply\', \'tickets\'); document.replyform.replycontents.focus(); EDITORON();" id="ttpostreply" title="'. $_SWIFT["language"]["tabpostreply"] .'">'. $_SWIFT["language"]["tabpostreply"] .'</a></li>';
That will enable you to use the HTML Edittor on Ticket Replies either automaicalyy or using a new link set up next to the Due Date .
I will add the instructions for the other areas soon.
Please let me know if you integrate this, of course any problems let me know !