ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilLinkCheckerTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Table/classes/class.ilTable2GUI.php';
5
14{
23 private $linkChecker = null;
24
33 private $rowHandler = null;
34
43 private $refreshButton = array('txt' => null, 'cmd' => null);
44
53 public function __construct(ilObjectGUI $parentGUIObject, $parentStdCmd)
54 {
55 parent::__construct($parentGUIObject, $parentStdCmd);
56 }
57
67 {
68 $this->linkChecker = $linkChecker;
69
70 return $this;
71 }
72
80 public function getLinkChecker()
81 {
82 return $this->linkChecker;
83 }
84
94 {
95 $this->rowHandler = $rowHandler;
96
97 return $this;
98 }
99
107 public function getRowHandler()
108 {
109 return $this->rowHandler;
110 }
111
121 public function setRefreshButton($txt, $cmd)
122 {
123 $this->refreshButton['txt'] = $txt;
124 $this->refreshButton['cmd'] = $cmd;
125
126 return $this;
127 }
128
136 public function getRefreshButton()
137 {
139 }
140
149 public function prepareHTML()
150 {
151 global $ilCtrl, $lng;
152
153 // #11002
154 $lng->loadLanguageModule("webr");
155
156 $title = $this->getParentObject()->object->getTitle().' ('.$lng->txt('invalid_links_tbl').')';
157 if($last_access = $this->getLinkChecker()->getLastCheckTimestamp())
158 {
159 $title .= ', '.$lng->txt('last_change').': '.
161 }
162 $this->setTitle($title);
163
164 $invalidLinks = $this->getLinkChecker()->getInvalidLinksFromDB();
165 if(!count($invalidLinks))
166 {
167 #$this->setNoEntriesText($lng->txt('no_invalid_links'));
168 }
169 else
170 {
171 foreach($invalidLinks as $key => $invalidLink)
172 {
173 $invalidLinks[$key] = $this->getRowHandler()->formatInvalidLinkArray($invalidLink);
174 }
175 }
176
177 $this->addColumn($lng->txt('title'), 'title', '20%');
178 $this->addColumn($lng->txt('url'), 'url', '80%');
179 $this->addColumn('', '', '10%');
180 $this->setLimit(32000);
181 $this->setEnableHeader(true);
182 $this->setData($invalidLinks);
183
184 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), $this->getParentCmd()));
185 $this->setRowTemplate('tpl.link_checker_table_row.html', 'Services/LinkChecker');
186 $this->setEnableTitle(true);
187 $this->setEnableNumInfo(false);
188
190 $this->addCommandButton($refreshButton['cmd'], $refreshButton['txt']);
191
192 return $this;
193 }
194}
195?>
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
class ilLinkCheckerTableGUI
__construct(ilObjectGUI $parentGUIObject, $parentStdCmd)
Constructor.
getRowHandler()
Get the row handler.
setLinkChecker(ilLinkChecker $linkChecker)
Set the link checker instance.
prepareHTML()
Call this before using getHTML()
getLinkChecker()
Gget the link checker instance.
setRefreshButton($txt, $cmd)
Set refresh button attributes.
getRefreshButton()
get refresh button attributes
setRowHandler(ilLinkCheckerGUIRowHandling $rowHandler)
Set the row handler.
class for checking external links in page objects Normally used in Cron jobs, but should be extensibl...
Class ilObjectGUI Basic methods of all Output classes.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setEnableNumInfo($a_val)
Set enable num info.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
$txt
Definition: error.php:12
global $ilCtrl
Definition: ilias.php:18
interface ilLinkCheckerGUIRowHandling
global $lng
Definition: privfeed.php:40
$cmd
Definition: sahs_server.php:35