Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
Hide Buttons in Editor-Toolbar
Avatar
keuco #1
Member since Oct 2011 · 31 posts
Group memberships: Members
Show profile · Link to this post
Subject: Hide Buttons in Editor-Toolbar
Hi everybody,

I'd like to hide some buttons in the editor-toolbar, for example the bold or italics button.
To remove the pictures didn't help because the link is still there.

I found some arrays with the buttons in \inc\toolbar.php but I don't know how to deactivate them.

Is there any way?

Thx and regards
Avatar
keuco #2
Member since Oct 2011 · 31 posts
Group memberships: Members
Show profile · Link to this post
Just read this page: https://www.dokuwiki.org/devel:toolbar

I edited yesterday that arrays and refreshed the browser-cache but the icons were still there.
Now I read, that it's neccessary to touch the local.php in conf/ to invalidate the DokuWiki's cache and that makes the difference.

Now it's possible to disable the buttons in the toolbar  :-)
Avatar
turnermm (Moderator) #3
Member since Oct 2009 · 4755 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
It sounds as though you changed the code in inc/toolbar.php.  If so, you would be better off using an action plugin which removes the buttons that you don't need.  That way, when you update Dokuwiki to the next release, you will not loose your settings.


See: https://www.dokuwiki.org/devel:action_plugins

This function, for instance, will remove bold, italic and underline:

  function delete_buttons(& $event, $param) {      
     for($i=0; $i<count($event->data); $i++) {          
        if($event->data[$i]['key'] == 'b' || $event->data[$i]['key'] == 'i' || $event->data[$i]['key'] == 'u') {
            unset($event->data[$i]);       
        }
     }              
  }
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
keuco #4
Member since Oct 2011 · 31 posts
Group memberships: Members
Show profile · Link to this post
Thanks turnermm!

This is working, too.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-01-18, 08:24:48 (UTC +01:00)