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

Generated on Fri Dec 13 2013 09:06:34 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1