/**
  * edit ("view" before)
  */
 function edit()
 {
     global $tree, $lng, $ilCtrl, $ilSetting, $ilUser;
     // editing allowed?
     if (!$this->getEnableEditing()) {
         ilUtil::sendFailure($lng->txt("permission_denied"), true);
         $ilCtrl->redirect($this, "preview");
     }
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     if ($ilUser->isAnonymous() && !$ilUser->isCaptchaVerified() && ilCaptchaUtil::isActiveForWiki()) {
         $form = $this->initCaptchaForm();
         if ($_POST['captcha_code'] && $form->checkInput()) {
             $ilUser->setCaptchaVerified(true);
         } else {
             return $form->getHTML();
         }
     }
     // edit lock
     if (!$this->getPageObject()->getEditLock()) {
         $info = $lng->txt("content_no_edit_lock");
         include_once "./Services/User/classes/class.ilUserUtil.php";
         $lock = $this->getPageObject()->getEditLockInfo();
         $info .= "</br>" . $lng->txt("content_until") . ": " . ilDatePresentation::formatDate(new ilDateTime($lock["edit_lock_until"], IL_CAL_UNIX));
         $info .= "</br>" . $lng->txt("obj_usr") . ": " . ilUserUtil::getNamePresentation($lock["edit_lock_user"]);
         ilUtil::sendInfo($info);
         return "";
     }
     $this->setOutputMode(IL_PAGE_EDIT);
     $html = $this->showPage();
     if ($this->isEnabledNotes()) {
         $html .= "<br /><br />" . $this->getNotesHTML();
     }
     return $html;
 }
 /**
  * edit ("view" before)
  */
 function edit()
 {
     global $tree, $lng, $ilCtrl, $ilSetting, $ilUser, $ilHelp;
     // editing allowed?
     if (!$this->getEnableEditing()) {
         ilUtil::sendFailure($lng->txt("permission_denied"), true);
         $ilCtrl->redirect($this, "preview");
     }
     $ilHelp->setScreenId("edit_" . $this->getParentType());
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     if ($ilUser->isAnonymous() && !$ilUser->isCaptchaVerified() && ilCaptchaUtil::isActiveForWiki()) {
         $form = $this->initCaptchaForm();
         if ($_POST['captcha_code'] && $form->checkInput()) {
             $ilUser->setCaptchaVerified(true);
         } else {
             return $form->getHTML();
         }
     }
     // edit lock
     if (!$this->getPageObject()->getEditLock()) {
         $info = $lng->txt("content_no_edit_lock");
         include_once "./Services/User/classes/class.ilUserUtil.php";
         $lock = $this->getPageObject()->getEditLockInfo();
         $info .= "</br>" . $lng->txt("content_until") . ": " . ilDatePresentation::formatDate(new ilDateTime($lock["edit_lock_until"], IL_CAL_UNIX));
         $info .= "</br>" . $lng->txt("obj_usr") . ": " . ilUserUtil::getNamePresentation($lock["edit_lock_user"]);
         ilUtil::sendInfo($info);
         return "";
     } else {
         $aset = new ilSetting("adve");
         $min = (int) $aset->get("block_mode_minutes");
         if ($min > 0) {
             $info = $lng->txt("cont_got_lock");
             include_once "./Services/User/classes/class.ilUserUtil.php";
             $lock = $this->getPageObject()->getEditLockInfo();
             //$info.= "</br>".$lng->txt("content_until").": ".
             //	ilDatePresentation::formatDate(new ilDateTime($lock["edit_lock_until"],IL_CAL_UNIX));
             //$info.= "</br>".$lng->txt("obj_usr").": ".
             //	ilUserUtil::getNamePresentation($lock["edit_lock_user"]);
             $info .= " <a class='small submit' href='" . $ilCtrl->getLinkTarget($this, "releasePageLock") . "'>" . $lng->txt("cont_finish_editing") . "</a>";
             ilUtil::sendInfo($info);
         }
     }
     $this->setOutputMode(IL_PAGE_EDIT);
     $html = $this->showPage();
     if ($this->isEnabledNotes()) {
         $html .= "<br /><br />" . $this->getNotesHTML();
     }
     return $html;
 }
 /**
  * @param string $a_form_id
  * @return array
  */
 public function addToExternalSettingsForm($a_form_id)
 {
     switch ($a_form_id) {
         case ilAdministrationSettingsFormHandler::FORM_ACCESSIBILITY:
             require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
             $fields = array('adm_captcha_anonymous_short' => array(ilCaptchaUtil::isActiveForWiki(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
             return array('obj_wiks' => array('editSettings', $fields));
     }
 }