• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

classes/class.ilObjSystemFolderGUI.php

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

Generated on Fri Dec 13 2013 17:56:48 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1