Page 1 of 1

no editor xtd on frontend

Posted: Wed Apr 09, 2008 1:54 pm
by sandy malteser
Hi,

I want the editor-xtd plugins not to work on the front end how do i do that? :)

Re: no editor xtd on frontend

Posted: Fri Apr 11, 2008 3:48 pm
by sandy malteser
any idea? anyone?

solved it

Posted: Tue Apr 15, 2008 12:41 am
by sandy malteser
done it but its not a nice, i hate core hacks.

i hacked every editor-xtd pph file. underneath is the image.php but its the same for every other xtd

Code: Select all

function onDisplay($name)
	{
		global $mainframe;
		$user = &JFactory::getUser();

		$doc 		=& JFactory::getDocument();
		$template 	= $mainframe->getTemplate();

		$link = 'index.php?option=com_media&view=images&tmpl=component&e_name='.$name;

		JHTML::_('behavior.modal');
		if ( $user->get('gid') > 23 ) {
		$button = new JObject();
		$button->set('modal', true);
		$button->set('link', $link);
		$button->set('text', JText::_('Image'));
		$button->set('name', 'image');
		$button->set('options', "{handler: 'iframe', size: {x: 570, y: 400}}");
		} else {
		$button = new JObject();
		$button->set('modal', false);
		$button->set('link', '');
		$button->set('text', '');
		$button->set('name', '');
		$button->set('options', "{handler: 'iframe', size: {x: 570, y: 400}}");
		}
		return $button;
	}
the reason for giving it an else statement is that the editor still expects a button and without it, the page crashes

Re: no editor xtd on frontend

Posted: Tue Nov 15, 2011 12:40 pm
by altibel
Thanks for posting this! I needed to remove only the Image button from the frontend editor and this solved it.