From 124ad22b94eb0eb75fd7fe7b21b8360fd3bd30cd Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 10 Jun 2005 09:36:28 +0000 Subject: [PATCH] hide forward backward button on first /lastpage git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@651 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/helpviewer.php | 27 ++++++++++++++++++++------- ihtml/themes/default/help.tpl | 8 ++------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/html/helpviewer.php b/html/helpviewer.php index 74f0af861..4e46ffbf4 100644 --- a/html/helpviewer.php +++ b/html/helpviewer.php @@ -79,6 +79,13 @@ $minwordlength = 3; // Word less $allowed_chars_in_searchword = "'[^a-z0-9 %_-]'i"; // Remove all chars that would disturb our search like < or > ... $pre_mark = "" ; // Sign words with this $suf_mark = ""; // and this +$backwardlink = " + \""._("previous")."\" + "; + +$forwardlink = " + \""._("next")."\" + "; $error_collector= ""; set_error_handler('gosaRaiseError'); @@ -197,7 +204,7 @@ if(!file_exists(HELP_BASEDIR."/en/manual_gosa_en/")){ }else{ $page = $defaultpage; } - + /* test if this page exists, in our array of files */ if((!isset($helppages[$page]))&&($page!=$defaultpage)) { @@ -220,10 +227,7 @@ if(!file_exists(HELP_BASEDIR."/en/manual_gosa_en/")){ $backward = $bck; } - /* forward exists ?*/ - if((isset($helppages[$fck]))) { - $forward = $fck; - } + $forward = $fck; } $help_contents=readfiles($helpdir,$prefix,$suffix,false,$page); @@ -240,9 +244,18 @@ if(!file_exists(HELP_BASEDIR."/en/manual_gosa_en/")){ $smarty->assign("help_contents",$help_contents); /* Define our own navigation pages */ - $smarty->assign("backward",$backward); + if($page == $defaultpage){ + $smarty->assign("backward",""); + }else{ + $smarty->assign("backward",sprintf($backwardlink,$backward)); + } $smarty->assign("index" ,$index); - $smarty->assign("forward" ,$forward); + + if(!(isset($helppages[$forward]))){ + $smarty->assign("forward",""); + }else{ + $smarty->assign("forward",sprintf($forwardlink,$forward)); + } /* show some errors */ if (isset($_SESSION['errors'])){ diff --git a/ihtml/themes/default/help.tpl b/ihtml/themes/default/help.tpl index d0c7c159c..11bcdee78 100644 --- a/ihtml/themes/default/help.tpl +++ b/ihtml/themes/default/help.tpl @@ -9,17 +9,13 @@ {t}GOsa help viewer{/t} - - < {t}previous{/t} - + {$backward}    {t}Index{/t}    - - {t}next{/t} - + {$forward}   -- 2.30.2