NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: olu on August 22, 2013, 06:06:27 AM

Title: Hiding Redactor Menus
Post by: olu on August 22, 2013, 06:06:27 AM
Please is there a way to hide some menus in the redactor text editor that I do not want available for users.
Title: Re: Hiding Redactor Menus
Post by: Bruce on August 22, 2013, 09:30:59 PM
Indeed there is.
Go to the WebHandler procedure
.RedactorInit method.
create a variable
options  StringTheory
then
before the parent call use
  Self.SetOption(options,'something','somevalue')
  Self.SetOption(options,'somethingelse','somevalue')

And the the parent call becomes;
  Parent.RedactorInit(p_FieldId,p_Flags,options.GetValue())
  Return

(be sure to put the Return in before the generated Parent call.)

A list of Redactor settings are here;
http://imperavi.com/redactor/docs/settings/
Here's an example of the option needed to manage the buttons;
http://imperavi.com/redactor/docs/toolbar/



Title: Re: Hiding Redactor Menus
Post by: olu on August 27, 2013, 11:18:15 PM
Hi Bruce,
       Been trying to figure this out following your instructions, but the only button I have been able to control so far is only the source button. I just can not find the call for the other buttons. Please any help would be appreciated. thanks.
Title: Re: Hiding Redactor Menus
Post by: Matthew on August 28, 2013, 12:32:42 AM
Try this:

In the
p_web.RedactorInit PROCEDURE(String p_FieldId,Long p_Flags=0,<string p_manual>)
declare variable:
loc:options  string(Net:MaxBinData)

And before
ReturnValue = PARENT.RedactorInit(p_FieldId,p_Flags,p_manual)
put:
 loc:options = clip(p_manual) & ', buttons: [''formatting'', ''bold'', ''italic'', ''deleted'', ''underline'',''|'', ' &|
                                 '''unorderedlist'', ''orderedlist'', ''outdent'', ''indent'', ''|'', ' &|
                                 '''table'', ''|'', ' &|
                                 '''fontcolor'', ''backcolor'', ''|'', ' &|
                                 '''alignment'', ''|'', ' &|
                                 '''horizontalrule'']'
  ReturnValue = PARENT.RedactorInit(p_FieldId,p_Flags,loc:options)
  RETURN ReturnValue

You can remove or add buttons as You like - names of buttons You can find at http://imperavi.com/redactor/docs/settings/

Regards,
Matthew
Title: Re: Hiding Redactor Menus
Post by: olu on August 28, 2013, 02:44:32 AM
Thanks matthew  and bruce , got it working now but just one slight problem I ran into after doing that now my text box width is no more fixed as I told it I only want 10columes but it now allows the width to expand out of the page. And when first open if no text already present the with shrinks.