Esempio n. 1
0
 /**
  * Link check test 
  * @param
  * @return
  */
 public function testLinkCheck()
 {
     global $ilDB;
     include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
     $not = new ilLinkCheckNotify($ilDB);
     $not->setObjId(99999);
     $not->setUserId(13);
     $ret = $not->addNotifier();
     $this->assertEquals($ret, true);
     $status = ilLinkCheckNotify::_getNotifyStatus(13, 99999);
     $this->assertEquals($status, true);
     $notifiers = ilLinkCheckNotify::_getNotifiers(99999);
     $this->assertEquals($notifiers, array(13));
     $del = ilLinkCheckNotify::_deleteObject(99999);
     $this->assertEquals($del, true);
 }
 function linkChecker()
 {
     global $ilias, $ilUser, $tpl;
     $this->__initLinkChecker();
     $this->setTabs();
     $this->setContentSubTabs("link_check");
     require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
     $toolbar = new ilToolbarGUI();
     if ((bool) $ilias->getSetting('cron_web_resource_check')) {
         include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
         include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
         $chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message');
         $chb->setValue(1);
         $chb->setChecked((bool) ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(), $this->object->getId()));
         $chb->setOptionTitle($this->lng->txt('link_check_message_b'));
         $toolbar->addInputItem($chb);
         $toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck');
         $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck'));
     }
     $tgui = new ilLinkCheckerTableGUI($this, 'linkChecker');
     $tgui->setLinkChecker($this->link_checker_obj)->setRowHandler($this)->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck');
     return $tpl->setContent($tgui->prepareHTML()->getHTML() . $toolbar->getHTML());
 }