[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/editor/ -> editor.htmlarea3.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @author Mambo Foundation Inc see README.php
   5  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   6  * See COPYRIGHT.php for copyright notices and details.
   7  * @license GNU/GPL Version 2, see LICENSE.php
   8  *
   9  * Redistributions of files must retain the above copyright notice.
  10  *
  11  * Mambo is free software; you can redistribute it and/or
  12  * modify it under the terms of the GNU General Public License
  13  * as published by the Free Software Foundation; version 2 of the License.
  14  */
  15  
  16  /** ensure this file is being included by a parent file */
  17  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  18  
  19  function initEditor() {
  20      global $mosConfig_live_site;
  21  ?>
  22  <script type="text/javascript"> 
  23  <!--
  24  _editor_url ="<?php echo $mosConfig_live_site;?>/editor/htmlarea3/";
  25  //-->
  26  </script>
  27  <script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/editor/htmlarea3/htmlarea.js"></script>
  28  <script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/editor/htmlarea3/dialog.js"></script>
  29  <script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/editor/htmlarea3/lang/en.js"></script>
  30  <style type="text/css">@import url(<?php echo $mosConfig_live_site;?>/editor/htmlarea3/htmlarea.css)</style>
  31  <script type="text/javascript"> 
  32  <!--
  33  // load the plugin files
  34  HTMLArea.loadPlugin("TableOperations");
  35  HTMLArea.loadPlugin("EnterParagraphs");
  36  var editor = null;
  37  
  38  /** Wrapper around the editor specific update function in JavaScript
  39  */
  40  function updateEditorContents( editorName, newValue ) {
  41      //TODO: correct call
  42  }
  43  //-->
  44  </script>
  45  <?php
  46  }
  47  
  48  function editorArea( $name, $content, $hiddenField, $width, $height, $col, $row ) {
  49  ?>
  50  <textarea name="<?php echo $hiddenField; ?>" id="<?php echo $hiddenField; ?>" cols="<?php echo $col; ?>" rows="<?php echo $row; ?>" style="width:<?php echo $width; ?>; height:<?php echo $height; ?>"><?php echo $content; ?></textarea>
  51  <script language="JavaScript1.2" defer="defer">
  52  <!--
  53  // create the editor
  54  var editor = new HTMLArea("<?php echo $hiddenField ?>");
  55  
  56  // retrieve the config object
  57  var config = editor.config;
  58  
  59  config.sizeIncludesToolbar = false;
  60  config.height= "200px";
  61  
  62  config.registerButton({
  63      id        : "mosimage",
  64      tooltip   : "Insert {mosimage} tag",
  65      image     : _editor_url + "images/ed_mos_image.gif",
  66      textMode  : false,
  67      action    : function(editor, id) {
  68          editor.focusEditor();
  69          editor.insertHTML('{mosimage}');
  70      }
  71  });
  72  
  73  config.registerButton({
  74      id        : "mospagebreak",
  75      tooltip   : "Insert {mospagebreak} tag",
  76      image     : _editor_url + "images/ed_mos_pagebreak.gif",
  77      textMode  : false,
  78      action    : function(editor, id) {
  79          editor.focusEditor();
  80          editor.insertHTML('{mospagebreak}');
  81      }
  82  });
  83  
  84  config.toolbar = [
  85  [ "fontname", "space",
  86  "fontsize", "space",
  87  "formatblock", "space",
  88  "bold", "italic", "underline", "separator",
  89  "strikethrough", "subscript", "superscript", "separator",
  90  "mosimage", "mospagebreak" ],
  91  
  92  [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
  93  "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
  94  "forecolor", "hilitecolor", "textindicator", "separator",
  95  "inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode"]
  96  ];
  97  
  98  // register the TableOperations plugin with our editor
  99  editor.registerPlugin(TableOperations);
 100  editor.registerPlugin(EnterParagraphs);
 101  editor.generate('<?php echo $hiddenField ?>');
 102  //-->
 103  </script>
 104  <?php
 105  }
 106  
 107  function getEditorContents( $editorArea, $hiddenField ) {
 108  }