po/src/help.php

106 lines
4.0 KiB
PHP

<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2013 Solomon Peachy (pizza@shaftnet.org)
// 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 3 of the License, or
// (at your option) any later version.
// 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 St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/common.php";
include_once "include/site.php";
function display_help_navigator($index, $helpfiles) {
global $thm_elem;
$num_of_pages = sizeof($helpfiles);
$previous_index = $index - 1;
$next_index = $index + 1;
if ($previous_index < 0)
$previous_index = 0;
if ($next_index >= $num_of_pages)
$next_index = $num_of_pages - 1;
$first_page_index = 0;
$first_page_title = $helpfiles[0][0];
$previous_page_index = $previous_index;
$previous_page_title = $helpfiles[$previous_index][0];
$next_page_index = $next_index;
$next_page_title = $helpfiles[$next_index][0];
$last_page_index = $num_of_pages - 1;
$last_page_title = $helpfiles[$num_of_pages - 1][0];
print "<div class=\"photo_nav\">";
print sprintf($thm_elem['button.first'], "help.php?help=$first_page_index", $first_page_title);
print sprintf($thm_elem['button.previous'], "help.php?help=$previous_page_index", $previous_page_title, "");
for ($i=0; $i < $num_of_pages; $i++) {
$current_page_title = $helpfiles[$i][0];
if ($index == $i)
print sprintf($thm_elem['button.option.a'], "help.php?help=$i", $current_page_title);
else
print sprintf($thm_elem['button.option'], "help.php?help=$i", $current_page_title);
}
print sprintf($thm_elem['button.next'], "help.php?help=$next_page_index", $next_page_title, "");
print sprintf($thm_elem['button.last'], "help.php?help=$last_page_index", $last_page_title);
print "</div>";
}
$database = site_prolog();
$help_id = isset($_REQUEST['help']) ? $_REQUEST['help'] : 0;
if (!is_numeric($help_id)) {
$help_id = 0;
}
if ($help_id > 11) {
$help_id = 0;
}
$helpfiles = array (array("Content", "content.html"),
array("Registration", "registration.html"),
array("Login", "login.html"),
array("Folders and Albums", "folders.albums.html"),
array("Date Book", "datebook.html"),
array("Profile", "profile.html"),
array("Photo Management", "photo.html"),
array("Search", "search.html"),
array("Settings", "settings.html"),
array("Tools", "tools.html"),
array("Front Page", "front.page.html"),
array("Administrator", "admin.html"));
site_header("Help");
site_navigator(4);
$little_hack = $helpfiles[$help_id][0];
site_navigator_status("<a href=\"help.php\">Help</a> : $little_hack", "");
print "&nbsp;<br/>\n";
display_help_navigator($help_id, $helpfiles);
print "<h3>Please note that this documentation is outdated.</h3><h3>Visit the <a href=\"http://po.shaftnet.org/podoc:start\">Photo Organizer Wiki</a> for current documentation. This will be fixed in a future release.</h3>\n";
print "<table width=\"100%\">";
print "<tr><td >";
print "&nbsp;<br/>\n";
$little_hack = $helpfiles[$help_id][1];
readfile("help/$little_hack");
print "</td></tr>";
print "</table>";
print "&nbsp;<br/>\n";
display_help_navigator($help_id, $helpfiles);
print "&nbsp;<br/>\n";
site_footer($database);
site_epilog($database);
?>