00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00035 require_once "class.ilObjectGUI.php";
00036
00037 class ilObjSystemFolderGUI extends ilObjectGUI
00038 {
00044 var $type;
00045
00050 function ilObjSystemFolderGUI($a_data,$a_id,$a_call_by_reference)
00051 {
00052 $this->type = "adm";
00053 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference);
00054
00055 $this->lng->loadLanguageModule("administration");
00056 }
00057
00063 function viewObject()
00064 {
00065 global $rbacsystem, $styleDefinition;
00066
00067 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
00068 {
00069 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00070 }
00071
00072
00073 $this->objectList = array();
00074 $this->data["data"] = array();
00075 $this->data["ctrl"] = array();
00076 $this->data["cols"] = array("type", "title", "last_change");
00077
00078 $childs = $this->tree->getChilds($this->object->getRefId(),$_GET["order"],$_GET["direction"]);
00079
00080 foreach ($childs as $key => $val)
00081 {
00082
00083 if (!$rbacsystem->checkAccess("visible",$val["ref_id"]))
00084 {
00085 continue;
00086 }
00087
00088
00089 if ($this->objDefinition->getDevMode($val["type"]))
00090 {
00091 continue;
00092 }
00093
00094
00095 if ($val["ref_id"] == RECOVERY_FOLDER_ID and !$this->tree->getChilds(RECOVERY_FOLDER_ID))
00096 {
00097 continue;
00098 }
00099
00100
00101 $this->data["data"][] = array(
00102 "type" => $val["type"],
00103 "title" => $val["title"]."#separator#".$val["desc"],
00104
00105 "last_change" => $val["last_update"],
00106 "ref_id" => $val["ref_id"]
00107 );
00108
00109
00110
00111 }
00112
00113 $this->maxcount = count($this->data["data"]);
00114
00115
00116 $this->data["data"] = ilUtil::sortArray($this->data["data"],$_GET["sort_by"],$_GET["sort_order"]);
00117
00118
00119 foreach ($this->data["data"] as $key => $val)
00120 {
00121 $this->data["ctrl"][$key] = array(
00122 "type" => $val["type"],
00123 "ref_id" => $val["ref_id"]
00124 );
00125
00126 unset($this->data["data"][$key]["ref_id"]);
00127 $this->data["data"][$key]["last_change"] = ilFormat::formatDate($this->data["data"][$key]["last_change"]);
00128 }
00129
00130
00131 $this->displayList();
00132
00133
00134 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
00135 {
00136 $this->displayBasicSettings();
00137 }
00138 }
00139
00145 function displayList()
00146 {
00147 global $rbacsystem;
00148
00149 include_once "./classes/class.ilTableGUI.php";
00150
00151
00152 $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
00153
00154 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
00155
00156 $num = 0;
00157
00158 $obj_str = ($this->call_by_reference) ? "" : "&obj_id=".$this->obj_id;
00159 $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."$obj_str&cmd=gateway");
00160
00161
00162 $tbl = new ilTableGUI();
00163
00164
00165 $tbl->setTitle($this->lng->txt("obj_".$this->object->getType()),"icon_".$this->object->getType()."_b.gif",$this->lng->txt("obj_".$this->object->getType()));
00166 $tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
00167
00168 foreach ($this->data["cols"] as $val)
00169 {
00170 $header_names[] = $this->lng->txt($val);
00171 }
00172
00173 $tbl->setHeaderNames($header_names);
00174
00175 $header_params = array("ref_id" => $this->ref_id);
00176 $tbl->setHeaderVars($this->data["cols"],$header_params);
00177 $tbl->setColumnWidth(array("15","75%","25%"));
00178
00179
00180 $tbl->setOrderColumn($_GET["sort_by"]);
00181 $tbl->setOrderDirection($_GET["sort_order"]);
00182 $tbl->setLimit(0);
00183 $tbl->setOffset(0);
00184 $tbl->setMaxCount($this->maxcount);
00185
00186
00187 $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
00188 $tbl->disable("numinfo");
00189
00190
00191 $tbl->render();
00192
00193 if (is_array($this->data["data"][0]))
00194 {
00195
00196 for ($i=0; $i < count($this->data["data"]); $i++)
00197 {
00198 $data = $this->data["data"][$i];
00199 $ctrl = $this->data["ctrl"][$i];
00200
00201
00202 $css_row = ilUtil::switchColor($i+1,"tblrow1","tblrow2");
00203
00204 $this->tpl->setCurrentBlock("table_cell");
00205 $this->tpl->setVariable("CELLSTYLE", "tblrow1");
00206 $this->tpl->parseCurrentBlock();
00207
00208 foreach ($data as $key => $val)
00209 {
00210
00211 $link = "adm_object.php?";
00212
00213 $n = 0;
00214
00215 foreach ($ctrl as $key2 => $val2)
00216 {
00217 $link .= $key2."=".$val2;
00218
00219 if ($n < count($ctrl)-1)
00220 {
00221 $link .= "&";
00222 $n++;
00223 }
00224 }
00225
00226 if ($key == "title")
00227 {
00228 $name_field = explode("#separator#",$val);
00229 }
00230
00231 if ($key == "title" || $key == "type")
00232 {
00233 $this->tpl->setCurrentBlock("begin_link");
00234 $this->tpl->setVariable("LINK_TARGET", $link);
00235
00236 $this->tpl->parseCurrentBlock();
00237 $this->tpl->touchBlock("end_link");
00238 }
00239
00240 $this->tpl->setCurrentBlock("text");
00241
00242 if ($key == "type")
00243 {
00244 $val = ilUtil::getImageTagByType($val,$this->tpl->tplPath);
00245 }
00246
00247 if ($key == "title")
00248 {
00249 $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
00250
00251 $this->tpl->setCurrentBlock("subtitle");
00252 $this->tpl->setVariable("DESC", $name_field[1]);
00253 $this->tpl->parseCurrentBlock();
00254 }
00255 else
00256 {
00257 $this->tpl->setVariable("TEXT_CONTENT", $val);
00258 }
00259
00260 $this->tpl->parseCurrentBlock();
00261
00262 $this->tpl->setCurrentBlock("table_cell");
00263 $this->tpl->parseCurrentBlock();
00264
00265 }
00266
00267 $this->tpl->setCurrentBlock("tbl_content");
00268 $this->tpl->setVariable("CSS_ROW", $css_row);
00269 $this->tpl->parseCurrentBlock();
00270 }
00271
00272 }
00273 else
00274 {
00275 $this->tpl->setCurrentBlock("notfound");
00276 $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
00277 $this->tpl->setVariable("NUM_COLS", $num);
00278 $this->tpl->parseCurrentBlock();
00279 }
00280 }
00281
00287 function displayBasicSettings()
00288 {
00289 global $rbacsystem, $styleDefinition;
00290
00291 $this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.adm_basicdata.html");
00292 $this->tpl->setCurrentBlock("systemsettings");
00293
00294 $settings = $this->ilias->getAllSettings();
00295
00296 if (isset($_POST["save_settings"]))
00297 {
00298
00299 $form_valid = true;
00300
00301 if($_POST['https'])
00302 {
00303 include_once './classes/class.ilHTTPS.php';
00304
00305 if(!ilHTTPS::_checkHTTPS())
00306 {
00307 sendInfo($this->lng->txt('https_not_possible'));
00308 $form_valid = false;
00309 }
00310 if(!ilHTTPS::_checkHTTP())
00311 {
00312 sendInfo($this->lng->txt('http_not_possible'));
00313 $form_valid = false;
00314 }
00315 }
00316
00317
00318 if (empty($_POST["admin_firstname"]) or empty($_POST["admin_lastname"])
00319 or empty($_POST["admin_street"]) or empty($_POST["admin_zipcode"])
00320 or empty($_POST["admin_country"]) or empty($_POST["admin_city"])
00321 or empty($_POST["admin_phone"]) or empty($_POST["admin_email"]))
00322 {
00323
00324 sendInfo($this->lng->txt("fill_out_all_required_fields"));
00325 $form_valid = false;
00326 }
00327
00328
00329 if (!ilUtil::is_email($_POST["feedback_recipient"]) and !empty($_POST["feedback_recipient"]) and $form_valid)
00330 {
00331 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("feedback_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
00332 $form_valid = false;
00333 }
00334
00335
00336 if (!ilUtil::is_email($_POST["error_recipient"]) and !empty($_POST["error_recipient"]) and $form_valid)
00337 {
00338 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("error_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
00339 $form_valid = false;
00340 }
00341
00342
00343 if (!ilUtil::is_email($_POST["admin_email"]) and $form_valid)
00344 {
00345 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("email")."'<br/>".$this->lng->txt("email_not_valid"));
00346 $form_valid = false;
00347 }
00348
00349
00350 foreach ($_POST as $key => $val)
00351 {
00352 $_POST[$key] = ilUtil::prepareFormOutput($val,true);
00353 }
00354
00355 if (!$form_valid)
00356 {
00358
00359
00360
00361 $settings["feedback_recipient"] = $_POST["feedback_recipient"];
00362 $settings["error_recipient"] = $_POST["error_recipient"];
00363
00364
00365 $settings["pub_section"] = $_POST["pub_section"];
00366 $settings["password_assistance"] = $_POST["password_assistance"];
00367 $settings["js_edit"] = $_POST["js_edit"];
00368 $settings["enable_registration"] = $_POST["enable_registration"];
00369 $settings["passwd_auto_generate"] = $_POST["passwd_auto_generate"];
00370 $settings["https"] = $_POST["https"];
00371
00372
00373 $settings["admin_firstname"] = $_POST["admin_firstname"];
00374 $settings["admin_lastname"] = $_POST["admin_lastname"];
00375 $settings["admin_title"] = $_POST["admin_title"];
00376 $settings["admin_position"] = $_POST["admin_position"];
00377 $settings["admin_institution"] = $_POST["admin_institution"];
00378 $settings["admin_street"] = $_POST["admin_street"];
00379 $settings["admin_zipcode"] = $_POST["admin_zipcode"];
00380 $settings["admin_city"] = $_POST["admin_city"];
00381 $settings["admin_country"] = $_POST["admin_country"];
00382 $settings["admin_phone"] = $_POST["admin_phone"];
00383 $settings["admin_email"] = $_POST["admin_email"];
00384
00385
00386 $settings["enable_registration"] = $_POST["enable_registration"];
00387
00388
00389 $settings["cron_user_check"] = $_POST["cron_user_check"];
00390 $settings["cron_link_check"] = $_POST["cron_link_check"];
00391
00392
00393 $settings["soap_user_administration"] = $_POST["soap_user_administration"];
00394 }
00395 else
00396 {
00397
00399
00400
00401
00402 $this->ilias->setSetting("feedback_recipient",$_POST["feedback_recipient"]);
00403 $this->ilias->setSetting("error_recipient",$_POST["error_recipient"]);
00404 $this->ilias->ini->setVariable("language","default",$_POST["default_language"]);
00405
00406
00407 if ($_POST["default_skin_style"] != "")
00408 {
00409 $sknst = explode(":", $_POST["default_skin_style"]);
00410
00411 if ($this->ilias->ini->readVariable("layout","style") != $sknst[1] ||
00412 $this->ilias->ini->readVariable("layout","skin") != $sknst[0])
00413 {
00414 $this->ilias->ini->setVariable("layout","skin", $sknst[0]);
00415 $this->ilias->ini->setVariable("layout","style",$sknst[1]);
00416 }
00417 }
00418
00419 if ($_POST["open_views_inside_frameset"] == "1")
00420 {
00421 $this->ilias->ini->setVariable("layout","view_target","frame");
00422 }
00423 else
00424 {
00425 $this->ilias->ini->setVariable("layout","view_target","window");
00426 }
00427
00428
00429 $this->ilias->setSetting("pub_section",$_POST["pub_section"]);
00430 $this->ilias->setSetting("enable_registration",$_POST["enable_registration"]);
00431 $this->ilias->setSetting("passwd_auto_generate",$_POST["passwd_auto_generate"]);
00432 $this->ilias->setSetting('https',$_POST['https']);
00433 $this->ilias->setSetting('password_assistance',$_POST['password_assistance']);
00434 $this->ilias->setSetting('enable_js_edit',$_POST['js_edit']);
00435
00436
00437 $this->ilias->setSetting("admin_firstname",$_POST["admin_firstname"]);
00438 $this->ilias->setSetting("admin_lastname",$_POST["admin_lastname"]);
00439 $this->ilias->setSetting("admin_title",$_POST["admin_title"]);
00440 $this->ilias->setSetting("admin_position",$_POST["admin_position"]);
00441 $this->ilias->setSetting("admin_institution",$_POST["admin_institution"]);
00442 $this->ilias->setSetting("admin_street",$_POST["admin_street"]);
00443 $this->ilias->setSetting("admin_zipcode",$_POST["admin_zipcode"]);
00444 $this->ilias->setSetting("admin_city",$_POST["admin_city"]);
00445 $this->ilias->setSetting("admin_country",$_POST["admin_country"]);
00446 $this->ilias->setSetting("admin_phone",$_POST["admin_phone"]);
00447 $this->ilias->setSetting("admin_email",$_POST["admin_email"]);
00448
00449
00450 $this->ilias->setSetting("enable_registration",$_POST["enable_registration"]);
00451
00452
00453 $_POST["require_default_role"] = 1;
00454 $_POST["require_email"] = 1;
00455 $_POST["require_firstname"] = 1;
00456 $_POST["require_gender"] = 1;
00457 $_POST["require_lastname"] = 1;
00458 $_POST["require_login"] = 1;
00459 $_POST["require_passwd"] = 1;
00460 $_POST["require_passwd2"] = 1;
00461
00462
00463 $this->ilias->setSetting("auto_registration",$_POST["auto_registration"]);
00464 $this->ilias->setSetting("approve_recipient",$_POST["approve_recipient"]);
00465 $this->ilias->setSetting("require_city",$_POST["require_city"]);
00466 $this->ilias->setSetting("require_country",$_POST["require_country"]);
00467 $this->ilias->setSetting("require_default_role",$_POST["require_default_role"]);
00468 $this->ilias->setSetting("require_department",$_POST["require_department"]);
00469 $this->ilias->setSetting("require_email",$_POST["require_email"]);
00470 $this->ilias->setSetting("require_fax",$_POST["require_fax"]);
00471 $this->ilias->setSetting("require_firstname",$_POST["require_firstname"]);
00472 $this->ilias->setSetting("require_gender",$_POST["require_gender"]);
00473 $this->ilias->setSetting("require_hobby",$_POST["require_hobby"]);
00474 $this->ilias->setSetting("require_institution",$_POST["require_institution"]);
00475 $this->ilias->setSetting("require_lastname",$_POST["require_lastname"]);
00476 $this->ilias->setSetting("require_login",$_POST["require_login"]);
00477 $this->ilias->setSetting("require_passwd",$_POST["require_passwd"]);
00478 $this->ilias->setSetting("require_passwd2",$_POST["require_passwd2"]);
00479 $this->ilias->setSetting("require_phone_home",$_POST["require_phone_home"]);
00480 $this->ilias->setSetting("require_phone_mobile",$_POST["require_phone_mobile"]);
00481 $this->ilias->setSetting("require_phone_office",$_POST["require_phone_office"]);
00482 $this->ilias->setSetting("require_street",$_POST["require_street"]);
00483 $this->ilias->setSetting("require_zipcode",$_POST["require_zipcode"]);
00484 $this->ilias->setSetting("require_referral_comment",$_POST["require_referral_comment"]);
00485 $this->ilias->setSetting("require_matriculation",$_POST["require_matriculation"]);
00486
00487
00488 $this->ilias->setSetting("cron_user_check",$_POST["cron_user_check"]);
00489 $this->ilias->setSetting("cron_link_check",$_POST["cron_link_check"]);
00490
00491
00492 $this->ilias->setSetting("soap_user_administration",$_POST["soap_user_administration"]);
00493
00494
00495 $this->ilias->ini->write();
00496
00497 $settings = $this->ilias->getAllSettings();
00498
00499
00500 sendInfo($this->lng->txt("saved_successfully"));
00501 }
00502 }
00503
00504 $this->tpl->setVariable("TXT_BASIC_DATA", $this->lng->txt("basic_data"));
00505
00507
00508
00509
00510 $this->tpl->setVariable("TXT_ILIAS_VERSION", $this->lng->txt("ilias_version"));
00511 $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("db_version"));
00512 $this->tpl->setVariable("TXT_CLIENT_ID", $this->lng->txt("client_id"));
00513 $this->tpl->setVariable("TXT_INST_ID", $this->lng->txt("inst_id"));
00514 $this->tpl->setVariable("TXT_ACTIVATE_HTTPS",$this->lng->txt('activate_https'));
00515 $this->tpl->setVariable("TXT_HOSTNAME", $this->lng->txt("host"));
00516 $this->tpl->setVariable("TXT_IP_ADDRESS", $this->lng->txt("ip_address"));
00517 $this->tpl->setVariable("TXT_SERVER_DATA", $this->lng->txt("server_data"));
00518 $this->tpl->setVariable("TXT_SERVER_PORT", $this->lng->txt("port"));
00519 $this->tpl->setVariable("TXT_SERVER_SOFTWARE", $this->lng->txt("server_software"));
00520 $this->tpl->setVariable("TXT_HTTP_PATH", $this->lng->txt("http_path"));
00521 $this->tpl->setVariable("TXT_ABSOLUTE_PATH", $this->lng->txt("absolute_path"));
00522 $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("inst_name"));
00523 $this->tpl->setVariable("TXT_INST_INFO", $this->lng->txt("inst_info"));
00524 $this->tpl->setVariable("TXT_DEFAULT_SKIN_STYLE", $this->lng->txt("default_skin_style"));
00525 $this->tpl->setVariable("TXT_OPEN_VIEWS_INSIDE_FRAMESET", $this->lng->txt("open_views_inside_frameset"));
00526 $this->tpl->setVariable("TXT_DEFAULT_LANGUAGE", $this->lng->txt("default_language"));
00527 $this->tpl->setVariable("TXT_FEEDBACK_RECIPIENT", $this->lng->txt("feedback_recipient"));
00528 $this->tpl->setVariable("TXT_ERROR_RECIPIENT", $this->lng->txt("error_recipient"));
00529 $this->tpl->setVariable("TXT_HEADER_TITLE", $this->lng->txt("header_title"));
00530 $this->tpl->setVariable("TXT_CHANGE", $this->lng->txt("change"));
00531 $this->tpl->setVariable("LINK_HEADER_TITLE", "adm_object.php?ref_id=".
00532 $_GET["ref_id"]."&cmd=changeHeaderTitle");
00533 $this->tpl->setVariable("VAL_HEADER_TITLE",
00534 ilObjSystemFolder::_getHeaderTitle());
00535
00536 include_once ("./classes/class.ilDBUpdate.php");
00537 $dbupdate = new ilDBUpdate($this->ilias->db,true);
00538
00539 if (!$dbupdate->getDBVersionStatus())
00540 {
00541 $this->tpl->setVariable("TXT_DB_UPDATE", " (<span class=\"warning\">".$this->lng->txt("db_need_update")."</span>)");
00542 }
00543
00544
00545 $this->tpl->setVariable("TXT_PUB_SECTION", $this->lng->txt("pub_section"));
00546 $this->tpl->setVariable("TXT_ENABLE_PASSWORD_ASSISTANCE", $this->lng->txt("enable_password_assistance"));
00547 if (AUTH_CURRENT != AUTH_LOCAL)
00548 {
00549 $this->tpl->setVariable("DISABLE_PASSWORD_ASSISTANCE", 'disabled=\"disabled\"');
00550 $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_DISABLED", $this->lng->txt("password_assistance_disabled"));
00551 }
00552 $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_INFO", $this->lng->txt("password_assistance_info"));
00553
00554
00555 $this->tpl->setVariable("TXT_JS_EDIT", $this->lng->txt("enable_js_edit"));
00556 $this->tpl->setVariable("TXT_JS_EDIT_INFO", $this->lng->txt("enable_js_edit_info"));
00557
00558
00559 $this->tpl->setVariable("TXT_REGISTRATION", $this->lng->txt("registration"));
00560 $this->tpl->setVariable("TXT_ENABLE_REGISTRATION", $this->lng->txt("enable_registration"));
00561 $this->tpl->setVariable("TXT_PASSWD_AUTO_GENERATE", $this->lng->txt("passwd_auto_generate"));
00562
00563 if (AUTH_CURRENT != AUTH_LOCAL)
00564 {
00565 $this->tpl->setVariable("TXT_REGISTRATION_DISABLED", "(".$this->lng->txt("registration_disabled").")");
00566 $this->tpl->setVariable("DISABLE_REGISTRATION", "\"disabled=disabled\"");
00567 }
00568
00569
00570 $this->tpl->setVariable("TXT_SOFTWARE", $this->lng->txt("3rd_party_software"));
00571 $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("path_to_convert"));
00572 $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("path_to_zip"));
00573 $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("path_to_unzip"));
00574 $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("path_to_java"));
00575 $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("path_to_htmldoc"));
00576
00577
00578 $this->tpl->setVariable("TXT_CRON",$this->lng->txt('cron_jobs'));
00579 $this->tpl->setVariable("TXT_CRON_DESC",$this->lng->txt('cron_jobs_desc'));
00580 $this->tpl->setVariable("TXT_CRON_USER_ACCOUNTS",$this->lng->txt('check_user_accounts'));
00581 $this->tpl->setVariable("CRON_USER_ACCOUNTS_DESC",$this->lng->txt('check_user_accounts_desc'));
00582 $this->tpl->setVariable("TXT_CRON_LINK_CHECK",$this->lng->txt('check_link'));
00583 $this->tpl->setVariable("CRON_LINK_CHECK_DESC",$this->lng->txt('check_link_desc'));
00584
00585 $this->tpl->setVariable("TXT_WEBSERVICES",$this->lng->txt('webservices'));
00586 $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION",$this->lng->txt('soap_user_administration'));
00587 $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION_DESC",$this->lng->txt('soap_user_administration_desc'));
00588
00589
00590
00591 $this->tpl->setVariable("TXT_CONTACT_DATA", $this->lng->txt("contact_data"));
00592 $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
00593 $this->tpl->setVariable("TXT_ADMIN", $this->lng->txt("administrator"));
00594 $this->tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt("firstname"));
00595 $this->tpl->setVariable("TXT_LASTNAME", $this->lng->txt("lastname"));
00596 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
00597 $this->tpl->setVariable("TXT_POSITION", $this->lng->txt("position"));
00598 $this->tpl->setVariable("TXT_INSTITUTION", $this->lng->txt("institution"));
00599 $this->tpl->setVariable("TXT_STREET", $this->lng->txt("street"));
00600 $this->tpl->setVariable("TXT_ZIPCODE", $this->lng->txt("zipcode"));
00601 $this->tpl->setVariable("TXT_CITY", $this->lng->txt("city"));
00602 $this->tpl->setVariable("TXT_COUNTRY", $this->lng->txt("country"));
00603 $this->tpl->setVariable("TXT_PHONE", $this->lng->txt("phone"));
00604 $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
00605 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00606
00607
00608 $this->tpl->setVariable("TXT_AUTO_REGISTRATION", $this->lng->txt("auto_registration"));
00609 $this->tpl->setVariable("TXT_APPROVE_RECIPIENT", $this->lng->txt("approve_recipient"));
00610 $this->tpl->setVariable("TXT_REQUIRE_MANDATORY", " (<span class=\"warning\">" .
00611 $this->lng->txt("require_mandatory") . "</span>)");
00612 $this->tpl->setVariable("TXT_REQUIRE_LOGIN", $this->lng->txt("require_login"));
00613 $this->tpl->setVariable("TXT_REQUIRE_PASSWD", $this->lng->txt("require_passwd"));
00614 $this->tpl->setVariable("TXT_REQUIRE_PASSWD2", $this->lng->txt("require_passwd2"));
00615 $this->tpl->setVariable("TXT_REQUIRE_FIRSTNAME", $this->lng->txt("require_firstname"));
00616 $this->tpl->setVariable("TXT_REQUIRE_GENDER", $this->lng->txt("require_gender"));
00617 $this->tpl->setVariable("TXT_REQUIRE_LASTNAME", $this->lng->txt("require_lastname"));
00618 $this->tpl->setVariable("TXT_REQUIRE_INSTITUTION", $this->lng->txt("require_institution"));
00619 $this->tpl->setVariable("TXT_REQUIRE_DEPARTMENT", $this->lng->txt("require_department"));
00620 $this->tpl->setVariable("TXT_REQUIRE_STREET", $this->lng->txt("require_street"));
00621 $this->tpl->setVariable("TXT_REQUIRE_CITY", $this->lng->txt("require_city"));
00622 $this->tpl->setVariable("TXT_REQUIRE_ZIPCODE", $this->lng->txt("require_zipcode"));
00623 $this->tpl->setVariable("TXT_REQUIRE_COUNTRY", $this->lng->txt("require_country"));
00624 $this->tpl->setVariable("TXT_REQUIRE_PHONE_OFFICE", $this->lng->txt("require_phone_office"));
00625 $this->tpl->setVariable("TXT_REQUIRE_PHONE_HOME", $this->lng->txt("require_phone_home"));
00626 $this->tpl->setVariable("TXT_REQUIRE_PHONE_MOBILE", $this->lng->txt("require_phone_mobile"));
00627 $this->tpl->setVariable("TXT_REQUIRE_FAX", $this->lng->txt("require_fax"));
00628 $this->tpl->setVariable("TXT_REQUIRE_EMAIL", $this->lng->txt("require_email"));
00629 $this->tpl->setVariable("TXT_REQUIRE_HOBBY", $this->lng->txt("require_hobby"));
00630 $this->tpl->setVariable("TXT_REQUIRE_DEFAULT_ROLE", $this->lng->txt("require_default_role"));
00631 $this->tpl->setVariable("TXT_REQUIRE_REFERRAL_COMMENT", $this->lng->txt("require_referral_comment"));
00632 $this->tpl->setVariable("TXT_REQUIRE_MATRICULATION", $this->lng->txt("require_matriculation"));
00633
00635
00636
00637
00638 $loc = "adm_object.php?ref_id=".$this->object->getRefId();
00639 $this->tpl->setVariable("FORMACTION_BASICDATA", $loc);
00640 $this->tpl->setVariable("HTTP_PATH",ILIAS_HTTP_PATH);
00641 $this->tpl->setVariable("ABSOLUTE_PATH",ILIAS_ABSOLUTE_PATH);
00642 $this->tpl->setVariable("HOSTNAME", $_SERVER["SERVER_NAME"]);
00643 $this->tpl->setVariable("SERVER_PORT", $_SERVER["SERVER_PORT"]);
00644 $this->tpl->setVariable("SERVER_ADMIN", $_SERVER["SERVER_ADMIN"]);
00645 $this->tpl->setVariable("SERVER_SOFTWARE", $_SERVER["SERVER_SOFTWARE"]);
00646 $this->tpl->setVariable("IP_ADDRESS", $_SERVER["SERVER_ADDR"]);
00647 $this->tpl->setVariable("DB_VERSION",$settings["db_version"]);
00648 $this->tpl->setVariable("ILIAS_VERSION",$settings["ilias_version"]);
00649 $this->tpl->setVariable("INST_ID",$settings["inst_id"]);
00650 $this->tpl->setVariable("CLIENT_ID",CLIENT_ID);
00651 $this->tpl->setVariable("INST_NAME",$this->ilias->ini->readVariable("client","name"));
00652 $this->tpl->setVariable("INST_INFO",$this->ilias->ini->readVariable("client","description"));
00653 $this->tpl->setVariable("FEEDBACK_RECIPIENT",$settings["feedback_recipient"]);
00654 $this->tpl->setVariable("ERROR_RECIPIENT",$settings["error_recipient"]);
00655
00656
00657 $templates = $styleDefinition->getAllTemplates();
00658
00659 $this->tpl->setCurrentBlock("selectskin");
00660
00661 foreach ($templates as $template)
00662 {
00663
00664 $styleDef =& new ilStyleDefinition($template["id"]);
00665 $styleDef->startParsing();
00666 $styles = $styleDef->getStyles();
00667
00668 foreach ($styles as $style)
00669 {
00670 if ($this->ilias->ini->readVariable("layout","skin") == $template["id"] &&
00671 $this->ilias->ini->readVariable("layout","style") == $style["id"])
00672 {
00673 $this->tpl->setVariable("SKINSELECTED", "selected=\"selected\"");
00674 }
00675
00676 $this->tpl->setVariable("SKINVALUE", $template["id"].":".$style["id"]);
00677 $this->tpl->setVariable("SKINOPTION", $styleDef->getTemplateName()." / ".$style["name"]);
00678 $this->tpl->parseCurrentBlock();
00679 }
00680 }
00681
00682
00683 $view_target = $this->ilias->ini->readVariable("layout","view_target");
00684 if ($view_target == "frame")
00685 {
00686 $this->tpl->setVariable("OPEN_VIEWS_INSIDE_FRAMESET","checked=\"checked\"");
00687 }
00688 else
00689 {
00690 $this->tpl->setVariable("OPEN_VIEWS_INSIDE_FRAMESET","");
00691 }
00692
00693
00694 $languages = $this->lng->getInstalledLanguages();
00695 $this->tpl->setCurrentBlock("selectlanguage");
00696
00697 foreach ($languages as $lang_key)
00698 {
00699 if ($this->ilias->ini->readVariable("language","default") == $lang_key)
00700 {
00701 $this->tpl->setVariable("LANGSELECTED", " selected=\"selected\"");
00702 }
00703
00704 $this->tpl->setVariable("LANGVALUE", $lang_key);
00705 $this->tpl->setVariable("LANGOPTION", $this->lng->txt("lang_".$lang_key));
00706 $this->tpl->parseCurrentBlock();
00707 }
00708
00709 if ($settings["pub_section"])
00710 {
00711 $this->tpl->setVariable("PUB_SECTION","checked=\"checked\"");
00712 }
00713 if($settings['https'])
00714 {
00715 $this->tpl->setVariable("HTTPS","checked=\"checked\"");
00716 }
00717 if($settings['password_assistance'])
00718 {
00719 $this->tpl->setVariable("PASSWORD_ASSISTANCE","checked=\"checked\"");
00720 }
00721
00722
00723 if($settings['enable_js_edit'])
00724 {
00725 $this->tpl->setVariable("JS_EDIT","checked=\"checked\"");
00726 }
00727
00728
00729
00730 if ($settings["passwd_auto_generate"])
00731 {
00732 $this->tpl->setVariable("PASSWD_AUTO_GENERATE","checked=\"checked\"");
00733 }
00734 if ($settings["enable_registration"])
00735 {
00736 $this->tpl->setVariable("ENABLE_REGISTRATION","checked=\"checked\"");
00737 }
00738
00739
00740 if ($settings["auto_registration"])
00741 {
00742 $this->tpl->setVariable("AUTO_REGISTRATION","checked=\"checked\"");
00743 }
00744 if ($settings["approve_recipient"])
00745 {
00746 $this->tpl->setVariable("APPROVE_RECIPIENT",$settings["approve_recipient"]);
00747 }
00748 if ($settings["require_login"])
00749 {
00750 $this->tpl->setVariable("REQUIRE_LOGIN","checked=\"checked\"");
00751 }
00752 if ($settings["require_passwd"])
00753 {
00754 $this->tpl->setVariable("REQUIRE_PASSWD","checked=\"checked\"");
00755 }
00756 if ($settings["require_passwd2"])
00757 {
00758 $this->tpl->setVariable("REQUIRE_PASSWD2","checked=\"checked\"");
00759 }
00760 if ($settings["require_firstname"])
00761 {
00762 $this->tpl->setVariable("REQUIRE_FIRSTNAME","checked=\"checked\"");
00763 }
00764 if ($settings["require_gender"])
00765 {
00766 $this->tpl->setVariable("REQUIRE_GENDER","checked=\"checked\"");
00767 }
00768 if ($settings["require_lastname"])
00769 {
00770 $this->tpl->setVariable("REQUIRE_LASTNAME","checked=\"checked\"");
00771 }
00772 if ($settings["require_institution"])
00773 {
00774 $this->tpl->setVariable("REQUIRE_INSTITUTION","checked=\"checked\"");
00775 }
00776 if ($settings["require_department"])
00777 {
00778 $this->tpl->setVariable("REQUIRE_DEPARTMENT","checked=\"checked\"");
00779 }
00780 if ($settings["require_street"])
00781 {
00782 $this->tpl->setVariable("REQUIRE_STREET","checked=\"checked\"");
00783 }
00784 if ($settings["require_city"])
00785 {
00786 $this->tpl->setVariable("REQUIRE_CITY","checked=\"checked\"");
00787 }
00788 if ($settings["require_zipcode"])
00789 {
00790 $this->tpl->setVariable("REQUIRE_ZIPCODE","checked=\"checked\"");
00791 }
00792 if ($settings["require_country"])
00793 {
00794 $this->tpl->setVariable("REQUIRE_COUNTRY","checked=\"checked\"");
00795 }
00796 if ($settings["require_phone_office"])
00797 {
00798 $this->tpl->setVariable("REQUIRE_PHONE_OFFICE","checked=\"checked\"");
00799 }
00800 if ($settings["require_phone_home"])
00801 {
00802 $this->tpl->setVariable("REQUIRE_PHONE_HOME","checked=\"checked\"");
00803 }
00804 if ($settings["require_phone_mobile"])
00805 {
00806 $this->tpl->setVariable("REQUIRE_PHONE_MOBILE","checked=\"checked\"");
00807 }
00808 if ($settings["require_fax"])
00809 {
00810 $this->tpl->setVariable("REQUIRE_FAX","checked=\"checked\"");
00811 }
00812 if ($settings["require_email"])
00813 {
00814 $this->tpl->setVariable("REQUIRE_EMAIL","checked=\"checked\"");
00815 }
00816 if ($settings["require_hobby"])
00817 {
00818 $this->tpl->setVariable("REQUIRE_HOBBY","checked=\"checked\"");
00819 }
00820 if ($settings["require_default_role"])
00821 {
00822 $this->tpl->setVariable("REQUIRE_DEFAULT_ROLE","checked=\"checked\"");
00823 }
00824 if ($settings["require_referral_comment"])
00825 {
00826 $this->tpl->setVariable("REQUIRE_REFERRAL_COMMENT","checked=\"checked\"");
00827 }
00828 if ($settings["require_matriculation"])
00829 {
00830 $this->tpl->setVariable("REQUIRE_MATRICULATION","checked=\"checked\"");
00831 }
00832 if ($settings["cron_user_check"])
00833 {
00834 $this->tpl->setVariable("CRON_USER_CHECK","checked=\"checked\"");
00835 }
00836 if ($settings["cron_link_check"])
00837 {
00838 $this->tpl->setVariable("CRON_LINK_CHECK","checked=\"checked\"");
00839 }
00840 if ($settings["soap_user_administration"])
00841 {
00842 $this->tpl->setVariable("SOAP_USER_ADMINISTRATION_CHECK","checked=\"checked\"");
00843 }
00844
00845
00846 $not_set = $this->lng->txt("path_not_set");
00847
00848 $this->tpl->setVariable("CONVERT_PATH",(PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
00849 $this->tpl->setVariable("ZIP_PATH",(PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
00850 $this->tpl->setVariable("UNZIP_PATH",(PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
00851 $this->tpl->setVariable("JAVA_PATH",(PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
00852 $this->tpl->setVariable("HTMLDOC_PATH",(PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
00853
00854
00855 $this->tpl->setVariable("ADMIN_FIRSTNAME",$settings["admin_firstname"]);
00856 $this->tpl->setVariable("ADMIN_LASTNAME",$settings["admin_lastname"]);
00857 $this->tpl->setVariable("ADMIN_TITLE",$settings["admin_title"]);
00858 $this->tpl->setVariable("ADMIN_POSITION",$settings["admin_position"]);
00859 $this->tpl->setVariable("ADMIN_INSTITUTION",$settings["admin_institution"]);
00860 $this->tpl->setVariable("ADMIN_STREET",$settings["admin_street"]);
00861 $this->tpl->setVariable("ADMIN_ZIPCODE",$settings["admin_zipcode"]);
00862 $this->tpl->setVariable("ADMIN_CITY",$settings["admin_city"]);
00863 $this->tpl->setVariable("ADMIN_COUNTRY",$settings["admin_country"]);
00864 $this->tpl->setVariable("ADMIN_PHONE",$settings["admin_phone"]);
00865 $this->tpl->setVariable("ADMIN_EMAIL",$settings["admin_email"]);
00866
00867 $this->tpl->parseCurrentBlock();
00868 }
00869
00875 function checkObject()
00876 {
00877 global $rbacsystem;
00878
00879 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
00880 {
00881 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00882 }
00883
00884 if ($_POST["systemcheck"])
00885 {
00886 return $this->viewScanLog();
00887 }
00888
00889 if ($_POST["mode"])
00890 {
00891 $this->startValidator($_POST["mode"],$_POST["log_scan"]);
00892 }
00893 else
00894 {
00895 include_once "classes/class.ilValidator.php";
00896 $validator = new ilValidator();
00897 $last_scan = $validator->readScanLog();
00898
00899 $this->getTemplateFile("check");
00900
00901 if (is_array($last_scan))
00902 {
00903 $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
00904 }
00905
00906 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
00907 $this->tpl->setVariable("COLSPAN", 3);
00908 $this->tpl->setVariable("TXT_OPTIONS", $this->lng->txt("options"));
00909 $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
00910 $this->tpl->setVariable("TXT_ANALYZE", $this->lng->txt("scan_only"));
00911 $this->tpl->setVariable("TXT_ANALYZE_DESC", $this->lng->txt("analyze_desc"));
00912 $this->tpl->setVariable("TXT_CHECK_TREE", $this->lng->txt("check_tree"));
00913 $this->tpl->setVariable("TXT_CHECK_TREE_DESC", $this->lng->txt("check_tree_desc"));
00914 $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
00915 $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
00916 $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
00917 $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
00918 $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
00919 $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
00920 $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
00921 $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
00922 $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
00923 $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
00924 $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
00925 $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
00926 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
00927 }
00928 }
00929
00935 function changeHeaderTitleObject()
00936 {
00937 global $rbacsystem, $styleDefinition;
00938
00939 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html");
00940
00941 $array_push = true;
00942
00943 if ($_SESSION["error_post_vars"])
00944 {
00945 $_SESSION["translation_post"] = $_SESSION["error_post_vars"];
00946 $_GET["mode"] = "session";
00947 $array_push = false;
00948 }
00949
00950
00951 if (($_GET["mode"] != "session"))
00952 {
00953 $data = $this->object->getHeaderTitleTranslations();
00954 $_SESSION["translation_post"] = $data;
00955 $array_push = false;
00956 }
00957 elseif ($_GET["entry"] != 0)
00958 {
00959 array_splice($_SESSION["translation_post"]["Fobject"],$_GET["entry"],1,array());
00960
00961 if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"])
00962 {
00963 $_SESSION["translation_post"]["default_language"] = "";
00964 }
00965 }
00966
00967 $data = $_SESSION["translation_post"];
00968
00969
00970 if (!$_GET["entry"] and $array_push)
00971 {
00972 $count = array_push($data["Fobject"],array("title" => "","desc" => ""));
00973 }
00974 else
00975 {
00976 $count = count($data["Fobject"]);
00977 }
00978
00979
00980 $strip = isset($_SESSION["translation_post"]) ? true : false;
00981
00982 foreach ($data["Fobject"] as $key => $val)
00983 {
00984
00985 if ($key == $count -1)
00986 {
00987 $this->tpl->setCurrentBlock("addTranslation");
00988 $this->tpl->setVariable("TXT_ADD_TRANSLATION",$this->lng->txt("add_translation")." >>");
00989 $this->tpl->parseCurrentBlock();
00990 }
00991
00992
00993 if ($key != 0)
00994 {
00995 $this->tpl->setCurrentBlock("removeTranslation");
00996 $this->tpl->setVariable("TXT_REMOVE_TRANSLATION",$this->lng->txt("remove_translation"));
00997 $this->tpl->setVariable("LINK_REMOVE_TRANSLATION", "adm_object.php?cmd=removeTranslation&entry=".$key."&mode=edit&ref_id=".$_GET["ref_id"]);
00998 $this->tpl->parseCurrentBlock();
00999 }
01000
01001
01002 $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html", false);
01003 $this->tpl->setVariable("SEL_NAME", "Fobject[".$key."][lang]");
01004
01005 include_once("classes/class.ilMetaData.php");
01006
01007 $languages = ilMetaData::getLanguages();
01008
01009 foreach ($languages as $code => $language)
01010 {
01011 $this->tpl->setCurrentBlock("lg_option");
01012 $this->tpl->setVariable("VAL_LG", $code);
01013 $this->tpl->setVariable("TXT_LG", $language);
01014
01015 if ($code == $val["lang"])
01016 {
01017 $this->tpl->setVariable("SELECTED", "selected=\"selected\"");
01018 }
01019
01020 $this->tpl->parseCurrentBlock();
01021 }
01022
01023
01024 $this->tpl->setCurrentBlock("obj_form");
01025
01026 if ($key == 0)
01027 {
01028 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title"));
01029 }
01030 else
01031 {
01032 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation")." ".$key);
01033 }
01034
01035 if ($key == $data["default_language"])
01036 {
01037 $this->tpl->setVariable("CHECKED", "checked=\"checked\"");
01038 }
01039
01040 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
01041 $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
01042 $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default"));
01043 $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
01044 $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"],$strip));
01045 $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"]));
01046 $this->tpl->setVariable("NUM", $key);
01047 $this->tpl->parseCurrentBlock();
01048 }
01049
01050
01051 $this->tpl->setCurrentBlock("adm_content");
01052 $this->tpl->setVariable("FORMACTION", $this->getFormAction("update","adm_object.php?cmd=gateway&mode=edit&ref_id=".$_GET["ref_id"]));
01053 $this->tpl->setVariable("TARGET", $this->getTargetFrame("update"));
01054 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
01055 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
01056 $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle");
01057 $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
01058 }
01059
01063 function saveHeaderTitleObject()
01064 {
01065 $data = $_POST;
01066
01067
01068 if (!isset($data["default_language"]))
01069 {
01070 $this->ilias->raiseError($this->lng->txt("msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
01071 }
01072
01073
01074 foreach ($data["Fobject"] as $key => $val)
01075 {
01076 $langs[$key] = $val["lang"];
01077 }
01078
01079 $langs = array_count_values($langs);
01080
01081
01082 if (array_key_exists("",$langs))
01083 {
01084 $this->ilias->raiseError($this->lng->txt("msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
01085 }
01086
01087
01088 if (array_sum($langs) > count($langs))
01089 {
01090 $this->ilias->raiseError($this->lng->txt("msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
01091 }
01092
01093
01094 $_POST["Fobject"]["title"] = $_POST["Fobject"][$_POST["default_language"]]["title"];
01095 $_POST["Fobject"]["desc"] = $_POST["Fobject"][$_POST["default_language"]]["desc"];
01096
01097
01098 $this->object->removeHeaderTitleTranslations();
01099
01100
01101 foreach ($data["Fobject"] as $key => $val)
01102 {
01103 if ($key == $data["default_language"])
01104 {
01105 $default = 1;
01106 }
01107 else
01108 {
01109 $default = 0;
01110 }
01111
01112 $this->object->addHeaderTitleTranslation(ilUtil::stripSlashes($val["title"]),ilUtil::stripSlashes($val["desc"]),$val["lang"],$default);
01113 }
01114
01115 sendInfo($this->lng->txt("msg_obj_modified"),true);
01116
01117 header("Location:".$this->getReturnLocation("update","adm_object.php?".$this->link_params));
01118 exit();
01119 }
01120
01126 function addHeaderTitleTranslationObject()
01127 {
01128 $_SESSION["translation_post"] = $_POST;
01129 header("Location:".$this->getReturnLocation("addTranslation",
01130 "adm_object.php?cmd=changeHeaderTitle&entry=0&mode=session&ref_id=".$_GET["ref_id"]."&new_type=".$_GET["new_type"]));
01131 exit();
01132 }
01133
01139 function removeTranslationObject()
01140 {
01141 header("location: adm_object.php?cmd=changeHeaderTitle&entry=".$_GET["entry"]."&mode=session&ref_id=".$_GET["ref_id"]."&new_type=".$_GET["new_type"]);
01142 exit();
01143 }
01144
01145
01146 function startValidator($a_mode,$a_log)
01147 {
01148 global $rbacsystem;
01149
01150 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01151 {
01152 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
01153 }
01154
01155 $logging = ($a_log) ? true : false;
01156 include_once "classes/class.ilValidator.php";
01157 $validator = new ilValidator($logging);
01158 $validator->setMode("all",false);
01159
01160 foreach ($a_mode as $mode => $value)
01161 {
01162 $validator->setMode($mode,(bool) $value);
01163
01164 }
01165
01166
01167
01168 $scan_log .= $this->lng->txt("analyzing");
01169
01170 if (!$validator->isModeEnabled("analyze"))
01171 {
01172 $scan_log .= $this->lng->txt("disabled");
01173 }
01174 else
01175 {
01176 $scan_log .= "<br />".$this->lng->txt("searching_invalid_refs");
01177 if ($validator->findInvalidReferences())
01178 {
01179 $scan_log .= count($validator->getInvalidReferences())." ".$this->lng->txt("found");
01180 }
01181 else
01182 {
01183 $scan_log .= $this->lng->txt("found_none");
01184 }
01185
01186 $scan_log .= "<br />".$this->lng->txt("searching_invalid_childs");
01187 if ($validator->findInvalidChilds())
01188 {
01189 $scan_log .= count($validator->getInvalidChilds())." ".$this->lng->txt("found");
01190
01191 }
01192 else
01193 {
01194 $scan_log .= $this->lng->txt("found_none");
01195 }
01196
01197 $scan_log .= "<br />".$this->lng->txt("searching_missing_objs");
01198 if ($validator->findMissingObjects())
01199 {
01200 $scan_log .= count($validator->getMissingObjects())." ".$this->lng->txt("found");
01201
01202 }
01203 else
01204 {
01205 $scan_log .= $this->lng->txt("found_none");
01206 }
01207
01208 $scan_log .= "<br />".$this->lng->txt("searching_unbound_objs");
01209 if ($validator->findUnboundObjects())
01210 {
01211 $scan_log .= count($validator->getUnboundObjects())." ".$this->lng->txt("found");
01212
01213 }
01214 else
01215 {
01216 $scan_log .= $this->lng->txt("found_none");
01217 }
01218
01219 $scan_log .= "<br />".$this->lng->txt("searching_deleted_objs");
01220 if ($validator->findDeletedObjects())
01221 {
01222 $scan_log .= count($validator->getDeletedObjects())." ".$this->lng->txt("found");
01223
01224 }
01225 else
01226 {
01227 $scan_log .= $this->lng->txt("found_none");
01228 }
01229
01230 $scan_log .= "<br />".$this->lng->txt("searching_invalid_rolfs");
01231 if ($validator->findInvalidRolefolders())
01232 {
01233 $scan_log .= count($validator->getInvalidRolefolders())." ".$this->lng->txt("found");
01234
01235 }
01236 else
01237 {
01238 $scan_log .= $this->lng->txt("found_none");
01239 }
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251 }
01252
01253
01254 $scan_log .= "<br /><br />".$this->lng->txt("analyzing_tree_structure");
01255
01256 if (!$validator->isModeEnabled("check_tree"))
01257 {
01258 $scan_log .= $this->lng->txt("disabled");
01259 }
01260 else
01261 {
01262 if ($validator->checkTreeStructure())
01263 {
01264 $scan_log .= $this->lng->txt("tree_corrupt");
01265 }
01266 else
01267 {
01268 $scan_log .= $this->lng->txt("disabled");
01269 }
01270 }
01271
01272
01273 $scan_log .= "<br /><br />".$this->lng->txt("cleaning");
01274
01275 if (!$validator->isModeEnabled("clean"))
01276 {
01277 $scan_log .= $this->lng->txt("disabled");
01278 }
01279 else
01280 {
01281 $scan_log .= "<br />".$this->lng->txt("removing_invalid_refs");
01282 if ($validator->removeInvalidReferences())
01283 {
01284 $scan_log .= strtolower($this->lng->txt("done"));
01285 }
01286 else
01287 {
01288 $scan_log .= $this->lng->txt("nothing_to_remove").$this->lng->txt("skipped");
01289 }
01290
01291 $scan_log .= "<br />".$this->lng->txt("removing_invalid_childs");
01292 if ($validator->removeInvalidChilds())
01293 {
01294 $scan_log .= strtolower($this->lng->txt("done"));
01295 }
01296 else
01297 {
01298 $scan_log .= $this->lng->txt("nothing_to_remove").$this->lng->txt("skipped");
01299 }
01300
01301 $scan_log .= "<br />".$this->lng->txt("removing_invalid_rolfs");
01302 if ($validator->removeInvalidRolefolders())
01303 {
01304 $scan_log .= strtolower($this->lng->txt("done"));
01305 }
01306 else
01307 {
01308 $scan_log .= $this->lng->txt("nothing_to_remove").$this->lng->txt("skipped");
01309 }
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
01324
01325 $validator->findUnboundObjects();
01326 }
01327
01328
01329 $scan_log .= "<br /><br />".$this->lng->txt("restoring");
01330
01331 if (!$validator->isModeEnabled("restore"))
01332 {
01333 $scan_log .= $this->lng->txt("disabled");
01334 }
01335 else
01336 {
01337 $scan_log .= "<br />".$this->lng->txt("restoring_missing_objs");
01338 if ($validator->restoreMissingObjects())
01339 {
01340 $scan_log .= strtolower($this->lng->txt("done"));
01341 }
01342 else
01343 {
01344 $scan_log .= $this->lng->txt("nothing_to_restore").$this->lng->txt("skipped");
01345 }
01346
01347 $scan_log .= "<br />".$this->lng->txt("restoring_unbound_objs");
01348 if ($validator->restoreUnboundObjects())
01349 {
01350 $scan_log .= strtolower($this->lng->txt("done"));
01351 }
01352 else
01353 {
01354 $scan_log .= $this->lng->txt("nothing_to_restore").$this->lng->txt("skipped");
01355 }
01356 }
01357
01358
01359 $scan_log .= "<br /><br />".$this->lng->txt("restoring_trash");
01360
01361 if (!$validator->isModeEnabled("restore_trash"))
01362 {
01363 $scan_log .= $this->lng->txt("disabled");
01364 }
01365 else
01366 {
01367 if ($validator->restoreTrash())
01368 {
01369 $scan_log .= strtolower($this->lng->txt("done"));
01370 }
01371 else
01372 {
01373 $scan_log .= $this->lng->txt("nothing_to_restore").$this->lng->txt("skipped");
01374 }
01375 }
01376
01377
01378 $scan_log .= "<br /><br />".$this->lng->txt("purging");
01379
01380 if (!$validator->isModeEnabled("purge"))
01381 {
01382 $scan_log .= $this->lng->txt("disabled");
01383 }
01384 else
01385 {
01386 $scan_log .= "<br />".$this->lng->txt("purging_missing_objs");
01387 if ($validator->purgeMissingObjects())
01388 {
01389 $scan_log .= strtolower($this->lng->txt("done"));
01390 }
01391 else
01392 {
01393 $scan_log .= $this->lng->txt("nothing_to_purge").$this->lng->txt("skipped");
01394 }
01395
01396 $scan_log .= "<br />".$this->lng->txt("purging_unbound_objs");
01397 if ($validator->purgeUnboundObjects())
01398 {
01399 $scan_log .= strtolower($this->lng->txt("done"));
01400 }
01401 else
01402 {
01403 $scan_log .= $this->lng->txt("nothing_to_purge").$this->lng->txt("skipped");
01404 }
01405 }
01406
01407
01408 $scan_log .= "<br /><br />".$this->lng->txt("purging_trash");
01409
01410 if (!$validator->isModeEnabled("purge_trash"))
01411 {
01412 $scan_log .= $this->lng->txt("disabled");
01413 }
01414 else
01415 {
01416 if ($validator->purgeTrash())
01417 {
01418 $scan_log .= strtolower($this->lng->txt("done"));
01419 }
01420 else
01421 {
01422 $scan_log .= $this->lng->txt("nothing_to_purge").$this->lng->txt("skipped");
01423 }
01424 }
01425
01426
01427 if ($validator->isModeEnabled("clean"))
01428 {
01429 $scan_log .= "<br /><br />".$this->lng->txt("cleaning_final");
01430 if ($validator->closeGapsInTree())
01431 {
01432 $scan_log .= "<br />".$this->lng->txt("closing_gaps")." ".strtolower($this->lng->txt("done"));
01433 }
01434 }
01435
01436
01437
01438
01439
01440 foreach ($validator->mode as $mode => $value)
01441 {
01442 $arr[] = $mode."[".(int)$value."]";
01443 }
01444
01445 $scan_log .= "<br /><br />".$this->lng->txt("scan_completed");
01446
01447
01448 $mode = $this->lng->txt("scan_modes").": ".implode(', ',$arr);
01449
01450
01451 $this->getTemplateFile("scan");
01452 $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."&cmd=check");
01453 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system"));
01454 $this->tpl->setVariable("COLSPAN", 3);
01455 $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
01456 $this->tpl->setVariable("TXT_MODE", $mode);
01457
01458 if ($logging === true)
01459 {
01460 $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log"));
01461 }
01462
01463 $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
01464
01465 $validator->writeScanLogLine($mode);
01466 }
01467
01468 function viewScanLog()
01469 {
01470 include_once "classes/class.ilValidator.php";
01471 $validator = new IlValidator();
01472 $scan_log = $validator->readScanLog();
01473
01474 if (is_array($scan_log))
01475 {
01476 $scan_log = nl2br(implode("",$scan_log));
01477 $this->tpl->setVariable("ADM_CONTENT", $scan_log);
01478 }
01479 else
01480 {
01481 $scan_log = "no scanlog found.";
01482 }
01483
01484
01485 $this->getTemplateFile("scan");
01486 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scan_details"));
01487 $this->tpl->setVariable("COLSPAN", 3);
01488 $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
01489 $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
01490 }
01491
01492
01496 function benchmarkObject()
01497 {
01498 global $ilBench, $rbacsystem;
01499
01500 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01501 {
01502 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
01503 }
01504
01505 $this->getTemplateFile("bench");
01506 $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$_GET["ref_id"]."&cur_mod=".$_GET["cur_mod"]."&cmd=gateway");
01507 $this->tpl->setVariable("TXT_BENCH_SETTINGS", $this->lng->txt("benchmark_settings"));
01508 $this->tpl->setVariable("TXT_ACTIVATION", $this->lng->txt("activation"));
01509 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_settings"));
01510 $this->tpl->setVariable("TXT_CUR_RECORDS", $this->lng->txt("cur_number_rec"));
01511 $this->tpl->setVariable("VAL_CUR_RECORDS", $ilBench->getCurrentRecordNumber());
01512 $this->tpl->setVariable("TXT_MAX_RECORDS", $this->lng->txt("max_number_rec"));
01513 $this->tpl->setVariable("VAL_MAX_RECORDS", $ilBench->getMaximumRecords());
01514 $this->tpl->setVariable("TXT_CLEAR", $this->lng->txt("delete_all_rec"));
01515 if($ilBench->isEnabled())
01516 {
01517 $this->tpl->setVariable("ACT_CHECKED", " checked=\"1\" ");
01518 }
01519
01520 $modules = $ilBench->getMeasuredModules();
01521
01522 if (count($modules) > 0)
01523 {
01524 $this->tpl->setCurrentBlock("eval_table");
01525
01526 $cur_module = ($_GET["cur_mod"] != "" &&
01527 in_array($_GET["cur_mod"], $modules))
01528 ? $_GET["cur_mod"]
01529 : current($modules);
01530
01531 $benchs = $ilBench->getEvaluation($cur_module);
01532
01533 $i=0;
01534 foreach($benchs as $bench)
01535 {
01536 $this->tpl->setCurrentBlock("eval_row");
01537 $this->tpl->setVariable("ROWCOL",
01538 ilUtil::switchColor($i++, "tblrow2", "tblrow1"));
01539
01540 $this->tpl->setVariable("VAL_BENCH", $bench["benchmark"]);
01541 $this->tpl->setVariable("VAL_NUMBER_RECORDS", $bench["cnt"]);
01542 $this->tpl->setVariable("VAL_AVG_TIME", $bench["duration"]);
01543 $this->tpl->setVariable("VAL_MIN_TIME", $bench["min"]);
01544 $this->tpl->setVariable("VAL_MAX_TIME", $bench["max"]);
01545 $this->tpl->setVariable("VAL_CUM_TIME", $bench["duration"] * $bench["cnt"]);
01546 $this->tpl->parseCurrentBlock();
01547 }
01548
01549 $this->tpl->setVariable("SELECT_MODULE",
01550 ilUtil::formSelect($cur_module, "module",$modules, false, true));
01551
01552 $this->tpl->setVariable("TXT_SHOW", $this->lng->txt("show"));
01553 $this->tpl->setVariable("TXT_BENCH", $this->lng->txt("benchmark"));
01554 $this->tpl->setVariable("TXT_NUMBER_RECORDS", $this->lng->txt("number_of_records"));
01555 $this->tpl->setVariable("TXT_AVG_TIME", $this->lng->txt("average_time"));
01556 $this->tpl->setVariable("TXT_MIN_TIME", $this->lng->txt("min_time"));
01557 $this->tpl->setVariable("TXT_MAX_TIME", $this->lng->txt("max_time"));
01558 $this->tpl->setVariable("TXT_CUM_TIME", $this->lng->txt("cumulative_time"));
01559
01560 $this->tpl->parseCurrentBlock();
01561 }
01562 }
01563
01564
01568 function saveBenchSettingsObject()
01569 {
01570 global $ilBench;
01571
01572 if ($_POST["activate"] == "y")
01573 {
01574 $ilBench->enable(true);
01575 }
01576 else
01577 {
01578 $ilBench->enable(false);
01579 }
01580
01581 $ilBench->setMaximumRecords($_POST["max_records"]);
01582
01583 sendinfo($this->lng->txt("msg_obj_modified"), true);
01584
01585 ilUtil::redirect("adm_object.php?cur_mod=".$_POST["module"]."&ref_id=".$_GET["ref_id"]."&cmd=benchmark");
01586 }
01587
01588
01592 function switchBenchModuleObject()
01593 {
01594 global $ilBench;
01595
01596 ilUtil::redirect("adm_object.php?cur_mod=".$_POST["module"]."&ref_id=".$_GET["ref_id"]."&cmd=benchmark");
01597 }
01598
01599
01603 function clearBenchObject()
01604 {
01605 global $ilBench;
01606
01607 $ilBench->clearData();
01608 $this->saveBenchSettingsObject();
01609
01610 }
01611
01612
01613 function getTabs(&$tabs_gui)
01614 {
01615 global $rbacsystem;
01616
01617 $this->ctrl->setParameter($this,"ref_id",$this->ref_id);
01618
01619 if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01620 {
01621 $tabs_gui->addTarget("settings",
01622 $this->ctrl->getLinkTarget($this, "view"), "view", get_class($this));
01623 }
01624
01625 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
01626 {
01627 $tabs_gui->addTarget("edit_properties",
01628 $this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this));
01629
01630 $tabs_gui->addTarget("system_check",
01631 $this->ctrl->getLinkTarget($this, "check"), "check", get_class($this));
01632
01633 $tabs_gui->addTarget("benchmarks",
01634 $this->ctrl->getLinkTarget($this, "benchmark"), "benchmark", get_class($this));
01635 }
01636
01637 if ($rbacsystem->checkAccess("edit_permission",$this->object->getRefId()))
01638 {
01639 $tabs_gui->addTarget("perm_settings",
01640 $this->ctrl->getLinkTarget($this, "perm"), "perm", get_class($this));
01641 }
01642
01643 if ($this->ctrl->getTargetScript() == "adm_object.php")
01644 {
01645 $tabs_gui->addTarget("show_owner",
01646 $this->ctrl->getLinkTarget($this, "owner"), "owner", get_class($this));
01647 }
01648 }
01649
01650 }
01651 ?>