getTag(), 0, strpos( $language->getTag(), '-' ) );
if ($language->isRTL()) {
$direction = 'rtl';
} else {
$direction = 'ltr';
}
/*
* Lets get the default template for the site application
*/
$query = 'SELECT template'
. ' FROM #__templates_menu'
. ' WHERE client_id = 0'
. ' AND menuid = 0'
;
$db->setQuery( $query );
$template = $db->loadResult();
$file_path = JPATH_SITE .'/templates/'. $template .'/css/';
if ( !file_exists( $file_path .DS. 'editor.css' ) ) {
$template = 'system';
}
$css = JURI::root() .'/templates/'. $template . '/css/editor.css';
$html = '';
ob_start();
?>
_displayButtons($name, $buttons);
return $html;
}
function onGetInsertMethod($name)
{
$doc = & JFactory::getDocument();
$js= "function jInsertEditorText( text ) {
var editor = document.getElementById('xstandard');
editor.InsertXML(text);
}";
$doc->addScriptDeclaration($js);
return true;
}
function _getTemplateCss()
{
$db =& JFactory::getDBO();
/*
* Lets get the default template for the site application
*/
$query = 'SELECT template'
. ' FROM #__templates_menu'
. ' WHERE client_id = 0'
. ' AND menuid = 0'
;
$db->setQuery( $query );
$template = $db->loadResult();
$content_css = JURI::root() .'/templates/'. $template .'/css/';
$file_path = JPATH_SITE .'/templates/'. $template .'/css/';
if ( file_exists( $file_path .DS. 'editor.css' ) ) {
$content_css = $content_css . 'editor.css' .'", ';
} else {
$content_css = $content_css . 'template_css.css", ';
}
return $content_css;
}
function _displayButtons($name, $buttons)
{
// 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(!empty($buttons))
{
$results = $this->_subject->getButtons($name, $buttons);
/*
* This will allow plugins to attach buttons or change the behavior on the fly using AJAX
*/
$return .= "\n\n";
}
return $return;
}
}