Page 1 of 1

Getting an error in my code to change FCKeditor config.

PostPosted: Mon May 23, 2011 8:04 am
by rlevin
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.

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

PostPosted: Tue May 24, 2011 11:20 am
by shannah
That isn't valid PHP syntax. Looks like you're writing a javascript-php hybrid language.