OSI-Certified logo

Source code of file editor.php
from the Content Management module for Phprojekt.

<?php
// WYSIWYG DHTML editor.
// Copyright 1999-2005 by Mario A. Valdez-Ramirez
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.

// This piece of code now integrated with:

// Content Management System module for PHProjekt (CMS4P).
// Copyright 2002-2005 by Mario A. Valdez-Ramirez
// http://www.mariovaldez.net/

// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, 
// Boston, MA 02111-1307, USA.

// You can contact Mario A. Valdez-Ramirez by email 
// at mario@mariovaldez.org or paper mail at 
// Olmos 809, San Nicolas, NL. 66495, Mexico.

//session_start();
$path_pre="../";
include_once (
$path_pre "cm/cm_anon.inc.php");
$include_path $path_pre "lib/lib.inc.php";
include_once 
$include_path;
include_once (
$path_pre "cm/cm_lib.inc.php");
fcm_load_secdb ($cm_security);

if (
$cm_enable_visedit) {

$cm_html_header "<html><head>\n<title>{$cm_text["contentmanagement"]}</title>\n
<link rel=stylesheet type=\"text/css\" href=\"
$css_style\">\n$lang_cfg\n</head>\n
<body bgcolor=\"
$bgcolor3\" leftmargin=\"5\" topmargin=\"5\" rightmargin=\"5\" bottommargin=\"5\" onload=\"HideForm();HidePalette();UpdateEdit();\">\n";
echo 
$cm_html_header;

$cm_http_base "http://$cm_server_name/" substr ($cm_php_self1strrpos ($cm_php_self"/"));
$cm_https_base "https://$cm_server_name/" substr ($cm_php_self1strrpos ($cm_php_self"/"));

?>
<script><!--
function ToggleFColor(cm_fcolor) {
  document.all("edittextarea").focus();
  document.execCommand("ForeColor", false, cm_fcolor);
  document.all("forecolor").style.backgroundColor = cm_fcolor;
  HidePalette();
  document.all("edittextarea").focus();
}
function HidePalette() {
  document.all("cmpalette").style.display = "none";
}
function ShowPalette() {
  document.all("cmpalette").style.display = "block";
}
function TogglePalette() {
  if (document.all("cmpalette").style.display == "none") {
    document.all("cmpalette").style.display = "block";
  }
  else {
    document.all("cmpalette").style.display = "none";
  }
}
function ChkStatus(cm_trigger) {
  if (document.queryCommandValue("FormatBlock")) {
  // There is no way to know this because the return string is localized...
    document.all("BlockType").selectedIndex = (0);
  }
  if (document.queryCommandValue("FontSize")) {
    document.all("fontsize").selectedIndex = (document.queryCommandValue("FontSize"));
  }
  else {
    document.all("fontsize").selectedIndex = (0);
  }
<?php
if ($cm_enable_platfonts) {
?>
  if (document.queryCommandValue("FontName")) {
    cm_theFName = document.queryCommandValue("FontName");
    if (cm_theFName.indexOf ("Verdana") >= 0) {
      document.all("fontname").selectedIndex = 9;
    }  
    else if (cm_theFName.indexOf ("Andale") >= 0) {
      document.all("fontname").selectedIndex = 1;
    }  
    else if (cm_theFName.indexOf ("Antiqua") >= 0) {
      document.all("fontname").selectedIndex = 3;
    }  
    else if (cm_theFName.indexOf ("Bookman") >= 0) {
      document.all("fontname").selectedIndex = 4;
    }  
    else if (cm_theFName.indexOf ("Trebuchet") >= 0) {
      document.all("fontname").selectedIndex = 8;
    }  
    else if (cm_theFName.indexOf ("Comic") >= 0) {
      document.all("fontname").selectedIndex = 5;
    }  
    else if (cm_theFName.indexOf ("Times") >= 0) {
      document.all("fontname").selectedIndex = 7;
    }
    else if (cm_theFName.indexOf ("Arial") >= 0) {
      document.all("fontname").selectedIndex = 2;
    }  
    else if (cm_theFName.indexOf ("Helvetica") >= 0) {
      document.all("fontname").selectedIndex = 2;
    }  
    else if (cm_theFName.indexOf ("Courier") >= 0) {
      document.all("fontname").selectedIndex = 6;
    }
    else {
      document.all("fontname").selectedIndex = 0;
    }  
  }
<?php
}
else {
?>
  if (document.queryCommandValue("FontName")) {
    cm_theFName = document.queryCommandValue("FontName");
    if (cm_theFName.indexOf ("Verdana") >= 0) {
      document.all("fontname").selectedIndex = 1;
    }  
    else if (cm_theFName.indexOf ("Andale") >= 0) {
      document.all("fontname").selectedIndex = 2;
    }  
    else if (cm_theFName.indexOf ("Antiqua") >= 0) {
      document.all("fontname").selectedIndex = 3;
    }  
    else if (cm_theFName.indexOf ("Bookman") >= 0) {
      document.all("fontname").selectedIndex = 3;
    }  
    else if (cm_theFName.indexOf ("Trebuchet") >= 0) {
      document.all("fontname").selectedIndex = 1;
    }  
    else if (cm_theFName.indexOf ("Comic") >= 0) {
      document.all("fontname").selectedIndex = 1;
    }  
    else if (cm_theFName.indexOf ("Times") >= 0) {
      document.all("fontname").selectedIndex = 3;
    }
    else if (cm_theFName.indexOf ("Arial") >= 0) {
      document.all("fontname").selectedIndex = 1;
    }  
    else if (cm_theFName.indexOf ("Helvetica") >= 0) {
      document.all("fontname").selectedIndex = 1;
    }  
    else if (cm_theFName.indexOf ("Courier") >= 0) {
      document.all("fontname").selectedIndex = 2;
    }  
    else {
      document.all("fontname").selectedIndex = 0;
    }  
  }
<?php
}
?>
  if (document.queryCommandValue("ForeColor")) {
    cmfcolor = document.queryCommandValue("ForeColor");
    cmfcolorstr = cmfcolor.toString(16);
    while (cmfcolorstr.length < 6) {
      cmfcolorstr = "0" + cmfcolorstr;      
    }
    cmfcolorrevstr = cmfcolorstr.substr (4, 2) + cmfcolorstr.substr (2, 2) + cmfcolorstr.substr (0, 2); 
    cmfcolorstr = "#" + cmfcolorrevstr; 
    document.all("forecolor").style.backgroundColor = cmfcolorstr;
  }
  else {
    document.all("forecolor").style.backgroundColor = "#000000";
  }
  if (document.queryCommandValue("Bold")) {
    document.all("N").style.borderStyle = "inset";
  }
  else {
    document.all("N").style.borderStyle = "groove";
  }
  if (document.queryCommandValue("Italic")) {
    document.all("I").style.borderStyle = "inset";
  }
  else {
    document.all("I").style.borderStyle = "groove";
  }
  if (document.queryCommandValue("Underline")) {
    document.all("S").style.borderStyle = "inset";
  }
  else {
    document.all("S").style.borderStyle = "groove";
  }
  if (document.queryCommandValue("JustifyCenter")) {
    document.all("Cen").style.borderStyle = "inset";
  }
  else {
    document.all("Cen").style.borderStyle = "groove";
  }
  if (document.queryCommandValue("JustifyLeft")) {
    document.all("Izq").style.borderStyle = "inset";
  }
  else {
    document.all("Izq").style.borderStyle = "groove";
  }
  if (document.queryCommandValue("JustifyRight")) {
    document.all("Der").style.borderStyle = "inset";
  }
  else {
    document.all("Der").style.borderStyle = "groove";
  }
  if (document.queryCommandValue("SuperScript")) {
    document.all("SuperS").style.borderStyle = "inset";
  }
  else {
    document.all("SuperS").style.borderStyle = "groove";
  }
  if (document.queryCommandValue("SubScript")) {
    document.all("SubS").style.borderStyle = "inset";
  }
  else {
    document.all("SubS").style.borderStyle = "groove";
  }
}
function HideForm() {
  document.all("cm_content").style.display = "none";
  window.focus();
}
function UpdateEdit() {
  document.all("edittextarea").innerHTML = document.all("cm_content").value;
}
function UpdateHTML() {
  document.all("cm_content").value = document.all("edittextarea").innerHTML;
}
function SendHTML() {
  cm_preprocess_content = document.all("cm_content").value;
  cm_replace4 = document.URL;
  cm_replace4 = cm_replace4.substring(0, cm_replace4.indexOf("/", cm_replace4.lastIndexOf("/"))) + "/";
  cm_re1 = new RegExp(cm_replace1, "gi");
  cm_re2 = new RegExp(cm_replace2, "gi");
  cm_re3 = new RegExp("&amp;cm_file=", "gi");
  cm_re4 = new RegExp(cm_replace4, "gi");
  cm_preprocess_content = cm_preprocess_content.replace(cm_re1, "");
  cm_preprocess_content = cm_preprocess_content.replace(cm_re2, "");
  cm_preprocess_content = cm_preprocess_content.replace(cm_re3, "&cm_file=");
  cm_preprocess_content = cm_preprocess_content.replace(cm_re4, "");
  document.all("cm_content").value = cm_preprocess_content;
  opener.document.all("cm_content").value = document.all("cm_content").value;  
}
function SetButtonVisualClue() {
  window.event.srcElement.style.borderStyle = "ridge";
}
function SetButtonVisualActivate() {
  window.event.srcElement.style.borderStyle = "inset";
}
function SetButtonVisualDeactivate() {  
  window.event.srcElement.style.borderStyle = "groove";
}
function ToggleButton(Operation) {
  if (document.all("edittextarea").contentEditable == "true") {
    document.all("edittextarea").focus();
    switch (Operation) {
     case "N": {
          document.execCommand("Bold");
          break;
          }
     case "I": {
          document.execCommand("Italic");
          break;
          }
     case "S": {
          document.execCommand("Underline");
          break;
          }
     case "SuperS": {
          document.execCommand("SuperScript");
          break;
          }
     case "SubS": {
          document.execCommand("SubScript");
          break;
          }
     case "OL": {
          document.execCommand("InsertOrderedList");
          break;
          }
     case "UL": {
          document.execCommand("InsertUnorderedList");
          break;
          }
     case "HR": {
          document.execCommand("InsertHorizontalRule");
          break;
          }
     case "A": {
          cm_newlink = prompt (cm_linkprompt, "http://");
          if (cm_newlink) {
            document.all("edittextarea").focus();
            cm_linkpoint = document.selection.createRange();
            cm_linkcaption = cm_linkpoint.text;
            if (!cm_linkcaption) {
              cm_linkcaption = cm_newlink; 
            }
            if ((cm_newlink.substr(0, 7) == "mailto:") || (cm_newlink.substr(0, 6) == "ftp://")) {
              cm_htmllink = "<a href=\"" + cm_newlink + "\">" + cm_linkcaption + "</a>"
            }
            else {
              cm_elink = confirm (cm_elinkprompt);
              if ((cm_newlink.substr(0, 7) == "http://") || (cm_newlink.substr(0, 8) == "https://"))
                cm_lflink = true;
              else
                cm_lflink = false;
              if (cm_lflink) {
                if (cm_elink)
                  cm_htmllink = "<a href=\"redir.php?cm_elink=" + cm_newlink + "\" target=\"_blank\">" + cm_linkcaption + "</a>";
                else
                  cm_htmllink = "<a href=\"redir.php?cm_elink=" + cm_newlink + "\">" + cm_linkcaption + "</a>";
              }
              else {
                if (cm_direxist == 1) {
                  if (cm_elink)
                    cm_htmllink = "<a href=\"getfile.php?cm_path=" + cm_path + "&cm_file=" + cm_newlink + "\" target=\"_blank\">" + cm_linkcaption + "</a>";
                  else
                    cm_htmllink = "<a href=\"getfile.php?cm_path=" + cm_path + "&cm_file=" + cm_newlink + "\">" + cm_linkcaption + "</a>";
                }
                else {
                  cm_htmllink = "";
                  alert (cm_nolfprompt);
                }
              }
            }
            if (cm_htmllink)
              cm_linkpoint.pasteHTML(cm_htmllink);
          }
          break;
          }
     case "TABLE": {
          cm_tblrows = Math.abs (prompt (cm_rowsprompt, 2));
          if (cm_tblrows) {
            cm_tblcols = Math.abs (prompt (cm_colsprompt, 2));
            if (cm_tblcols) {
              cm_htmltable = "<table border=\"1\" cellpadding=\"4\" cellspacing=\"0\">";
              for (var cmtr = 0; cmtr < cm_tblrows; cmtr++) {
                cm_htmltable = cm_htmltable + "<tr>";
                for (var cmtc = 0; cmtc < cm_tblcols; cmtc++)
                  cm_htmltable = cm_htmltable + "<td>x</td>";
                cm_htmltable = cm_htmltable + "</tr>";
              }
              cm_htmltable = cm_htmltable + "</table>";
              document.all("edittextarea").focus();
              cm_tablepoint = document.selection.createRange();
              cm_tablepoint.pasteHTML(cm_htmltable);
            }
          }
          break;
          }
     case "IMG": {
          if (cm_direxist == 1) {
            cm_newimgdata = window.showModalDialog ("editorup.php?cm_ua=IE&cm_path=" + cm_path);
            if (cm_newimgdata != null) {
              if ((cm_newimgdata[0] != "") && (cm_newimgdata[1] != 0) && (cm_newimgdata[1] != 0)) {
                cm_newimghtml = "<img src=\"getfile.php?cm_path=" + cm_path + "&cm_file=" + cm_newimgdata[0] + "\" width=\"" + cm_newimgdata[1] + "\" height=\"" + cm_newimgdata[2] + "\">"
                document.all("edittextarea").focus();
                cm_imgpoint = document.selection.createRange();
                cm_imgpoint.pasteHTML(cm_newimghtml);
              }
            }
          }
          else {
            alert (cm_nolfprompt);
          }
          break;
          }
     case "San": {
          document.execCommand("Indent");
          break;
          }
     case "DeSan": {
          document.execCommand("Outdent");
          break;
          }
     case "Izq": {
          document.execCommand("JustifyLeft");
          break;
          }
     case "Cen": {
           document.execCommand("JustifyCenter");
          break;
          }
     case "Der": {
          document.execCommand("JustifyRight");
          break;
          }
     case "Copy": {
          document.execCommand("Copy");
          break;
          }
     case "Cut": {
          document.execCommand("Cut");
          break;
          }
     case "Paste": {
          document.execCommand("Paste");
          break;
          }
     case "QuitarF": {
          document.execCommand("RemoveFormat");
          break;
          }
     case "QuitarTF": {
          document.all("edittextarea").innerHTML = document.all("edittextarea").innerText;
          break;
          }
     case "Nuevo": {
          document.all("cm_content").value = "";
          document.all("edittextarea").innerHTML = "";
          break;
          }
     case "ActHTML": {
          UpdateHTML ();
          SendHTML ();
          self.close();
          break;
          }
     case "CancelHTML": {
          self.close();
          break;
          }
     case "Tama": {
          theSize = document.all.fontsize.value;
          if (theSize != "")    
            document.execCommand("FontSize", false, theSize);
          break;
          }
     case "Tipo": {
          theName = document.all.fontname.value;
          if (theName != "")
             document.execCommand("FontName", false, theName);
          break;
          }
     case "FBlock": {
          theBlock = document.all.blocktype.value;
          if (theBlock != "")
             document.execCommand("FormatBlock", false, "<" + theBlock + ">");
          break;
          }
    }
   window.event.srcElement.style.borderStyle = "groove";
   document.all("edittextarea").focus();
 }
}
<?php
echo "var cm_replace1 = \"$cm_https_base\";\n";
echo 
"var cm_replace2 = \"$cm_http_base\";\n";
echo 
"var cm_path = \"$cm_path\";\n"
echo 
"var cm_linkprompt = \"{$cm_text["edit_enterurl"]}\";\n";
echo 
"var cm_elinkprompt = \"{$cm_text["edit_eurl"]}\";\n";
echo 
"var cm_imgprompt = \"{$cm_text["edit_enterimg"]}\";\n";
echo 
"var cm_rowsprompt = \"{$cm_text["edit_rows"]}\";\n";
echo 
"var cm_colsprompt = \"{$cm_text["edit_cols"]}\";\n";
echo 
"var cm_nolfprompt = \"{$cm_text["edit_nolocalfiles"]}\";\n";
echo 
"var cm_nocompat = \"{$cm_text["edit_notcompat"]}\";\n";
echo 
"var cm_direxist = \"$cm_direxist\";\n";
?>
-->
</script>



<?php
echo "
<div unselectable=\"on\" class=\"tbedicion01\" contentEditable=\"false\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_delformatsel"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_delformatsel"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('QuitarF');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_delallformat"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_delallformat"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('QuitarTF');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_deleteall"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_deleteall"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('Nuevo');\" onmouseout=\"SetButtonVisualDeactivate();\">
&nbsp;&nbsp;"
;
echo 
"
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_copy"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_copy"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('Copy');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_cut"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_cut"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('Cut');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_paste"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_paste"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('Paste');\" onmouseout=\"SetButtonVisualDeactivate();\">
&nbsp;&nbsp;"
;
echo 
"
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_bold"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_bold"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('N');\" onmouseout=\"SetButtonVisualDeactivate();\" id=\"N\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_italics"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_italics"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('I');\" onmouseout=\"SetButtonVisualDeactivate();\" id=\"I\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_underline"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_underline"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('S');\" onmouseout=\"SetButtonVisualDeactivate();\" id=\"S\">
&nbsp;&nbsp;"
;
echo 
"
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_superscript"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_superscript"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('SuperS');\" onmouseout=\"SetButtonVisualDeactivate();\" id=\"SuperS\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_underscript"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_underscript"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('SubS');\" onmouseout=\"SetButtonVisualDeactivate();\" id=\"SubS\">
&nbsp;&nbsp;"
;
echo 
"
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_leftjustify"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_leftjustify"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('Izq');\" onmouseout=\"SetButtonVisualDeactivate();\" id=\"Izq\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_center"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_center"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('Cen');\" onmouseout=\"SetButtonVisualDeactivate();\" id=\"Cen\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_rightjustify"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_rightjustify"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('Der');\" onmouseout=\"SetButtonVisualDeactivate();\" id=\"Der\">
&nbsp;&nbsp;"
;
echo 
"
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_deindent"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_deindent"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('DeSan');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_indent"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_indent"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('San');\" onmouseout=\"SetButtonVisualDeactivate();\">
&nbsp;&nbsp;"
;
echo 
"
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_listorder"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_listorder"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('OL');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_listunorder"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_listunorder"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('UL');\" onmouseout=\"SetButtonVisualDeactivate();\">
<br>
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_link"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_link"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('A');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_image"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_image"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('IMG');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_bar"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_bar"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('HR');\" onmouseout=\"SetButtonVisualDeactivate();\">
<img src=\"
$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_table"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_table"]}\" unselectable=\"on\" class=\"btngr\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('TABLE');\" onmouseout=\"SetButtonVisualDeactivate();\">
&nbsp;&nbsp;"
;
echo 
"
  <select unselectable=\"on\" name=\"blocktype\" id=\"blocktype\" onchange=\"ToggleButton('FBlock');\" class=\"btngr\">
    <option SELECTED value=\"\">
{$cm_text["edit_selblock"]}</option>
    <option value=\"p\">
{$cm_text["edit_blockp"]}</option>
    <option value=\"h1\">
{$cm_text["edit_blockh1"]}</option>
    <option value=\"h2\">
{$cm_text["edit_blockh2"]}</option>
    <option value=\"h3\">
{$cm_text["edit_blockh3"]}</option>
    <option value=\"h4\">
{$cm_text["edit_blockh4"]}</option>
    <option value=\"h5\">
{$cm_text["edit_blockh5"]}</option>
    <option value=\"h6\">
{$cm_text["edit_blockh6"]}</option>
    <option value=\"pre\">
{$cm_text["edit_blockpre"]}</option>
  </select>\n"
;
if (
$cm_enable_platfonts) {
 echo 
"
  <select unselectable=\"on\" name=\"fontname\" id=\"fontname\" onchange=\"ToggleButton('Tipo');\" class=\"btngr\">
    <option SELECTED value=\"\">
{$cm_text["edit_selfont"]}</option>
    <option value=\"Andale Mono, Courier New, Courier, monospace\">Andale Mono</option>
    <option value=\"Arial, Helvetica, sans-serif\">Arial</option>
    <option value=\"Book Antiqua, Times New Roman, Times, serif\">Book Antiqua</option>
    <option value=\"Bookman Old Style, Times New Roman, Times, serif\">Bookman Old Style</option>
    <option value=\"Comic Sans MS, Arial, Helvetica, sans-serif\">Comic Sans MS</option>
    <option value=\"Courier New, Courier, monospace\">Courier</option>
    <option value=\"Times New Roman, Times, serif\">Times</option>
    <option value=\"Trebuchet MS, Arial, Helvetica, sans-serif\">Trebuchet MS</option>
    <option value=\"Verdana, Arial, Helvetica, sans-serif\">Verdana</option>
  </select>\n"
;
}
else {
 echo 
"
  <select unselectable=\"on\" name=\"fontname\" id=\"fontname\" onchange=\"ToggleButton('Tipo');\" class=\"btngr\">
    <option SELECTED value=\"\">
{$cm_text["edit_selfont"]}</option>
    <option value=\"Arial, Helvetica, sans-serif\">Arial</option>
    <option value=\"Courier New, Courier, monospace\">Courier</option>
    <option value=\"Times New Roman, Times, serif\">Times</option>
  </select>\n"
;
}
echo 
"
  <select unselectable=\"on\" name=\"fontsize\" id=\"fontsize\" onchange=\"ToggleButton('Tama');\" class=\"btngr\">
    <option SELECTED value=\"\">
{$cm_text["edit_selfontsize"]}</option>
    <option value=\"1\">1</option>
    <option value=\"2\">2</option>
    <option value=\"3\">3</option>
    <option value=\"4\">4</option>
    <option value=\"5\">5</option>
    <option value=\"6\">6</option>
    <option value=\"7\">7</option>
  </select>\n"
;

echo 
"<span unselectable=\"on\" id=\"forecolor\" class=\"btntxt\" title=\"{$cm_text["edit_colorpick"]}\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"TogglePalette();\" onmouseout=\"SetButtonVisualDeactivate();\">";
echo 
"<img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["edit_colorpicker"]}\" width=\"16\" height=\"16\" title=\"{$cm_text["edit_colorpicker"]}\" unselectable=\"on\" class=\"btngr2\">";
echo 
"</span>";

echo 
"<table unselectable=\"on\" id=\"cmpalette\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n";
for (
$cpcr 0$cpcr 256$cpcr $cpcr 51) {
  echo 
"<tr>";
  for (
$cpcg 0$cpcg 256$cpcg $cpcg 51) {
    for (
$cpcb 0$cpcb 256$cpcb $cpcb 51) {
      echo 
"<td unselectable=\"on\" width=\"8\" height=\"8\" bgcolor=\"#" sprintf("%02X%02X%02X",$cpcr,$cpcg,$cpcb) . "\" title=\"" sprintf("%02X%02X%02X",$cpcr,$cpcg,$cpcb) . "\" onclick=\"ToggleFColor('" sprintf("%02X%02X%02X",$cpcr,$cpcg,$cpcb) . "');\"></td>";
    }
  echo 
"\n";
  }
  echo 
"</tr>\n";
}
echo 
"</table>";  
echo 
"</div>";

echo 
"<div id=\"edittextarea\" contentEditable=\"true\" onclick=\"ChkStatus('oc');\" ondblclick=\"ChkStatus('odc');\" onkeydown=\"ChkStatus('okd');\"></div>";

echo 
"
<div><br>
<span title=\"
{$cm_text["edit_update_alt"]}\" unselectable=\"on\" class=\"btntxt\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('ActHTML');\" onmouseout=\"SetButtonVisualDeactivate();\">{$cm_text["edit_update"]}</span>
<span title=\"
{$cm_text["edit_cancel_alt"]}\" unselectable=\"on\" class=\"btntxt\" onmouseover=\"SetButtonVisualClue();\" onmousedown=\"SetButtonVisualActivate();\" onmouseup=\"ToggleButton('CancelHTML');\" onmouseout=\"SetButtonVisualDeactivate();\">{$cm_text["edit_cancel"]}</span>
<br>
</div>"
;


//if (get_magic_quotes_gpc ()) {
  
$cm_content stripslashes ($cm_content);
//}

echo "<div unselectable=\"on\"><textarea cols=\"10\" rows=\"10\" id=\"cm_content\" name=\"cm_content\" contenteditable=\"false\">$cm_content</textarea></div>\n";

// if cm_enable_visedit...
else {
echo 
$cm_html_header;
}
echo 
$cm_html_footer;
?>
 
 
NA fum/lmd: 2004.09.16
Copyright ©1994-2018 by Mario A. Valdez-Ramírez.
no siga este enlace / do not follow this link