YAP  2.5
 All Data Structures Namespaces Files Functions Variables
CYap_PageJump.php
Go to the documentation of this file.
1 <?PHP
10 /*
11  * +-------------------------------------------------------------------------+
12  * | Yap, Version 2.5.0 |
13  * +-------------------------------------------------------------------------+
14  * | Copyright (c) 2003-2013 Andrioli Darvin |
15  * | Email <darvin (inside) andrioli (dot) com> |
16  * | Web http://www.andrioli.com/en/yap.html |
17  * | Download http://www.phpclasses.org/browse.html/package/1391.html |
18  * | |
19  * +-------------------------------------------------------------------------+
20  * | This library is free software; you can redistribute it and/or modify |
21  * | it under the terms of the GNU Lesser General Public License as |
22  * | published by the Free Software Foundation; either version 2 of the |
23  * | License, or (at your option) any later version. |
24  * | |
25  * | This library is distributed in the hope that it will be useful, but |
26  * | WITHOUT ANY WARRANTY; without even the implied warranty of |
27  * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
28  * | Lesser General Public License for more details. |
29  * | |
30  * | You should have received a copy of the GNU Lesser General Public |
31  * | License along with this library; if not, write to the Free Software |
32  * | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
33  * +-------------------------------------------------------------------------+
34  */
35 
41 {
46 var $Lang;
52 {
53 $this->Lang=parse_ini_file($Lang);
54 }
55 
56 function Draw($LinkTbl)
57 {
58 
59 echo "<table border=1 align=center>\n
60  <tr><td>";
61 
62 if(array_key_exists('FirstPage',$LinkTbl))
63  { echo "<a href=".$LinkTbl['FirstPage']." onMouseOver=\"YapToolTip('".$this->Lang['TipFirst']."')\" onMouseOut=\"YapToolTip()\" >".$this->Lang['First']."</a>"; }
64 else { echo "&nbsp"; }
65 echo "</td><td>";
66 
67 if(array_key_exists('PrevPage',$LinkTbl))
68  { echo "<a href=".$LinkTbl['PrevPage']." onMouseOver=\"YapToolTip('".$this->Lang['TipPrevious']."')\" onMouseOut=\"YapToolTip()\" >".$this->Lang['Previous']."</a>"; }
69 else { echo "&nbsp"; }
70 echo "</td><td>";
71 
72 echo "<a href='".$LinkTbl['Exit']."' onMouseOver=\"YapToolTip('".$this->Lang['TipExit']."')\" onMouseOut=\"YapToolTip()\" >".$this->Lang['Exit']."</a>";
73 echo "</td><td>";
74 
75 // In detailmode I give the link to the 'normal' mode
76 if(array_key_exists('DetailMode',$LinkTbl))
77  {
78  echo "<a href=".$LinkTbl['DetailMode']." onMouseOver=\"YapToolTip('".$this->Lang['TipTableView']."')\" onMouseOut=\"YapToolTip()\" >".$this->Lang['TableView']."</a>";
79  echo "</td><td>";
80  }
81 
82 if(array_key_exists('NextPage',$LinkTbl))
83  { echo "<a href=".$LinkTbl['NextPage']." onMouseOver=\"YapToolTip('".$this->Lang['TipNext']."')\" onMouseOut=\"YapToolTip()\" >".$this->Lang['Next']."</a>"; }
84 else { echo "&nbsp"; }
85 echo "</td><td>";
86 
87 if(array_key_exists('LastPage',$LinkTbl))
88  { echo "<a href=".$LinkTbl['LastPage']." onMouseOver=\"YapToolTip('".$this->Lang['TipEnd']."')\" onMouseOut=\"YapToolTip()\" >".$this->Lang['End']."</a>"; }
89 else { echo "&nbsp"; }
90 echo "</td>\n</tr></table>";
91 }
92 
93 }
94 
100 {
105 var $Lang;
111 {
112 $this->Lang=parse_ini_file($Lang);
113 }
114 
115 function Draw($min,$max,$current)
116 {
117 // Open the tabel
118 echo "<table border=1 align=center>\n
119  <tr><td>".$this->Lang['GotoPage'].": ";
120 
121 // Page number loop
122 for($i=$min;$i<$max+1;$i++)
123  {
124  if($i==$current)
125  // Current page
126  echo "[$i] ";
127  else
128  echo "<a href=".$_SERVER["PHP_SELF"]."?ev=YAP_TOPAGE&pag=".$i.">".$i."</a> ";
129  }
130 
131 echo "</td>\n</tr></table>";
132 }
133 
134 }
135 
136 ?>