24 include_once
"./classes/class.ilObjectGUI.php";
48 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
52 $this->ctrl->saveParameter($this,array(
"ref_id",
"cmdClass"));
54 $this->lng->loadLanguageModule(
'webr');
62 if(
$_GET[
"baseClass"] ==
'ilLinkResourceHandlerGUI')
67 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
74 $next_class = $this->ctrl->getNextClass($this);
75 $cmd = $this->ctrl->getCmd();
79 case "ilinfoscreengui":
85 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
87 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
88 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
90 $this->ctrl->forwardCommand($md_gui);
93 case 'ilpermissiongui':
94 include_once(
"./classes/class.ilPermissionGUI.php");
96 $ret =& $this->ctrl->forwardCommand($perm_gui);
113 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
136 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
138 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
142 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
159 include_once
"./Services/Table/classes/class.ilTableGUI.php";
160 include_once
'./Modules/WebResource/classes/class.ilParameterAppender.php';
163 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
165 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
168 $this->
object->initLinkResourceItemsObject();
169 if(!count($items = $this->object->items_obj->getActivatedItems()))
176 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lnkr_view_items.html",
"Modules/WebResource");
179 #$items_sliced = array_slice($items, $_GET["offset"], $_GET["limit"]);
181 $tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.lnkr_view_items_row.html",
'Modules/WebResource');
185 $_GET[
'sort_order'] ?
$_GET[
'sort_order'] :
'asc');
187 foreach($items as $item_id => $item)
193 if(strlen($item[
'description']))
195 $tpl->setCurrentBlock(
"description");
196 $tpl->setVariable(
"DESCRIPTION",$item[
'description']);
197 $tpl->parseCurrentBlock();
199 $tpl->setCurrentBlock(
"row");
201 $tpl->setVariable(
"TITLE",$item[
'title']);
202 $tpl->setVariable(
"TARGET",$item[
'target']);
203 $tpl->parseCurrentBlock();
210 $tbl->setTitle($this->lng->txt(
"web_resources"),
"icon_webr.gif",$this->lng->txt(
"web_resources"));
211 $tbl->setHeaderNames(array($this->lng->txt(
"title")));
212 $tbl->setHeaderVars(array(
"title"),array(
"ref_id" => $this->object->getRefId(),
213 "cmd" =>
'listItems'));
214 $tbl->setColumnWidth(array(
"100%"));
215 $tbl->disable(
'linkbar');
216 $tbl->disable(
'numinfo');
218 $tbl->setOrderColumn(
'title');
219 $tbl->setOrderDirection($_GET[
'sort_order']);
220 $tbl->setLimit($_GET[
"limit"]);
221 $tbl->setOffset($_GET[
"offset"]);
222 $tbl->setMaxCount(count($items));
225 $tbl->setTemplate(
$tpl);
228 $this->tpl->setVariable(
"ITEM_TABLE",
$tpl->get());
237 include_once
"./Services/Table/classes/class.ilTableGUI.php";
238 include_once
'./Modules/WebResource/classes/class.ilParameterAppender.php';
242 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
244 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
247 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lnkr_edit_items.html",
"Modules/WebResource");
248 $this->
__showButton(
'showAddItem',$this->lng->txt(
'webr_add_item'));
250 $this->
object->initLinkResourceItemsObject();
251 if(!count($items = $this->object->items_obj->getAllItems()))
259 #$items_sliced = array_slice($items, $_GET["offset"], $_GET["limit"]);
261 $tpl->setCurrentBlock(
"tbl_form_header");
262 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
263 $tpl->parseCurrentBlock();
265 $tpl->setCurrentBlock(
"tbl_action_btn");
266 $tpl->setVariable(
"BTN_NAME",
'askDeleteItems');
267 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'delete'));
268 $tpl->parseCurrentBlock();
270 $tpl->setCurrentBlock(
"plain_buttons");
271 $tpl->setVariable(
"PBTN_NAME",
'updateItems');
272 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
'save'));
273 $tpl->parseCurrentBlock();
275 $tpl->setCurrentBlock(
"tbl_action_row");
278 $tpl->parseCurrentBlock();
282 $tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.lnkr_edit_items_row.html",
'Modules/WebResource');
285 $_GET[
'sort_by'] ?
$_GET[
'sort_by'] :
'title',
286 $_GET[
'sort_order'] ? $_GET[
'sort_order'] :
'asc');
289 foreach($items as $item_id => $item)
293 $params_list = array();
296 $txt_param = $param[
'name'];
297 switch($param[
'value'])
300 $txt_param .=
'=IL_USER_ID';
304 $txt_param .=
'=IL_SESSION_ID';
308 $txt_param .=
'=IL_LOGIN';
311 $params_list[] = $txt_param;
313 $tpl->setCurrentBlock(
"params");
314 $tpl->setVariable(
"DYN_PARAM",count($params_list) ?
315 implode(
'<br />',$params_list) :
316 $this->lng->txt(
'links_not_available'));
317 $tpl->parseCurrentBlock();
321 if(strlen($item[
'description']))
323 $tpl->setCurrentBlock(
"description");
324 $tpl->setVariable(
"DESCRIPTION",$item[
'description']);
325 $tpl->parseCurrentBlock();
328 $tpl->setCurrentBlock(
"row");
332 $tpl->setVariable(
"TITLE",$item[
'title']);
334 if($item[
'last_check'])
340 $last_check = $this->lng->txt(
'webr_never_checked');
342 $tpl->setVariable(
"TXT_LAST_CHECK",$this->lng->txt(
'webr_last_check_table'));
343 $tpl->setVariable(
"LAST_CHECK",$last_check);
345 $target = substr($item[
'target'],0,70);
346 if(strlen($item[
'target']) > 70)
348 $target = substr($item[
'target'],0,70).
'...';
352 $target = $item[
'target'];
357 $tpl->setVariable(
"TARGET",$target);
360 $tpl->setVariable(
"DISABLE_CHECK",
ilUtil::formCheckbox($item[
'disable_check'] ? 1 : 0,
'disable['.$item[
'link_id'].
']',1));
362 $tpl->setVariable(
"EDIT_ALT",$this->lng->txt(
'edit'));
364 $this->ctrl->setParameter($this,
'item_id',$item[
'link_id']);
365 $tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editItem'));
367 $tpl->parseCurrentBlock();
377 $tbl->setTitle($this->lng->txt(
"web_resources"),
"icon_webr.gif",$this->lng->txt(
"web_resources"));
381 $tbl->setHeaderNames(array(
'',
382 $this->lng->txt(
"title"),
383 $this->lng->txt(
"target"),
384 $this->lng->txt(
'valid'),
385 $this->lng->txt(
'active'),
386 $this->lng->txt(
'disable_check'),
387 $this->lng->txt(
'details')));
388 $tbl->setHeaderVars(array(
"",
394 ""),array(
"ref_id" => $this->object->getRefId(),
395 "cmd" =>
'editItems'));
396 $tbl->setColumnWidth(array(
"",
406 $tbl->setHeaderNames(array(
'',
407 $this->lng->txt(
"title"),
408 $this->lng->txt(
"target"),
409 $this->lng->txt(
"links_dyn_parameter"),
410 $this->lng->txt(
'valid'),
411 $this->lng->txt(
'active'),
412 $this->lng->txt(
'disable_check'),
413 $this->lng->txt(
'details')));
415 $tbl->setHeaderVars(array(
"",
422 ""),array(
"ref_id" => $this->object->getRefId(),
423 "cmd" =>
'editItems'));
424 $tbl->setColumnWidth(array(
"",
433 $tbl->disable(
'linkbar');
434 $tbl->disable(
'numinfo');
435 $tbl->enable(
'sort');
437 $tbl->setOrderColumn($_GET[
'sort_by']);
438 $tbl->setOrderDirection($_GET[
'sort_order']);
439 $tbl->setLimit($_GET[
"limit"]);
440 $tbl->setOffset($_GET[
"offset"]);
441 $tbl->setMaxCount(count($items));
444 $tbl->setTemplate(
$tpl);
447 $this->tpl->setVariable(
"ITEM_TABLE",
$tpl->get());
457 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
459 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
461 if(!count($_POST[
'item_id']))
470 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.lnkr_ask_delete.html',
'Modules/WebResource');
472 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
474 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'obj_webr'));
475 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'webr_delete_items'));
476 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'title'));
477 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
478 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
480 $this->
object->initLinkResourceItemsObject();
483 foreach($_POST[
'item_id'] as $id)
485 $this->
object->items_obj->readItem($id);
486 $this->tpl->setCurrentBlock(
"item_row");
487 $this->tpl->setVariable(
"ITEM_TITLE",$this->object->items_obj->getTitle());
488 $this->tpl->setVariable(
"TXT_TARGET",$this->lng->txt(
'target'));
489 $this->tpl->setVariable(
"TARGET",$this->object->items_obj->getTarget());
491 $this->tpl->parseCurrentBlock();
493 $_SESSION[
'webr_item_ids'] = $_POST[
'item_id'];
503 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
505 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
515 $this->
object->initLinkResourceItemsObject();
516 foreach(
$_SESSION[
'webr_item_ids'] as $id)
518 $this->
object->items_obj->delete($id);
532 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
534 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
536 $this->
object->initLinkResourceItemsObject();
537 foreach($this->object->items_obj->getAllItems() as $item)
541 $valid = (int) $_POST[
'valid'][$item[
'link_id']];
542 $active = (int) $_POST[
'active'][$item[
'link_id']];
543 $disable = (int) $_POST[
'disable'][$item[
'link_id']];
545 if(
$valid != $item[
'valid'] or
546 $active != $item[
'active'] or
547 $disable != $item[
'disable_check'])
549 $this->
object->items_obj->readItem($item[
'link_id']);
550 $this->
object->items_obj->setValidStatus(
$valid);
551 $this->
object->items_obj->setActiveStatus($active);
552 $this->
object->items_obj->setDisableCheckStatus($disable);
553 $this->
object->items_obj->update();
568 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
570 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
573 $this->
object->initLinkResourceItemsObject();
574 $item = $this->
object->items_obj->getItem(
$_GET[
'item_id'] ?
$_GET[
'item_id'] :
$_SESSION[
'webr_item_id']);
577 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.lnkr_edit_item.html',
'Modules/WebResource');
579 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
581 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'obj_webr'));
582 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'webr_edit_item'));
583 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
584 $this->tpl->setVariable(
"TXT_DESCRIPTION",$this->lng->txt(
'description'));
587 $this->tpl->setVariable(
"TXT_TARGET",$this->lng->txt(
'target'));
589 $this->tpl->setVariable(
"TXT_ACTIVE",$this->lng->txt(
'webr_active'));
590 $this->tpl->setVariable(
"ACTIVE_CHECK",
ilUtil::formCheckbox($item[
'active'] ? 1 : 0,
'active',1));
591 $this->tpl->setVariable(
"TXT_VALID",$this->lng->txt(
'valid'));
593 $this->tpl->setVariable(
"TXT_DISABLE",$this->lng->txt(
'disable_check'));
594 $this->tpl->setVariable(
"DISABLE_CHECK",
ilUtil::formCheckbox($item[
'disable_check'] ? 1 : 0,
'disable',1));
595 $this->tpl->setVariable(
"TXT_CREATED",$this->lng->txt(
'created'));
597 $this->tpl->setVariable(
"TXT_MODIFIED",$this->lng->txt(
'last_change'));
599 $this->tpl->setVariable(
"TXT_LAST_CHECK",$this->lng->txt(
'webr_last_check'));
602 include_once(
'./Modules/WebResource/classes/class.ilParameterAppender.php');
611 $this->tpl->setCurrentBlock(
"header_info");
612 $this->tpl->setVariable(
"TXT_PARAM_EXIST",$this->lng->txt(
'links_existing_params'));
613 $this->tpl->parseCurrentBlock();
615 $this->tpl->setCurrentBlock(
"show_params");
617 $txt_param = $param[
'name'];
618 switch($param[
'value'])
621 $txt_param .=
'=IL_USER_ID';
625 $txt_param .=
'=IL_SESSION_ID';
629 $txt_param .=
'=IL_LOGIN';
632 $this->tpl->setVariable(
"PARAMETER",$txt_param);
635 $this->ctrl->setParameter($this,
'param_id',$id);
636 $this->tpl->setVariable(
"DEL_TARGET",$this->ctrl->getLinkTarget($this,
'deleteParameter'));
637 $this->tpl->setVariable(
"TXT_DELETE",$this->lng->txt(
'delete'));
638 $this->tpl->parseCurrentBlock();
641 $this->tpl->setCurrentBlock(
"params");
642 $this->tpl->setVariable(
"TXT_ADD_PARAM",$this->lng->txt(
'links_add_param'));
643 $this->tpl->setVariable(
"TXT_DYNAMIC",$this->lng->txt(
'links_dynamic'));
644 $this->tpl->setVariable(
"TXT_NAME",$this->lng->txt(
'links_name'));
645 $this->tpl->setVariable(
"TXT_VALUE",$this->lng->txt(
'links_value'));
646 $this->tpl->setVariable(
"DYNAMIC_INFO",$this->lng->txt(
'link_dynamic_info'));
654 $this->tpl->parseCurrentBlock();
659 if($item[
'last_check'])
665 $last_check = $this->lng->txt(
'webr_never_checked');
668 $this->tpl->setVariable(
"LAST_CHECK",$last_check);
669 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
670 $this->tpl->setVariable(
"BTN_UPDATE",$this->lng->txt(
'save'));
672 $_SESSION[
'webr_item_id'] =
$_GET[
'item_id'] ?
$_GET[
'item_id'] : $_SESSION[
'webr_item_id'];
679 if(!((
int)
$_GET[
'param_id']))
687 include_once
'./Modules/WebResource/classes/class.ilParameterAppender.php';
690 $appender->
delete((
int) $_GET[
'param_id']);
701 include_once
'./Modules/WebResource/classes/class.ilParameterAppender.php';
706 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
708 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
710 if(!$_POST[
'title'] or $_POST[
'target'] ==
'http://')
723 if(!$appender->validate())
725 switch($appender->getErrorCode())
743 $this->
object->initLinkResourceItemsObject();
745 $this->
object->items_obj->readItem(
$_SESSION[
'webr_item_id']);
746 $this->
object->items_obj->setLinkId(
$_SESSION[
'webr_item_id']);
750 $this->
object->items_obj->setActiveStatus($_POST[
'active']);
751 $this->
object->items_obj->setValidStatus($_POST[
'valid']);
752 $this->
object->items_obj->setDisableCheckStatus($_POST[
'disable']);
753 $this->
object->items_obj->update();
755 if(is_object($appender))
757 $appender->add(
$_SESSION[
'webr_item_id']);
773 $this->tabs_gui->setTabActive(
'edit_content');
776 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
778 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
782 $target = $_POST[
'target'] ? ilUtil::prepareFormOutput($_POST[
'target'],
true) :
'http://';
785 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lnkr_add_item.html",
"Modules/WebResource");
787 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
788 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
'webr_add_item'));
789 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
790 $this->tpl->setVariable(
"TXT_DESC",$this->lng->txt(
'description'));
791 $this->tpl->setVariable(
"TXT_TARGET",$this->lng->txt(
'target'));
792 $this->tpl->setVariable(
"TARGET",$target);
793 $this->tpl->setVariable(
"TXT_ACTIVE",$this->lng->txt(
'active'));
794 $this->tpl->setVariable(
"TXT_CHECK",$this->lng->txt(
'webr_disable_check'));
795 $this->tpl->setVariable(
"TXT_REQUIRED_FLD",$this->lng->txt(
'required_field'));
796 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
797 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
'add'));
798 $this->tpl->setVariable(
"CMD_SUBMIT",
'addItem');
799 $this->tpl->setVariable(
"CMD_CANCEL",
'editItems');
802 include_once(
'./Modules/WebResource/classes/class.ilParameterAppender.php');
806 $this->tpl->setCurrentBlock(
"params");
807 $this->tpl->setVariable(
"TXT_DYNAMIC",$this->lng->txt(
'links_dynamic'));
808 $this->tpl->setVariable(
"TXT_NAME",$this->lng->txt(
'links_name'));
809 $this->tpl->setVariable(
"TXT_VALUE",$this->lng->txt(
'links_value'));
810 $this->tpl->setVariable(
"DYNAMIC_INFO",$this->lng->txt(
'links_dynamic_info'));
812 $this->tpl->setVariable(
"NAME",$_POST[
'name'] ? ilUtil::prepareFormOutput($_POST[
'name'],
true) :
'');
818 $this->tpl->parseCurrentBlock();
821 $this->tpl->setVariable(
"ACTIVE_CHECK",ilUtil::formCheckBox(1,
'active',1));
822 $this->tpl->setVariable(
"CHECK_CHECK",ilUtil::formCheckBox(0,
'disable_check',1));
828 include_once(
'./Modules/WebResource/classes/class.ilParameterAppender.php');
833 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
835 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
838 $this->
object->initLinkResourceItemsObject();
840 if(!$_POST[
'title'] or $_POST[
'target'] ==
'http://')
853 if(!$appender->validate())
855 switch($appender->getErrorCode())
875 $this->
object->items_obj->setActiveStatus($_POST[
'active']);
876 $this->
object->items_obj->setDisableCheckStatus($_POST[
'disable_check']);
877 $link_id = $this->
object->items_obj->add();
879 if(is_object($appender))
881 $appender->add($link_id);
893 $this->ctrl->setCmd(
"showSummary");
894 $this->ctrl->setCmdClass(
"ilinfoscreengui");
905 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
907 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
910 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
913 $info->enablePrivateNotes();
916 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
919 $this->ctrl->forwardCommand($info);
927 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
929 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
932 include_once(
"classes/class.ilHistoryGUI.php");
938 "cmdClass" =>
$_GET[
"cmdClass"],
939 "cmdNode" =>
$_GET[
"cmdNode"]));
941 $this->tpl->setVariable(
"ADM_CONTENT", $hist_html);
965 ilUtil::redirect(
"ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$newObj->getRefId().
977 $this->
object->initLinkResourceItemsObject();
979 $invalid_links = $this->link_checker_obj->getInvalidLinksFromDB();
982 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.link_check.html",
'Modules/WebResource');
984 if($last_access = $this->link_checker_obj->getLastCheckTimestamp())
986 $this->tpl->setCurrentBlock(
"LAST_MODIFIED");
987 $this->tpl->setVariable(
"AS_OF",$this->lng->txt(
'last_change').
": ");
989 $this->tpl->parseCurrentBlock();
993 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
996 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_webr'));
997 $this->tpl->setVariable(
"TITLE",$this->object->getTitle().
' ('.$this->lng->txt(
'link_check').
')');
998 $this->tpl->setVariable(
"PAGE_TITLE",$this->lng->txt(
'title'));
999 $this->tpl->setVariable(
"URL",$this->lng->txt(
'url'));
1000 $this->tpl->setVariable(
"OPTIONS",$this->lng->txt(
'edit'));
1002 if(!count($invalid_links))
1004 $this->tpl->setCurrentBlock(
"no_invalid");
1005 $this->tpl->setVariable(
"TXT_NO_INVALID",$this->lng->txt(
'no_invalid_links'));
1006 $this->tpl->parseCurrentBlock();
1011 foreach($invalid_links as $invalid)
1013 $this->
object->items_obj->readItem($invalid[
'page_id']);
1015 $this->tpl->setCurrentBlock(
"invalid_row");
1017 $this->tpl->setVariable(
"ROW_PAGE_TITLE",$this->object->items_obj->getTitle());
1018 $this->tpl->setVariable(
"ROW_URL",$invalid[
'url']);
1022 $this->ctrl->setParameter($this,
'item_id',$invalid[
'page_id']);
1023 $this->tpl->setVariable(
"ROW_EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editItem'));
1025 $this->tpl->setVariable(
"ROW_ALT_IMG",$this->lng->txt(
'edit'));
1026 $this->tpl->parseCurrentBlock();
1029 if((
bool) $ilias->getSetting(
'cron_web_resource_check'))
1031 include_once
'./classes/class.ilLinkCheckNotify.php';
1034 $this->tpl->setCurrentBlock(
"MESSAGE_BLOCK");
1035 $this->tpl->setVariable(
"INFO_MESSAGE",$this->lng->txt(
'link_check_message_a'));
1038 'link_check_message',
1040 $this->tpl->setVariable(
"INFO_MESSAGE_LONG",$this->lng->txt(
'link_check_message_b'));
1041 $this->tpl->parseCurrentBlock();
1044 $this->tpl->setCurrentBlock(
"CRON_ENABLED");
1046 $this->tpl->setVariable(
"BTN_SUBMIT_LINK_CHECK",$this->lng->txt(
'save'));
1047 $this->tpl->parseCurrentBlock();
1049 $this->tpl->setVariable(
"BTN_REFRESH",$this->lng->txt(
'refresh'));
1056 global $ilDB,$ilUser;
1058 include_once
'./classes/class.ilLinkCheckNotify.php';
1061 $link_check_notify->setUserId($ilUser->getId());
1062 $link_check_notify->setObjId($this->object->getId());
1064 if($_POST[
'link_check_message'])
1067 $link_check_notify->addNotifier();
1072 $link_check_notify->deleteNotifier();
1085 if(!$this->link_checker_obj->checkPear())
1094 $this->
object->initLinkResourceItemsObject();
1097 $this->
object->items_obj->updateValidByCheck();
1099 foreach($this->link_checker_obj->checkWebResourceLinks() as $invalid)
1101 $this->
object->items_obj->readItem($invalid[
'page_id']);
1102 $this->
object->items_obj->setActiveStatus(
false);
1103 $this->
object->items_obj->setValidStatus(
false);
1104 $this->
object->items_obj->update(
false);
1107 $this->
object->items_obj->updateLastCheck();
1119 include_once
'./classes/class.ilLinkChecker.php';
1122 $this->link_checker_obj->setObjId($this->object->getId());
1133 global $rbacsystem,$rbacreview,$ilAccess;
1135 if ($ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
1137 $tabs_gui->addTarget(
"view_content",
1138 $this->ctrl->getLinkTarget($this,
"view"), array(
"",
"view"),
1139 array(strtolower(get_class($this)),
""));
1142 if ($rbacsystem->checkAccess(
'write',$this->object->getRefId()))
1144 $tabs_gui->addTarget(
"edit_content",
1145 $this->ctrl->getLinkTarget($this,
"editItems"),
1146 array(
"editItems",
"addItem",
"deleteItems",
"editItem",
"updateItem"),
1150 if ($ilAccess->checkAccess(
'visible',
'',$this->ref_id))
1155 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilinfoscreengui"
1156 ||
$_GET[
"cmd"] ==
"infoScreen"
1157 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
1160 $tabs_gui->addTarget(
"info_short",
1161 $this->ctrl->getLinkTargetByClass(
1162 array(
"ilobjlinkresourcegui",
"ilinfoscreengui"),
"showSummary"),
1164 "",
"", $force_active);
1167 if ($rbacsystem->checkAccess(
'write',$this->object->getRefId()))
1169 $tabs_gui->addTarget(
"meta_data",
1170 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
1171 "",
'ilmdeditorgui');
1174 if ($rbacsystem->checkAccess(
'write',$this->object->getRefId()))
1176 $tabs_gui->addTarget(
"history",
1177 $this->ctrl->getLinkTarget($this,
"history"),
"history", get_class($this));
1180 if ($rbacsystem->checkAccess(
'write',$this->object->getRefId()))
1183 if(@include_once(
'HTTP/Request.php'))
1185 $tabs_gui->addTarget(
"link_check",
1186 $this->ctrl->getLinkTarget($this,
"linkChecker"),
1187 array(
"linkChecker",
"refreshLinkCheck"), get_class($this));
1191 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1193 $tabs_gui->addTarget(
"perm_settings",
1194 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1203 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
1204 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1224 include_once
'./classes/class.ilTabsGUI.php';
1226 $this->tpl->setCurrentBlock(
"header_image");
1228 $this->tpl->parseCurrentBlock();
1229 $this->tpl->setVariable(
"HEADER",$this->object->getTitle());
1230 $this->tpl->setVariable(
"H_DESCRIPTION",$this->object->getDescription());
1232 #$tabs_gui =& new ilTabsGUI();
1233 $this->
getTabs($this->tabs_gui);
1236 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
1242 global $ilias_locator,
$lng;
1244 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html");
1251 foreach ($tree->getPathFull($this->object->getRefId()) as $key => $row)
1261 $this->tpl->touchBlock(
'locator_separator_prefix');
1264 if ($row[
"child"] > 0)
1266 $this->tpl->setCurrentBlock(
"locator_img");
1267 $this->tpl->setVariable(
"IMG_SRC",
1269 $this->tpl->setVariable(
"IMG_ALT",
1270 $lng->txt(
"obj_".$type));
1271 $this->tpl->parseCurrentBlock();
1274 $this->tpl->setCurrentBlock(
"locator_item");
1276 if($row[
"type"] ==
'webr')
1278 $this->tpl->setVariable(
"ITEM",$this->object->getTitle());
1279 $this->tpl->setVariable(
"LINK_ITEM",$this->ctrl->getLinkTarget($this));
1281 elseif ($row[
"child"] != $tree->getRootId())
1283 $this->tpl->setVariable(
"ITEM", $row[
"title"]);
1284 $this->tpl->setVariable(
"LINK_ITEM",
"./repository.php?ref_id=".$row[
"child"]);
1288 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"repository"));
1289 $this->tpl->setVariable(
"LINK_ITEM",
"./repository.php?ref_id=".$row[
"child"]);
1292 $this->tpl->parseCurrentBlock();
1295 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
1296 $this->tpl->parseCurrentBlock();
1304 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1306 ilUtil::redirect(
"ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=$a_target");
1311 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1313 ilUtil::redirect(
"ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$a_target.
"&cmd=infoScreen");
1317 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1319 $_GET[
"cmd"] =
"frameset";
1320 $_GET[
"target"] =
"";
1321 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1324 include(
"repository.php");
1330 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);