Extension:BackwardNavigation

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
BackwardNavigation

Release status: beta

Implementation User interface
Description Enables backward navigation
Author(s) Marc Despland
Latest version 1.0.1 (2007-06-16)
MediaWiki 1.6.10+
License GPL
Download BackwardNavigation_1.0.1.tgz
documentation
Example http://www.art122-5.net

Translate the BackwardNavigation extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

What can this extension do?[edit | edit source]

This extension proposes a popup interface to "what links here".

Usage[edit | edit source]

This extension overrides the behavior of the "What links here" link in the sidebar (by default found in the toolbox area).

  • If the page is not referred to by any other, the sidebar "What links here" does nothing.
  • If only one page is linked to the current page, “What links here” is a link to that page
  • If several pages are linked to the current page, bringing the mouse on “What links here” posts a popup containing the list of these pages.
  • If there are too many pages, "What links here" behaves as usual (in plain vanilla MediaWiki) and displays a special page listing all pages referring to this page, i.e. it's a link to [[Special:Whatlinkshere/{{PAGENAME}}]].

Installation[edit | edit source]

We very highly advise you to proceed to an installation on a test server before modifying your production server. A backup is always a good idea before making modifications.

Copy the extension files[edit | edit source]

First, download the extension : BackwardNavigation_1.0.1.tgz

Unzip it in your extension folder :

./BackwardNavigation.i18n.php
./BackwardNavigation.php
./BackwardNavigation_body.php
./BackwardNavigation_template.php
./licence.txt
./README.art122-5
./skins
./skins/Art122_5.php
./skins/Tests.php

Changes to LocalSettings.php[edit | edit source]

Add at the end of your file the following lines :

require_once("$IP/extensions/BackwardNavigation/BackwardNavigation.php");

If you use the MultiLanguageManager extension you have to add BackwardNavigation after MultiLanguageManager.

Integration in your template[edit | edit source]

To display the referer selection, you have to modify your template to add the following code where you wish to see appearing the selection referer element :

<?php
   global $wgTitle;
   $backNav_controller=new BackwardNavigation();
   echo $backNav_controller->executeBackwardNavigation($wgTitle->getArticleID());
?>

You also have to change your CSS files, cf Customize the CSS.

Customization[edit | edit source]

BackwardNavigation has been designed to adapt to different skins. The graphic functions are isolated in the file BackwardNavigation_template.php containing the class from the same name. It contains the various method used to create the view.

You must not modify it. If you alter this file, the change could touch all the skins. Indeed the module uses this class only if it can't find specific class for your skin. It is the generic class derived by all the module skin

Create a new skin[edit | edit source]

In the extensions/BackwardNavigation/skins directory, duplicate the Default.php file and name the copy of the name of your skin (the same file name as the .php of the directory skins of the wiki).

By defect this class contains only the manufacturer, but you can overload all the methods of your choice. An example is given with the Art122-5.php file that modify the method of the popup to correspond to the style of the wiki.

Customize the CSS[edit | edit source]

You also have the possibility of personalizing the CSS. The name of the various classes can be modified by overloading the variables $class_ of the class BackwardNavigation_template , you can find an exemple of CSS configuration at the beginning of this file.

  • class_referer_disabled = referer_disabled : no referer
  • class_referer_activated = referer_activated : only one referer
  • class_popup = popup : the link used to display the popup
  • class_cadre_popup = cadre_popup : the popup

Licence[edit | edit source]

This extension is distributed under GPL v2 licence

 * Copyright (C) 2007  Marc Despland
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

You are free :

  • modify
  • distribute
  • use

this extension, with a commercial aim or not.

Any time you have to respect the licence clauses, in particular:

  • Even if you modify it, this extension remains under GPL
  • You are not authorized to remove information relating to its author or the licence


See also[edit | edit source]