SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 202 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"


This snippet shows the files tag in the XML manifest file:

smiley.php
smiley1.gif
smiley2.gif

Before we move on, there are some handy methods available to us of which you
should be aware. We can interrogate the editor to get some useful JavaScript
snippets. This table details the methods to do this:
Method Description
getContent JavaScript to get the content of the editor.
save JavaScript to save the content of the editor. Not all editors use this.
setContent JavaScript to set the content of the editor.
All of these methods return a JavaScript string. We can use the strings to build scripts
that interact with the editor. We use these because most of the editors are JavaScript
based, and therefore require bespoke script to perform these functions client-side.
This is an example of how we would use the getContent() method to build a script
that presents a JavaScript alert that contains the contents of the editor identified
by $name:
// get the editor
$editor =& JFactory::getEditor();
// prepare the JavaScript which will get the value of editor
$getContent = $editor->getContent($name);
// build the JavaScript alert that contains the contents of the editor
$js = 'var content = '.


Pages:
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214