File/program/manual.php

Description

/program/manual.php - a kickstarter for the documentation

This script is an entry point; it can be called directly. It is also linked to from /program/admin.php, via the help button, implementing a context-sensitive help function. The following parameters are recognised:

  • language: a language key, e.g. 'nl' (Dutch) or 'es' (Spanish). Default is 'en' (English)
  • topic: one of the recognised topics, e.g. 'tools' or 'pagemanager'. Default is 'toc' (Table of contents)
  • subtopic: one of the subtopics relevant in this topic, e.g. 'license' in the 'install' topic. Default is '' (None).
The actual work is done in the function show_manual() below.

Functions
get_available_languages (line 278)

construct a list of 0 or more languages from the languages directory

This routine examines the directory $path to see which subdirectories exist. Each subdirectory indicates a possible language. An array keyed with these languages and the full name of the language in the language itself is returned (but it could be empty).

  • return: contains a list of available language names keyed by language_key
array get_available_languages (string $path)
  • string $path: is the directory where to look for languages (usually /program/languages).
get_available_manuals (line 248)

construct a list of 0 or more languages of available manuals

This routine examines the directory $path to see which subdirectories exist. Each subdirectory indicates a possible language. An array keyed with these languages and the full path to the directory containing the manual's index.html is returned (but it could be empty).

  • return: contains a list of available manual directories keyed by language_key
array get_available_manuals (string $path)
  • string $path: is the directory where to look for manuals (usually /program/manuals).
show_manual (line 157)

redirect the user to a specific place in the manual OR show helpful message about downloading the manual

There is a Website@School Users' Guide available, in English. This is a separate download from the project's website. That means that it is optional to have the (English) manual installed. If it is installed, it is installed under /program/manuals/en/. There might also be translations available, say the Dutch version of the manual. That one would be installed in /program/manuals/nl/ which allows for peaceful co-existence of multiple translations of the manual. This script manual.php is designed to:

  • redirect the user to the correct translation of the manual (if installed), and
  • possibly use deep links to create context-sensitive help.
If the manual is not available in the requested language, the user is redirected to the English version (if that one IS installed). If no manual is installed at all, the user is shown a simple HTML-page which provides a link to the location where the manual(s) can be downloaded.

  • return: this function never returns
void show_manual ([string $language = 'en'], [string $topic = 'toc'], [string $subtopic = ''])
  • string $language: indicates the desired manual language
  • string $topic: is the topic of interest to which we deep link
  • string $subtopic: is a subtopic to allow for an even deeper link
show_screen_choose_language (line 357)

show a screen to the visitor presenting a choice between various available translations of the manual

  • return: screen sent to visitor
void show_screen_choose_language (array $manuals)
  • array $manuals: holds a list of relative paths to manuals ToC's keyed by language code
show_screen_download (line 307)

show a screen to the visitor hinting at downloading a manual archive from download.websiteatschool.eu

  • return: screen sent to visitor
void show_screen_download ()

Documentation generated on Tue, 28 Jun 2016 19:10:31 +0200 by phpDocumentor 1.4.0