EditToolbar

Summary: A shiny new set of icons, replacing and extending those on the standard edit toolbar.
Version: 2024-08-24
Prerequisites: None
Status: Active
Maintainer: DaveG
Discussion: EditToolbar-Talk
Download: ZIP or TAR
License: Licensed under the GPL license.
Users: +6 (View / Edit)

Description

Replaces the default edit-toolbar icons, and adds a few additional icons.

Download and Install

  1. Download (ZIP or TAR). There are two folders in the zip file:
    1. cookbook: unzip the folder edittoolbar/, and the file in the folder, into your cookbook directory (usually pmwiki/cookbook/).
    2. pub: Unzip the folder edittoolbar/, and the files in the folder, into your pub directory (usually pmwiki/pub/).
  2. Add the following to your local configuration file, usually pmwiki/local/config.php:
$EnableGUIButtons = 1;
include_once("$FarmD/cookbook/edittoolbar/edittoolbar.php");
  1. Comment out $GUIButtons in config.php if they were enabled
  2. 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

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.

  • h1 - 10
  • h2 - 20
  • h3 - 30
  • separator1 - 40
  • strong - 50
  • em - 60
  • strike - 70
  • sup - 80
  • sub - 90
  • big - 100
  • small - 110
  • separator2 - 120
  • ol - 130
  • ul - 140
  • hr - 150
  • table - 160
  • separator3 - 170
  • center - 180
  • right - 190
  • indent - 200
  • outdent - 210
  • separator4 - 220
  • pagelink - 230
  • extlink - 240
  • attach - 250
  • thumb - 260
  • separator5 - 270
  • author - 280
  • authordate - 290

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

Comments

See also

  • FixURL   Encode special characters in link addresses
  • GuiEdit   Add graphical editing buttons, as in pmwiki.org's site

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.