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
00037 require_once "class.ilObjectGUI.php";
00038
00039 class ilObjSystemFolderGUI extends ilObjectGUI
00040 {
00046 var $type;
00047
00052 function ilObjSystemFolderGUI($a_data,$a_id,$a_call_by_reference)
00053 {
00054 $this->type = "adm";
00055 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
00056
00057 $this->lng->loadLanguageModule("administration");
00058 }
00059
00060 function &executeCommand()
00061 {
00062 global $rbacsystem;
00063
00064 $next_class = $this->ctrl->getNextClass($this);
00065 $this->prepareOutput();
00066 switch($next_class)
00067 {
00068 case 'ilpermissiongui':
00069 include_once("./classes/class.ilPermissionGUI.php");
00070 $perm_gui =& new ilPermissionGUI($this);
00071 $ret =& $this->ctrl->forwardCommand($perm_gui);
00072 break;
00073
00074 default:
00075
00076 $cmd = $this->ctrl->getCmd("view");
00077
00078 $cmd .= "Object";
00079 $this->$cmd();
00080
00081 break;
00082 }
00083 return true;
00084 }
00085
00086
00092 function viewObject()
00093 {
00094 global $rbacsystem;
00095
00096 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
00097 {
00098 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00099 }
00100
00101
00102 $this->objectList = array();
00103 $this->data["data"] = array();
00104 $this->data["ctrl"] = array();
00105 $this->data["cols"] = array("type", "title");
00106
00107 $childs = $this->tree->getChilds($this->object->getRefId(),$_GET["order"],$_GET["direction"]);
00108
00109 foreach ($childs as $key => $val)
00110 {
00111
00112 if (!$rbacsystem->checkAccess("visible",$val["ref_id"]))
00113 {
00114 continue;
00115 }
00116
00117
00118 if ($this->objDefinition->getDevMode($val["type"]))
00119 {
00120 continue;
00121 }
00122
00123
00124 if ($val["ref_id"] == RECOVERY_FOLDER_ID and !$this->tree->getChilds(RECOVERY_FOLDER_ID))
00125 {
00126 continue;
00127 }
00128
00129
00130 $this->data["data"][] = array(
00131 "type" => $val["type"],
00132 "title" => $val["title"]."#separator#".$val["desc"],
00133 "ref_id" => $val["ref_id"]
00134 );
00135
00136
00137
00138 }
00139
00140
00141 $this->data["data"][] = array(
00142 "type" => "root",
00143 "title" => $this->lng->txt("repository_admin")."#separator#".
00144 $this->lng->txt("repository_admin_desc"),
00145 "ref_id" => ROOT_FOLDER_ID
00146 );
00147
00148 $this->maxcount = count($this->data["data"]);
00149
00150
00151 if ($_GET["sort_by"] == "")
00152 {
00153 $_GET["sort_by"] = "title";
00154 }
00155 $this->data["data"] = ilUtil::sortArray($this->data["data"],$_GET["sort_by"],$_GET["sort_order"]);
00156
00157
00158 foreach ($this->data["data"] as $key => $val)
00159 {
00160 $this->data["ctrl"][$key] = array(
00161 "type" => $val["type"],
00162 "ref_id" => $val["ref_id"]
00163 );
00164
00165 unset($this->data["data"][$key]["ref_id"]);
00166
00167 }
00168
00169
00170
00171
00172 $this->displayList();
00173
00174
00175 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
00176 {
00177 $this->displayBasicSettings();
00178 }
00179 }
00180
00186 function displayList()
00187 {
00188 global $rbacsystem;
00189
00190 include_once "./classes/class.ilTableGUI.php";
00191
00192
00193 $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
00194
00195 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
00196
00197 $num = 0;
00198
00199 if (!$this->call_by_reference)
00200 {
00201 $this->ctrl->setParameter($this, "obj_id", $this->obj_id);
00202 }
00203
00204 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
00205
00206
00207 $tbl = new ilTableGUI();
00208
00209
00210 $tbl->setTitle($this->lng->txt("obj_".$this->object->getType()),"icon_".$this->object->getType().".gif",$this->lng->txt("obj_".$this->object->getType()));
00211
00212
00213
00214
00215
00216
00217
00218
00219 $header_names[] = "";
00220 $header_names[] = $this->lng->txt("obj_cat");
00221
00222 $tbl->setHeaderNames($header_names);
00223
00224 $header_params = $this->ctrl->getParameterArray($this, "view");
00225 $tbl->setHeaderVars($this->data["cols"],$header_params);
00226 $tbl->setColumnWidth(array("15","99%"));
00227
00228
00229 $tbl->setOrderColumn($_GET["sort_by"]);
00230 $tbl->setOrderDirection($_GET["sort_order"]);
00231 $tbl->setLimit(0);
00232 $tbl->setOffset(0);
00233 $tbl->setMaxCount($this->maxcount);
00234
00235
00236 $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
00237 $tbl->disable("numinfo");
00238
00239
00240 $tbl->render();
00241
00242 if (is_array($this->data["data"][0]))
00243 {
00244
00245 for ($i=0; $i < count($this->data["data"]); $i++)
00246 {
00247 $data = $this->data["data"][$i];
00248 $ctrl = $this->data["ctrl"][$i];
00249
00250
00251 $css_row = ilUtil::switchColor($i+1,"tblrow1","tblrow2");
00252
00253 $this->tpl->setCurrentBlock("table_cell");
00254 $this->tpl->setVariable("CELLSTYLE", "tblrow1");
00255 $this->tpl->parseCurrentBlock();
00256
00257 if ($ctrl["ref_id"] != ROOT_FOLDER_ID)
00258 {
00259 foreach ($data as $key => $val)
00260 {
00261
00262 $obj_type = ilObject::_lookupType($ctrl["ref_id"],true);
00263 $class_name = $this->objDefinition->getClassName($obj_type);
00264 $class = strtolower("ilObj".$class_name."GUI");
00265 $this->ctrl->setParameterByClass($class, "ref_id", $ctrl["ref_id"]);
00266 $this->ctrl->setParameterByClass($class, "obj_id", $ctrl["ref_id"]);
00267 $link = $this->ctrl->getLinkTargetByClass($class, "view");
00268
00269 if ($key == "title")
00270 {
00271 $name_field = explode("#separator#",$val);
00272 }
00273
00274 if ($key == "title" || $key == "type")
00275 {
00276 $this->tpl->setCurrentBlock("begin_link");
00277 $this->tpl->setVariable("LINK_TARGET", $link);
00278
00279 $this->tpl->parseCurrentBlock();
00280 $this->tpl->touchBlock("end_link");
00281 }
00282
00283 $this->tpl->setCurrentBlock("text");
00284
00285 if ($key == "type")
00286 {
00287 $val = ilUtil::getImageTagByType($val,$this->tpl->tplPath);
00288 }
00289
00290 if ($key == "title")
00291 {
00292 $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
00293
00294 $this->tpl->setCurrentBlock("subtitle");
00295 $this->tpl->setVariable("DESC", $name_field[1]);
00296 $this->tpl->parseCurrentBlock();
00297 }
00298 else
00299 {
00300 $this->tpl->setVariable("TEXT_CONTENT", $val);
00301 }
00302
00303 $this->tpl->parseCurrentBlock();
00304 $this->tpl->setCurrentBlock("table_cell");
00305 $this->tpl->parseCurrentBlock();
00306
00307 }
00308 }
00309 else
00310 {
00311
00312
00313
00314
00315 $val = ilUtil::getImageTagByType("root",$this->tpl->tplPath);
00316 $this->tpl->setCurrentBlock("text");
00317 $this->tpl->setVariable("TEXT_CONTENT", $val);
00318 $this->tpl->parseCurrentBlock();
00319
00320 $this->tpl->setCurrentBlock("table_cell");
00321 $this->tpl->parseCurrentBlock();
00322
00323
00324 $this->tpl->setCurrentBlock("begin_link");
00325 $this->ctrl->setParameterByClass("iladministrationgui",
00326 "admin_mode", "repository");
00327 $this->ctrl->setParameterByClass("iladministrationgui",
00328 "ref_id", ROOT_FOLDER_ID);
00329 $this->tpl->setVariable("LINK_TARGET",
00330 $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"));
00331 $this->tpl->setVariable("FRAME_TARGET",
00332 " target=\"".ilFrameTargetInfo::_getFrame("MainContent")."\"");
00333 $this->ctrl->clearParametersByClass("iladministrationgui");
00334 $this->tpl->parseCurrentBlock();
00335 $this->tpl->touchBlock("end_link");
00336
00337
00338
00339 $name_field = explode("#separator#", $data["title"]);
00340 $this->tpl->setCurrentBlock("text");
00341 $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
00342 $this->tpl->setCurrentBlock("subtitle");
00343 $this->tpl->setVariable("DESC", $name_field[1]);
00344 $this->tpl->parseCurrentBlock();
00345
00346 $this->tpl->setCurrentBlock("table_cell");
00347 $this->tpl->parseCurrentBlock();
00348
00349 }
00350
00351 $this->tpl->setCurrentBlock("tbl_content");
00352 $this->tpl->setVariable("CSS_ROW", $css_row);
00353 $this->tpl->parseCurrentBlock();
00354 }
00355
00356 }
00357 else
00358 {
00359 $this->tpl->setCurrentBlock("notfound");
00360 $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
00361 $this->tpl->setVariable("NUM_COLS", $num);
00362 $this->tpl->parseCurrentBlock();
00363 }
00364 }
00365
00366 function saveSettingsObject()
00367 {
00368 global $rbacsystem;
00369
00370 $settings = $this->ilias->getAllSettings();
00371
00372
00373 $form_valid = true;
00374
00375 if($_POST['https'])
00376 {
00377 include_once './classes/class.ilHTTPS.php';
00378
00379 if(!ilHTTPS::_checkHTTPS())
00380 {
00381 sendInfo($this->lng->txt('https_not_possible'));
00382 $form_valid = false;
00383 }
00384 if(!ilHTTPS::_checkHTTP())
00385 {
00386 sendInfo($this->lng->txt('http_not_possible'));
00387 $form_valid = false;
00388 }
00389 }
00390
00391
00392 if (empty($_POST["admin_firstname"]) or empty($_POST["admin_lastname"])
00393 or empty($_POST["admin_street"]) or empty($_POST["admin_zipcode"])
00394 or empty($_POST["admin_country"]) or empty($_POST["admin_city"])
00395 or empty($_POST["admin_phone"]) or empty($_POST["admin_email"]))
00396 {
00397
00398 sendInfo($this->lng->txt("fill_out_all_required_fields"));
00399 $form_valid = false;
00400 }
00401
00402
00403 if (!ilUtil::is_email($_POST["feedback_recipient"]) and !empty($_POST["feedback_recipient"]) and $form_valid)
00404 {
00405 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("feedback_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
00406 $form_valid = false;
00407 }
00408
00409
00410 if (!ilUtil::is_email($_POST["error_recipient"]) and !empty($_POST["error_recipient"]) and $form_valid)
00411 {
00412 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("error_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
00413 $form_valid = false;
00414 }
00415
00416
00417 if (!ilUtil::is_email($_POST["admin_email"]) and $form_valid)
00418 {
00419 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("email")."'<br/>".$this->lng->txt("email_not_valid"));
00420 $form_valid = false;
00421 }
00422
00423
00424 foreach ($_POST as $key => $val)
00425 {
00426 if($key != "cmd")
00427 {
00428 $_POST[$key] = ilUtil::prepareFormOutput($val,true);
00429 }
00430 }
00431
00432 if (!$form_valid)
00433 {
00435
00436
00437
00438 $settings["feedback_recipient"] = $_POST["feedback_recipient"];
00439 $settings["error_recipient"] = $_POST["error_recipient"];
00440
00441
00442 $settings["pub_section"] = $_POST["pub_section"];
00443 $settings["enable_calendar"] = $_POST["enable_calendar"];
00444 $settings["default_repository_view"] = $_POST["default_rep_view"];
00445 $settings["password_assistance"] = $_POST["password_assistance"];
00446 $settings["passwd_auto_generate"] = $_POST["password_auto_generate"];
00447
00448 $settings["enable_trash"] = $_POST["enable_trash"];
00449 $settings["https"] = $_POST["https"];
00450
00451
00452 $settings["admin_firstname"] = $_POST["admin_firstname"];
00453 $settings["admin_lastname"] = $_POST["admin_lastname"];
00454 $settings["admin_title"] = $_POST["admin_title"];
00455 $settings["admin_position"] = $_POST["admin_position"];
00456 $settings["admin_institution"] = $_POST["admin_institution"];
00457 $settings["admin_street"] = $_POST["admin_street"];
00458 $settings["admin_zipcode"] = $_POST["admin_zipcode"];
00459 $settings["admin_city"] = $_POST["admin_city"];
00460 $settings["admin_country"] = $_POST["admin_country"];
00461 $settings["admin_phone"] = $_POST["admin_phone"];
00462 $settings["admin_email"] = $_POST["admin_email"];
00463
00464
00465 $settings["cron_user_check"] = $_POST["cron_user_check"];
00466 $settings["cron_link_check"] = $_POST["cron_link_check"];
00467 $settings["cron_web_resource_check"] = $_POST["cron_web_resource_check"];
00468 $settings["cron_lucene_index"] = $_POST["cron_lucene_index"];
00469 $settings["forum_notification"] = $_POST["forum_notification"];
00470
00471
00472 $settings['frm_store_new'] = $_POST['frm_store_new'];
00473
00474
00475 $settings["soap_user_administration"] = $_POST["soap_user_administration"];
00476
00477
00478 $settings["enable_fora_statistics"] = $_POST["enable_fora_statistics"];
00479
00480 $settings["suffix_repl_additional"] = $_POST["suffix_repl_additional"];
00481
00482
00483 $settings["links_dynamic"] = $_POST["links_dynamic"];
00484 }
00485 else
00486 {
00487
00489
00490
00491
00492 $this->ilias->setSetting("feedback_recipient",$_POST["feedback_recipient"]);
00493 $this->ilias->setSetting("error_recipient",$_POST["error_recipient"]);
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521 $this->ilias->setSetting("pub_section",$_POST["pub_section"]);
00522 $this->ilias->setSetting("enable_calendar",$_POST["enable_calendar"]);
00523 $this->ilias->setSetting("default_repository_view",$_POST["default_rep_view"]);
00524 $this->ilias->setSetting('https',$_POST['https']);
00525 $this->ilias->setSetting('password_assistance',$_POST['password_assistance']);
00526 $this->ilias->setSetting('passwd_auto_generate',$_POST['password_auto_generate']);
00527
00528
00529 $this->ilias->setSetting('enable_trash',$_POST['enable_trash']);
00530
00531
00532 $this->ilias->setSetting("admin_firstname",$_POST["admin_firstname"]);
00533 $this->ilias->setSetting("admin_lastname",$_POST["admin_lastname"]);
00534 $this->ilias->setSetting("admin_title",$_POST["admin_title"]);
00535 $this->ilias->setSetting("admin_position",$_POST["admin_position"]);
00536 $this->ilias->setSetting("admin_institution",$_POST["admin_institution"]);
00537 $this->ilias->setSetting("admin_street",$_POST["admin_street"]);
00538 $this->ilias->setSetting("admin_zipcode",$_POST["admin_zipcode"]);
00539 $this->ilias->setSetting("admin_city",$_POST["admin_city"]);
00540 $this->ilias->setSetting("admin_country",$_POST["admin_country"]);
00541 $this->ilias->setSetting("admin_phone",$_POST["admin_phone"]);
00542 $this->ilias->setSetting("admin_email",$_POST["admin_email"]);
00543
00544
00545 $this->ilias->setSetting("cron_user_check",$_POST["cron_user_check"]);
00546 $this->ilias->setSetting("cron_link_check",$_POST["cron_link_check"]);
00547 $this->ilias->setSetting("cron_web_resource_check",$_POST["cron_web_resource_check"]);
00548 $this->ilias->setSetting("cron_lucene_index",$_POST["cron_lucene_index"]);
00549 $this->ilias->setSetting("forum_notification",$_POST["forum_notification"]);
00550 if ($_POST["forum_notification"] == 2)
00551 {
00552 $this->ilias->setSetting("cron_forum_notification_last_date",date("Y-m-d H:i:s"));
00553 }
00554
00555
00556 $this->ilias->setSetting("soap_user_administration",$_POST["soap_user_administration"]);
00557 $this->ilias->setSetting("rpc_server_host",trim($_POST["rpc_server_host"]));
00558 $this->ilias->setSetting("rpc_server_port",trim($_POST["rpc_server_port"]));
00559
00560
00561 $this->ilias->setSetting("enable_fora_statistics",$_POST["enable_fora_statistics"]);
00562
00563
00564 $this->ilias->setSetting('frm_store_new',$_POST['frm_store_new']);
00565
00566
00567 $this->ilias->ini->write();
00568
00569
00570 $this->ilias->setSetting('links_dynamic',$_POST['links_dynamic']);
00571
00572 $this->ilias->setSetting("suffix_repl_additional",
00573 ilUtil::stripSlashes($_POST["suffix_repl_additional"]));
00574
00575 $settings = $this->ilias->getAllSettings();
00576
00577
00578 $feedback = $this->lng->txt("saved_successfully");
00579 if (trim($_POST["rpc_server_host"]) != "" ||
00580 trim($_POST["rpc_server_port"]) != "")
00581 {
00582 include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
00583 $rpc_settings =& new ilRPCServerSettings();
00584 if(!$rpc_settings->pingServer())
00585 {
00586 $feedback .= "<br />\n".$this->lng->txt('java_server_no_connection');
00587 }
00588 }
00589 sendInfo($feedback);
00590 }
00591
00592 $this->displayBasicSettings();
00593 }
00594
00600 function displayBasicSettings()
00601 {
00602 global $rbacsystem;
00603
00604 $this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.adm_basicdata.html");
00605
00606 $settings = $this->ilias->getAllSettings();
00607
00608 $this->tpl->setVariable("TXT_BASIC_DATA", $this->lng->txt("basic_data"));
00609
00611
00612
00613
00614 $this->tpl->setVariable("TXT_ILIAS_VERSION", $this->lng->txt("ilias_version"));
00615 $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("db_version"));
00616 $this->tpl->setVariable("TXT_CLIENT_ID", $this->lng->txt("client_id"));
00617 $this->tpl->setVariable("TXT_INST_ID", $this->lng->txt("inst_id"));
00618 $this->tpl->setVariable("TXT_ACTIVATE_HTTPS",$this->lng->txt('activate_https'));
00619 $this->tpl->setVariable("TXT_HOSTNAME", $this->lng->txt("host"));
00620 $this->tpl->setVariable("TXT_IP_ADDRESS", $this->lng->txt("ip_address"));
00621 $this->tpl->setVariable("TXT_SERVER_DATA", $this->lng->txt("server_data"));
00622 $this->tpl->setVariable("TXT_SERVER_PORT", $this->lng->txt("port"));
00623 $this->tpl->setVariable("TXT_SERVER_SOFTWARE", $this->lng->txt("server_software"));
00624 $this->tpl->setVariable("TXT_HTTP_PATH", $this->lng->txt("http_path"));
00625 $this->tpl->setVariable("TXT_ABSOLUTE_PATH", $this->lng->txt("absolute_path"));
00626 $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("inst_name"));
00627 $this->tpl->setVariable("TXT_INST_INFO", $this->lng->txt("inst_info"));
00628
00629 $this->tpl->setVariable("TXT_FEEDBACK_RECIPIENT", $this->lng->txt("feedback_recipient"));
00630 $this->tpl->setVariable("TXT_ERROR_RECIPIENT", $this->lng->txt("error_recipient"));
00631 $this->tpl->setVariable("TXT_HEADER_TITLE", $this->lng->txt("header_title"));
00632 $this->tpl->setVariable("TXT_CHANGE", $this->lng->txt("change"));
00633 $this->tpl->setVariable("LINK_HEADER_TITLE",
00634 $this->ctrl->getLinkTarget($this, "changeHeaderTitle"));
00635 $this->tpl->setVariable("VAL_HEADER_TITLE",
00636 ilObjSystemFolder::_getHeaderTitle());
00637
00638 include_once ("./classes/class.ilDBUpdate.php");
00639 $dbupdate = new ilDBUpdate($this->ilias->db,true);
00640
00641 if (!$dbupdate->getDBVersionStatus())
00642 {
00643 $this->tpl->setVariable("TXT_DB_UPDATE", " (<span class=\"warning\">".$this->lng->txt("db_need_update")."</span>)");
00644 }
00645
00646
00647 $this->tpl->setVariable("TXT_PUB_SECTION", $this->lng->txt("pub_section"));
00648 $this->tpl->setVariable("TXT_ENABLE_CALENDAR", $this->lng->txt("enable_calendar"));
00649 $this->tpl->setVariable("TXT_DEFAULT_REPOSITORY_VIEW", $this->lng->txt("def_repository_view"));
00650 $this->tpl->setVariable("TXT_FLAT", $this->lng->txt("flatview"));
00651 $this->tpl->setVariable("TXT_TREE", $this->lng->txt("treeview"));
00652
00653 $this->tpl->setVariable("TXT_ENABLE_PASSWORD_ASSISTANCE", $this->lng->txt("enable_password_assistance"));
00654 $this->tpl->setVariable("TXT_PASSWORD_AUTO_GENERATE_INFO",$this->lng->txt('passwd_generation_info'));
00655
00656 if (AUTH_DEFAULT != AUTH_LOCAL)
00657 {
00658 $this->tpl->setVariable("DISABLE_PASSWORD_ASSISTANCE", 'disabled=\"disabled\"');
00659 $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_DISABLED", $this->lng->txt("password_assistance_disabled"));
00660 }
00661
00662 $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_INFO", $this->lng->txt("password_assistance_info"));
00663
00664 $this->tpl->setVariable("TXT_ENABLE_PASSWORD_GENERATION",$this->lng->txt('passwd_generation'));
00665
00666
00667 $this->tpl->setVariable("TXT_FILE_SUFFIX_REPL", $this->lng->txt("file_suffix_repl"));
00668 $this->tpl->setVariable("INFO_FILE_SUFFIX_REPL",
00669 $this->lng->txt("file_suffix_repl_info")." ".SUFFIX_REPL_DEFAULT);
00670
00671 $this->tpl->setVariable("TXT_DYNAMIC_LINKS",$this->lng->txt('links_dynamic'));
00672 $this->tpl->setVariable("INFO_DYNAMIC_LINKS",$this->lng->txt('links_dynamic_info'));
00673
00674 $this->tpl->setVariable("TXT_ENABLE_TRASH",$this->lng->txt('enable_trash'));
00675 $this->tpl->setVariable("INFO_ENABLE_TRASH",$this->lng->txt('enable_trash_info'));
00676
00677
00678 $this->tpl->setVariable("TXT_SOFTWARE", $this->lng->txt("3rd_party_software"));
00679 $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("path_to_convert"));
00680 $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("path_to_zip"));
00681 $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("path_to_unzip"));
00682 $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("path_to_java"));
00683 $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("path_to_htmldoc"));
00684 $this->tpl->setVariable("TXT_LATEX_URL", $this->lng->txt("url_to_latex"));
00685
00686
00687 $this->tpl->setVariable("TXT_CRON",$this->lng->txt('cron_jobs'));
00688 $this->tpl->setVariable("TXT_CRON_DESC",$this->lng->txt('cron_jobs_desc'));
00689 $this->tpl->setVariable("TXT_CRON_USER_ACCOUNTS",$this->lng->txt('check_user_accounts'));
00690 $this->tpl->setVariable("CRON_USER_ACCOUNTS_DESC",$this->lng->txt('check_user_accounts_desc'));
00691 $this->tpl->setVariable("TXT_CRON_LINK_CHECK",$this->lng->txt('check_link'));
00692 $this->tpl->setVariable("CRON_LINK_CHECK_DESC",$this->lng->txt('check_link_desc'));
00693 $this->tpl->setVariable("TXT_CRON_WEB_RESOURCE_CHECK",$this->lng->txt('check_web_resources'));
00694 $this->tpl->setVariable("CRON_WEB_RESOURCE_CHECK_DESC",$this->lng->txt('check_web_resources_desc'));
00695
00696 $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX",$this->lng->txt('cron_lucene_index'));
00697 $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX_INFO",$this->lng->txt('cron_lucene_index_info'));
00698
00699 $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION",$this->lng->txt('cron_forum_notification'));
00700 $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_NEVER",$this->lng->txt('cron_forum_notification_never'));
00701 $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_DIRECTLY",$this->lng->txt('cron_forum_notification_directly'));
00702 $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_CRON",$this->lng->txt('cron_forum_notification_cron'));
00703 $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_DESC",$this->lng->txt('cron_forum_notification_desc'));
00704
00705 $this->tpl->setVariable("TXT_NEVER",$this->lng->txt('never'));
00706 $this->tpl->setVariable("TXT_DAILY",$this->lng->txt('daily'));
00707 $this->tpl->setVariable("TXT_WEEKLY",$this->lng->txt('weekly'));
00708 $this->tpl->setVariable("TXT_MONTHLY",$this->lng->txt('monthly'));
00709 $this->tpl->setVariable("TXT_QUARTERLY",$this->lng->txt('quarterly'));
00710
00711 $this->tpl->setVariable("TXT_WEBSERVICES",$this->lng->txt('webservices'));
00712 $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION",$this->lng->txt('soap_user_administration'));
00713 $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION_DESC",$this->lng->txt('soap_user_administration_desc'));
00714
00715 $this->tpl->setVariable("TXT_JAVA_SERVER",$this->lng->txt('java_server'));
00716 $this->tpl->setVariable("TXT_JAVA_SERVER_HOST",$this->lng->txt('java_server_host'));
00717 $this->tpl->setVariable("TXT_JAVA_SERVER_PORT",$this->lng->txt('java_server_port'));
00718 $this->tpl->setVariable("TXT_JAVA_SERVER_INFO",$this->lng->txt('java_server_info'));
00719 $this->tpl->setVariable("TXT_JAVA_SERVER_README",$this->lng->txt('java_server_readme'));
00720
00721 $this->tpl->setVariable("TXT_DATA_PRIVACY",$this->lng->txt('data_privacy'));
00722 $this->tpl->setVariable("TXT_ENABLE_FORA_STATISTICS",$this->lng->txt('enable_fora_statistics'));
00723 $this->tpl->setVariable("TXT_ENABLE_FORA_STATISTICS_DESC",$this->lng->txt('enable_fora_statistics_desc'));
00724
00725
00726 $this->tpl->setVariable("TXT_FORUMS",$this->lng->txt('obj_frm'));
00727 $this->tpl->setVariable("TXT_STATUS_NEW",$this->lng->txt('frm_status_new'));
00728 $this->tpl->setVariable("TXT_STATUS_NEW_DESC",$this->lng->txt('frm_status_new_desc'));
00729
00730 $this->tpl->setVariable("TXT_ONE_WEEK","1 ". $this->lng->txt('week'));
00731 $this->tpl->setVariable("TXT_TWO_WEEKS","2 ". $this->lng->txt('weeks'));
00732 $this->tpl->setVariable("TXT_FOUR_WEEKS","4 ". $this->lng->txt('weeks'));
00733 $this->tpl->setVariable("TXT_EIGHT_WEEKS","8 ". $this->lng->txt('weeks'));
00734
00735
00736 $this->tpl->setVariable("TXT_CONTACT_DATA", $this->lng->txt("contact_data"));
00737 $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
00738 $this->tpl->setVariable("TXT_ADMIN", $this->lng->txt("administrator"));
00739 $this->tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt("firstname"));
00740 $this->tpl->setVariable("TXT_LASTNAME", $this->lng->txt("lastname"));
00741 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
00742 $this->tpl->setVariable("TXT_POSITION", $this->lng->txt("position"));
00743 $this->tpl->setVariable("TXT_INSTITUTION", $this->lng->txt("institution"));
00744 $this->tpl->setVariable("TXT_STREET", $this->lng->txt("street"));
00745 $this->tpl->setVariable("TXT_ZIPCODE", $this->lng->txt("zipcode"));
00746 $this->tpl->setVariable("TXT_CITY", $this->lng->txt("city"));
00747 $this->tpl->setVariable("TXT_COUNTRY", $this->lng->txt("country"));
00748 $this->tpl->setVariable("TXT_PHONE", $this->lng->txt("phone"));
00749 $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
00750 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00751
00752
00754
00755
00756
00757 $this->tpl->setVariable("FORMACTION_BASICDATA", $this->ctrl->getFormAction($this));
00758 $this->tpl->setVariable("HTTP_PATH",ILIAS_HTTP_PATH);
00759 $this->tpl->setVariable("ABSOLUTE_PATH",ILIAS_ABSOLUTE_PATH);
00760 $this->tpl->setVariable("HOSTNAME", $_SERVER["SERVER_NAME"]);
00761 $this->tpl->setVariable("SERVER_PORT", $_SERVER["SERVER_PORT"]);
00762 $this->tpl->setVariable("SERVER_ADMIN", $_SERVER["SERVER_ADMIN"]);
00763 $this->tpl->setVariable("SERVER_SOFTWARE", $_SERVER["SERVER_SOFTWARE"]);
00764 $this->tpl->setVariable("IP_ADDRESS", $_SERVER["SERVER_ADDR"]);
00765 $this->tpl->setVariable("DB_VERSION",$settings["db_version"]);
00766 $this->tpl->setVariable("ILIAS_VERSION",$settings["ilias_version"]);
00767 $this->tpl->setVariable("INST_ID",$settings["inst_id"]);
00768 $this->tpl->setVariable("CLIENT_ID",CLIENT_ID);
00769 $this->tpl->setVariable("INST_NAME",$this->ilias->ini->readVariable("client","name"));
00770 $this->tpl->setVariable("INST_INFO",$this->ilias->ini->readVariable("client","description"));
00771 $this->tpl->setVariable("FEEDBACK_RECIPIENT",$settings["feedback_recipient"]);
00772 $this->tpl->setVariable("ERROR_RECIPIENT",$settings["error_recipient"]);
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812 if ($settings["pub_section"])
00813 {
00814 $this->tpl->setVariable("PUB_SECTION","checked=\"checked\"");
00815 }
00816
00817 if ($settings["enable_calendar"])
00818 {
00819 $this->tpl->setVariable("ENABLE_CALENDAR","checked=\"checked\"");
00820 }
00821
00822 if ($settings["default_repository_view"] == "tree")
00823 {
00824 $this->tpl->setVariable("TREESELECTED","selected=\"1\"");
00825 }
00826 else
00827 {
00828 $this->tpl->setVariable("FLATSELECTED","selected=\"1\"");
00829 }
00830
00831 if($settings['https'])
00832 {
00833 $this->tpl->setVariable("HTTPS","checked=\"checked\"");
00834 }
00835 if($settings['password_assistance'])
00836 {
00837 $this->tpl->setVariable("PASSWORD_ASSISTANCE","checked=\"checked\"");
00838 }
00839 if($settings['passwd_auto_generate'])
00840 {
00841 $this->tpl->setVariable("PASSWORD_AUTO_GENERATE","checked=\"checked\"");
00842 }
00843
00844
00845
00846
00847
00848
00849
00850
00851 $this->tpl->setVariable("SUFFIX_REPL_ADDITIONAL", ilUtil::prepareFormOutput($settings['suffix_repl_additional']));
00852
00853 if($settings['links_dynamic'])
00854 {
00855 $this->tpl->setVariable("LINKS_DYNAMIC_CHECKED","checked=\"checked\"");
00856 }
00857
00858 if($settings['enable_trash'])
00859 {
00860 $this->tpl->setVariable("ENABLE_TRASH_CHECKED","checked=\"checked\"");
00861 }
00862
00863 if ($settings["require_login"])
00864 {
00865 $this->tpl->setVariable("REQUIRE_LOGIN","checked=\"checked\"");
00866 }
00867 if ($settings["require_passwd"])
00868 {
00869 $this->tpl->setVariable("REQUIRE_PASSWD","checked=\"checked\"");
00870 }
00871 if ($settings["require_passwd2"])
00872 {
00873 $this->tpl->setVariable("REQUIRE_PASSWD2","checked=\"checked\"");
00874 }
00875 if ($settings["require_firstname"])
00876 {
00877 $this->tpl->setVariable("REQUIRE_FIRSTNAME","checked=\"checked\"");
00878 }
00879 if ($settings["require_gender"])
00880 {
00881 $this->tpl->setVariable("REQUIRE_GENDER","checked=\"checked\"");
00882 }
00883 if ($settings["require_lastname"])
00884 {
00885 $this->tpl->setVariable("REQUIRE_LASTNAME","checked=\"checked\"");
00886 }
00887 if ($settings["require_institution"])
00888 {
00889 $this->tpl->setVariable("REQUIRE_INSTITUTION","checked=\"checked\"");
00890 }
00891 if ($settings["require_department"])
00892 {
00893 $this->tpl->setVariable("REQUIRE_DEPARTMENT","checked=\"checked\"");
00894 }
00895 if ($settings["require_street"])
00896 {
00897 $this->tpl->setVariable("REQUIRE_STREET","checked=\"checked\"");
00898 }
00899 if ($settings["require_city"])
00900 {
00901 $this->tpl->setVariable("REQUIRE_CITY","checked=\"checked\"");
00902 }
00903 if ($settings["require_zipcode"])
00904 {
00905 $this->tpl->setVariable("REQUIRE_ZIPCODE","checked=\"checked\"");
00906 }
00907 if ($settings["require_country"])
00908 {
00909 $this->tpl->setVariable("REQUIRE_COUNTRY","checked=\"checked\"");
00910 }
00911 if ($settings["require_phone_office"])
00912 {
00913 $this->tpl->setVariable("REQUIRE_PHONE_OFFICE","checked=\"checked\"");
00914 }
00915 if ($settings["require_phone_home"])
00916 {
00917 $this->tpl->setVariable("REQUIRE_PHONE_HOME","checked=\"checked\"");
00918 }
00919 if ($settings["require_phone_mobile"])
00920 {
00921 $this->tpl->setVariable("REQUIRE_PHONE_MOBILE","checked=\"checked\"");
00922 }
00923 if ($settings["require_fax"])
00924 {
00925 $this->tpl->setVariable("REQUIRE_FAX","checked=\"checked\"");
00926 }
00927 if ($settings["require_email"])
00928 {
00929 $this->tpl->setVariable("REQUIRE_EMAIL","checked=\"checked\"");
00930 }
00931 if ($settings["require_hobby"])
00932 {
00933 $this->tpl->setVariable("REQUIRE_HOBBY","checked=\"checked\"");
00934 }
00935 if ($settings["require_default_role"])
00936 {
00937 $this->tpl->setVariable("REQUIRE_DEFAULT_ROLE","checked=\"checked\"");
00938 }
00939 if ($settings["require_referral_comment"])
00940 {
00941 $this->tpl->setVariable("REQUIRE_REFERRAL_COMMENT","checked=\"checked\"");
00942 }
00943 if ($settings["require_matriculation"])
00944 {
00945 $this->tpl->setVariable("REQUIRE_MATRICULATION","checked=\"checked\"");
00946 }
00947 if ($settings["cron_user_check"])
00948 {
00949 $this->tpl->setVariable("CRON_USER_CHECK","checked=\"checked\"");
00950 }
00951 if ($settings["cron_link_check"])
00952 {
00953 $this->tpl->setVariable("CRON_LINK_CHECK","checked=\"checked\"");
00954 }
00955 if($settings["cron_lucene_index"])
00956 {
00957 $this->tpl->setVariable("CRON_LUCENE_INDEX","checked=\"checked\"");
00958 }
00959 if ($settings["forum_notification"] == 0)
00960 {
00961 $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_NEVER_SELECTED"," selected");
00962 }
00963 else if ($settings["forum_notification"] == 1)
00964 {
00965 $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_DIRECTLY_SELECTED"," selected");
00966 }
00967 else if ($settings["forum_notification"] == 2)
00968 {
00969 $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_CRON_SELECTED"," selected");
00970 }
00971 if ($val = $settings["cron_web_resource_check"])
00972 {
00973 switch($val)
00974 {
00975 case 1:
00976 $this->tpl->setVariable("D_SELECT",'selected="selected"');
00977 break;
00978 case 2:
00979 $this->tpl->setVariable("W_SELECT",'selected="selected"');
00980 break;
00981 case 3:
00982 $this->tpl->setVariable("M_SELECT",'selected="selected"');
00983 break;
00984 case 4:
00985 $this->tpl->setVariable("Q_SELECT",'selected="selected"');
00986 break;
00987
00988 }
00989 }
00990 switch($settings['frm_store_new'])
00991 {
00992 case 1:
00993 $this->tpl->setVariable("ONE_SELECT",'selected="selected"');
00994 break;
00995
00996 case 2:
00997 $this->tpl->setVariable("TWO_SELECT",'selected="selected"');
00998 break;
00999
01000 case 4:
01001 $this->tpl->setVariable("FOUR_SELECT",'selected="selected"');
01002 break;
01003
01004 case 8:
01005 default:
01006 $this->tpl->setVariable("EIGHT_SELECT",'selected="selected"');
01007 break;
01008 }
01009 if ($settings["soap_user_administration"])
01010 {
01011 $this->tpl->setVariable("SOAP_USER_ADMINISTRATION_CHECK","checked=\"checked\"");
01012 }
01013
01014 $this->tpl->setVariable("JAVA_SERVER_HOST",$settings["rpc_server_host"]);
01015 $this->tpl->setVariable("JAVA_SERVER_PORT",$settings["rpc_server_port"]);
01016
01017 if ($settings["enable_fora_statistics"])
01018 {
01019 $this->tpl->setVariable("ENABLE_FORA_STATISTICS_CHECK","checked=\"checked\"");
01020 }
01021
01022
01023 $not_set = $this->lng->txt("path_not_set");
01024
01025 $this->tpl->setVariable("CONVERT_PATH",(PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
01026 $this->tpl->setVariable("ZIP_PATH",(PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
01027 $this->tpl->setVariable("UNZIP_PATH",(PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
01028 $this->tpl->setVariable("JAVA_PATH",(PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
01029 $this->tpl->setVariable("HTMLDOC_PATH",(PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
01030 $this->tpl->setVariable("LATEX_URL",(URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
01031
01032
01033 $this->tpl->setVariable("ADMIN_FIRSTNAME",$settings["admin_firstname"]);
01034 $this->tpl->setVariable("ADMIN_LASTNAME",$settings["admin_lastname"]);
01035 $this->tpl->setVariable("ADMIN_TITLE",$settings["admin_title"]);
01036 $this->tpl->setVariable("ADMIN_POSITION",$settings["admin_position"]);
01037 $this->tpl->setVariable("ADMIN_INSTITUTION",$settings["admin_institution"]);
01038 $this->tpl->setVariable("ADMIN_STREET",$settings["admin_street"]);
01039 $this->tpl->setVariable("ADMIN_ZIPCODE",$settings["admin_zipcode"]);
01040 $this->tpl->setVariable("ADMIN_CITY",$settings["admin_city"]);
01041 $this->tpl->setVariable("ADMIN_COUNTRY",$settings["admin_country"]);
01042 $this->tpl->setVariable("ADMIN_PHONE",$settings["admin_phone"]);
01043 $this->tpl->setVariable("ADMIN_EMAIL",$settings["admin_email"]);
01044
01045 $this->tpl->parseCurrentBlock();
01046 }
01047
01048 function viewScanLogObject()
01049 {
01050 return $this->viewScanLog();
01051 }
01052
01058 function checkObject()
01059 {
01060 global $rbacsystem;
01061
01062 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01063 {
01064 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
01065 }
01066
01067
01068 if ($_POST["mode"])
01069 {
01070
01071 $this->startValidator($_POST["mode"],$_POST["log_scan"]);
01072 }
01073 else
01074 {
01075
01076 include_once "classes/class.ilValidator.php";
01077 $validator = new ilValidator();
01078 $hasScanLog = $validator->hasScanLog();
01079
01080 $this->getTemplateFile("check");
01081
01082 if ($hasScanLog)
01083 {
01084 $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
01085 }
01086
01087 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
01088 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
01089 $this->tpl->setVariable("COLSPAN", 3);
01090 $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
01091 $this->tpl->setVariable("TXT_ANALYSIS_OPTIONS", $this->lng->txt("analysis_options"));
01092 $this->tpl->setVariable("TXT_REPAIR_OPTIONS", $this->lng->txt("repair_options"));
01093 $this->tpl->setVariable("TXT_OUTPUT_OPTIONS", $this->lng->txt("output_options"));
01094 $this->tpl->setVariable("TXT_SCAN", $this->lng->txt("scan"));
01095 $this->tpl->setVariable("TXT_SCAN_DESC", $this->lng->txt("scan_desc"));
01096 $this->tpl->setVariable("TXT_DUMP_TREE", $this->lng->txt("dump_tree"));
01097 $this->tpl->setVariable("TXT_DUMP_TREE_DESC", $this->lng->txt("dump_tree_desc"));
01098 $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
01099 $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
01100 $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
01101 $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
01102 $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
01103 $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
01104 $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
01105 $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
01106 $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
01107 $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
01108 $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
01109 $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
01110 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
01111 }
01112 }
01113
01119 function changeHeaderTitleObject()
01120 {
01121 global $rbacsystem, $styleDefinition;
01122
01123 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html");
01124
01125 $array_push = true;
01126
01127 if ($_SESSION["error_post_vars"])
01128 {
01129 $_SESSION["translation_post"] = $_SESSION["error_post_vars"];
01130 $_GET["mode"] = "session";
01131 $array_push = false;
01132 }
01133
01134
01135 if (($_GET["mode"] != "session"))
01136 {
01137 $data = $this->object->getHeaderTitleTranslations();
01138 $_SESSION["translation_post"] = $data;
01139 $array_push = false;
01140 }
01141 elseif ($_GET["entry"] != 0)
01142 {
01143 array_splice($_SESSION["translation_post"]["Fobject"],$_GET["entry"],1,array());
01144
01145 if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"])
01146 {
01147 $_SESSION["translation_post"]["default_language"] = "";
01148 }
01149 }
01150
01151 $data = $_SESSION["translation_post"];
01152
01153
01154 if (!$_GET["entry"] and $array_push)
01155 {
01156 $count = array_push($data["Fobject"],array("title" => "","desc" => ""));
01157 }
01158 else
01159 {
01160 $count = count($data["Fobject"]);
01161 }
01162
01163
01164 $strip = isset($_SESSION["translation_post"]) ? true : false;
01165
01166 foreach ($data["Fobject"] as $key => $val)
01167 {
01168
01169 if ($key == $count -1)
01170 {
01171 $this->tpl->setCurrentBlock("addTranslation");
01172 $this->tpl->setVariable("TXT_ADD_TRANSLATION",$this->lng->txt("add_translation")." >>");
01173 $this->tpl->parseCurrentBlock();
01174 }
01175
01176
01177 if ($key != 0)
01178 {
01179 $this->tpl->setCurrentBlock("removeTranslation");
01180 $this->tpl->setVariable("TXT_REMOVE_TRANSLATION",$this->lng->txt("remove_translation"));
01181 $this->ctrl->setParameter($this, "entry", $key);
01182 $this->ctrl->setParameter($this, "mode", "edit");
01183 $this->tpl->setVariable("LINK_REMOVE_TRANSLATION",
01184 $this->ctrl->getLinkTarget($this, "removeTranslation"));
01185 $this->tpl->parseCurrentBlock();
01186 }
01187
01188
01189 $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html", false);
01190 $this->tpl->setVariable("SEL_NAME", "Fobject[".$key."][lang]");
01191
01192 include_once("classes/class.ilMetaData.php");
01193
01194 $languages = ilMetaData::getLanguages();
01195
01196 foreach ($languages as $code => $language)
01197 {
01198 $this->tpl->setCurrentBlock("lg_option");
01199 $this->tpl->setVariable("VAL_LG", $code);
01200 $this->tpl->setVariable("TXT_LG", $language);
01201
01202 if ($code == $val["lang"])
01203 {
01204 $this->tpl->setVariable("SELECTED", "selected=\"selected\"");
01205 }
01206
01207 $this->tpl->parseCurrentBlock();
01208 }
01209
01210
01211 $this->tpl->setCurrentBlock("obj_form");
01212
01213 if ($key == 0)
01214 {
01215 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title"));
01216 }
01217 else
01218 {
01219 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation")." ".$key);
01220 }
01221
01222 if ($key == $data["default_language"])
01223 {
01224 $this->tpl->setVariable("CHECKED", "checked=\"checked\"");
01225 }
01226
01227 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
01228 $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
01229 $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default"));
01230 $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
01231 $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"],$strip));
01232 $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"]));
01233 $this->tpl->setVariable("NUM", $key);
01234 $this->tpl->parseCurrentBlock();
01235 }
01236
01237
01238 $this->tpl->setCurrentBlock("adm_content");
01239
01240 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
01241 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
01242 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
01243 $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle");
01244 $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
01245 }
01246
01250 function saveHeaderTitleObject()
01251 {
01252 $data = $_POST;
01253
01254
01255 if (!isset($data["default_language"]))
01256 {
01257 $this->ilias->raiseError($this->lng->txt("msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
01258 }
01259
01260
01261 foreach ($data["Fobject"] as $key => $val)
01262 {
01263 $langs[$key] = $val["lang"];
01264 }
01265
01266 $langs = array_count_values($langs);
01267
01268
01269 if (array_key_exists("",$langs))
01270 {
01271 $this->ilias->raiseError($this->lng->txt("msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
01272 }
01273
01274
01275 if (array_sum($langs) > count($langs))
01276 {
01277 $this->ilias->raiseError($this->lng->txt("msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
01278 }
01279
01280
01281 $_POST["Fobject"]["title"] = $_POST["Fobject"][$_POST["default_language"]]["title"];
01282 $_POST["Fobject"]["desc"] = $_POST["Fobject"][$_POST["default_language"]]["desc"];
01283
01284
01285 $this->object->removeHeaderTitleTranslations();
01286
01287
01288 foreach ($data["Fobject"] as $key => $val)
01289 {
01290 if ($key == $data["default_language"])
01291 {
01292 $default = 1;
01293 }
01294 else
01295 {
01296 $default = 0;
01297 }
01298
01299 $this->object->addHeaderTitleTranslation(ilUtil::stripSlashes($val["title"]),ilUtil::stripSlashes($val["desc"]),$val["lang"],$default);
01300 }
01301
01302 sendInfo($this->lng->txt("msg_obj_modified"),true);
01303
01304 $this->ctrl->redirect($this);
01305 }
01306
01307 function cancelObject()
01308 {
01309 $this->ctrl->redirect($this, "view");
01310 }
01311
01317 function addHeaderTitleTranslationObject()
01318 {
01319 $_SESSION["translation_post"] = $_POST;
01320
01321 $this->ctrl->setParameter($this, "mode", "session");
01322 $this->ctrl->setParameter($this, "entry", "0");
01323 $this->ctrl->redirect($this, "changeHeaderTitle");
01324 }
01325
01331 function removeTranslationObject()
01332 {
01333 $this->ctrl->setParameter($this, "entry", $_GET["entry"]);
01334 $this->ctrl->setParameter($this, "mode", "session");
01335 $this->ctrl->redirect($this, "changeHeaderTitle");
01336 }
01337
01338
01339 function startValidator($a_mode,$a_log)
01340 {
01341 global $rbacsystem;
01342
01343 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01344 {
01345 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
01346 }
01347
01348 $logging = ($a_log) ? true : false;
01349 include_once "classes/class.ilValidator.php";
01350 $validator = new ilValidator($logging);
01351 $validator->setMode("all",false);
01352
01353 $modes = array();
01354 foreach ($a_mode as $mode => $value)
01355 {
01356 $validator->setMode($mode,(bool) $value);
01357 $modes[] = $mode.'='.$value;
01358 }
01359
01360 $scan_log = $validator->validate();
01361
01362 $mode = $this->lng->txt("scan_modes").": ".implode(', ',$modes);
01363
01364
01365 $this->getTemplateFile("scan");
01366
01367 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
01368 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system"));
01369 $this->tpl->setVariable("COLSPAN", 3);
01370 $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
01371 $this->tpl->setVariable("TXT_MODE", $mode);
01372
01373 if ($logging === true)
01374 {
01375 $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log"));
01376 }
01377
01378 $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
01379
01380 $validator->writeScanLogLine($mode);
01381 }
01382
01383 function viewScanLog()
01384 {
01385 include_once "classes/class.ilValidator.php";
01386 $validator = new IlValidator();
01387 $scan_log =& $validator->readScanLog();
01388
01389 if (is_array($scan_log))
01390 {
01391 $scan_log = '<pre>'.implode("",$scan_log).'</pre>';
01392 $this->tpl->setVariable("ADM_CONTENT", $scan_log);
01393 }
01394 else
01395 {
01396 $scan_log = "no scanlog found.";
01397 }
01398
01399
01400 $this->getTemplateFile("scan");
01401 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scan_details"));
01402 $this->tpl->setVariable("COLSPAN", 3);
01403 $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
01404 $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
01405 }
01406
01407
01411 function benchmarkObject()
01412 {
01413 global $ilBench, $rbacsystem;
01414
01415 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01416 {
01417 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
01418 }
01419
01420 $this->getTemplateFile("bench");
01421 $this->ctrl->setParameter($this,'cur_mode',$_GET['cur_mod']);
01422 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
01423 $this->tpl->setVariable("TXT_BENCH_SETTINGS", $this->lng->txt("benchmark_settings"));
01424 $this->tpl->setVariable("TXT_ACTIVATION", $this->lng->txt("activation"));
01425 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_settings"));
01426 $this->tpl->setVariable("TXT_CUR_RECORDS", $this->lng->txt("cur_number_rec"));
01427 $this->tpl->setVariable("VAL_CUR_RECORDS", $ilBench->getCurrentRecordNumber());
01428 $this->tpl->setVariable("TXT_MAX_RECORDS", $this->lng->txt("max_number_rec"));
01429 $this->tpl->setVariable("VAL_MAX_RECORDS", $ilBench->getMaximumRecords());
01430 $this->tpl->setVariable("TXT_CLEAR", $this->lng->txt("delete_all_rec"));
01431 if($ilBench->isEnabled())
01432 {
01433 $this->tpl->setVariable("ACT_CHECKED", " checked=\"1\" ");
01434 }
01435
01436 $modules = $ilBench->getMeasuredModules();
01437
01438 if (count($modules) > 0)
01439 {
01440 $this->tpl->setCurrentBlock("eval_table");
01441
01442 $cur_module = ($_GET["cur_mod"] != "" &&
01443 in_array($_GET["cur_mod"], $modules))
01444 ? $_GET["cur_mod"]
01445 : current($modules);
01446
01447 $benchs = $ilBench->getEvaluation($cur_module);
01448
01449 $i=0;
01450 foreach($benchs as $bench)
01451 {
01452 $this->tpl->setCurrentBlock("eval_row");
01453 $this->tpl->setVariable("ROWCOL",
01454 ilUtil::switchColor($i++, "tblrow2", "tblrow1"));
01455
01456 $this->tpl->setVariable("VAL_BENCH", $bench["benchmark"]);
01457 $this->tpl->setVariable("VAL_NUMBER_RECORDS", $bench["cnt"]);
01458 $this->tpl->setVariable("VAL_AVG_TIME", $bench["duration"]);
01459 $this->tpl->setVariable("VAL_MIN_TIME", $bench["min"]);
01460 $this->tpl->setVariable("VAL_MAX_TIME", $bench["max"]);
01461 $this->tpl->setVariable("VAL_CUM_TIME", $bench["duration"] * $bench["cnt"]);
01462 $this->tpl->parseCurrentBlock();
01463 }
01464
01465 $this->tpl->setVariable("SELECT_MODULE",
01466 ilUtil::formSelect($cur_module, "module",$modules, false, true));
01467
01468 $this->tpl->setVariable("TXT_SHOW", $this->lng->txt("show"));
01469 $this->tpl->setVariable("TXT_BENCH", $this->lng->txt("benchmark"));
01470 $this->tpl->setVariable("TXT_NUMBER_RECORDS", $this->lng->txt("number_of_records"));
01471 $this->tpl->setVariable("TXT_AVG_TIME", $this->lng->txt("average_time"));
01472 $this->tpl->setVariable("TXT_MIN_TIME", $this->lng->txt("min_time"));
01473 $this->tpl->setVariable("TXT_MAX_TIME", $this->lng->txt("max_time"));
01474 $this->tpl->setVariable("TXT_CUM_TIME", $this->lng->txt("cumulative_time"));
01475
01476 $this->tpl->parseCurrentBlock();
01477 }
01478 }
01479
01480
01484 function saveBenchSettingsObject()
01485 {
01486 global $ilBench;
01487
01488 if ($_POST["activate"] == "y")
01489 {
01490 $ilBench->enable(true);
01491 }
01492 else
01493 {
01494 $ilBench->enable(false);
01495 }
01496
01497 $ilBench->setMaximumRecords($_POST["max_records"]);
01498
01499 sendinfo($this->lng->txt("msg_obj_modified"), true);
01500
01501 $this->ctrl->redirect($this, "benchmark");
01502 }
01503
01504
01508 function switchBenchModuleObject()
01509 {
01510 global $ilBench;
01511
01512 $this->ctrl->setParameter($this,'cur_mod',$_POST['module']);
01513 $this->ctrl->redirect($this, "benchmark");
01514 }
01515
01516
01520 function clearBenchObject()
01521 {
01522 global $ilBench;
01523
01524 $ilBench->clearData();
01525 $this->saveBenchSettingsObject();
01526
01527 }
01528
01529
01530 function getAdminTabs(&$tabs_gui)
01531 {
01532 global $rbacsystem;
01533
01534 $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
01535
01536 if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01537 {
01538 $tabs_gui->addTarget("settings",
01539 $this->ctrl->getLinkTarget($this, "view"), array("view", "saveSettings"), get_class($this));
01540 }
01541
01542 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
01543 {
01544
01545
01546
01547 $tabs_gui->addTarget("system_check",
01548 $this->ctrl->getLinkTarget($this, "check"), array("check","viewScanLog"), get_class($this));
01549
01550 $tabs_gui->addTarget("benchmarks",
01551 $this->ctrl->getLinkTarget($this, "benchmark"), "benchmark", get_class($this));
01552 }
01553
01554 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
01555 {
01556 $tabs_gui->addTarget("perm_settings",
01557 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
01558 }
01559 }
01560 }
01561 ?>