_subject->getContent($name);
$present = JText::_('PLG_READMORE_ALREADY_EXISTS', true);
$js = "
function insertReadmore(editor)
{
var content = $getContent
if (content.match(/
/i))
{
alert('$present');
return false;
} else {
jInsertEditorText('
', editor);
}
}
";
$doc->addScriptDeclaration($js);
$button = new JObject;
$button->modal = false;
$button->class = 'btn';
$button->onclick = 'insertReadmore(\'' . $name . '\');return false;';
$button->text = JText::_('PLG_READMORE_BUTTON_READMORE');
$button->name = 'arrow-down';
// @TODO: The button writer needs to take into account the javascript directive
// $button->link', 'javascript:void(0)');
$button->link = '#';
return $button;
}
}