Framework  3.9
StatusBlockView Class Reference

Public Member Functions

 StatusBlockView ($item)
 
 drawView ()
 
 getViewHTML ()
 
 writeSummary ()
 
 getSummaryHTML ()
 
 drawLinks ()
 
 getLinksHTML ()
 
 writeButton ($url, $icon, $text, $newWindow=false, $class="")
 
 getButtonHTML ($url, $icon, $text, $newWindow=false, $class="")
 
 writeViewButton ()
 
 writeEditButton ()
 
 writeDeleteButton ($class="")
 
 writeViewPopupButton ()
 
 getDeleteButton ($class="")
 
 getEditButton ($class="", $newWindow=false)
 
 getViewButton ($class="")
 

Public Attributes

 $item
 
 $statusCategories
 
 $iconView
 
 $iconEdit
 
 $iconDelete
 
 $activityName
 
 $deleteUrl
 

Detailed Description

Definition at line 183 of file status_tree.inc.

Member Function Documentation

◆ drawLinks()

StatusBlockView::drawLinks ( )

Definition at line 241 of file status_tree.inc.

242  {
243  // handled by inheriting class - buttons linking to
244  // submit, edit, view, etc.
245  }

◆ drawView()

StatusBlockView::drawView ( )

Definition at line 199 of file status_tree.inc.

200  {
201  // begin status block
202  echo "<div class=\"status_block\">";
203 
204  echo "<div id=\"col2\"><br/>";
205 
206  $this->drawLinks();
207 
208  echo "</div>";
209 
210  $this->writeSummary();
211 
212  echo "</div>";
213  }

◆ getButtonHTML()

StatusBlockView::getButtonHTML (   $url,
  $icon,
  $text,
  $newWindow = false,
  $class = "" 
)

Definition at line 259 of file status_tree.inc.

260  {
261  if($newWindow)
262  $target = "target='_blank'";
263 
264  $class = (!$class) ? "button" : $class;
265  $img = ($icon) ? "<img src='$icon' style='border: none'>" : "";
266 
267  $html = "<p><a $target class=\"$class\" href=\"$url\">
268  $img&nbsp;$text&nbsp;</a></p>";
269 
270  return $html;
271  }

◆ getDeleteButton()

StatusBlockView::getDeleteButton (   $class = "")

Definition at line 297 of file status_tree.inc.

298  {
299  $class = (!$class) ? "button" : $class;
300  $icon = ($this->iconDelete) ? "<img src=\"$this->iconDelete\"/>\n" : "";
301 
302  $message = "Are you sure you want to delete this {$this->activityName}?";
303 
304  $html = "<p><a href=\"$this->deleteUrl\" class=\"$class\"
305  onclick=\"return confirm('$message');\">
306  $icon&nbsp;Delete this $this->activityName</a></p>";
307 
308  return $html;
309 
310  }

◆ getEditButton()

StatusBlockView::getEditButton (   $class = "",
  $newWindow = false 
)

Definition at line 312 of file status_tree.inc.

313  {
314  $html = $this->getButtonHTML($this->item->getEditUrl(), $this->iconEdit, "Edit this {$this->activityName}", $newWindow);
315 
316  return $html;
317  }
getButtonHTML($url, $icon, $text, $newWindow=false, $class="")

◆ getLinksHTML()

StatusBlockView::getLinksHTML ( )

Definition at line 247 of file status_tree.inc.

248  {
249  // handled by inheriting class - buttons linking to
250  // submit, edit, view, etc.
251  }

◆ getSummaryHTML()

StatusBlockView::getSummaryHTML ( )

Definition at line 236 of file status_tree.inc.

237  {
238  // handled by inheriting class
239  }

◆ getViewButton()

StatusBlockView::getViewButton (   $class = "")

Definition at line 319 of file status_tree.inc.

320  {
321  $html = $this->getButtonHTML($this->item->getViewUrl(), $this->iconView, "View this {$this->activityName}", $newWindow);
322 
323  return $html;
324 
325  }

◆ getViewHTML()

StatusBlockView::getViewHTML ( )

Definition at line 216 of file status_tree.inc.

217  {
218  global $user;
219 
220  $html = "<div class=\"status_block\">";
221 
222  $html .= "<div id=\"col2\" style=\"float: right\"><br/>\n";
223  $html .= $this->getLinksHTML();
224  $html .= "</div>\n<br/>\n";
225  $html .= $this->getSummaryHTML();
226  $html .= "</div>\n";
227 
228  return $html;
229  }

◆ StatusBlockView()

StatusBlockView::StatusBlockView (   $item)

Definition at line 193 of file status_tree.inc.

194  {
195  $this->item = $item;
196  }

◆ writeButton()

StatusBlockView::writeButton (   $url,
  $icon,
  $text,
  $newWindow = false,
  $class = "" 
)

Definition at line 254 of file status_tree.inc.

255  {
256  echo $this->getButtonHTML($url, $icon, $text, $newWindow, $class);
257  }

◆ writeDeleteButton()

StatusBlockView::writeDeleteButton (   $class = "")

Definition at line 283 of file status_tree.inc.

284  {
285  echo $this->getDeleteButtonHTML($class);
286  }

◆ writeEditButton()

StatusBlockView::writeEditButton ( )

Definition at line 278 of file status_tree.inc.

279  {
280  $this->writeButton($this->item->getEditUrl(), $this->iconEdit, "Edit this {$this->activityName}", false);
281  }
writeButton($url, $icon, $text, $newWindow=false, $class="")

◆ writeSummary()

StatusBlockView::writeSummary ( )

Definition at line 231 of file status_tree.inc.

232  {
233  // handled by inheriting class
234  }

◆ writeViewButton()

StatusBlockView::writeViewButton ( )

Definition at line 273 of file status_tree.inc.

274  {
275  $this->writeButton($this->item->getViewUrl(), $this->iconView, "View this {$this->activityName}", false);
276  }

◆ writeViewPopupButton()

StatusBlockView::writeViewPopupButton ( )

Definition at line 288 of file status_tree.inc.

289  {
290  $url = $this->item->getViewUrl();
291 
292  echo "<a class=\"button\" href=\"$url\" onclick=\"popup('$url', '_blank', 750, 600); return false;\">
293  <img src=\"$this->iconView\" alt=\"View\"/>&nbsp;View this $this->activityName&nbsp;</a><br/>";
294  }

Member Data Documentation

◆ $activityName

StatusBlockView::$activityName

Definition at line 190 of file status_tree.inc.

◆ $deleteUrl

StatusBlockView::$deleteUrl

Definition at line 191 of file status_tree.inc.

◆ $iconDelete

StatusBlockView::$iconDelete

Definition at line 189 of file status_tree.inc.

◆ $iconEdit

StatusBlockView::$iconEdit

Definition at line 188 of file status_tree.inc.

◆ $iconView

StatusBlockView::$iconView

Definition at line 187 of file status_tree.inc.

◆ $item

StatusBlockView::$item

Definition at line 185 of file status_tree.inc.

◆ $statusCategories

StatusBlockView::$statusCategories

Definition at line 186 of file status_tree.inc.


The documentation for this class was generated from the following file: