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

Generated on Fri Dec 13 2013 11:57:55 for ILIAS Release_3_6_x_branch .rev 46809 by  doxygen 1.7.1