Getting an error in my code to change FCKeditor config.

A place to discuss development of the Xataface core.

Getting an error in my code to change FCKeditor config.

Postby rlevin » Mon May 23, 2011 8:04 am

I want to change the tool bar on FCKeditor depending on the role of the user.

Code: Select all
function beforeHandleRequest(){
   if ($query['-action'] = 'new') {
      $oFCKeditor = new FCKeditor('Body');
      $oFCKeditor->BasePath = '/FCKeditor/';
      $oFCKeditor->Config['ToolbarSets["Default"]'] = [
      ['DocProps','-','Save','NewPage','Preview','-','Templates'],
      ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
      ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
      ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
      '/',
      ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
      ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
      ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
      ['Link','Unlink','Anchor'],
      ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
      '/',
      ['Style','FontFormat','FontName','FontSize'],
      ['TextColor','BGColor'],
      ['FitWindow','ShowBlocks','-','About']      // No comma for the last row.
      ] ;
      $oFCKeditor->Create();   
   }
}


I get an error at "Body". Body in this case is the name of the textarea.
rlevin
 
Posts: 32
Joined: Thu Mar 10, 2011 11:40 am

Re: Getting an error in my code to change FCKeditor config.

Postby shannah » Tue May 24, 2011 11:20 am

That isn't valid PHP syntax. Looks like you're writing a javascript-php hybrid language.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Developers

Who is online

Users browsing this forum: No registered users and 8 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved