function botCodepressEditorInit() {
return <<<EOD
<script type="text/javascript">
function insertAtCursor(myField, myValue) {
if (document.selection) {
// IE support
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
} else if (myField.selectionStart || myField.selectionStart == '0') {
// MOZILLA/NETSCAPE support
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}
}
</script>
EOD;
function botCodepressEditorInit() {
global $mosConfig_live_site, $mosConfig_absolute_path;
$load = '<script type="text/javascript" src="'. $mosConfig_live_site.'/mambots/editors/codepress/codepress.js"></script>';
echo $load;
}
function botNoEditorEditorArea( $name, $content, $hiddenField, $width, $height, $col, $row ) {
global $mosConfig_live_site, $_MAMBOTS;
$results = $_MAMBOTS->trigger( 'onCustomEditorButton' );
$buttons = array();
foreach ($results as $result) {
if ( $result[0] ) {
$buttons[] = '<img src="'.$mosConfig_live_site.'/mambots/editors-xtd/'.$result[0].'" onclick="insertAtCursor( document.adminForm.'.$hiddenField.', \''.$result[1].'\' )" alt="'.$result[1].'" />';
}
}
$buttons = implode( "", $buttons );
$width = $width . 'px';
$height = $height . 'px';
return <<<EOD
<textarea name="$hiddenField" id="$hiddenField" cols="$col" rows="$row" style="width: $width; height: $height;">$content</textarea>
<br />$buttons
EOD;
}
?>
function botCodepressEditorEditorArea( $name, $content, $hiddenField, $width, $height, $col, $row ) {
global $mosConfig_live_site, $_MAMBOTS;
return <<<EOD
<textarea id="$hiddenField" class="codepress html linenumbers-on" name="$hiddenField" cols="$col" rows="$row" style="width:{$width}px; height:{$height}px;" mce_editable="false">$content</textarea>
<br />
EOD;
Time to create page: 0.073 seconds