ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjGlossaryGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once("./Services/Object/classes/class.ilObjectGUI.php");
6require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
7require_once("./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
8require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
9require_once("./Modules/Glossary/classes/class.ilTermDefinitionEditorGUI.php");
10require_once("./Services/COPage/classes/class.ilPCParagraph.php");
11
28{
30 var $mode;
31 var $term;
32
37 function ilObjGlossaryGUI($a_data,$a_id = 0,$a_call_by_reference = true, $a_prepare_output = true)
38 {
39 global $ilCtrl, $lng;
40
41 $this->ctrl =& $ilCtrl;
42 $this->ctrl->saveParameter($this, array("ref_id", "offset"));
43
44 $lng->loadLanguageModule("content");
45
46 $this->type = "glo";
47 parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, false);
48
49 // determine term id and check whether it is valid (belongs to
50 // current glossary)
51 $this->term_id = (int) $_GET["term_id"];
52 $term_glo_id = ilGlossaryTerm::_lookGlossaryID($this->term_id);
53 if ($this->term_id > 0 && $term_glo_id != $this->object->getId())
54 {
55 $this->term_id = "";
56 }
57
58 $this->tax_id = $this->object->getTaxonomyId();
59 if ($this->tax_id > 0)
60 {
61 $this->ctrl->saveParameter($this, array("show_tax", "tax_node"));
62
63 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
64 $this->tax = new ilObjTaxonomy($this->tax_id);
65 }
66 if ((int) $_GET["tax_node"] > 1 && $this->tax->getTree()->readRootId() != $_GET["tax_node"])
67 {
68 $this->tax_node = (int) $_GET["tax_node"];
69 }
70 }
71
75 function &executeCommand()
76 {
77 global $lng, $ilAccess, $ilTabs, $ilErr;
78
79 $cmd = $this->ctrl->getCmd();
80 $next_class = $this->ctrl->getNextClass($this);
81
82 switch ($next_class)
83 {
84 case 'ilobjectmetadatagui';
85 $this->checkPermission("write");
86
87 $this->getTemplate();
88 $this->setTabs();
89 $this->setLocator();
90 $this->addHeaderAction();
91
92 $this->tabs_gui->activateTab('meta_data');
93 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
94 $md_gui = new ilObjectMetaDataGUI($this->object, 'term');
95 $this->ctrl->forwardCommand($md_gui);
96 break;
97
98 case "ilglossarytermgui":
99 $this->getTemplate();
100// $this->quickList();
101 $this->ctrl->setReturn($this, "listTerms");
102 $term_gui =& new ilGlossaryTermGUI($this->term_id);
103 $term_gui->setGlossary($this->object);
104 //$ret =& $term_gui->executeCommand();
105 $ret =& $this->ctrl->forwardCommand($term_gui);
106 break;
107
108 case "ilinfoscreengui":
109 $this->addHeaderAction();
110 $this->showInfoScreen();
111 break;
112
113 case "ilobjstylesheetgui":
114 include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
115 $this->ctrl->setReturn($this, "editStyleProperties");
116 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
117 $style_gui->omitLocator();
118 if ($cmd == "create" || $_GET["new_type"]=="sty")
119 {
120 $style_gui->setCreationMode(true);
121 }
122
123 if ($cmd == "confirmedDelete")
124 {
125 $this->object->setStyleSheetId(0);
126 $this->object->update();
127 }
128
129 $ret = $this->ctrl->forwardCommand($style_gui);
130
131 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
132 {
133 $style_id = $ret;
134 $this->object->setStyleSheetId($style_id);
135 $this->object->update();
136 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
137 }
138 break;
139
140
141 case 'ilpermissiongui':
142 if (strtolower($_GET["baseClass"]) == "iladministrationgui")
143 {
144 $this->prepareOutput();
145 }
146 else
147 {
148 $this->getTemplate();
149 $this->setTabs();
150 $this->setLocator();
151 $this->addHeaderAction();
152 }
153 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
154 $perm_gui =& new ilPermissionGUI($this);
155 $ret =& $this->ctrl->forwardCommand($perm_gui);
156 break;
157
158 case "ilcommonactiondispatchergui":
159 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
161 $this->ctrl->forwardCommand($gui);
162 break;
163
164 case "ilobjtaxonomygui":
165 $this->getTemplate();
166 $this->setTabs();
167 $this->setLocator();
168 $this->addHeaderAction();
169 $ilTabs->activateTab("settings");
170 $this->setSettingsSubTabs("taxonomy");
171
172 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php");
173 $this->ctrl->setReturn($this, "properties");
174 $tax_gui = new ilObjTaxonomyGUI();
175 $tax_gui->setMultiple(false);
176
177 /*include_once("./Modules/Glossary/classes/class.ilTermTaxInfo.php");
178 $term_info = new ilTermTaxInfo();*/
179 //$tax_gui->activateAssignedItemSorting($term_info, "glo", "term");
180
181 $tax_gui->setAssignedObject($this->object->getId());
182 $ret = $this->ctrl->forwardCommand($tax_gui);
183 break;
184
185 case "ilexportgui":
186 $this->getTemplate();
187 $this->setTabs();
188 $ilTabs->activateTab("export");
189 $this->setLocator();
190 include_once("./Services/Export/classes/class.ilExportGUI.php");
191 $exp_gui = new ilExportGUI($this);
192 //$exp_gui->addFormat("xml", "", $this, "export");
193 $exp_gui->addFormat("xml");
194 $exp_gui->addFormat("html", "", $this, "exportHTML");
195 $exp_gui->addCustomColumn($lng->txt("cont_public_access"),
196 $this, "getPublicAccessColValue");
197 $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"),
198 $this, "publishExportFile");
199 $ret = $this->ctrl->forwardCommand($exp_gui);
200 break;
201
202 case 'ilobjectcopygui':
203 $this->prepareOutput();
204 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
205 $cp = new ilObjectCopyGUI($this);
206 $cp->setType('glo');
207 $this->ctrl->forwardCommand($cp);
208 break;
209
210 default:
211 $cmd = $this->ctrl->getCmd("listTerms");
212
213 if (($cmd == "create") && ($_POST["new_type"] == "term"))
214 {
215 $this->ctrl->setCmd("create");
216 $this->ctrl->setCmdClass("ilGlossaryTermGUI");
217 $ret =& $this->executeCommand();
218 return;
219 }
220 else
221 {
222 if (!in_array($cmd, array("frameset", "quickList")))
223 {
224 if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
225 $this->getCreationMode() == true)
226 {
227 $this->prepareOutput();
228 $cmd.= "Object";
229 }
230 else
231 {
232 $this->getTemplate();
233 $this->setTabs();
234 $this->setLocator();
235 $this->addHeaderAction();
236
237 if($cmd == "redrawHeaderAction")
238 {
239 $cmd = "redrawHeaderActionObject";
240 }
241 }
242 }
243 $ret =& $this->$cmd();
244 }
245 break;
246 }
247
248 if (!in_array($cmd, array("frameset", "quickList")))
249 {
250 if (strtolower($_GET["baseClass"]) != "iladministrationgui")
251 {
252 if (!$this->getCreationMode())
253 {
254 $this->tpl->show();
255 }
256 }
257 }
258 else
259 {
260 $this->tpl->show(false);
261 }
262 }
263
264 function assignObject()
265 {
266 include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
267
268 $this->object =& new ilObjGlossary($this->id, true);
269 }
270
271 /*protected function initCreationForms($a_new_type)
272 {
273 $forms = array(
274 self::CFORM_NEW => $this->initCreateForm($a_new_type),
275 self::CFORM_IMPORT => $this->initImportForm($a_new_type)
276 );
277
278 return $forms;
279 }*/
280
281 function initCreateForm($a_new_type)
282 {
283 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
284 $form = new ilPropertyFormGUI();
285 $form->setTarget("_top");
286 $form->setFormAction($this->ctrl->getFormAction($this));
287 $form->setTitle($this->lng->txt($a_new_type."_new"));
288
289 // title
290 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
291 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
292 $ti->setMaxLength(ilObject::TITLE_LENGTH);
293 $ti->setRequired(true);
294 $form->addItem($ti);
295
296 // description
297 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
298 $ta->setCols(40);
299 $ta->setRows(2);
300 $form->addItem($ta);
301
302 // mode
303 $stati = array(
304 "none"=>$this->lng->txt("glo_mode_normal"),
305 "level"=>$this->lng->txt("glo_mode_level"),
306 "subtree"=>$this->lng->txt("glo_mode_subtree")
307 );
308 $tm = new ilSelectInputGUI($this->lng->txt("glo_mode"), "glo_mode");
309 $tm->setOptions($stati);
310 $tm->setInfo($this->lng->txt("glo_mode_desc"));
311 $tm->setRequired(true);
312 $form->addItem($tm);
313
314 $form->addCommandButton("save", $this->lng->txt($a_new_type."_add"));
315 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
316
317 return $form;
318 }
319
320 function importObject()
321 {
322 $this->createObject();
323 }
324
328 function saveObject()
329 {
330 global $tpl;
331
332 $new_type = $_REQUEST["new_type"];
333
334 // create permission is already checked in createObject. This check here is done to prevent hacking attempts
335 if (!$this->checkPermissionBool("create", "", $new_type))
336 {
337 $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
338 }
339
340 $this->lng->loadLanguageModule($new_type);
341 $this->ctrl->setParameter($this, "new_type", $new_type);
342
343 $form = $this->initCreateForm($new_type);
344 if ($form->checkInput())
345 {
346 $this->ctrl->setParameter($this, "new_type", "");
347
348 include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
349 $newObj = new ilObjGlossary();
350 $newObj->setType($new_type);
351 $newObj->setTitle($form->getInput("title"));
352 $newObj->setDescription($form->getInput("desc"));
353 $newObj->setVirtualMode($form->getInput("glo_mode"));
354 $newObj->create();
355
356 $this->putObjectInTree($newObj);
357
358 // always send a message
359 ilUtil::sendSuccess($this->lng->txt("glo_added"),true);
360 ilUtil::redirect("ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
361 }
362
363 // display only this form to correct input
364 $form->setValuesByPost();
365 $tpl->setContent($form->getHtml());
366 }
367
374 function showInfoScreen()
375 {
376 global $ilAccess;
377
378 $this->getTemplate();
379 $this->setTabs();
380 $this->setLocator();
381 $this->lng->loadLanguageModule("meta");
382 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
383
384 $info = new ilInfoScreenGUI($this);
385 $info->enablePrivateNotes();
386 $info->enableNews();
387 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
388 {
389 $info->enableNewsEditing();
390 $news_set = new ilSetting("news");
391 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
392 if ($enable_internal_rss)
393 {
394 $info->setBlockProperty("news", "settings", true);
395 }
396 }
397 $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
398
399 ilObjGlossaryGUI::addUsagesToInfo($info, $this->object->getId());
400
401 $this->ctrl->forwardCommand($info);
402 }
403
410 function addUsagesToInfo($info, $glo_id)
411 {
412 global $lng, $ilAccess;
413
414 $info->addSection($lng->txt("glo_usages"));
415 include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
417 foreach ($sms as $sm)
418 {
419 $link = false;
420 $refs = ilObject::_getAllReferences($sm);
421 foreach ($refs as $ref)
422 {
423 if ($link === false)
424 {
425 if ($ilAccess->checkAccess("write", "", $ref))
426 {
427 include_once("./Services/Link/classes/class.ilLink.php");
428 $link = ilLink::_getLink($ref,'sahs');
429 }
430 }
431 }
432
433 $entry = ilObject::_lookupTitle($sm);
434 if ($link !== false)
435 {
436 $entry = "<a href='".$link."' target='_top'>".$entry."</a>";
437 }
438
439 $info->addProperty($lng->txt("obj_sahs"), $entry);
440 }
441 }
442
443
444 function viewObject()
445 {
446 global $rbacsystem;
447
448 if (strtolower($_GET["baseClass"]) == "iladministrationgui")
449 {
450 parent::viewObject();
451 return;
452 }
453
454 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
455 {
456 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
457 }
458
459 }
460
466 function properties()
467 {
468 global $tpl;
469
470 $this->checkPermission("write");
471
472 $this->setSettingsSubTabs("general_settings");
473
474 $this->initSettingsForm();
475
476 // Edit ecs export settings
477 include_once 'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
478 $ecs = new ilECSGlossarySettings($this->object);
479 $ecs->addSettingsToForm($this->form, 'glo');
480
481 $tpl->setContent($this->form->getHTML());
482 }
483
489 public function initSettingsForm($a_mode = "edit")
490 {
491 global $lng, $ilCtrl;
492
493 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
494 $this->form = new ilPropertyFormGUI();
495
496 // title
497 $title = new ilTextInputGUI($lng->txt("title"), "title");
498 $title->setRequired(true);
499 $this->form->addItem($title);
500
501 // description
502 $desc = new ilTextAreaInputGUI($lng->txt("desc"), "description");
503 $this->form->addItem($desc);
504
505 $lng->loadLanguageModule("rep");
507 $section->setTitle($this->lng->txt('rep_activation_availability'));
508 $this->form->addItem($section);
509
510 // online
511 $online = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
512 $online->setValue("y");
513 $online->setInfo($lng->txt("glo_online_info"));
514 $this->form->addItem($online);
515
517 $section->setTitle($this->lng->txt('glo_content_settings'));
518 $this->form->addItem($section);
519
520 // glossary mode
521 $glo_mode = new ilRadioGroupInputGUI($lng->txt("glo_mode"), "glo_mode");
522 //$glo_mode->setInfo($lng->txt("glo_mode_desc"));
523 $op1 = new ilRadioOption($lng->txt("glo_mode_normal"), "none",$lng->txt("glo_mode_normal_info"));
524 $glo_mode->addOption($op1);
525 $op2 = new ilRadioOption($lng->txt("glo_mode_level"), "level",$lng->txt("glo_mode_level_info"));
526 $glo_mode->addOption($op2);
527 $op3 = new ilRadioOption($lng->txt("glo_mode_subtree"), "subtree",$lng->txt("glo_mode_subtree_info"));
528 $glo_mode->addOption($op3);
529 $this->form->addItem($glo_mode);
530
531 // glossary mode
532 /*$options = array(
533 "none"=>$this->lng->txt("glo_mode_normal"),
534 "level"=>$this->lng->txt("glo_mode_level"),
535 "subtree"=>$this->lng->txt("glo_mode_subtree")
536 );
537 $glo_mode = new ilSelectInputGUI($lng->txt("glo_mode"), "glo_mode");
538 $glo_mode->setOptions($options);
539 $glo_mode->setInfo($lng->txt("glo_mode_desc"));
540 $this->form->addItem($glo_mode);*/
541
542
544 $section->setTitle($this->lng->txt('cont_presentation'));
545 $this->form->addItem($section);
546
547 // presentation mode
548 $pres_mode = new ilRadioGroupInputGUI($lng->txt("glo_presentation_mode"), "pres_mode");
549 $pres_mode->setValue("table");
550 $op1 = new ilRadioOption($lng->txt("glo_table_form"), "table", $lng->txt("glo_table_form_info"));
551
552 // short text length
553 $snl = new ilNumberInputGUI($lng->txt("glo_text_snippet_length"), "snippet_length");
554 $snl->setMaxValue(3000);
555 $snl->setMinValue(100);
556 $snl->setMaxLength(4);
557 $snl->setSize(4);
558 $snl->setInfo($lng->txt("glo_text_snippet_length_info"));
559 $snl->setValue(200);
560 $op1->addSubItem($snl);
561
562 $pres_mode->addOption($op1);
563 $op2 = new ilRadioOption($lng->txt("glo_full_definitions"), "full_def", $lng->txt("glo_full_definitions_info"));
564 $pres_mode->addOption($op2);
565 $this->form->addItem($pres_mode);
566
567 // show taxonomy
568 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
569 $tax_ids = ilObjTaxonomy::getUsageOfObject($this->object->getId());
570 if (count($tax_ids) > 0)
571 {
572 $show_tax = new ilCheckboxInputGUI($this->lng->txt("glo_show_taxonomy"), "show_tax");
573 $show_tax->setInfo($this->lng->txt("glo_show_taxonomy_info"));
574 $this->form->addItem($show_tax);
575 }
576
577 // downloads
578 $down = new ilCheckboxInputGUI($lng->txt("cont_downloads"), "glo_act_downloads");
579 $down->setValue("y");
580 $down->setInfo($lng->txt("cont_downloads_desc"));
581 $this->form->addItem($down);
582
583 if ($a_mode == "edit")
584 {
585 $title->setValue($this->object->getTitle());
586 $desc->setValue($this->object->getDescription());
587 $online->setChecked($this->object->getOnline());
588 $glo_mode->setValue($this->object->getVirtualMode());
589 $pres_mode->setValue($this->object->getPresentationMode());
590 $snl->setValue($this->object->getSnippetLength());
591 if (count($tax_ids) > 0)
592 {
593 $show_tax->setChecked($this->object->getShowTaxonomy());
594 }
595
596 $down->setChecked($this->object->isActiveDownloads());
597
598 // additional features
599 $feat = new ilFormSectionHeaderGUI();
600 $feat->setTitle($this->lng->txt('obj_features'));
601 $this->form->addItem($feat);
602
603 include_once './Services/Container/classes/class.ilContainer.php';
604 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
606 $this->object->getId(),
607 $this->form,
608 array(
610 )
611 );
612 }
613
614 // sort columns, if adv fields are given
615 include_once("./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php");
616 $adv_ap = new ilGlossaryAdvMetaDataAdapter($this->object->getId());
617 $cols = $adv_ap->getColumnOrder();
618 if (count($cols) > 1)
619 {
620 include_once './Modules/Glossary/classes/class.ilGloAdvColSortInputGUI.php';
621 $ti = new ilGloAdvColSortInputGUI($lng->txt("cont_col_ordering"), "field_order");
622 $this->form->addItem($ti);
623 $ti->setValue($cols);
624 }
625
626 // save and cancel commands
627 $this->form->addCommandButton("saveProperties", $lng->txt("save"));
628
629 $this->form->setTitle($lng->txt("cont_glo_properties"));
630 $this->form->setFormAction($ilCtrl->getFormAction($this));
631 }
632
633
637 function saveProperties()
638 {
639 global $tpl;
640
641 $this->initSettingsForm();
642 if ($this->form->checkInput())
643 {
644 $this->object->setTitle($_POST['title']);
645 $this->object->setDescription($_POST['description']);
646 $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
647 $this->object->setVirtualMode($_POST["glo_mode"]);
648// $this->object->setActiveGlossaryMenu(ilUtil::yn2tf($_POST["glo_act_menu"]));
649 $this->object->setActiveDownloads(ilUtil::yn2tf($_POST["glo_act_downloads"]));
650 $this->object->setPresentationMode($_POST["pres_mode"]);
651 $this->object->setSnippetLength($_POST["snippet_length"]);
652 $this->object->setShowTaxonomy($_POST["show_tax"]);
653 $this->object->update();
654
655 // field order of advanced metadata
656 include_once("./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php");
657 $adv_ap = new ilGlossaryAdvMetaDataAdapter($this->object->getId());
658 $cols = $adv_ap->getColumnOrder();
659 if (count($cols) > 1)
660 {
661 $adv_ap->saveColumnOrder($_POST["field_order"]);
662 }
663
664 // set definition short texts dirty
665 include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
666 ilGlossaryDefinition::setShortTextsDirty($this->object->getId());
667
668 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
670 $this->object->getId(),
671 $this->form,
672 array(
674 )
675 );
676
677 // Update ecs export settings
678 include_once 'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
679 $ecs = new ilECSGlossarySettings($this->object);
680 if($ecs->handleSettingsUpdate())
681 {
682 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
683 $this->ctrl->redirect($this, "properties");
684 }
685
686 }
687 $this->form->setValuesByPost();
688 $tpl->setContent($this->form->getHTML());
689 }
690
694 function frameset()
695 {
696 global $ilCtrl;
697
698 include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
699 $fs_gui = new ilFramesetGUI();
700 $fs_gui->setFramesetTitle($this->object->getTitle());
701 if ((int) $_GET["edit_term"] > 0)
702 {
703 $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", (int) $_GET["edit_term"]);
704 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass("ilglossarytermgui", "listDefinitions"));
705 }
706 else
707 {
708 $fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this, "listTerms"));
709 }
710 $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this, "quickList"));
711 $fs_gui->setMainFrameName("content");
712 $fs_gui->setSideFrameName("tree");
713 $fs_gui->show();
714 exit;
715 }
716
720 function quickList()
721 {
722 global $ilUser, $tpl;
723
724 }
725
726
730 function listTerms()
731 {
732 global $ilUser, $ilToolbar, $lng, $ilCtrl, $tpl;
733
734 if ($_GET["show_tax"])
735 {
736 $this->showTaxonomy();
737 }
738
739 // term
740 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
741 $ti = new ilTextInputGUI($lng->txt("cont_new_term"), "new_term");
742 $ti->setMaxLength(80);
743 $ti->setSize(20);
744 $ilToolbar->addInputItem($ti, true);
745
746 // language
747 $this->lng->loadLanguageModule("meta");
749 if ($_SESSION["il_text_lang_".$_GET["ref_id"]] != "")
750 {
751 $s_lang = $_SESSION["il_text_lang_".$_GET["ref_id"]];
752 }
753 else
754 {
755 $s_lang = $ilUser->getLanguage();
756 }
757 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
758 $si = new ilSelectInputGUI($lng->txt("language"), "term_language");
759 $si->setOptions($lang);
760 $si->setValue($s_lang);
761 $ilToolbar->addInputItem($si, true);
762
763 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
764 $ilToolbar->addFormButton($lng->txt("glo_add_new_term"), "addTerm");
765 //$select_language = ilUtil::formSelect ($s_lang, "term_language",$lang,false,true);
766 //$this->tpl->setVariable("SELECT_LANGUAGE", $select_language);
767
768 if (is_object($this->tax))
769 {
770 $ilToolbar->addSeparator();
771 if ($_GET["show_tax"])
772 {
773 $ilToolbar->addButton($lng->txt("glo_hide_taxonomy"),
774 $ilCtrl->getLinkTarget($this, "deactTaxonomy"));
775 }
776 else
777 {
778 $ilToolbar->addButton($lng->txt("glo_show_taxonomy"),
779 $ilCtrl->getLinkTarget($this, "actTaxonomy"));
780 }
781 }
782
783 include_once("./Modules/Glossary/classes/class.ilTermListTableGUI.php");
784 $tab = new ilTermListTableGUI($this, "listTerms", $this->tax_node);
785 $tpl->setContent($tab->getHTML());
786 }
787
794 function actTaxonomy()
795 {
796 global $ilCtrl;
797
798 $ilCtrl->setParameter($this, "show_tax", 1);
799 $ilCtrl->redirect($this, "listTerms");
800 }
801
808 function deactTaxonomy()
809 {
810 global $ilCtrl;
811
812 $ilCtrl->setParameter($this, "show_tax", "");
813 $ilCtrl->redirect($this, "listTerms");
814 }
815
816
822 function showActions($a_actions)
823 {
824 foreach ($a_actions as $name => $lng)
825 {
826 $d[$name] = array("name" => $name, "lng" => $lng);
827 }
828
829 $notoperations = array();
830 $operations = array();
831
832 $operations = $d;
833
834 if (count($operations) > 0)
835 {
836 foreach ($operations as $val)
837 {
838 $this->tpl->setCurrentBlock("tbl_action_btn");
839 $this->tpl->setVariable("BTN_NAME", $val["name"]);
840 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
841 $this->tpl->parseCurrentBlock();
842 }
843
844 $this->tpl->setCurrentBlock("tbl_action_row");
845 $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.svg"));
846 $this->tpl->parseCurrentBlock();
847 }
848 }
849
853 function addTerm()
854 {
855 global $lng, $ilCtrl;
856
857 if (trim($_POST["new_term"]) == "")
858 {
859 ilUtil::sendFailure($lng->txt("cont_please_enter_a_term"), true);
860 $ilCtrl->redirect($this, "listTerms");
861 }
862
863 // add term
864 include_once ("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
865 $term =& new ilGlossaryTerm();
866 $term->setGlossary($this->object);
867 $term->setTerm(ilUtil::stripSlashes($_POST["new_term"]));
868 $term->setLanguage($_POST["term_language"]);
869 $_SESSION["il_text_lang_".$_GET["ref_id"]] = $_POST["term_language"];
870 $term->create();
871
872 // add first definition
873 $def =& new ilGlossaryDefinition();
874 $def->setTermId($term->getId());
875 $def->setTitle(ilUtil::stripSlashes($_POST["new_term"]));
876 $def->create();
877
878 $this->ctrl->setParameterByClass("ilglossarydefpagegui", "term_id", $term->getId());
879 $this->ctrl->setParameterByClass("ilglossarydefpagegui", "def", $def->getId());
880 $this->ctrl->redirectByClass(array("ilglossarytermgui",
881 "iltermdefinitioneditorgui", "ilglossarydefpagegui"), "edit");
882 }
883
888 {
889 include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
890
891 $definition =& new ilGlossaryDefinition($_GET["def"]);
892 $definition->moveUp();
893
894 $this->ctrl->redirect($this, "listTerms");
895 }
896
901 {
902 include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
903
904 $definition =& new ilGlossaryDefinition($_GET["def"]);
905 $definition->moveDown();
906
907 $this->ctrl->redirect($this, "listTerms");
908 }
909
914 {
915 global $ilCtrl, $lng;
916
917 //$this->getTemplate();
918 //$this->displayLocator();
919 //$this->setTabs();
920
921 $term = new ilGlossaryTerm($this->term_id);
922
923 $add = "";
924 $nr = ilGlossaryTerm::getNumberOfUsages($this->term_id);
925 if ($nr > 0)
926 {
927 $ilCtrl->setParameterByClass("ilglossarytermgui",
928 "term_id", $this->term_id);
929 $link = "[<a href='".
930 $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages").
931 "'>".$lng->txt("glo_list_usages")."</a>]";
932 $add = "<br/>".sprintf($lng->txt("glo_term_is_used_n_times"), $nr)." ".$link;
933 }
934
935 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
936 $cgui = new ilConfirmationGUI();
937 $cgui->setHeaderText($this->lng->txt("info_delete_sure").$add);
938
939 $cgui->setFormAction($this->ctrl->getFormAction($this));
940 $cgui->setCancel($this->lng->txt("cancel"), "cancelDefinitionDeletion");
941 $cgui->setConfirm($this->lng->txt("confirm"), "deleteDefinition");
942
943 // content style
944 $this->setContentStyleSheet($this->tpl);
945
946 // syntax style
947 $this->tpl->setCurrentBlock("SyntaxStyle");
948 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
950 $this->tpl->parseCurrentBlock();
951
952 $definition = new ilGlossaryDefinition($_GET["def"]);
953 $page_gui = new ilGlossaryDefPageGUI($definition->getId());
954 $page_gui->setTemplateOutput(false);
955 $page_gui->setStyleId($this->object->getStyleSheetId());
956 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
957 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
958 $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
959 $output = $page_gui->preview();
960
961 $cgui->addItem("def", $_GET["def"], $term->getTerm().$output);
962
963 $this->tpl->setContent($cgui->getHTML());
964 }
965
967 {
968 $this->ctrl->redirect($this, "listTerms");
969 }
970
971
973 {
974 $definition =& new ilGlossaryDefinition($_REQUEST["def"]);
975 $definition->delete();
976 $this->ctrl->redirect($this, "listTerms");
977 }
978
982 function editTerm()
983 {
984 // deprecated
985 }
986
987
991 function updateTerm()
992 {
993 $term = new ilGlossaryTerm($this->term_id);
994
995 $term->setTerm(ilUtil::stripSlashes($_POST["term"]));
996 $term->setLanguage($_POST["term_language"]);
997 $term->update();
998 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
999 $this->ctrl->redirect($this, "listTerms");
1000 }
1001
1002
1003
1007 function export()
1008 {
1009 $this->checkPermission("write");
1010
1011 require_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
1012 $glo_exp = new ilGlossaryExport($this->object);
1013 $glo_exp->buildExportFile();
1014 $this->ctrl->redirectByClass("ilexportgui", "");
1015 }
1016
1020 function exportHTML()
1021 {
1022 require_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
1023 $glo_exp = new ilGlossaryExport($this->object, "html");
1024 $glo_exp->buildExportFile();
1025//echo $this->tpl->get();
1026 $this->ctrl->redirectByClass("ilexportgui", "");
1027 }
1028
1033 {
1034 if(!isset($_POST["file"]))
1035 {
1036 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1037 }
1038 if (count($_POST["file"]) > 1)
1039 {
1040 $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1041 }
1042
1043 $file = explode(":", $_POST["file"][0]);
1044 $export_dir = $this->object->getExportDirectory($file[0]);
1045
1046 if ($this->object->getPublicExportFile($file[0]) ==
1047 $file[1])
1048 {
1049 $this->object->setPublicExportFile($file[0], "");
1050 }
1051 else
1052 {
1053 $this->object->setPublicExportFile($file[0], $file[1]);
1054 }
1055 $this->object->update();
1056 $this->ctrl->redirectByClass("ilexportgui", "");
1057 }
1058
1059 /*
1060 * list all export files
1061 */
1062 function viewExportLog()
1063 {
1064 }
1065
1070 {
1071 global $ilCtrl, $lng;
1072
1073 //$this->prepareOutput();
1074 if (!isset($_POST["id"]))
1075 {
1076 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1077 $ilCtrl->redirect($this, "listTerms");
1078 }
1079
1080 // check ids
1081 include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1082 foreach ($_POST["id"] as $term_id)
1083 {
1084 $term_glo_id = ilGlossaryTerm::_lookGlossaryID((int) $term_id);
1085 if ($term_glo_id != $this->object->getId())
1086 {
1087 ilUtil::sendFailure($this->lng->txt("glo_term_must_belong_to_glo"), true);
1088 $ilCtrl->redirect($this, "listTerms");
1089 }
1090 }
1091
1092 // display confirmation message
1093 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1094 $cgui = new ilConfirmationGUI();
1095 $cgui->setFormAction($this->ctrl->getFormAction($this));
1096 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
1097 $cgui->setCancel($this->lng->txt("cancel"), "cancelTermDeletion");
1098 $cgui->setConfirm($this->lng->txt("confirm"), "deleteTerms");
1099
1100 foreach($_POST["id"] as $id)
1101 {
1102 $term = new ilGlossaryTerm($id);
1103
1104 $add = "";
1106 if ($nr > 0)
1107 {
1108 $ilCtrl->setParameterByClass("ilglossarytermgui",
1109 "term_id", $id);
1110 $link = "[<a href='".
1111 $ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages").
1112 "'>".$lng->txt("glo_list_usages")."</a>]";
1113 $add = "<div class='small'>".
1114 sprintf($lng->txt("glo_term_is_used_n_times"), $nr)." ".$link."</div>";
1115 }
1116
1117 $cgui->addItem("id[]", $id, $term->getTerm().$add);
1118 }
1119
1120 $this->tpl->setContent($cgui->getHTML());
1121 }
1122
1129 {
1130 $this->ctrl->redirect($this, "listTerms");
1131 }
1132
1136 function deleteTerms()
1137 {
1138 foreach($_POST["id"] as $id)
1139 {
1140 $term = new ilGlossaryTerm($id);
1141 $term->delete();
1142 }
1143 $this->ctrl->redirect($this, "listTerms");
1144 }
1145
1153 function setLocator($a_tree = "", $a_id = "")
1154 {
1155 if(strtolower($_GET["baseClass"]) != "ilglossaryeditorgui")
1156 {
1157 parent::setLocator($a_tree, $a_id);
1158 }
1159 else
1160 {
1161 if(is_object($this->object))
1162 {
1163 require_once("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
1164 $gloss_loc =& new ilGlossaryLocatorGUI();
1165 if (is_object($this->term))
1166 {
1167 $gloss_loc->setTerm($this->term);
1168 }
1169 $gloss_loc->setGlossary($this->object);
1170 //$gloss_loc->setDefinition($this->definition);
1171 $gloss_loc->display();
1172 }
1173 }
1174
1175 }
1176
1180 function view()
1181 {
1182 //$this->prepareOutput();
1183 $this->viewObject();
1184 }
1185
1189 function create()
1190 {
1191 switch($_POST["new_type"])
1192 {
1193 case "term":
1194 $term_gui =& new ilGlossaryTermGUI();
1195 $term_gui->create();
1196 break;
1197 }
1198 }
1199
1200 function saveTerm()
1201 {
1202 $term_gui =& new ilGlossaryTermGUI();
1203 $term_gui->setGlossary($this->object);
1204 $term_gui->save();
1205
1206 ilUtil::sendSuccess($this->lng->txt("cont_added_term"),true);
1207
1208 //ilUtil::redirect("glossary_edit.php?ref_id=".$_GET["ref_id"]."&cmd=listTerms");
1209 $ilCtrl->redirect($this, "listTerms");
1210 }
1211
1212
1216 function addDefinition()
1217 {
1218 global $ilCtrl;
1219
1220 $term_id = (int) $_GET["term_id"];
1221
1222 include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1223 $term_glo_id = ilGlossaryTerm::_lookGlossaryID((int) $term_id);
1224 if ($term_glo_id != $this->object->getId())
1225 {
1226 ilUtil::sendFailure($this->lng->txt("glo_term_must_belong_to_glo"), true);
1227 $ilCtrl->redirect($this, "listTerms");
1228 }
1229
1230 // add term
1231 include_once ("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1232 $term = new ilGlossaryTerm($term_id);
1233
1234 // add first definition
1235 $def = new ilGlossaryDefinition();
1236 $def->setTermId($term->getId());
1237 $def->setTitle(ilUtil::stripSlashes($term->getTerm()));
1238 $def->create();
1239
1240 $this->ctrl->setParameterByClass("ilglossarydefpagegui", "term_id", $term->getId());
1241 $this->ctrl->setParameterByClass("ilglossarydefpagegui", "def", $def->getId());
1242 $this->ctrl->redirectByClass(array("ilglossarytermgui",
1243 "iltermdefinitioneditorgui", "ilglossarydefpagegui"), "edit");
1244
1245 }
1246
1247 function getTemplate()
1248 {
1249 $this->tpl->getStandardTemplate();
1250
1251 $title = $this->object->getTitle();
1252
1253
1254 if ($this->term_id > 0)
1255 {
1256 $this->tpl->setTitle($this->lng->txt("term").": ".
1257 ilGlossaryTerm::_lookGlossaryTerm($this->term_id));
1258 }
1259 else
1260 {
1261 parent::setTitleAndDescription();
1262 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
1263 $this->tpl->setTitle($this->lng->txt("glo").": ".$title);
1264 }
1265 }
1266
1270 function setTabs()
1271 {
1272 $this->getTabs($this->tabs_gui);
1273 }
1274
1278 function getTabs(&$tabs_gui)
1279 {
1280 global $rbacsystem, $ilHelp;
1281
1282 $ilHelp->setScreenIdComponent("glo");
1283
1284 // list terms
1285 $force_active = ($_GET["cmd"] == "" || $_GET["cmd"] == "listTerms")
1286 ? true
1287 : false;
1288 $tabs_gui->addTarget("cont_terms",
1289 $this->ctrl->getLinkTarget($this, "listTerms"), array("listTerms", ""),
1290 get_class($this), "", $force_active);
1291
1292 $force_active = false;
1293 if ($this->ctrl->getCmd() == "showSummary" ||
1294 strtolower($this->ctrl->getNextClass()) == "ilinfoscreengui")
1295 {
1296 $force_active = true;
1297 }
1298 $tabs_gui->addTarget("info_short",
1299 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "",
1300 "ilInfoScreenGUI", "", $force_active);
1301
1302 // properties
1303 if ($rbacsystem->checkAccess('write',$this->object->getRefId()))
1304 {
1305 $tabs_gui->addTarget("settings",
1306 $this->ctrl->getLinkTarget($this, "properties"), "properties",
1307 get_class($this));
1308
1309 // meta data
1310 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
1311 $mdgui = new ilObjectMetaDataGUI($this->object, "term");
1312 $mdtab = $mdgui->getTab();
1313 if($mdtab)
1314 {
1315 $tabs_gui->addTarget("meta_data", $mdtab,
1316 "", "ilobjectmetadatagui");
1317 }
1318
1319 // export
1320 /*$tabs_gui->addTarget("export",
1321 $this->ctrl->getLinkTarget($this, "exportList"),
1322 array("exportList", "viewExportLog"), get_class($this));*/
1323
1324 // export
1325 $tabs_gui->addTarget("export",
1326 $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1327 "", "ilexportgui");
1328 }
1329
1330 // permissions
1331 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
1332 {
1333 /*$tabs_gui->addTarget("permission_settings",
1334 $this->ctrl->getLinkTarget($this, "perm"),
1335 array("perm", "info"),
1336 get_class($this));
1337 */
1338 $tabs_gui->addTarget("perm_settings",
1339 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1340
1341 }
1342
1343 $tabs_gui->addNonTabbedLink("presentation_view",
1344 $this->lng->txt("glo_presentation_view"),
1345 "ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$this->object->getRefID(),
1346 "_top"
1347 );
1348
1349 }
1350
1354 function setSettingsSubTabs($a_active)
1355 {
1356 global $ilTabs, $ilCtrl, $lng;
1357
1358 if (in_array($a_active,
1359 array("general_settings", "style", "taxonomy")))
1360 {
1361 // general properties
1362 $ilTabs->addSubTab("general_settings",
1363 $lng->txt("settings"),
1364 $ilCtrl->getLinkTarget($this, 'properties'));
1365
1366 // style properties
1367 $ilTabs->addSubTab("style",
1368 $lng->txt("obj_sty"),
1369 $ilCtrl->getLinkTarget($this, 'editStyleProperties'));
1370
1371 // taxonomy
1372 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1374 $ilTabs->addSubTab("taxonomy",
1375 $lng->txt("tax_taxonomy"),
1376 $ilCtrl->getLinkTargetByClass("ilobjtaxonomygui", ''));
1377
1378 $ilTabs->activateSubTab($a_active);
1379 }
1380 }
1381
1382
1388 public static function _goto($a_target)
1389 {
1390 global $rbacsystem, $ilErr, $lng, $ilAccess;
1391
1392 if ($ilAccess->checkAccess("read", "", $a_target))
1393 {
1394 $_GET["ref_id"] = $a_target;
1395 $_GET["baseClass"] = "ilGlossaryPresentationGUI";
1396 include("ilias.php");
1397 exit;
1398 }
1399 else if ($ilAccess->checkAccess("visible", "", $a_target))
1400 {
1401 $_GET["ref_id"] = $a_target;
1402 $_GET["cmd"] = "infoScreen";
1403 $_GET["baseClass"] = "ilGlossaryPresentationGUI";
1404 include("ilias.php");
1405 exit;
1406 }
1407 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1408 {
1409 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1412 }
1413
1414 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
1415 }
1416
1420 function applyFilter()
1421 {
1422 include_once("./Modules/Glossary/classes/class.ilTermListTableGUI.php");
1423 $prtab = new ilTermListTableGUI($this, "listTerms", $this->tax_node);
1424 $prtab->resetOffset();
1425 $prtab->writeFilterToSession();
1426 $this->listTerms();
1427 }
1428
1433 function resetFilter()
1434 {
1435 include_once("./Modules/Glossary/classes/class.ilTermListTableGUI.php");
1436 $prtab = new ilTermListTableGUI($this, "listTerms", $this->tax_node);
1437 $prtab->resetOffset();
1438 $prtab->resetFilter();
1439 $this->listTerms();
1440 }
1441
1442
1446
1450 function setContentStyleSheet($a_tpl = null)
1451 {
1452 global $tpl;
1453
1454 if ($a_tpl != null)
1455 {
1456 $ctpl = $a_tpl;
1457 }
1458 else
1459 {
1460 $ctpl = $tpl;
1461 }
1462
1463 $ctpl->setCurrentBlock("ContentStyle");
1464 $ctpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1465 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
1466 $ctpl->parseCurrentBlock();
1467 }
1468
1469
1474 {
1475 global $ilTabs, $tpl;
1476
1477 $this->checkPermission("write");
1478
1479 $this->initStylePropertiesForm();
1480 $tpl->setContent($this->form->getHTML());
1481
1482 $ilTabs->activateTab("settings");
1483 $this->setSettingsSubTabs("style");
1484 }
1485
1490 {
1491 global $ilCtrl, $lng, $ilTabs, $ilSetting;
1492
1493 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1494 $lng->loadLanguageModule("style");
1495
1496 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1497 $this->form = new ilPropertyFormGUI();
1498
1499 $fixed_style = $ilSetting->get("fixed_content_style_id");
1500 $style_id = $this->object->getStyleSheetId();
1501
1502 if ($fixed_style > 0)
1503 {
1504 $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1505 $st->setValue(ilObject::_lookupTitle($fixed_style)." (".
1506 $this->lng->txt("global_fixed").")");
1507 $this->form->addItem($st);
1508 }
1509 else
1510 {
1511 $st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
1512 $_GET["ref_id"]);
1513
1514 $st_styles[0] = $this->lng->txt("default");
1515 ksort($st_styles);
1516
1517 if ($style_id > 0)
1518 {
1519 // individual style
1520 if (!ilObjStyleSheet::_lookupStandard($style_id))
1521 {
1522 $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1523 $st->setValue(ilObject::_lookupTitle($style_id));
1524 $this->form->addItem($st);
1525
1526//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
1527
1528 // delete command
1529 $this->form->addCommandButton("editStyle",
1530 $lng->txt("style_edit_style"));
1531 $this->form->addCommandButton("deleteStyle",
1532 $lng->txt("style_delete_style"));
1533//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
1534 }
1535 }
1536
1537 if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
1538 {
1539 $style_sel = ilUtil::formSelect ($style_id, "style_id",
1540 $st_styles, false, true);
1541 $style_sel = new ilSelectInputGUI($lng->txt("style_current_style"), "style_id");
1542 $style_sel->setOptions($st_styles);
1543 $style_sel->setValue($style_id);
1544 $this->form->addItem($style_sel);
1545//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
1546 $this->form->addCommandButton("saveStyleSettings",
1547 $lng->txt("save"));
1548 $this->form->addCommandButton("createStyle",
1549 $lng->txt("sty_create_ind_style"));
1550 }
1551 }
1552 $this->form->setTitle($lng->txt("glo_style"));
1553 $this->form->setFormAction($ilCtrl->getFormAction($this));
1554 }
1555
1559 function createStyle()
1560 {
1561 global $ilCtrl;
1562
1563 $ilCtrl->redirectByClass("ilobjstylesheetgui", "create");
1564 }
1565
1569 function editStyle()
1570 {
1571 global $ilCtrl;
1572
1573 $ilCtrl->redirectByClass("ilobjstylesheetgui", "edit");
1574 }
1575
1579 function deleteStyle()
1580 {
1581 global $ilCtrl;
1582
1583 $ilCtrl->redirectByClass("ilobjstylesheetgui", "delete");
1584 }
1585
1590 {
1591 global $ilSetting;
1592
1593 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1594 if ($ilSetting->get("fixed_content_style_id") <= 0 &&
1595 (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
1596 || $this->object->getStyleSheetId() == 0))
1597 {
1598 $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
1599 $this->object->update();
1600 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1601 }
1602 $this->ctrl->redirect($this, "editStyleProperties");
1603 }
1604
1608 function getPublicAccessColValue($a_type, $a_file)
1609 {
1610 global $lng, $ilCtrl;
1611
1612 if ($this->object->getPublicExportFile($a_type) == $a_file)
1613 {
1614 return $lng->txt("yes");
1615 }
1616
1617 return " ";
1618 }
1619
1626 function showTaxonomy()
1627 {
1628 global $tpl, $lng;
1629
1630 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1631 $tax_ids = ilObjTaxonomy::getUsageOfObject($this->object->getId());
1632 if (count($tax_ids) > 0)
1633 {
1634 include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
1635 $tax_exp = new ilTaxonomyExplorerGUI($this, "showTaxonomy", $tax_ids[0],
1636 "ilobjglossarygui", "listTerms");
1637 if (!$tax_exp->handleCommand())
1638 {
1639 //$tpl->setLeftNavContent($tax_exp->getHTML());
1640 $tpl->setLeftNavContent($tax_exp->getHTML()."&nbsp;");
1641 }
1642 }
1643
1644 }
1645
1646}
1647
1648?>
print $file
$section
Definition: Utf8Test.php:84
$_GET["client_id"]
$_SESSION["AccountId"]
This class represents a checkbox property in a property form.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
Class ilECSGlossarySettings.
Export User Interface Class.
This class represents a section header in a property form.
Class ilFramesetGUI.
Input for adv meta data column sorting in glossaries.
Glossary definition page GUI class.
Class ilGlossaryDefinition.
static setShortTextsDirty($a_glo_id)
Set short texts dirty.
Export class for content objects.
GUI class for glossary terms.
Class ilGlossaryTerm.
static getNumberOfUsages($a_term_id)
Get number of usages.
static _lookGlossaryID($term_id)
get glossary id form term id
static _lookGlossaryTerm($term_id)
get glossary term
Class ilInfoScreenGUI.
This class represents a non editable value in a property form.
This class represents a number property in a property form.
Class ilGlossaryGUI.
initSettingsForm($a_mode="edit")
Init settings form.
exportHTML()
create html package
addDefinition()
add definition
moveDefinitionDown()
move a definiton down
setLocator($a_tree="", $a_id="")
set Locator
static _goto($a_target)
redirect script
addUsagesToInfo($info, $glo_id)
Add usages to info.
setContentStyleSheet($a_tpl=null)
Set content style sheet.
setSettingsSubTabs($a_active)
Set sub tabs.
initStylePropertiesForm()
Init style properties form.
frameset()
glossary edit frameset
confirmTermDeletion()
confirm term deletion
confirmDefinitionDeletion()
deletion confirmation screen
getTabs(&$tabs_gui)
get tabs
getPublicAccessColValue($a_type, $a_file)
Get public access value for export table.
actTaxonomy()
Show Taxonomy.
showActions($a_actions)
show possible action (form buttons)
properties()
edit properties of object (admin form)
deleteTerms()
delete selected terms
& executeCommand()
execute command
moveDefinitionUp()
move a definiton up
viewObject()
list childs of current object
showTaxonomy()
Show taxonomy.
editStyleProperties()
Edit style properties.
publishExportFile()
download export file
saveObject()
save new content object to db
resetFilter()
Reset filter (note: this function existed before data table filter has been introduced.
create()
create new (subobject) in glossary
quickList()
quick term list
deactTaxonomy()
Hide Taxonomy.
export()
export content object
saveStyleSettings()
Save style settings.
initCreateForm($a_new_type)
Init object creation form.
ilObjGlossaryGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
cancelTermDeletion()
cancel deletion of object
showInfoScreen()
Show info screen.
saveProperties()
save properties
Class ilObjGlossary.
static getScormModulesForGlossary($a_glo_id)
Get SCORM modules that assign a certain glossary.
Class ilObjStyleSheetGUI.
getContentStylePath($a_style_id)
get content style path
_getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
getSyntaxStylePath()
get syntax style path
_lookupStandard($a_id)
Lookup standard flag.
Taxonomy GUI class.
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
static loadLanguageModule()
Load language module.
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
prepareOutput()
prepare output
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
addHeaderAction()
Add header action menu.
createObject()
create new object form
setLocator()
set Locator
Class ilObjectMetaDataGUI.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
static _lookupObjId($a_id)
const TITLE_LENGTH
max length of object title
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
ILIAS Setting Class.
Taxonomy explorer GUI class.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static yn2tf($a_yn)
convert "y"/"n" to true/false
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$_POST['username']
Definition: cron.php:12
$info
Definition: example_052.php:80
global $ilCtrl
Definition: ilias.php:18
exit
Definition: login.php:54
redirection script todo: (a better solution should control the processing via a xml file)
global $ilSetting
Definition: privfeed.php:40
$cmd
Definition: sahs_server.php:35
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
global $ilUser
Definition: imgupload.php:15