ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjSystemFolderGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
36 require_once "./classes/class.ilObjectGUI.php";
37 
39 {
45  var $type;
46 
51  function ilObjSystemFolderGUI($a_data,$a_id,$a_call_by_reference)
52  {
53  $this->type = "adm";
54  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
55 
56  $this->lng->loadLanguageModule("administration");
57  }
58 
59  function &executeCommand()
60  {
61  global $rbacsystem;
62 
63  $next_class = $this->ctrl->getNextClass($this);
64  $this->prepareOutput();
65  switch($next_class)
66  {
67  case 'ilpermissiongui':
68  include_once("./classes/class.ilPermissionGUI.php");
69  $perm_gui =& new ilPermissionGUI($this);
70  $ret =& $this->ctrl->forwardCommand($perm_gui);
71  break;
72 
73  default:
74 //var_dump($_POST);
75  $cmd = $this->ctrl->getCmd("view");
76 
77  $cmd .= "Object";
78  $this->$cmd();
79 
80  break;
81  }
82  return true;
83  }
84 
85 
91  function viewObject()
92  {
93  global $rbacsystem;
94 
95  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
96  {
97  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
98  }
99 
100  //prepare objectlist
101  $this->objectList = array();
102  $this->data["data"] = array();
103  $this->data["ctrl"] = array();
104  $this->data["cols"] = array("type", "title");
105 
106  $childs = $this->tree->getChilds($this->object->getRefId(),$_GET["order"],$_GET["direction"]);
107 
108  foreach ($childs as $key => $val)
109  {
110  // visible
111  if (!$rbacsystem->checkAccess("visible",$val["ref_id"]))
112  {
113  continue;
114  }
115 
116  // hide object types in devmode
117  if ($this->objDefinition->getDevMode($val["type"]))
118  {
119  continue;
120  }
121 
122  // hide RecoveryFolder if empty
123  if ($val["ref_id"] == RECOVERY_FOLDER_ID and !$this->tree->getChilds(RECOVERY_FOLDER_ID))
124  {
125  continue;
126  }
127 
128  //visible data part
129  $this->data["data"][] = array(
130  "type" => $val["type"],
131  "title" => $val["title"]."#separator#".$val["desc"],
132  "ref_id" => $val["ref_id"]
133  );
134 
135  //control information is set below
136 
137  } //foreach
138 
139  // add entry for switching to repository admin
140  $this->data["data"][] = array(
141  "type" => "root",
142  "title" => $this->lng->txt("repository_admin")."#separator#".
143  $this->lng->txt("repository_admin_desc"),
144  "ref_id" => ROOT_FOLDER_ID
145  );
146 
147  $this->maxcount = count($this->data["data"]);
148 
149  // sorting array
150  if ($_GET["sort_by"] == "")
151  {
152  $_GET["sort_by"] = "title";
153  }
154  $this->data["data"] = ilUtil::sortArray($this->data["data"],$_GET["sort_by"],$_GET["sort_order"]);
155 
156  // now compute control information
157  foreach ($this->data["data"] as $key => $val)
158  {
159  $this->data["ctrl"][$key] = array(
160  "type" => $val["type"],
161  "ref_id" => $val["ref_id"]
162  );
163 
164  unset($this->data["data"][$key]["ref_id"]);
165  }
166 
167  //var_dump("<pre>",$this->data,"</pre>");
168 
169  // display admin subpanels
170  $this->displayList();
171 
172  // display basic settings form
173  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
174  {
175  $this->displayBasicSettings();
176  }
177  }
178 
184  function displayList()
185  {
186  global $rbacsystem;
187 
188  include_once "./Services/Table/classes/class.ilTableGUI.php";
189 
190  // load template for table
191  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
192  // load template for table content data
193  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
194 
195  $num = 0;
196 
197  if (!$this->call_by_reference)
198  {
199  $this->ctrl->setParameter($this, "obj_id", $this->obj_id);
200  }
201 
202  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
203 
204  // create table
205  $tbl = new ilTableGUI();
206 
207  // title & header columns
208  $tbl->setTitle($this->lng->txt("obj_".$this->object->getType()),"icon_".$this->object->getType().".gif",$this->lng->txt("obj_".$this->object->getType()));
209  //$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
210 
211  /*
212  foreach ($this->data["cols"] as $val)
213  {
214  $header_names[] = $this->lng->txt($val);
215  }*/
216 
217  $header_names[] = "";
218  $header_names[] = $this->lng->txt("obj_cat");
219 
220  $tbl->setHeaderNames($header_names);
221 
222  $header_params = $this->ctrl->getParameterArray($this, "view");
223  $tbl->setHeaderVars($this->data["cols"],$header_params);
224  $tbl->setColumnWidth(array("15","99%"));
225 
226  // control
227  $tbl->setOrderColumn($_GET["sort_by"]);
228  $tbl->setOrderDirection($_GET["sort_order"]);
229  $tbl->setLimit(0);
230  $tbl->setOffset(0);
231  $tbl->setMaxCount($this->maxcount);
232 
233  // footer
234  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
235  $tbl->disable("numinfo");
236 
237  // render table
238  $tbl->render();
239 
240  if (is_array($this->data["data"][0]))
241  {
242  //table cell
243  for ($i=0; $i < count($this->data["data"]); $i++)
244  {
245  $data = $this->data["data"][$i];
246  $ctrl = $this->data["ctrl"][$i];
247 
248  // color changing
249  $css_row = ilUtil::switchColor($i+1,"tblrow1","tblrow2");
250 
251  $this->tpl->setCurrentBlock("table_cell");
252  $this->tpl->setVariable("CELLSTYLE", "tblrow1");
253  $this->tpl->parseCurrentBlock();
254 
255  if ($ctrl["ref_id"] != ROOT_FOLDER_ID)
256  {
257  foreach ($data as $key => $val)
258  {
259  //build link
260  $obj_type = ilObject::_lookupType($ctrl["ref_id"],true);
261  $class_name = $this->objDefinition->getClassName($obj_type);
262  $class = strtolower("ilObj".$class_name."GUI");
263  $this->ctrl->setParameterByClass($class, "ref_id", $ctrl["ref_id"]);
264  $this->ctrl->setParameterByClass($class, "obj_id", $ctrl["ref_id"]);
265  $link = $this->ctrl->getLinkTargetByClass($class, "view");
266 
267  if ($key == "title")
268  {
269  $name_field = explode("#separator#",$val);
270  }
271 
272  if ($key == "title" || $key == "type")
273  {
274  $this->tpl->setCurrentBlock("begin_link");
275  $this->tpl->setVariable("LINK_TARGET", $link);
276 
277  $this->tpl->parseCurrentBlock();
278  $this->tpl->touchBlock("end_link");
279  }
280 
281  $this->tpl->setCurrentBlock("text");
282 
283  if ($key == "type")
284  {
285  $val = ilUtil::getImageTagByType($val,$this->tpl->tplPath);
286  }
287 
288  if ($key == "title")
289  {
290  $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
291 
292  $this->tpl->setCurrentBlock("subtitle");
293  $this->tpl->setVariable("DESC", $name_field[1]);
294  $this->tpl->parseCurrentBlock();
295  }
296  else
297  {
298  $this->tpl->setVariable("TEXT_CONTENT", $val);
299  }
300 
301  $this->tpl->parseCurrentBlock();
302  $this->tpl->setCurrentBlock("table_cell");
303  $this->tpl->parseCurrentBlock();
304 
305  } //foreach
306  }
307  else // extra root folder handling (repository)
308  {
309  //$this->tpl->parseCurrentBlock();
310  // link
311 
312  // icon
313  $val = ilUtil::getImageTagByType("root",$this->tpl->tplPath);
314  $this->tpl->setCurrentBlock("text");
315  $this->tpl->setVariable("TEXT_CONTENT", $val);
316  $this->tpl->parseCurrentBlock();
317 
318  $this->tpl->setCurrentBlock("table_cell");
319  $this->tpl->parseCurrentBlock();
320 
321  // Link
322  $this->tpl->setCurrentBlock("begin_link");
323  $this->ctrl->setParameterByClass("iladministrationgui",
324  "admin_mode", "repository");
325  $this->ctrl->setParameterByClass("iladministrationgui",
326  "ref_id", ROOT_FOLDER_ID);
327  $this->tpl->setVariable("LINK_TARGET",
328  $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"));
329  $this->tpl->setVariable("FRAME_TARGET",
330  " target=\"".ilFrameTargetInfo::_getFrame("MainContent")."\"");
331  $this->ctrl->clearParametersByClass("iladministrationgui");
332  $this->tpl->parseCurrentBlock();
333  $this->tpl->touchBlock("end_link");
334 
335 
336  // text
337  $name_field = explode("#separator#", $data["title"]);
338  $this->tpl->setCurrentBlock("text");
339  $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
340  $this->tpl->setCurrentBlock("subtitle");
341  $this->tpl->setVariable("DESC", $name_field[1]);
342  $this->tpl->parseCurrentBlock();
343 
344  $this->tpl->setCurrentBlock("table_cell");
345  $this->tpl->parseCurrentBlock();
346 
347  }
348 
349  $this->tpl->setCurrentBlock("tbl_content");
350  $this->tpl->setVariable("CSS_ROW", $css_row);
351  $this->tpl->parseCurrentBlock();
352  } //for
353 
354  } //if is_array
355  else
356  {
357  $this->tpl->setCurrentBlock("notfound");
358  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
359  $this->tpl->setVariable("NUM_COLS", $num);
360  $this->tpl->parseCurrentBlock();
361  }
362  }
363 
365  {
366  global $rbacsystem, $ilCtrl;
367 
368  $settings = $this->ilias->getAllSettings();
369 
370  //init checking var
371  $form_valid = true;
372 
373  // moved to privacy/security
374 
375  /*if($_POST['https'])
376  {
377  include_once './classes/class.ilHTTPS.php';
378 
379  if(!ilHTTPS::_checkHTTPS())
380  {
381  ilUtil::sendInfo($this->lng->txt('https_not_possible'));
382  $form_valid = false;
383  }
384  if(!ilHTTPS::_checkHTTP())
385  {
386  ilUtil::sendInfo($this->lng->txt('http_not_possible'));
387  $form_valid = false;
388  }
389  }*/
390 
391  // check required user information
392  if (empty($_POST["admin_firstname"]) or empty($_POST["admin_lastname"])
393  or empty($_POST["admin_street"]) or empty($_POST["admin_zipcode"])
394  or empty($_POST["admin_country"]) or empty($_POST["admin_city"])
395  or empty($_POST["admin_phone"]) or empty($_POST["admin_email"]))
396  {
397  // feedback
398  ilUtil::sendInfo($this->lng->txt("fill_out_all_required_fields"));
399  $form_valid = false;
400  }
401  // check email adresses
402  // feedback_recipient
403  if (!ilUtil::is_email($_POST["feedback_recipient"]) and !empty($_POST["feedback_recipient"]) and $form_valid)
404  {
405  ilUtil::sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("feedback_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
406  $form_valid = false;
407  }
408 
409  // error_recipient
410  if (!ilUtil::is_email($_POST["error_recipient"]) and !empty($_POST["error_recipient"]) and $form_valid)
411  {
412  ilUtil::sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("error_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
413  $form_valid = false;
414  }
415 
416  // admin email
417  if (!ilUtil::is_email($_POST["admin_email"]) and $form_valid)
418  {
419  ilUtil::sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("email")."'<br/>".$this->lng->txt("email_not_valid"));
420  $form_valid = false;
421  }
422 
423  // prepare output
424  foreach ($_POST as $key => $val)
425  {
426  if($key != "cmd")
427  {
428  $_POST[$key] = ilUtil::prepareFormOutput($val,true);
429  }
430  }
431 
432  if (!$form_valid) //required fields not satisfied. Set formular to already fill in values
433  {
435  // load user modified settings again
436 
437  // basic data
438  $settings["feedback_recipient"] = $_POST["feedback_recipient"];
439  $settings["error_recipient"] = $_POST["error_recipient"];
440 
441  // modules
442  $settings["pub_section"] = $_POST["pub_section"];
443  $settings["open_google"] = $_POST["open_google"];
444  $settings["default_repository_view"] = $_POST["default_rep_view"];
445  $settings["password_assistance"] = $_POST["password_assistance"];
446  $settings['short_inst_title'] = $_POST['short_inst_title'];
447  $settings["passwd_auto_generate"] = $_POST["password_auto_generate"];
448  //$settings["js_edit"] = $_POST["js_edit"];
449  $settings["enable_trash"] = $_POST["enable_trash"];
450  //$settings["https"] = $_POST["https"];
451 
452  // contact
453  $settings["admin_firstname"] = $_POST["admin_firstname"];
454  $settings["admin_lastname"] = $_POST["admin_lastname"];
455  $settings["admin_title"] = $_POST["admin_title"];
456  $settings["admin_position"] = $_POST["admin_position"];
457  $settings["admin_institution"] = $_POST["admin_institution"];
458  $settings["admin_street"] = $_POST["admin_street"];
459  $settings["admin_zipcode"] = $_POST["admin_zipcode"];
460  $settings["admin_city"] = $_POST["admin_city"];
461  $settings["admin_country"] = $_POST["admin_country"];
462  $settings["admin_phone"] = $_POST["admin_phone"];
463  $settings["admin_email"] = $_POST["admin_email"];
464 
465  // cron
466  $settings["cron_user_check"] = $_POST["cron_user_check"];
467  $settings["cron_link_check"] = $_POST["cron_link_check"];
468  $settings["cron_web_resource_check"] = $_POST["cron_web_resource_check"];
469  $settings["cron_lucene_index"] = $_POST["cron_lucene_index"];
470  $settings["forum_notification"] = $_POST["forum_notification"];
471  $settings["mail_notification"] = $_POST["mail_notification"];
472 
473  // forums
474  $settings['frm_store_new'] = $_POST['frm_store_new'];
475 
476  // soap
477  $settings["soap_user_administration"] = $_POST["soap_user_administration"];
478 
479  // data privacy
480  /* $settings["enable_fora_statistics"] = $_POST["enable_fora_statistics"]; */
481 
482  $settings["suffix_repl_additional"] = $_POST["suffix_repl_additional"];
483 
484  // dynamic links
485  $settings["links_dynamic"] = $_POST["links_dynamic"];
486  }
487  else // all required fields ok
488  {
489 
491  // write new settings
492 
493  // basic data
494  $this->ilias->setSetting("feedback_recipient",$_POST["feedback_recipient"]);
495  $this->ilias->setSetting("error_recipient",$_POST["error_recipient"]);
496  //$this->ilias->ini->setVariable("language","default",$_POST["default_language"]);
497 
498  //set default skin and style
499  /*
500  if ($_POST["default_skin_style"] != "")
501  {
502  $sknst = explode(":", $_POST["default_skin_style"]);
503 
504  if ($this->ilias->ini->readVariable("layout","style") != $sknst[1] ||
505  $this->ilias->ini->readVariable("layout","skin") != $sknst[0])
506  {
507  $this->ilias->ini->setVariable("layout","skin", $sknst[0]);
508  $this->ilias->ini->setVariable("layout","style",$sknst[1]);
509  }
510  }*/
511  // set default view target
512  /*
513  if ($_POST["open_views_inside_frameset"] == "1")
514  {
515  $this->ilias->ini->setVariable("layout","view_target","frame");
516  }
517  else
518  {
519  $this->ilias->ini->setVariable("layout","view_target","window");
520  }*/
521 
522  // modules
523  $this->ilias->setSetting("pub_section",$_POST["pub_section"]);
524  $this->ilias->setSetting('open_google',$_POST['open_google']);
525  $this->ilias->setSetting("default_repository_view",$_POST["default_rep_view"]);
526  //$this->ilias->setSetting('https',$_POST['https']);
527  $this->ilias->setSetting('password_assistance',$_POST['password_assistance']);
528  $this->ilias->setSetting('passwd_auto_generate',$_POST['password_auto_generate']);
529 
530  //$this->ilias->setSetting('enable_js_edit',$_POST['js_edit']);
531  $this->ilias->setSetting('short_inst_name',$_POST['short_inst_name']);
532  $this->ilias->setSetting('enable_trash',$_POST['enable_trash']);
533 
534  // contact
535  $this->ilias->setSetting("admin_firstname",$_POST["admin_firstname"]);
536  $this->ilias->setSetting("admin_lastname",$_POST["admin_lastname"]);
537  $this->ilias->setSetting("admin_title",$_POST["admin_title"]);
538  $this->ilias->setSetting("admin_position",$_POST["admin_position"]);
539  $this->ilias->setSetting("admin_institution",$_POST["admin_institution"]);
540  $this->ilias->setSetting("admin_street",$_POST["admin_street"]);
541  $this->ilias->setSetting("admin_zipcode",$_POST["admin_zipcode"]);
542  $this->ilias->setSetting("admin_city",$_POST["admin_city"]);
543  $this->ilias->setSetting("admin_country",$_POST["admin_country"]);
544  $this->ilias->setSetting("admin_phone",$_POST["admin_phone"]);
545  $this->ilias->setSetting("admin_email",$_POST["admin_email"]);
546 
547  // cron
548  $this->ilias->setSetting("cron_user_check",$_POST["cron_user_check"]);
549  $this->ilias->setSetting("cron_link_check",$_POST["cron_link_check"]);
550  $this->ilias->setSetting("cron_web_resource_check",$_POST["cron_web_resource_check"]);
551  $this->ilias->setSetting("cron_lucene_index",$_POST["cron_lucene_index"]);
552  $this->ilias->setSetting("forum_notification",$_POST["forum_notification"]);
553  if ($_POST["forum_notification"] == 2)
554  {
555  $this->ilias->setSetting("cron_forum_notification_last_date",date("Y-m-d H:i:s"));
556  }
557  $this->ilias->setSetting("mail_notification", $_POST["mail_notification"]);
558 
559 
560  // webservice
561  $this->ilias->setSetting("soap_user_administration",$_POST["soap_user_administration"]);
562  $this->ilias->setSetting("rpc_server_host",trim($_POST["rpc_server_host"]));
563  $this->ilias->setSetting("rpc_server_port",trim($_POST["rpc_server_port"]));
564 
565  // data privacy
566  // $this->ilias->setSetting("enable_fora_statistics",$_POST["enable_fora_statistics"]);
567 
568  // forums
569  $this->ilias->setSetting('frm_store_new',$_POST['frm_store_new']);
570 
571  // write ini settings
572  $this->ilias->ini->write();
573 
574  // links dynamic
575  $this->ilias->setSetting('links_dynamic',$_POST['links_dynamic']);
576 
577  $this->ilias->setSetting("suffix_repl_additional",
578  ilUtil::stripSlashes($_POST["suffix_repl_additional"]));
579 
580  $settings = $this->ilias->getAllSettings();
581 
582  // feedback
583  $feedback = $this->lng->txt("saved_successfully");
584  if (trim($_POST["rpc_server_host"]) != "" ||
585  trim($_POST["rpc_server_port"]) != "")
586  {
587  include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
588  $rpc_settings =& new ilRPCServerSettings();
589  if(!$rpc_settings->pingServer())
590  {
591  $feedback .= "<br />\n".$this->lng->txt('java_server_no_connection');
592  }
593  }
594  ilUtil::sendInfo($feedback);
595  }
596 
597  $ilCtrl->redirect($this, "view");
598  //$this->displayBasicSettings();
599  }
600 
602  {
603  include_once("./Modules/Wiki/classes/class.ilWikiDBCreator.php");
605  $this->viewObject();
606  }
607 
614  {
615  global $rbacsystem, $ilCtrl;
616 
617  $this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.adm_basicdata.html");
618 
619  $settings = $this->ilias->getAllSettings();
620 
621  // temp wiki stuff
622  $this->tpl->setVariable("HREF_CREATE_WIKI_TABLE",
623  $ilCtrl->getLinkTarget($this, "createWikiTables"));
624 
625 
626 
627  $this->tpl->setVariable("TXT_BASIC_DATA", $this->lng->txt("basic_data"));
628 
630  // setting language vars
631 
632  // basic data
633  $this->tpl->setVariable("TXT_ILIAS_VERSION", $this->lng->txt("ilias_version"));
634  $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("db_version"));
635  $this->tpl->setVariable("TXT_CLIENT_ID", $this->lng->txt("client_id"));
636  $this->tpl->setVariable("TXT_INST_ID", $this->lng->txt("inst_id"));
637  $this->tpl->setVariable("TXT_ACTIVATE_HTTPS",$this->lng->txt('activate_https'));
638  $this->tpl->setVariable("TXT_HOSTNAME", $this->lng->txt("host"));
639  $this->tpl->setVariable("TXT_IP_ADDRESS", $this->lng->txt("ip_address"));
640  $this->tpl->setVariable("TXT_SERVER_DATA", $this->lng->txt("server_data"));
641  $this->tpl->setVariable("TXT_SERVER_PORT", $this->lng->txt("port"));
642  $this->tpl->setVariable("TXT_SERVER_SOFTWARE", $this->lng->txt("server_software"));
643  $this->tpl->setVariable("TXT_HTTP_PATH", $this->lng->txt("http_path"));
644  $this->tpl->setVariable("TXT_ABSOLUTE_PATH", $this->lng->txt("absolute_path"));
645  $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("inst_name"));
646  $this->tpl->setVariable("TXT_INST_INFO", $this->lng->txt("inst_info"));
647  //$this->tpl->setVariable("TXT_OPEN_VIEWS_INSIDE_FRAMESET", $this->lng->txt("open_views_inside_frameset"));
648  $this->tpl->setVariable("TXT_FEEDBACK_RECIPIENT", $this->lng->txt("feedback_recipient"));
649  $this->tpl->setVariable("TXT_ERROR_RECIPIENT", $this->lng->txt("error_recipient"));
650  $this->tpl->setVariable("TXT_HEADER_TITLE", $this->lng->txt("header_title"));
651  $this->tpl->setVariable("TXT_SHORT_NAME", $this->lng->txt("short_inst_name"));
652  $this->tpl->setVariable("TXT_SHORT_NAME_INFO", $this->lng->txt("short_inst_name_info"));
653 
654  $this->tpl->setVariable("VAL_SHORT_INST_NAME", $settings['short_inst_name']);
655  $this->tpl->setVariable("TXT_CHANGE", $this->lng->txt("change"));
656  $this->tpl->setVariable("LINK_HEADER_TITLE",
657  $this->ctrl->getLinkTarget($this, "changeHeaderTitle"));
658  $this->tpl->setVariable("VAL_HEADER_TITLE",
660 
661  include_once ("./classes/class.ilDBUpdate.php");
662  $dbupdate = new ilDBUpdate($this->ilias->db,true);
663 
664  if (!$dbupdate->getDBVersionStatus())
665  {
666  $this->tpl->setVariable("TXT_DB_UPDATE", "&nbsp;(<span class=\"warning\">".$this->lng->txt("db_need_update")."</span>)");
667  }
668 
669  //$this->tpl->setVariable("TXT_MODULES", $this->lng->txt("modules"));
670  $this->tpl->setVariable("TXT_PUB_SECTION", $this->lng->txt("pub_section"));
671 
672 
673  $this->tpl->setVariable('TXT_SEARCH_ENGINE',$this->lng->txt('search_engine'));
674  $this->tpl->setVariable('TXT_ENABLE_SEARCH_ENGINE',$this->lng->txt('enable_search_engine'));
675  include_once('Services/PrivacySecurity/classes/class.ilRobotSettings.php');
676  $robot_settings = ilRobotSettings::_getInstance();
677 
678  $error_se = false;
679  if(!$robot_settings->checkModRewrite())
680  {
681  $error_se = true;
682  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','disabled="disabled"');
683 
684  $this->tpl->setCurrentBlock('search_engine_alert');
685  $this->tpl->setVariable('SE_ALERT_IMG',ilUtil::getImagePath('icon_alert_s.gif'));
686  $this->tpl->setVariable('SE_ALT_ALERT',$this->lng->txt('alert'));
687  $this->tpl->setVariable('TXT_SE_ALERT',$this->lng->txt('mod_rewrite_disabled'));
688  $this->tpl->parseCurrentBlock();
689  }
690  elseif(!$robot_settings->checkRewrite())
691  {
692  $error_se = true;
693  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','disabled="disabled"');
694 
695  $this->tpl->setCurrentBlock('search_engine_alert');
696  $this->tpl->setVariable('SE_ALERT_IMG',ilUtil::getImagePath('icon_alert_s.gif'));
697  $this->tpl->setVariable('SE_ALT_ALERT',$this->lng->txt('alert'));
698  $this->tpl->setVariable('TXT_SE_ALERT',$this->lng->txt('allow_override_alert'));
699  $this->tpl->parseCurrentBlock();
700  }
701  if($settings['open_google'] and !$error_se)
702  {
703  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','checked="checked"');
704  }
705 
706  $this->tpl->setVariable("TXT_DEFAULT_REPOSITORY_VIEW", $this->lng->txt("def_repository_view"));
707  $this->tpl->setVariable("TXT_FLAT", $this->lng->txt("flatview"));
708  $this->tpl->setVariable("TXT_TREE", $this->lng->txt("treeview"));
709 
710  $this->tpl->setVariable("TXT_ENABLE_PASSWORD_ASSISTANCE", $this->lng->txt("enable_password_assistance"));
711  $this->tpl->setVariable("TXT_PASSWORD_AUTO_GENERATE_INFO",$this->lng->txt('passwd_generation_info'));
712  //rku: password assistent should be availabe always, even in mixed mode.
713  /* if (AUTH_DEFAULT != AUTH_LOCAL)
714  {
715  $this->tpl->setVariable("DISABLE_PASSWORD_ASSISTANCE", 'disabled=\"disabled\"');
716  $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_DISABLED", $this->lng->txt("password_assistance_disabled"));
717  }*/
718 
719  $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_INFO", $this->lng->txt("password_assistance_info"));
720 
721  $this->tpl->setVariable("TXT_ENABLE_PASSWORD_GENERATION",$this->lng->txt('passwd_generation'));
722 
723  // File Suffix Replacements
724  $this->tpl->setVariable("TXT_FILE_SUFFIX_REPL", $this->lng->txt("file_suffix_repl"));
725  $this->tpl->setVariable("INFO_FILE_SUFFIX_REPL",
726  $this->lng->txt("file_suffix_repl_info")." ".SUFFIX_REPL_DEFAULT);
727 
728  $this->tpl->setVariable("TXT_DYNAMIC_LINKS",$this->lng->txt('links_dynamic'));
729  $this->tpl->setVariable("INFO_DYNAMIC_LINKS",$this->lng->txt('links_dynamic_info'));
730 
731  $this->tpl->setVariable("TXT_ENABLE_TRASH",$this->lng->txt('enable_trash'));
732  $this->tpl->setVariable("INFO_ENABLE_TRASH",$this->lng->txt('enable_trash_info'));
733 
734  // paths
735  $this->tpl->setVariable("TXT_SOFTWARE", $this->lng->txt("3rd_party_software"));
736  $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("path_to_convert"));
737  $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("path_to_zip"));
738  $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("path_to_unzip"));
739  $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("path_to_java"));
740  $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("path_to_htmldoc"));
741  $this->tpl->setVariable("TXT_LATEX_URL", $this->lng->txt("url_to_latex"));
742 
743  // Cron
744  $this->tpl->setVariable("TXT_CRON",$this->lng->txt('cron_jobs'));
745  $this->tpl->setVariable("TXT_CRON_DESC",$this->lng->txt('cron_jobs_desc'));
746  $this->tpl->setVariable("TXT_CRON_USER_ACCOUNTS",$this->lng->txt('check_user_accounts'));
747  $this->tpl->setVariable("CRON_USER_ACCOUNTS_DESC",$this->lng->txt('check_user_accounts_desc'));
748  $this->tpl->setVariable("TXT_CRON_LINK_CHECK",$this->lng->txt('check_link'));
749  $this->tpl->setVariable("CRON_LINK_CHECK_DESC",$this->lng->txt('check_link_desc'));
750  $this->tpl->setVariable("TXT_CRON_WEB_RESOURCE_CHECK",$this->lng->txt('check_web_resources'));
751  $this->tpl->setVariable("CRON_WEB_RESOURCE_CHECK_DESC",$this->lng->txt('check_web_resources_desc'));
752 
753  $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX",$this->lng->txt('cron_lucene_index'));
754  $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX_INFO",$this->lng->txt('cron_lucene_index_info'));
755 
756  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION",$this->lng->txt('cron_forum_notification'));
757  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_NEVER",$this->lng->txt('cron_forum_notification_never'));
758  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_DIRECTLY",$this->lng->txt('cron_forum_notification_directly'));
759  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_CRON",$this->lng->txt('cron_forum_notification_cron'));
760  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_DESC",$this->lng->txt('cron_forum_notification_desc'));
761 
762  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION",$this->lng->txt('cron_mail_notification'));
763  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION_NEVER",$this->lng->txt('cron_mail_notification_never'));
764  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION_CRON",$this->lng->txt('cron_mail_notification_cron'));
765  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_DESC",$this->lng->txt('cron_mail_notification_desc'));
766 
767  $this->tpl->setVariable("TXT_NEVER",$this->lng->txt('never'));
768  $this->tpl->setVariable("TXT_DAILY",$this->lng->txt('daily'));
769  $this->tpl->setVariable("TXT_WEEKLY",$this->lng->txt('weekly'));
770  $this->tpl->setVariable("TXT_MONTHLY",$this->lng->txt('monthly'));
771  $this->tpl->setVariable("TXT_QUARTERLY",$this->lng->txt('quarterly'));
772 
773  $this->tpl->setVariable("TXT_WEBSERVICES",$this->lng->txt('webservices'));
774  $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION",$this->lng->txt('soap_user_administration'));
775  $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION_DESC",$this->lng->txt('soap_user_administration_desc'));
776 
777  $this->tpl->setVariable("TXT_JAVA_SERVER",$this->lng->txt('java_server'));
778  $this->tpl->setVariable("TXT_JAVA_SERVER_HOST",$this->lng->txt('java_server_host'));
779  $this->tpl->setVariable("TXT_JAVA_SERVER_PORT",$this->lng->txt('java_server_port'));
780  $this->tpl->setVariable("TXT_JAVA_SERVER_INFO",$this->lng->txt('java_server_info'));
781  $this->tpl->setVariable("TXT_JAVA_SERVER_README",$this->lng->txt('java_server_readme'));
782 
783 /* $this->tpl->setVariable("TXT_DATA_PRIVACY",$this->lng->txt('data_privacy'));
784  $this->tpl->setVariable("TXT_ENABLE_FORA_STATISTICS",$this->lng->txt('enable_fora_statistics'));
785  $this->tpl->setVariable("TXT_ENABLE_FORA_STATISTICS_DESC",$this->lng->txt('enable_fora_statistics_desc')); */
786 
787 
788  // forums
789  $this->tpl->setVariable("TXT_FORUMS",$this->lng->txt('obj_frm'));
790  $this->tpl->setVariable("TXT_STATUS_NEW",$this->lng->txt('frm_status_new'));
791  $this->tpl->setVariable("TXT_STATUS_NEW_DESC",$this->lng->txt('frm_status_new_desc'));
792 
793  $this->tpl->setVariable("TXT_ONE_WEEK","1 ". $this->lng->txt('week'));
794  $this->tpl->setVariable("TXT_TWO_WEEKS","2 ". $this->lng->txt('weeks'));
795  $this->tpl->setVariable("TXT_FOUR_WEEKS","4 ". $this->lng->txt('weeks'));
796  $this->tpl->setVariable("TXT_EIGHT_WEEKS","8 ". $this->lng->txt('weeks'));
797 
798  // contact
799  $this->tpl->setVariable("TXT_CONTACT_DATA", $this->lng->txt("contact_data"));
800  $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
801  $this->tpl->setVariable("TXT_ADMIN", $this->lng->txt("administrator"));
802  $this->tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt("firstname"));
803  $this->tpl->setVariable("TXT_LASTNAME", $this->lng->txt("lastname"));
804  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
805  $this->tpl->setVariable("TXT_POSITION", $this->lng->txt("position"));
806  $this->tpl->setVariable("TXT_INSTITUTION", $this->lng->txt("institution"));
807  $this->tpl->setVariable("TXT_STREET", $this->lng->txt("street"));
808  $this->tpl->setVariable("TXT_ZIPCODE", $this->lng->txt("zipcode"));
809  $this->tpl->setVariable("TXT_CITY", $this->lng->txt("city"));
810  $this->tpl->setVariable("TXT_COUNTRY", $this->lng->txt("country"));
811  $this->tpl->setVariable("TXT_PHONE", $this->lng->txt("phone"));
812  $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
813  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
814 
815 
817  // display formula data
818 
819  // basic data
820  $this->tpl->setVariable("FORMACTION_BASICDATA", $this->ctrl->getFormAction($this));
821  $this->tpl->setVariable("HTTP_PATH",ILIAS_HTTP_PATH);
822  $this->tpl->setVariable("ABSOLUTE_PATH",ILIAS_ABSOLUTE_PATH);
823  $this->tpl->setVariable("HOSTNAME", $_SERVER["SERVER_NAME"]);
824  $this->tpl->setVariable("SERVER_PORT", $_SERVER["SERVER_PORT"]);
825  $this->tpl->setVariable("SERVER_ADMIN", $_SERVER["SERVER_ADMIN"]); // not used
826  $this->tpl->setVariable("SERVER_SOFTWARE", $_SERVER["SERVER_SOFTWARE"]);
827  $this->tpl->setVariable("IP_ADDRESS", $_SERVER["SERVER_ADDR"]);
828  $this->tpl->setVariable("DB_VERSION",$settings["db_version"]);
829  $this->tpl->setVariable("ILIAS_VERSION",$settings["ilias_version"]);
830  $this->tpl->setVariable("INST_ID",$settings["inst_id"]);
831  $this->tpl->setVariable("CLIENT_ID",CLIENT_ID);
832  $this->tpl->setVariable("INST_NAME",$this->ilias->ini->readVariable("client","name"));
833  $this->tpl->setVariable("INST_INFO",$this->ilias->ini->readVariable("client","description"));
834  $this->tpl->setVariable("FEEDBACK_RECIPIENT",$settings["feedback_recipient"]);
835  $this->tpl->setVariable("ERROR_RECIPIENT",$settings["error_recipient"]);
836 
837  $this->tpl->setVariable("PHP_INFO_LINK",
838  $this->ctrl->getLinkTarget($this, "showPHPInfo"));
839 
840  // get all templates
841  /*
842  $templates = $styleDefinition->getAllTemplates();
843 
844  $this->tpl->setCurrentBlock("selectskin");
845 
846  foreach ($templates as $template)
847  {
848  // get styles definition for template
849  $styleDef =& new ilStyleDefinition($template["id"]);
850  $styleDef->startParsing();
851  $styles = $styleDef->getStyles();
852 
853  foreach ($styles as $style)
854  {
855  if ($this->ilias->ini->readVariable("layout","skin") == $template["id"] &&
856  $this->ilias->ini->readVariable("layout","style") == $style["id"])
857  {
858  $this->tpl->setVariable("SKINSELECTED", "selected=\"selected\"");
859  }
860 
861  $this->tpl->setVariable("SKINVALUE", $template["id"].":".$style["id"]);
862  $this->tpl->setVariable("SKINOPTION", $styleDef->getTemplateName()." / ".$style["name"]);
863  $this->tpl->parseCurrentBlock();
864  }
865  }*/
866 
867  // default view target
868  /*$view_target = $this->ilias->ini->readVariable("layout","view_target");
869  if ($view_target == "frame")
870  {
871  $this->tpl->setVariable("OPEN_VIEWS_INSIDE_FRAMESET","checked=\"checked\"");
872  }
873  else
874  {
875  $this->tpl->setVariable("OPEN_VIEWS_INSIDE_FRAMESET","");
876  }*/
877 
878  if ($settings["pub_section"])
879  {
880  $this->tpl->setVariable("PUB_SECTION","checked=\"checked\"");
881  }
882 
883  if ($settings["default_repository_view"] == "tree")
884  {
885  $this->tpl->setVariable("TREESELECTED","selected=\"1\"");
886  }
887  else
888  {
889  $this->tpl->setVariable("FLATSELECTED","selected=\"1\"");
890  }
891 
892  /*if($settings['https'])
893  {
894  $this->tpl->setVariable("HTTPS","checked=\"checked\"");
895  }*/
896  if($settings['password_assistance'])
897  {
898  $this->tpl->setVariable("PASSWORD_ASSISTANCE","checked=\"checked\"");
899  }
900  $this->tpl->setVariable("VAL_SHORT_NAME", $settings['short_inst_title']);
901  if($settings['passwd_auto_generate'])
902  {
903  $this->tpl->setVariable("PASSWORD_AUTO_GENERATE","checked=\"checked\"");
904  }
905 
906  // js editing
907  /*
908  if($settings['enable_js_edit'])
909  {
910  $this->tpl->setVariable("JS_EDIT","checked=\"checked\"");
911  }*/
912 
913  $this->tpl->setVariable("SUFFIX_REPL_ADDITIONAL", ilUtil::prepareFormOutput($settings['suffix_repl_additional']));
914 
915  if($settings['links_dynamic'])
916  {
917  $this->tpl->setVariable("LINKS_DYNAMIC_CHECKED","checked=\"checked\"");
918  }
919 
920  if($settings['enable_trash'])
921  {
922  $this->tpl->setVariable("ENABLE_TRASH_CHECKED","checked=\"checked\"");
923  }
924 
925  if ($settings["require_login"])
926  {
927  $this->tpl->setVariable("REQUIRE_LOGIN","checked=\"checked\"");
928  }
929  if ($settings["require_passwd"])
930  {
931  $this->tpl->setVariable("REQUIRE_PASSWD","checked=\"checked\"");
932  }
933  if ($settings["require_passwd2"])
934  {
935  $this->tpl->setVariable("REQUIRE_PASSWD2","checked=\"checked\"");
936  }
937  if ($settings["require_firstname"])
938  {
939  $this->tpl->setVariable("REQUIRE_FIRSTNAME","checked=\"checked\"");
940  }
941  if ($settings["require_gender"])
942  {
943  $this->tpl->setVariable("REQUIRE_GENDER","checked=\"checked\"");
944  }
945  if ($settings["require_lastname"])
946  {
947  $this->tpl->setVariable("REQUIRE_LASTNAME","checked=\"checked\"");
948  }
949  if ($settings["require_institution"])
950  {
951  $this->tpl->setVariable("REQUIRE_INSTITUTION","checked=\"checked\"");
952  }
953  if ($settings["require_department"])
954  {
955  $this->tpl->setVariable("REQUIRE_DEPARTMENT","checked=\"checked\"");
956  }
957  if ($settings["require_street"])
958  {
959  $this->tpl->setVariable("REQUIRE_STREET","checked=\"checked\"");
960  }
961  if ($settings["require_city"])
962  {
963  $this->tpl->setVariable("REQUIRE_CITY","checked=\"checked\"");
964  }
965  if ($settings["require_zipcode"])
966  {
967  $this->tpl->setVariable("REQUIRE_ZIPCODE","checked=\"checked\"");
968  }
969  if ($settings["require_country"])
970  {
971  $this->tpl->setVariable("REQUIRE_COUNTRY","checked=\"checked\"");
972  }
973  if ($settings["require_phone_office"])
974  {
975  $this->tpl->setVariable("REQUIRE_PHONE_OFFICE","checked=\"checked\"");
976  }
977  if ($settings["require_phone_home"])
978  {
979  $this->tpl->setVariable("REQUIRE_PHONE_HOME","checked=\"checked\"");
980  }
981  if ($settings["require_phone_mobile"])
982  {
983  $this->tpl->setVariable("REQUIRE_PHONE_MOBILE","checked=\"checked\"");
984  }
985  if ($settings["require_fax"])
986  {
987  $this->tpl->setVariable("REQUIRE_FAX","checked=\"checked\"");
988  }
989  if ($settings["require_email"])
990  {
991  $this->tpl->setVariable("REQUIRE_EMAIL","checked=\"checked\"");
992  }
993  if ($settings["require_hobby"])
994  {
995  $this->tpl->setVariable("REQUIRE_HOBBY","checked=\"checked\"");
996  }
997  if ($settings["require_default_role"])
998  {
999  $this->tpl->setVariable("REQUIRE_DEFAULT_ROLE","checked=\"checked\"");
1000  }
1001  if ($settings["require_referral_comment"])
1002  {
1003  $this->tpl->setVariable("REQUIRE_REFERRAL_COMMENT","checked=\"checked\"");
1004  }
1005  if ($settings["require_matriculation"])
1006  {
1007  $this->tpl->setVariable("REQUIRE_MATRICULATION","checked=\"checked\"");
1008  }
1009  if ($settings["cron_user_check"])
1010  {
1011  $this->tpl->setVariable("CRON_USER_CHECK","checked=\"checked\"");
1012  }
1013  if ($settings["cron_link_check"])
1014  {
1015  $this->tpl->setVariable("CRON_LINK_CHECK","checked=\"checked\"");
1016  }
1017  if($settings["cron_lucene_index"])
1018  {
1019  $this->tpl->setVariable("CRON_LUCENE_INDEX","checked=\"checked\"");
1020  }
1021  if ($settings["forum_notification"] == 0)
1022  {
1023  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_NEVER_SELECTED"," selected");
1024  }
1025  else if ($settings["forum_notification"] == 1)
1026  {
1027  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_DIRECTLY_SELECTED"," selected");
1028  }
1029  else if ($settings["forum_notification"] == 2)
1030  {
1031  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_CRON_SELECTED"," selected");
1032  }
1033  if ($settings["mail_notification"] == 0)
1034  {
1035  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_NEVER_SELECTED"," selected=\"selected\"");
1036  }
1037  else if ($settings["mail_notification"] == 1)
1038  {
1039  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_CRON_SELECTED"," selected=\"selected\"");
1040  }
1041  if ($val = $settings["cron_web_resource_check"])
1042  {
1043  switch($val)
1044  {
1045  case 1:
1046  $this->tpl->setVariable("D_SELECT",'selected="selected"');
1047  break;
1048  case 2:
1049  $this->tpl->setVariable("W_SELECT",'selected="selected"');
1050  break;
1051  case 3:
1052  $this->tpl->setVariable("M_SELECT",'selected="selected"');
1053  break;
1054  case 4:
1055  $this->tpl->setVariable("Q_SELECT",'selected="selected"');
1056  break;
1057 
1058  }
1059  }
1060  switch($settings['frm_store_new'])
1061  {
1062  case 1:
1063  $this->tpl->setVariable("ONE_SELECT",'selected="selected"');
1064  break;
1065 
1066  case 2:
1067  $this->tpl->setVariable("TWO_SELECT",'selected="selected"');
1068  break;
1069 
1070  case 4:
1071  $this->tpl->setVariable("FOUR_SELECT",'selected="selected"');
1072  break;
1073 
1074  case 8:
1075  default:
1076  $this->tpl->setVariable("EIGHT_SELECT",'selected="selected"');
1077  break;
1078  }
1079  if ($settings["soap_user_administration"])
1080  {
1081  $this->tpl->setVariable("SOAP_USER_ADMINISTRATION_CHECK","checked=\"checked\"");
1082  }
1083 
1084  $this->tpl->setVariable("JAVA_SERVER_HOST",$settings["rpc_server_host"]);
1085  $this->tpl->setVariable("JAVA_SERVER_PORT",$settings["rpc_server_port"]);
1086 
1087  /* if ($settings["enable_fora_statistics"])
1088  {
1089  $this->tpl->setVariable("ENABLE_FORA_STATISTICS_CHECK","checked=\"checked\"");
1090  }*/
1091 
1092 
1093  // paths to tools
1094  $not_set = $this->lng->txt("path_not_set");
1095 
1096  $this->tpl->setVariable("CONVERT_PATH",(PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
1097  $this->tpl->setVariable("ZIP_PATH",(PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
1098  $this->tpl->setVariable("UNZIP_PATH",(PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
1099  $this->tpl->setVariable("JAVA_PATH",(PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
1100  $this->tpl->setVariable("HTMLDOC_PATH",(PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
1101  $this->tpl->setVariable("LATEX_URL",(URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
1102 
1103  // contact
1104  $this->tpl->setVariable("ADMIN_FIRSTNAME",$settings["admin_firstname"]);
1105  $this->tpl->setVariable("ADMIN_LASTNAME",$settings["admin_lastname"]);
1106  $this->tpl->setVariable("ADMIN_TITLE",$settings["admin_title"]);
1107  $this->tpl->setVariable("ADMIN_POSITION",$settings["admin_position"]);
1108  $this->tpl->setVariable("ADMIN_INSTITUTION",$settings["admin_institution"]);
1109  $this->tpl->setVariable("ADMIN_STREET",$settings["admin_street"]);
1110  $this->tpl->setVariable("ADMIN_ZIPCODE",$settings["admin_zipcode"]);
1111  $this->tpl->setVariable("ADMIN_CITY",$settings["admin_city"]);
1112  $this->tpl->setVariable("ADMIN_COUNTRY",$settings["admin_country"]);
1113  $this->tpl->setVariable("ADMIN_PHONE",$settings["admin_phone"]);
1114  $this->tpl->setVariable("ADMIN_EMAIL",$settings["admin_email"]);
1115 
1116  $this->tpl->parseCurrentBlock();
1117  }
1118 
1120  {
1121  return $this->viewScanLog();
1122  }
1123 
1129  function checkObject()
1130  {
1131  global $rbacsystem, $ilias, $objDefinition;
1132 
1133  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1134  {
1135  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1136  }
1137 //echo "1";
1138 
1139  if ($_POST['count_limit'] !== null || $_POST['age_limit'] !== null || $_POST['type_limit'] !== null)
1140  {
1141  $ilias->account->writePref('systemcheck_count_limit',
1142  (is_numeric($_POST['count_limit']) && $_POST['count_limit'] > 0) ? $_POST['count_limit'] : ''
1143  );
1144  $ilias->account->writePref('systemcheck_age_limit',
1145  (is_numeric($_POST['age_limit']) && $_POST['age_limit'] > 0) ? $_POST['age_limit'] : '');
1146  $ilias->account->writePref('systemcheck_type_limit', trim($_POST['type_limit']));
1147  }
1148 
1149  if ($_POST["mode"])
1150  {
1151 //echo "3";
1152  $this->startValidator($_POST["mode"],$_POST["log_scan"]);
1153  }
1154  else
1155  {
1156 //echo "4";
1157  include_once "classes/class.ilValidator.php";
1158  $validator = new ilValidator();
1159  $hasScanLog = $validator->hasScanLog();
1160 
1161  $this->getTemplateFile("check");
1162 
1163  if ($hasScanLog)
1164  {
1165  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
1166  }
1167 
1168  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1169  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
1170  $this->tpl->setVariable("COLSPAN", 3);
1171  $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
1172  $this->tpl->setVariable("TXT_ANALYSIS_OPTIONS", $this->lng->txt("analysis_options"));
1173  $this->tpl->setVariable("TXT_REPAIR_OPTIONS", $this->lng->txt("repair_options"));
1174  $this->tpl->setVariable("TXT_OUTPUT_OPTIONS", $this->lng->txt("output_options"));
1175  $this->tpl->setVariable("TXT_SCAN", $this->lng->txt("scan"));
1176  $this->tpl->setVariable("TXT_SCAN_DESC", $this->lng->txt("scan_desc"));
1177  $this->tpl->setVariable("TXT_DUMP_TREE", $this->lng->txt("dump_tree"));
1178  $this->tpl->setVariable("TXT_DUMP_TREE_DESC", $this->lng->txt("dump_tree_desc"));
1179  $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
1180  $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
1181  $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
1182  $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
1183  $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
1184  $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
1185  $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
1186  $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
1187  $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
1188  $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
1189  $this->tpl->setVariable("TXT_COUNT_LIMIT", $this->lng->txt("purge_count_limit"));
1190  $this->tpl->setVariable("TXT_COUNT_LIMIT_DESC", $this->lng->txt("purge_count_limit_desc"));
1191  $this->tpl->setVariable("COUNT_LIMIT_VALUE", $ilias->account->getPref("systemcheck_count_limit"));
1192  $this->tpl->setVariable("TXT_AGE_LIMIT", $this->lng->txt("purge_age_limit"));
1193  $this->tpl->setVariable("TXT_AGE_LIMIT_DESC", $this->lng->txt("purge_age_limit_desc"));
1194  $this->tpl->setVariable("AGE_LIMIT_VALUE", $ilias->account->getPref("systemcheck_age_limit"));
1195  $this->tpl->setVariable("TXT_TYPE_LIMIT", $this->lng->txt("purge_type_limit"));
1196  $this->tpl->setVariable("TXT_TYPE_LIMIT_DESC", $this->lng->txt("purge_type_limit_desc"));
1197 
1198  $types = array_merge(array(""), $objDefinition->getAllObjects());
1199  $this->tpl->setVariable("TYPE_LIMIT_CHOICE",
1201  $ilias->account->getPref("systemcheck_type_limit"),
1202  'type_limit',
1203  $types
1204  )
1205  );
1206  $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
1207  $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
1208  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
1209  }
1210  }
1211 
1218  {
1219  global $rbacsystem, $styleDefinition;
1220 
1221  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html");
1222 
1223  $array_push = true;
1224 
1225  if ($_SESSION["error_post_vars"])
1226  {
1227  $_SESSION["translation_post"] = $_SESSION["error_post_vars"];
1228  $_GET["mode"] = "session";
1229  $array_push = false;
1230  }
1231 
1232  // load from db if edit category is called the first time
1233  if (($_GET["mode"] != "session"))
1234  {
1235  $data = $this->object->getHeaderTitleTranslations();
1236  $_SESSION["translation_post"] = $data;
1237  $array_push = false;
1238  } // remove a translation from session
1239  elseif ($_GET["entry"] != 0)
1240  {
1241  array_splice($_SESSION["translation_post"]["Fobject"],$_GET["entry"],1,array());
1242 
1243  if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"])
1244  {
1245  $_SESSION["translation_post"]["default_language"] = "";
1246  }
1247  }
1248 
1249  $data = $_SESSION["translation_post"];
1250 
1251  // add additional translation form
1252  if (!$_GET["entry"] and $array_push)
1253  {
1254  $count = array_push($data["Fobject"],array("title" => "","desc" => ""));
1255  }
1256  else
1257  {
1258  $count = count($data["Fobject"]);
1259  }
1260 
1261  // stripslashes in form?
1262  $strip = isset($_SESSION["translation_post"]) ? true : false;
1263 
1264  foreach ($data["Fobject"] as $key => $val)
1265  {
1266  // add translation button
1267  if ($key == $count -1)
1268  {
1269  $this->tpl->setCurrentBlock("addTranslation");
1270  $this->tpl->setVariable("TXT_ADD_TRANSLATION",$this->lng->txt("add_translation")." >>");
1271  $this->tpl->parseCurrentBlock();
1272  }
1273 
1274  // remove translation button
1275  if ($key != 0)
1276  {
1277  $this->tpl->setCurrentBlock("removeTranslation");
1278  $this->tpl->setVariable("TXT_REMOVE_TRANSLATION",$this->lng->txt("remove_translation"));
1279  $this->ctrl->setParameter($this, "entry", $key);
1280  $this->ctrl->setParameter($this, "mode", "edit");
1281  $this->tpl->setVariable("LINK_REMOVE_TRANSLATION",
1282  $this->ctrl->getLinkTarget($this, "removeTranslation"));
1283  $this->tpl->parseCurrentBlock();
1284  }
1285 
1286  // lang selection
1287  $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html", false);
1288  $this->tpl->setVariable("SEL_NAME", "Fobject[".$key."][lang]");
1289 
1290  include_once('Services/MetaData/classes/class.ilMDLanguageItem.php');
1291 
1292  $languages = ilMDLanguageItem::_getLanguages();
1293 
1294  foreach ($languages as $code => $language)
1295  {
1296  $this->tpl->setCurrentBlock("lg_option");
1297  $this->tpl->setVariable("VAL_LG", $code);
1298  $this->tpl->setVariable("TXT_LG", $language);
1299 
1300  if ($code == $val["lang"])
1301  {
1302  $this->tpl->setVariable("SELECTED", "selected=\"selected\"");
1303  }
1304 
1305  $this->tpl->parseCurrentBlock();
1306  }
1307 
1308  // object data
1309  $this->tpl->setCurrentBlock("obj_form");
1310 
1311  if ($key == 0)
1312  {
1313  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title"));
1314  }
1315  else
1316  {
1317  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation")." ".$key);
1318  }
1319 
1320  if ($key == $data["default_language"])
1321  {
1322  $this->tpl->setVariable("CHECKED", "checked=\"checked\"");
1323  }
1324 
1325  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
1326  $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
1327  $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default"));
1328  $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
1329  $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"],$strip));
1330  $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"]));
1331  $this->tpl->setVariable("NUM", $key);
1332  $this->tpl->parseCurrentBlock();
1333  }
1334 
1335  // global
1336  $this->tpl->setCurrentBlock("adm_content");
1337 
1338  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1339  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
1340  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
1341  $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle");
1342  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
1343  }
1344 
1349  {
1350  $data = $_POST;
1351 
1352  // default language set?
1353  if (!isset($data["default_language"]))
1354  {
1355  $this->ilias->raiseError($this->lng->txt("msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
1356  }
1357 
1358  // prepare array fro further checks
1359  foreach ($data["Fobject"] as $key => $val)
1360  {
1361  $langs[$key] = $val["lang"];
1362  }
1363 
1364  $langs = array_count_values($langs);
1365 
1366  // all languages set?
1367  if (array_key_exists("",$langs))
1368  {
1369  $this->ilias->raiseError($this->lng->txt("msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
1370  }
1371 
1372  // no single language is selected more than once?
1373  if (array_sum($langs) > count($langs))
1374  {
1375  $this->ilias->raiseError($this->lng->txt("msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
1376  }
1377 
1378  // copy default translation to variable for object data entry
1379  $_POST["Fobject"]["title"] = $_POST["Fobject"][$_POST["default_language"]]["title"];
1380  $_POST["Fobject"]["desc"] = $_POST["Fobject"][$_POST["default_language"]]["desc"];
1381 
1382  // first delete all translation entries...
1383  $this->object->removeHeaderTitleTranslations();
1384 
1385  // ...and write new translations to object_translation
1386  foreach ($data["Fobject"] as $key => $val)
1387  {
1388  if ($key == $data["default_language"])
1389  {
1390  $default = 1;
1391  }
1392  else
1393  {
1394  $default = 0;
1395  }
1396 
1397  $this->object->addHeaderTitleTranslation(ilUtil::stripSlashes($val["title"]),ilUtil::stripSlashes($val["desc"]),$val["lang"],$default);
1398  }
1399 
1400  ilUtil::sendInfo($this->lng->txt("msg_obj_modified"),true);
1401 
1402  $this->ctrl->redirect($this);
1403  }
1404 
1405  function cancelObject()
1406  {
1407  $this->ctrl->redirect($this, "view");
1408  }
1409 
1416  {
1417  $_SESSION["translation_post"] = $_POST;
1418 
1419  $this->ctrl->setParameter($this, "mode", "session");
1420  $this->ctrl->setParameter($this, "entry", "0");
1421  $this->ctrl->redirect($this, "changeHeaderTitle");
1422  }
1423 
1430  {
1431  $this->ctrl->setParameter($this, "entry", $_GET["entry"]);
1432  $this->ctrl->setParameter($this, "mode", "session");
1433  $this->ctrl->redirect($this, "changeHeaderTitle");
1434  }
1435 
1436 
1437  function startValidator($a_mode,$a_log)
1438  {
1439  global $rbacsystem;
1440 
1441  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1442  {
1443  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1444  }
1445 
1446  $logging = ($a_log) ? true : false;
1447  include_once "classes/class.ilValidator.php";
1448  $validator = new ilValidator($logging);
1449  $validator->setMode("all",false);
1450 
1451  $modes = array();
1452  foreach ($a_mode as $mode => $value)
1453  {
1454  $validator->setMode($mode,(bool) $value);
1455  $modes[] = $mode.'='.$value;
1456  }
1457 
1458  $scan_log = $validator->validate();
1459 
1460  $mode = $this->lng->txt("scan_modes").": ".implode(', ',$modes);
1461 
1462  // output
1463  $this->getTemplateFile("scan");
1464 
1465  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1466  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system"));
1467  $this->tpl->setVariable("COLSPAN", 3);
1468  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
1469  $this->tpl->setVariable("TXT_MODE", $mode);
1470 
1471  if ($logging === true)
1472  {
1473  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log"));
1474  }
1475 
1476  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
1477 
1478  $validator->writeScanLogLine($mode);
1479  }
1480 
1481  function viewScanLog()
1482  {
1483  include_once "classes/class.ilValidator.php";
1484  $validator = new IlValidator();
1485  $scan_log =& $validator->readScanLog();
1486 
1487  if (is_array($scan_log))
1488  {
1489  $scan_log = '<pre>'.implode("",$scan_log).'</pre>';
1490  $this->tpl->setVariable("ADM_CONTENT", $scan_log);
1491  }
1492  else
1493  {
1494  $scan_log = "no scanlog found.";
1495  }
1496 
1497  // output
1498  $this->getTemplateFile("scan");
1499  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scan_details"));
1500  $this->tpl->setVariable("COLSPAN", 3);
1501  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
1502  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
1503  }
1504 
1505 
1509  function benchmarkObject()
1510  {
1511  global $ilBench, $rbacsystem;
1512 
1513  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1514  {
1515  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1516  }
1517 
1518  $this->getTemplateFile("bench");
1519  $this->ctrl->setParameter($this,'cur_mode',$_GET['cur_mod']);
1520  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1521  $this->tpl->setVariable("TXT_BENCH_SETTINGS", $this->lng->txt("benchmark_settings"));
1522  $this->tpl->setVariable("TXT_ACTIVATION", $this->lng->txt("activation"));
1523  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_settings"));
1524  $this->tpl->setVariable("TXT_CUR_RECORDS", $this->lng->txt("cur_number_rec"));
1525  $this->tpl->setVariable("VAL_CUR_RECORDS", $ilBench->getCurrentRecordNumber());
1526  $this->tpl->setVariable("TXT_MAX_RECORDS", $this->lng->txt("max_number_rec"));
1527  $this->tpl->setVariable("VAL_MAX_RECORDS", $ilBench->getMaximumRecords());
1528  $this->tpl->setVariable("TXT_CLEAR", $this->lng->txt("delete_all_rec"));
1529  if($ilBench->isEnabled())
1530  {
1531  $this->tpl->setVariable("ACT_CHECKED", " checked=\"1\" ");
1532  }
1533 
1534  $modules = $ilBench->getMeasuredModules();
1535 
1536  if (count($modules) > 0)
1537  {
1538  $this->tpl->setCurrentBlock("eval_table");
1539 
1540  $cur_module = ($_GET["cur_mod"] != "" &&
1541  in_array($_GET["cur_mod"], $modules))
1542  ? $_GET["cur_mod"]
1543  : current($modules);
1544 
1545  $benchs = $ilBench->getEvaluation($cur_module);
1546 
1547  $i=0;
1548  foreach($benchs as $bench)
1549  {
1550  $this->tpl->setCurrentBlock("eval_row");
1551  $this->tpl->setVariable("ROWCOL",
1552  ilUtil::switchColor($i++, "tblrow2", "tblrow1"));
1553 
1554  $this->tpl->setVariable("VAL_BENCH", $bench["benchmark"]);
1555  $this->tpl->setVariable("VAL_NUMBER_RECORDS", $bench["cnt"]);
1556  $this->tpl->setVariable("VAL_AVG_TIME", $bench["duration"]);
1557  $this->tpl->setVariable("VAL_MIN_TIME", $bench["min"]);
1558  $this->tpl->setVariable("VAL_MAX_TIME", $bench["max"]);
1559  $this->tpl->setVariable("VAL_CUM_TIME", $bench["duration"] * $bench["cnt"]);
1560  $this->tpl->parseCurrentBlock();
1561  }
1562 
1563  $this->tpl->setVariable("SELECT_MODULE",
1564  ilUtil::formSelect($cur_module, "module",$modules, false, true));
1565 
1566  $this->tpl->setVariable("TXT_SHOW", $this->lng->txt("show"));
1567  $this->tpl->setVariable("TXT_BENCH", $this->lng->txt("benchmark"));
1568  $this->tpl->setVariable("TXT_NUMBER_RECORDS", $this->lng->txt("number_of_records"));
1569  $this->tpl->setVariable("TXT_AVG_TIME", $this->lng->txt("average_time"));
1570  $this->tpl->setVariable("TXT_MIN_TIME", $this->lng->txt("min_time"));
1571  $this->tpl->setVariable("TXT_MAX_TIME", $this->lng->txt("max_time"));
1572  $this->tpl->setVariable("TXT_CUM_TIME", $this->lng->txt("cumulative_time"));
1573 
1574  $this->tpl->parseCurrentBlock();
1575  }
1576  }
1577 
1578 
1583  {
1584  global $ilBench;
1585 
1586  if ($_POST["activate"] == "y")
1587  {
1588  $ilBench->enable(true);
1589  }
1590  else
1591  {
1592  $ilBench->enable(false);
1593  }
1594 //echo ":".$_POST["max_records"].":<br>"; exit;
1595  $ilBench->setMaximumRecords($_POST["max_records"]);
1596 
1597  ilUtil::sendInfo($this->lng->txt("msg_obj_modified"), true);
1598 
1599  $this->ctrl->redirect($this, "benchmark");
1600  }
1601 
1602 
1607  {
1608  global $ilBench;
1609 
1610  $this->ctrl->setParameter($this,'cur_mod',$_POST['module']);
1611  $this->ctrl->redirect($this, "benchmark");
1612  }
1613 
1614 
1618  function clearBenchObject()
1619  {
1620  global $ilBench;
1621 
1622  $ilBench->clearData();
1623  $this->saveBenchSettingsObject();
1624 
1625  }
1626 
1627  // get tabs
1628  function getAdminTabs(&$tabs_gui)
1629  {
1630  global $rbacsystem;
1631 
1632  $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
1633 
1634  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1635  {
1636  $tabs_gui->addTarget("settings",
1637  $this->ctrl->getLinkTarget($this, "view"), array("view", "saveSettings"), get_class($this));
1638  }
1639 
1640  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
1641  {
1642  //$tabs_gui->addTarget("edit_properties",
1643  // $this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this));
1644 
1645  $tabs_gui->addTarget("system_check",
1646  $this->ctrl->getLinkTarget($this, "check"), array("check","viewScanLog"), get_class($this));
1647 
1648  $tabs_gui->addTarget("benchmarks",
1649  $this->ctrl->getLinkTarget($this, "benchmark"), "benchmark", get_class($this));
1650  }
1651 
1652  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
1653  {
1654  $tabs_gui->addTarget("perm_settings",
1655  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1656  }
1657  }
1658 
1663  {
1664  phpinfo();
1665  exit;
1666  }
1667 
1668 } // END class.ilObjSystemFolderGUI
1669 ?>