CWIS Developer Documentation
TransportControlsUI.php
Go to the documentation of this file.
1 <?PHP
2 #
3 # FILE: TransportControlsUI.php
4 #
5 # Part of the Collection Workflow Integration System (CWIS)
6 # Copyright 2015 Edward Almasy and Internet Scout Research Group
7 # http://scout.wisc.edu/cwis/
8 #
9 
19 {
20  # ---- PUBLIC INTERFACE --------------------------------------------------
21 
22  # parameter ($_GET) variable names
23  const PNAME_REVERSESORT = "RS";
24  const PNAME_SORTFIELD = "SF";
25  const PNAME_STARTINGINDEX = "SI";
26  const PNAME_ACTIVETAB = "AT";
27 
35  public function PrintControls($ItemType, $BaseLink, $Message = "")
36  {
37  $this->SetItemType($ItemType);
38  $this->SetBaseLink($BaseLink);
39 
40  if ($this->ShowAnyReverseButtons()
41  || $this->ShowAnyForwardButtons()
42  || strlen($Message))
43  {
44  if($this->ShowAnyReverseButtons() || $this->ShowAnyForwardButtons())
45  {
46  ?><div class="cw-transport-controls clearfix">
47  <?PHP
48  if ($this->ShowAnyReverseButtons())
49  {
50  ?><div class="cw-transport-controls-left">
51  <a class="StyledButton NavStyledButton"
52  href="<?PHP print $this->GoToStartLink(); ?>"
53  title="Go to first page">&#124;<span
54  style="position:relative; bottom: 1px;">&lt;</span></a>
55  <?PHP
56 
57  if ($this->ShowFastReverseButton())
58  {
59  ?><a class="StyledButton NavStyledButton"
60  href="<?PHP print $this->FastReverseLink(); ?>"
61  title="Jump back">&lt;&lt;</a> <?PHP
62  }
63 
64  if ($this->ShowReverseButton())
65  {
66  ?><a class="StyledButton NavStyledButton"
67  href="<?PHP print $this->ReverseLink(); ?>"
68  title="Go to previous page">&lt;</a> <?PHP
69  }
70 
71  ?></div><?PHP
72  }
73 
74  if ($this->ShowAnyForwardButtons())
75  {
76  ?><div class="cw-transport-controls-right">
77  <?PHP
78 
79  if ($this->ShowForwardButton())
80  {
81  ?><a class="StyledButton NavStyledButton"
82  href="<?PHP print $this->ForwardLink(); ?>"
83  title="Go to next page">&gt;</a> <?PHP
84  }
85 
86  if ($this->ShowFastForwardButton())
87  {
88  ?><a class="StyledButton NavStyledButton"
89  href="<?PHP print $this->FastForwardLink(); ?>"
90  title="Jump forward">&gt;&gt;</a> <?PHP
91  }
92 
93  ?><a class="StyledButton NavStyledButton"
94  href="<?PHP print $this->GoToEndLink(); ?>"
95  title="Go to last page">&gt;<span
96  style="position:relative; bottom: 1px;">&#124;</span></a>
97  </div><?PHP
98  }
99 
100  if($this->ShowAnyReverseButtons() && !$this->ShowAnyForwardButtons())
101  {
102  ?><div class="cw-transport-controls-msg-left-only clearfix"><?PHP
103  print strlen($Message) ? $Message : "&nbsp;";
104  ?></div><?PHP
105  }
106  elseif(!$this->ShowAnyReverseButtons()
107  && $this->ShowAnyForwardButtons())
108  {
109  ?><div class="cw-transport-controls-msg-right-only clearfix"><?PHP
110  print strlen($Message) ? $Message : "&nbsp;";
111  ?></div><?PHP
112  }
113  else
114  {
115  ?><div class="cw-transport-controls-msg clearfix"><?PHP
116  print strlen($Message) ? $Message : "&nbsp;";
117  ?></div><?PHP
118  }
119 
120  ?></div><?PHP
121  }
122  else
123  {
124  print strlen($Message) ? $Message : "&nbsp;";
125  }
126  }
127  }
128 }
129 
ShowForwardButton()
Report whether forward button should be displayed.
ShowAnyForwardButtons()
Report whether any forward buttons should be displayed.
Class to provide support for transport controls (used for paging back and forth through a list) in th...
Class to provide support for transport controls (used for paging back and forth through a list) in th...
ShowReverseButton()
Report whether reverse button should be displayed.
ShowAnyReverseButtons()
Report whether any reverse buttons should be displayed.
ShowFastReverseButton()
Report whether fast reverse button should be displayed.
SetBaseLink($BaseLink)
Set current base link for Link methods.
ShowFastForwardButton()
Report whether fast forward button should be displayed.
PrintControls($ItemType, $BaseLink, $Message="")
Print transport control HTML.
SetItemType($ItemType)
Set current item type for Show or Link methods.