Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
general.inc
1 <?php
18 global $ROOT_PATH;
19 include_once($ROOT_PATH.'wysiwyg_plugin.inc');
20 
33 class general extends wysiwyg_plugin
34 {
35 
36 
44  function general()
45  {
46  wysiwyg_plugin::wysiwyg_plugin($wysiwyg);
47  $this->_add_button('selectall','SelectAll','Select All','false','6');
48  $this->_add_button('inserthorizontalrule','InsertHorizontalRule','Horizontal Rule','false','31');
49 
50  }//end constructor
51 
52 
61  function paint_generic()
62  {
63  ?>
64  <script type="text/javascript" language="Javascript">
65  HTMLArea.prototype._insertHorizontalRule = function() {
66  this.surroundHTML('', '<hr>');
67  }
68  </script>
69  <?php
70 
71  }//end paint_generic()
72 
73 
84  {
85  ?>
86  case "inserthorizontalrule":
87  if (HTMLArea.is_gecko) {
88  this._insertHorizontalRule();
89  } else if (HTMLArea.is_ie) {
90  this._doc.execCommand('InsertHorizontalRule');
91  }
92  break;
93  <?php
94 
95  }//end print_plugin_exec_command()
96 
97 
105  {
106  ?>
107  case 'a':
108  if (!HTMLArea.is_ie) {
109  // KEY select all
110  sel = this._getSelection();
111  sel.removeAllRanges();
112  range = this._createRange();
113  range.selectNodeContents(this._doc.body);
114  sel.addRange(range);
115  HTMLArea._stopEvent(ev);
116  }
117  break;
118  <?php
119 
120  }//end print_plugin_shortcuts()
121 
122 
123 }//end class
124 
125 ?>