EditToolbar
Description
Replaces the default edit-toolbar icons, and adds a few additional icons.
Download and Install
- Download (ZIP or TAR). There are two folders in the zip file:
- cookbook: unzip the folder
edittoolbar/
, and the file in the folder, into your cookbook directory (usuallypmwiki/cookbook/
). - pub: Unzip the folder
edittoolbar/
, and the files in the folder, into your pub directory (usuallypmwiki/pub/
).
- cookbook: unzip the folder
- Add the following to your local configuration file, usually
pmwiki/local/config.php
:
$EnableGUIButtons = 1; include_once("$FarmD/cookbook/edittoolbar/edittoolbar.php");
- Comment out
in$GUIButtons
config.php
if they were enabled - Edit the edittoolbar.php file, removing the number 25 from around center and right. (Instead of reading
'%25center%25'
and'%25right%25'
they should read'%center%'
and'%right%'
.)
Or
- download the
edittoolbar-2024-08-24.phpΔ
file for a later version - copy to the
/cookbook/
folder as above (no editing needed) - download edittoolbaricons.zipΔ
- extract the icons and copy to the
/pub/edittoolbar/
folder
So, after installing you should have a folder named edittoolbar
, with a newly edited edittoolbar.php
, in your cookbook
directory, and a folder named edittoolbar/
, with a bunch of image files, in your pub
directory.
H1 Headers
The H1 header is reserved by convention for the page title, so it is excluded from the toolbar by default. If you want to include the H1 element on the toolbar, then add this to config.php
$et_Include_H1 = true;
FAQ
How do I control which buttons to show?
How do I remove icons that I don't want displayed?
Each icon is identified by a name, listed below. Simply add an 'unset' statement in config.php
for each icon you want to remove. Make sure you place the unset statements after the includes in config.php
.
$EnableGUIButtons = 1; include_once("$FarmD/cookbook/edittoolbar/edittoolbar.php"); # These lines remove the icons for author's, including the separator. unset($GUIButtons['separator5']); unset($GUIButtons['author']); unset($GUIButtons['authordate']);
Refer to the icon list for a list of icon names.
How do I add new icons?
Rather than change the edittoolbar.php
file, add the statements to your config.php
.
Each icon is assigned to a number, which determines the icons position in the toolbar. EditToolbar uses from 0 through 290 in jumps of 10, so your numbering should start at 300 and above to position icons at the end of the toolbar, or use numbers not divisible by 10 (155, 157, etc) to position icons between the existing icons. Refer to the icon list for a list of icon names and array position numbers.
$GUIButtons['new_button'] = array(300, 'PRE-TEXT', 'POST-TEXT', '$[LABEL]','$GUIButtonDirUrlFmt/ICON"$[BALOON TEXT]"');
Each button is specified by an array of five values:
- the position of the button relative to others (a number)
- PRE-TEXT: the opening markup sequence
- POST-TEXT: the closing markup sequence
- LABEL: the default text if none was highlighted
- the text of the button, either (a) HTML markup or (b) the url of a gif/jpg/png image to be used for the button (along with optional "title" text in quotes).
Icon List
This table is a list of icon names, and icon array numbers. Use this list when either removing icons, or when determining the postion for new icons.
|
|
|
|
|
|
Known Issues
- 2010-09-22: When including Creole before EditToolbar some of the
$GUIButtons
entries are not correctly initialised by EditToolbar, apparently because they were already initialised in creole.php. The problem can be fixed by adding "unset($GUIButtons
);" directly after including creole.php in config.php (or maybe including edittoolbar.php before creole.php). (Marco Lehnort)
Change Log
2024-08-24
- fixed PHP 8 warning
1.1.1 (27-May-2009)
Contributors: DaveG, IDB
- bug: Error in version identifier.
1.1.0 (1-Mar-2009)
Contributors: DaveG
- new: Removed H1 icon by default -- H1 is really reserved for the page title. If you want the H1 element back refer to
1.0.0 (13-Feb-2009)
Contributors: DaveG
- Initial release.
Credit
Images are ImagesSilk icon set 1.3, by Mark James (broken link 2024), and are licensed under a Creative Commons Attribution 2.5 License. See the
- Silk Icon pack from the IconArchive
- famfamfam-silk icons on GihHub
Comments
See also
See discussion at EditToolbar-Talk
User notes +6: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.