CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
18 class TransportControlsUI extends TransportControlsUI_Base
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 (isset($this->ItemTypeNames[$ItemType]))
41 {
42 $TypeName = StdLib::Pluralize($this->ItemTypeNames[$ItemType]);
43 }
44
45 if ($this->ShowAnyReverseButtons()
46 || $this->ShowAnyForwardButtons()
47 || strlen($Message))
48 {
49 if($this->ShowAnyReverseButtons() || $this->ShowAnyForwardButtons())
50 {
51 ?><div class="cw-transport-controls clearfix">
52 <?PHP
53 if ($this->ShowAnyReverseButtons())
54 {
55 $TitleAttrib = "Go to first page";
56 if (isset($TypeName)) { $TitleAttrib .= " of ".$TypeName; }
57 ?><div class="cw-transport-controls-left">
58 <a class="StyledButton NavStyledButton"
59 href="<?PHP print $this->GoToStartLink(); ?>"
60 title="<?= $TitleAttrib ?>">&#124;<span
61 style="position:relative; bottom: 1px;">&lt;</span></a>
62 <?PHP
63
64 if ($this->ShowFastReverseButton())
65 {
66 $TitleAttrib = "Jump back";
67 if (isset($TypeName)) { $TitleAttrib .= " in ".$TypeName; }
68 ?><a class="StyledButton NavStyledButton"
69 href="<?PHP print $this->FastReverseLink(); ?>"
70 title="<?= $TitleAttrib ?>">&lt;&lt;</a> <?PHP
71 }
72
73 if ($this->ShowReverseButton())
74 {
75 $TitleAttrib = "Go to previous page";
76 if (isset($TypeName)) { $TitleAttrib .= " of ".$TypeName; }
77 ?><a class="StyledButton NavStyledButton"
78 href="<?PHP print $this->ReverseLink(); ?>"
79 title="<?= $TitleAttrib ?>">&lt;</a> <?PHP
80 }
81
82 ?></div><?PHP
83 }
84
85 if ($this->ShowAnyForwardButtons())
86 {
87 ?><div class="cw-transport-controls-right">
88 <?PHP
89
90 if ($this->ShowForwardButton())
91 {
92 $TitleAttrib = "Go to next page";
93 if (isset($TypeName)) { $TitleAttrib .= " of ".$TypeName; }
94 ?><a class="StyledButton NavStyledButton"
95 href="<?PHP print $this->ForwardLink(); ?>"
96 title="<?= $TitleAttrib ?>">&gt;</a> <?PHP
97 }
98
99 if ($this->ShowFastForwardButton())
100 {
101 $TitleAttrib = "Jump forward";
102 if (isset($TypeName)) { $TitleAttrib .= " in ".$TypeName; }
103 ?><a class="StyledButton NavStyledButton"
104 href="<?PHP print $this->FastForwardLink(); ?>"
105 title="<?= $TitleAttrib ?>">&gt;&gt;</a> <?PHP
106 }
107
108 $TitleAttrib = "Go to last page";
109 if (isset($TypeName)) { $TitleAttrib .= " of ".$TypeName; }
110 ?><a class="StyledButton NavStyledButton"
111 href="<?PHP print $this->GoToEndLink(); ?>"
112 title="<?= $TitleAttrib ?>">&gt;<span
113 style="position:relative; bottom: 1px;">&#124;</span></a>
114 </div><?PHP
115 }
116
117 if($this->ShowAnyReverseButtons() && !$this->ShowAnyForwardButtons())
118 {
119 ?><div class="cw-transport-controls-msg-left-only clearfix"><?PHP
120 print strlen($Message) ? $Message : "&nbsp;";
121 ?></div><?PHP
122 }
123 elseif(!$this->ShowAnyReverseButtons()
124 && $this->ShowAnyForwardButtons())
125 {
126 ?><div class="cw-transport-controls-msg-right-only clearfix"><?PHP
127 print strlen($Message) ? $Message : "&nbsp;";
128 ?></div><?PHP
129 }
130 else
131 {
132 ?><div class="cw-transport-controls-msg clearfix"><?PHP
133 print strlen($Message) ? $Message : "&nbsp;";
134 ?></div><?PHP
135 }
136
137 ?></div><?PHP
138 }
139 else
140 {
141 print strlen($Message) ? $Message : "&nbsp;";
142 }
143 }
144 }
145 }
146
TransportControlsUI_Base\ShowForwardButton
ShowForwardButton()
Report whether forward button should be displayed.
Definition: TransportControlsUI_Base.php:528
StdLib\Pluralize
static Pluralize($Word)
Pluralize an English word.
Definition: StdLib.php:162
TransportControlsUI_Base\ShowAnyForwardButtons
ShowAnyForwardButtons()
Report whether any forward buttons should be displayed.
Definition: TransportControlsUI_Base.php:501
TransportControlsUI\PNAME_ACTIVETAB
const PNAME_ACTIVETAB
Definition: TransportControlsUI.php:26
PHP
PHP
Definition: RSSClient--Test.php:12
TransportControlsUI_Base
Class to provide support for transport controls (used for paging back and forth through a list) in th...
Definition: TransportControlsUI_Base.php:18
TransportControlsUI
Class to provide support for transport controls (used for paging back and forth through a list) in th...
Definition: TransportControlsUI.php:18
TransportControlsUI_Base\ShowReverseButton
ShowReverseButton()
Report whether reverse button should be displayed.
Definition: TransportControlsUI_Base.php:542
TransportControlsUI\PNAME_SORTFIELD
const PNAME_SORTFIELD
Definition: TransportControlsUI.php:24
TransportControlsUI_Base\ShowAnyReverseButtons
ShowAnyReverseButtons()
Report whether any reverse buttons should be displayed.
Definition: TransportControlsUI_Base.php:516
TransportControlsUI_Base\ShowFastReverseButton
ShowFastReverseButton()
Report whether fast reverse button should be displayed.
Definition: TransportControlsUI_Base.php:572
TransportControlsUI_Base\ItemTypeNames
ItemTypeNames($Names=NULL)
Get/set printable names for item types.
Definition: TransportControlsUI_Base.php:464
TransportControlsUI_Base\SetBaseLink
SetBaseLink($BaseLink)
Set current base link for Link methods.
Definition: TransportControlsUI_Base.php:489
TransportControlsUI_Base\ShowFastForwardButton
ShowFastForwardButton()
Report whether fast forward button should be displayed.
Definition: TransportControlsUI_Base.php:556
TransportControlsUI\PrintControls
PrintControls($ItemType, $BaseLink, $Message="")
Print transport control HTML.
Definition: TransportControlsUI.php:35
TransportControlsUI_Base\SetItemType
SetItemType($ItemType)
Set current item type for Show or Link methods.
Definition: TransportControlsUI_Base.php:480
TransportControlsUI\PNAME_STARTINGINDEX
const PNAME_STARTINGINDEX
Definition: TransportControlsUI.php:25
TransportControlsUI\PNAME_REVERSESORT
const PNAME_REVERSESORT
Definition: TransportControlsUI.php:23