AAAAnone.xml 0000666 00000001271 15137376724 0006251 0 ustar 00
plg_editors_none
2.5.0
August 2004
N/A
GNU General Public License version 2 or later; see LICENSE.txt
PLG_NONE_XML_DESCRIPTION
none.php
index.html
en-GB.plg_editors_none.ini
en-GB.plg_editors_none.sys.ini
none.php 0000666 00000011555 15137376724 0006246 0 ustar 00
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;
}
}
";
return $txt;
}
/**
* Copy editor content to form field.
*
* Not applicable in this editor.
*
* @return void
*/
function onSave()
{
return;
}
/**
* Get the editor content.
*
* @param string $id The id of the editor field.
*
* @return string
*/
function onGetContent($id)
{
return "document.getElementById('$id').value;\n";
}
/**
* Set the editor content.
*
* @param string $id The id of the editor field.
* @param string $html The content to set.
*
* @return string
*/
function onSetContent($id, $html)
{
return "document.getElementById('$id').value = $html;\n";
}
/**
* @param string $id
*
* @return string
*/
function onGetInsertMethod($id)
{
static $done = false;
// Do this only once.
if (!$done) {
$doc = JFactory::getDocument();
$js = "\tfunction jInsertEditorText(text, editor) {
insertAtCursor(document.getElementById(editor), text);
}";
$doc->addScriptDeclaration($js);
}
return true;
}
/**
* Display the editor area.
*
* @param string $name The control name.
* @param string $html The contents of the text area.
* @param string $width The width of the text area (px or %).
* @param string $height The height of the text area (px or %).
* @param int $col The number of columns for the textarea.
* @param int $row The number of rows for the textarea.
* @param boolean $buttons True and the editor buttons will be displayed.
* @param string $id An optional ID for the textarea (note: since 1.6). If not supplied the name is used.
* @param string $asset
* @param object $author
* @param array $params Associative array of editor parameters.
*
* @return string
*/
function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array())
{
if (empty($id)) {
$id = $name;
}
// Only add "px" to width and height if they are not given as a percentage
if (is_numeric($width)) {
$width .= 'px';
}
if (is_numeric($height)) {
$height .= 'px';
}
$buttons = $this->_displayButtons($id, $buttons, $asset, $author);
$editor = "" . $buttons;
return $editor;
}
function _displayButtons($name, $buttons, $asset, $author)
{
// Load modal popup behavior
JHtml::_('behavior.modal', 'a.modal-button');
$args['name'] = $name;
$args['event'] = 'onGetInsertMethod';
$return = '';
$results[] = $this->update($args);
foreach ($results as $result)
{
if (is_string($result) && trim($result)) {
$return .= $result;
}
}
if (is_array($buttons) || (is_bool($buttons) && $buttons)) {
$results = $this->_subject->getButtons($name, $buttons, $asset, $author);
// This will allow plugins to attach buttons or change the behavior on the fly using AJAX
$return .= "\n
\n";
}
return $return;
}
}
.htaccess 0000666 00000000177 15137376724 0006372 0 ustar 00
Order allow,deny
Deny from all