didou Wed Feb 18 13:40:35 2004 EDT
Modified files: /livedocs TODO error.php /livedocs/themes/default html_format.php /livedocs/themes/php.net html_format.php Log: Finally added the Frontpage with language selection # still need to be improved, don't scream at me :) http://cvs.php.net/diff.php/livedocs/TODO?r1=1.12&r2=1.13&ty=u Index: livedocs/TODO diff -u livedocs/TODO:1.12 livedocs/TODO:1.13 --- livedocs/TODO:1.12 Tue Jan 13 06:00:39 2004 +++ livedocs/TODO Wed Feb 18 13:40:34 2004 @@ -2,8 +2,8 @@ ========= - Re-implement the index -- Add a frontpage to select language, and some other goodies (like search and - the index) +- Add some goodies to the frontpage (like search and the index). +- Add language chooser in the manual pages - Add support for other charsets (including RTL :) - Abstract making links to other parts of the manual (static and dynamic, based on filename) @@ -18,4 +18,4 @@ relationship when indexing the content -$Revision: 1.12 $ +$Revision: 1.13 $ http://cvs.php.net/diff.php/livedocs/error.php?r1=1.7&r2=1.8&ty=u Index: livedocs/error.php diff -u livedocs/error.php:1.7 livedocs/error.php:1.8 --- livedocs/error.php:1.7 Mon Feb 16 12:54:59 2004 +++ livedocs/error.php Wed Feb 18 13:40:34 2004 @@ -18,7 +18,7 @@ // | Handles the 404 error and try to redirect to the good place. | // +----------------------------------------------------------------------+ // -// $Id: error.php,v 1.7 2004/02/16 17:54:59 derick Exp $ +// $Id: error.php,v 1.8 2004/02/18 18:40:34 didou Exp $ /* handle IIS style 404 handler */ if (strncmp($_SERVER['SERVER_SOFTWARE'], "Microsoft", 9) == 0 && @@ -36,6 +36,19 @@ if (!empty($_SERVER['REDIRECT_URL'])) { // This is the requested page that caused the error $current_page = substr($_SERVER['REDIRECT_URL'], strlen(WEBBASE)); + if ($current_page === FALSE) { // This is the manual index ! + echo index_page_header(); + $languages = preg_split('|[\s]+|', LANGUAGES); + sort($languages); + echo 'Choose a language !'; + echo '<ul>'; + foreach ($languages as $language) { + echo '<li><a href="' . WEBBASE . '?l=' . $language . '&q=manual">' . $language . '</a></li>'; + } + echo '</ul>'; + echo index_page_footer(); + exit; + } if (strncmp(substr($current_page, -5), ".html", 5)) { if (preg_match('|([A-Za-z_]{2,5})/(.*)|', $current_page, $m)) { $current_page = $m[2]; http://cvs.php.net/diff.php/livedocs/themes/default/html_format.php?r1=1.4&r2=1.5&ty=u Index: livedocs/themes/default/html_format.php diff -u livedocs/themes/default/html_format.php:1.4 livedocs/themes/default/html_format.php:1.5 --- livedocs/themes/default/html_format.php:1.4 Wed Feb 18 13:21:49 2004 +++ livedocs/themes/default/html_format.php Wed Feb 18 13:40:34 2004 @@ -18,7 +18,7 @@ // | headers and footers for the HTML rendering | // +----------------------------------------------------------------------+ // -// $Id: html_format.php,v 1.4 2004/02/18 18:21:49 didou Exp $ +// $Id: html_format.php,v 1.5 2004/02/18 18:40:34 didou Exp $ // in livedoc.php @@ -92,6 +92,36 @@ } + +function index_page_header() +{ + global $css_url; + $head =<<<HEAD +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>Livedocs Index</title> +<link rel="stylesheet" href="$css_url" > +</head> +<body> +<h1>PHP Manual</h1> + +HEAD; + + return $head; +} + +function index_page_footer() +{ + $foot =<<<FOOT +</body> +</html> +FOOT; + + return $foot; +} + // in livedoc-index.php function functions_page_header() http://cvs.php.net/diff.php/livedocs/themes/php.net/html_format.php?r1=1.5&r2=1.6&ty=u Index: livedocs/themes/php.net/html_format.php diff -u livedocs/themes/php.net/html_format.php:1.5 livedocs/themes/php.net/html_format.php:1.6 --- livedocs/themes/php.net/html_format.php:1.5 Wed Feb 18 13:21:49 2004 +++ livedocs/themes/php.net/html_format.php Wed Feb 18 13:40:35 2004 @@ -18,7 +18,7 @@ // | headers and footers for the HTML rendering | // +----------------------------------------------------------------------+ // -// $Id: html_format.php,v 1.5 2004/02/18 18:21:49 didou Exp $ +// $Id: html_format.php,v 1.6 2004/02/18 18:40:35 didou Exp $ // in livedoc.php include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; @@ -132,6 +132,35 @@ } +function index_page_header() +{ + global $css_url; + $head =<<<HEAD +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>Livedocs Index</title> +<link rel="stylesheet" href="$css_url" > +</head> +<body> +<h1>PHP Manual</h1> + +HEAD; + + return $head; +} + +function index_page_footer() +{ + $foot =<<<FOOT +</body> +</html> +FOOT; + + return $foot; +} + // in livedoc-index.php function functions_page_header()