Code

hide forward backward button on first /lastpage
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Jun 2005 09:36:28 +0000 (09:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Jun 2005 09:36:28 +0000 (09:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@651 594d385d-05f5-0310-b6e9-bd551577e9d8

html/helpviewer.php
ihtml/themes/default/help.tpl

index 74f0af861a08d0bc4b38dc874b385868c7be8d84..4e46ffbf4c32ec4bb5e92ea3bacd7fe0beaaf81c 100644 (file)
@@ -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                     = "<b><u><i>" ;                       // Sign words with this
 $suf_mark                     = "</i></u></b>";                     //  and this
+$backwardlink                 = "<a href=\"?pg=%s\"  class=\"maintitlebar\">
+                                  <img src='images/back.png' align=\"middle\" alt=\""._("previous")."\" border=\"0\">
+                                 </a>";
+
+$forwardlink                 = "<a href=\"?pg=%s\"  class=\"maintitlebar\">
+                                  <img src='images/forward.png' align=\"middle\" alt=\""._("next")."\" border=\"0\">
+                                 </a>";
 
 $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'])){
index d0c7c159c2bd93a814e8558fe76e03f38a49681b..11bcdee78a105466bca31362dd7ac7962ef60ea8 100644 (file)
@@ -9,17 +9,13 @@
      <b>{t}GOsa help viewer{/t}</b>
        </td>
     <td width="33%" style="text-align:center">
-               <a href="?pg={$backward}"  class="maintitlebar">
-                       <img src='images/back.png' align="middle" alt="&lt; {t}previous{/t}" border="0">
-               </a>
+               {$backward}
                &nbsp;&nbsp;
                <a href="?pg={$index}"  class="maintitlebar">
                        {t}Index{/t}
                </a>
                &nbsp;&nbsp;
-               <a href="?pg={$forward}" class="maintitlebar">
-                       <img src='images/forward.png' align="middle" alt="{t}next{/t}" border="0">
-               </a>
+               {$forward}
        </td>
        <td style="text-align:right">
         <input name="search_string" size="15" value="{$search_string}" maxlength="50">&nbsp;<input type=submit name="search" value="{t}Search{/t}">