コード例 #1
0
 /**
  * Save form input (currently does not save anything to db)
  *
  */
 public function save()
 {
     global $tpl, $lng, $ilCtrl, $ilDB;
     $pl = $this->getPluginObject();
     $form = $this->initConfigurationForm();
     if ($form->checkInput()) {
         // Get submitted data
         $ephorus_logging = $form->getInput("ephorus_logging");
         $handin_code = $form->getInput("handin_code");
         $handin_address = $form->getInput("handin_address");
         $index_address = $form->getInput("index_address");
         $processtype = $form->getInput("processtype");
         $disclosure = $form->getInput("disclosure");
         // Saving to the database.
         $ilDB->manipulate($up = "UPDATE settings SET" . " value = " . $ilDB->quote($ephorus_logging, "integer") . " WHERE module = " . $ilDB->quote("rep_robj_xeph", "text") . " AND keyword = " . $ilDB->quote("ephorus_logging", "text"));
         $ilDB->manipulate($up = "UPDATE settings SET" . " value = " . $ilDB->quote($handin_code, "text") . " WHERE module = " . $ilDB->quote("rep_robj_xeph", "text") . " AND keyword = " . $ilDB->quote("handin_code", "text"));
         $ilDB->manipulate($up = "UPDATE settings SET" . " value = " . $ilDB->quote($handin_address, "text") . " WHERE module = " . $ilDB->quote("rep_robj_xeph", "text") . " AND keyword = " . $ilDB->quote("handin_address", "text"));
         $ilDB->manipulate($up = "UPDATE settings SET" . " value = " . $ilDB->quote($index_address, "text") . " WHERE module = " . $ilDB->quote("rep_robj_xeph", "text") . " AND keyword = " . $ilDB->quote("index_address", "text"));
         $ilDB->manipulate($up = "UPDATE settings SET" . " value = " . $ilDB->quote($processtype, "integer") . " WHERE module = " . $ilDB->quote("rep_robj_xeph", "text") . " AND keyword = " . $ilDB->quote("processtype", "text"));
         $ilDB->manipulate($up = "UPDATE settings SET" . " value = " . $ilDB->quote($disclosure, "text") . " WHERE module = " . $ilDB->quote("rep_robj_xeph", "text") . " AND keyword = " . $ilDB->quote("disclosure", "text"));
         ilUtil::sendInfo($pl->txt("saving_invoked"), true);
         include "Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/include/class.EphorusApi.php";
         $status = new EphorusStatus();
         $connection = $status->connectivityTest();
         if ($connection["handin"] && $connection["index"]) {
             ilUtil::sendSuccess($pl->txt("handin_index_okay"), true);
         } elseif ($connection["handin"]) {
             ilUtil::sendSuccess($pl->txt("handin_okay"), true);
             ilUtil::sendFailure($pl->txt("index_not_okay"), true);
         } elseif ($connection["index"]) {
             ilUtil::sendSuccess($pl->txt("index_okay"), true);
             ilUtil::sendFailure($pl->txt("handin_not_okay"), true);
         } else {
             ilUtil::sendFailure($pl->txt("handin_index_not_okay"), true);
         }
         $ilCtrl->redirect($this, "configure");
     } else {
         $form->setValuesByPost();
         $tpl->setContent($form->getHtml());
     }
 }