63        $this->
help = $DIC[
"ilHelp"];
 
   66        $ilCtrl = 
$DIC->ctrl();
 
   67        $ilTabs = 
$DIC->tabs();
 
   71        $this->ctrl = $ilCtrl;
 
   72        $this->ctrl->saveParameter($this, array(
"term_id"));
 
   73        $this->tabs_gui = $ilTabs;
 
   77        $this->toolbar = 
$DIC->toolbar();
 
   79        $this->ref_id = 
$_GET[
"ref_id"];
 
   84                $this->term_glossary = 
new ilObjGlossary($this->ref_id, 
true);
 
   98        $next_class = $this->ctrl->getNextClass($this);
 
   99        $cmd = $this->ctrl->getCmd();
 
  101        $this->log->debug(
"glossary term, next class " . $next_class . 
", cmd: " . $cmd);
 
  103        switch ($next_class) {
 
  104            case "iltermdefinitioneditorgui":
 
  108                $ret = $this->ctrl->forwardCommand($def_edit);
 
  112            case "ilpropertyformgui":
 
  114                $this->ctrl->forwardCommand($form);
 
  117            case "ilobjectmetadatagui":
 
  119                $ilTabs->activateTab(
'meta_data');
 
  121                    $this->term_glossary,
 
  125                $this->ctrl->forwardCommand($md_gui);
 
  130                $ret = $this->$cmd();
 
  142        $this->offline_directory = $offdir;
 
  152        return $this->offline_directory;
 
  158        $this->glossary = $a_glossary;
 
  159        if (!is_object($this->term_glossary)) {
 
  160            $this->term_glossary = $a_glossary;
 
  197        $ilTabs->activateTab(
"properties");
 
  199        $this->tpl->setTitle($this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm());
 
  206        $this->tpl->setContent($ilCtrl->getHTML($a_form));
 
  223        $form->setFormAction($this->ctrl->getFormAction($this, 
"updateTerm"));
 
  224        $form->setTitle($this->lng->txt(
"cont_edit_term"));
 
  227        $term->setRequired(
true);
 
  228        $term->setValue($this->term->getTerm());
 
  229        $form->addItem(
$term);
 
  232        $lang->setRequired(
true);
 
  234        $lang->setValue($this->term->getLanguage());
 
  235        $form->addItem(
$lang);
 
  238        if ($this->term_glossary->getTaxonomyId() > 0) {
 
  239            $tax_node_assign = 
new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), 
"tax_node", 
true);
 
  241            $ta = 
new ilTaxNodeAssignment(
"glo", $this->term_glossary->getId(), 
"term", $this->term_glossary->getTaxonomyId());
 
  242            $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
 
  244            foreach ($assgnmts as 
$a) {
 
  245                $node_ids[] = 
$a[
"node_id"];
 
  247            $tax_node_assign->setValue($node_ids);
 
  249            $form->addItem($tax_node_assign);
 
  256            $this->term_glossary->getId(),
 
  260        $this->record_gui->setPropertyForm($form);
 
  261        $this->record_gui->parse();
 
  263        $form->addCommandButton(
"updateTerm", $this->lng->txt(
"save"));
 
  276        if ($form->checkInput() &&
 
  277            $this->record_gui->importEditFormPostValues()) {
 
  280            $this->term->setLanguage(
$_POST[
"term_language"]);
 
  281            $this->term->update();
 
  284            if ($this->term_glossary->getTaxonomyId() > 0) {
 
  285                $ta = 
new ilTaxNodeAssignment(
"glo", $this->term_glossary->getId(), 
"term", $this->term_glossary->getTaxonomyId());
 
  286                $ta->deleteAssignmentsOfItem($this->term->getId());
 
  287                if (is_array(
$_POST[
"tax_node"])) {
 
  288                    foreach (
$_POST[
"tax_node"] as $node_id) {
 
  289                        $ta->addAssignment($node_id, $this->term->getId());
 
  294            $this->record_gui->writeEditForm();
 
  295            ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"), 
true);
 
  296            $this->ctrl->redirect($this, 
"editTerm");
 
  299        $form->setValuesByPost();
 
  309    public function getOverlayHTML($a_close_el_id, $a_glo_ov_id = 
"", $a_lang = 
"", $a_outputmode = 
"offline")
 
  314            $a_lang = 
$lng->getLangKey();
 
  317        $tpl = 
new ilTemplate(
"tpl.glossary_overlay.html", 
true, 
true, 
"Modules/Glossary");
 
  319        if ($a_outputmode == 
"preview") {
 
  320            $a_outputmode = 
"presentation";
 
  322        if ($a_outputmode == 
"offline") {
 
  327        if ($a_glo_ov_id != 
"") {
 
  328            $tpl->setCurrentBlock(
"glovlink");
 
  329            $tpl->setVariable(
"TXT_LINK", 
$lng->txtlng(
"content", 
"cont_sco_glossary", $a_lang));
 
  330            $tpl->setVariable(
"ID_LINK", $a_glo_ov_id);
 
  331            $tpl->parseCurrentBlock();
 
  333        $tpl->setVariable(
"TXT_CLOSE", 
$lng->txtlng(
"common", 
"close", $a_lang));
 
  334        $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
 
  343    public function output($a_offline = 
false, $a_tpl = 
"", $a_outputmode = 
"presentation")
 
  353        $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  355        for ($j = 0; $j < count($defs); $j++) {
 
  358            $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  363                $page_gui->setFullscreenLink(
"fullscreen.html");        
 
  365            $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=" . 
$_GET[
"ref_id"]);
 
  368                $page_gui->setOutputMode($a_outputmode);
 
  370                $page_gui->setOutputMode(
"offline");
 
  376            $page_gui->setPageLinker($this->page_linker);
 
  377            $page_gui->setTemplateOutput(
false);
 
  378            $output = $page_gui->presentation($page_gui->getOutputMode());
 
  380            if (count($defs) > 1) {
 
  381                $tpl->setCurrentBlock(
"definition_header");
 
  384                    $this->lng->txt(
"cont_definition") . 
" " . ($j + 1)
 
  386                $tpl->parseCurrentBlock();
 
  391            $tpl->setCurrentBlock(
"definition");
 
  392            $tpl->setVariable(
"PAGE_CONTENT", $output);
 
  393            $tpl->parseCurrentBlock();
 
  404        $term_links = array();
 
  405        for ($j = 0; $j < count($defs); $j++) {
 
  409            $page_links = $page->getInternalLinks();
 
  410            foreach ($page_links as $key => $page_link) {
 
  411                $term_links[$key] = $page_link;
 
  428        $ilTabs->activateTab(
"definitions");
 
  436        $tpl = 
new ilTemplate(
"tpl.glossary_definition_list.html", 
true, 
true, 
"Modules/Glossary");
 
  438        $this->tpl->setTitle(
 
  439            $this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm()
 
  443        $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  445        $tpl->setCurrentBlock(
"add_def");
 
  447            "TXT_ADD_DEFINITION",
 
  448            $this->lng->txt(
"cont_add_definition")
 
  450        $tpl->setVariable(
"BTN_ADD", 
"addDefinition");
 
  451        $tpl->parseCurrentBlock();
 
  456        $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  458        for ($j = 0; $j < count($defs); $j++) {
 
  461            $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
 
  462            $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  463            $page_gui->setTemplateOutput(
false);
 
  464            $output = $page_gui->preview();
 
  466            if (count($defs) > 1) {
 
  467                $tpl->setCurrentBlock(
"definition_header");
 
  470                    $this->lng->txt(
"cont_definition") . 
" " . ($j + 1)
 
  472                $tpl->parseCurrentBlock();
 
  476                $tpl->setCurrentBlock(
"up");
 
  477                $tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
 
  478                $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  481                    $this->ctrl->getLinkTarget($this, 
"moveUp")
 
  483                $tpl->parseCurrentBlock();
 
  486            if ($j + 1 < count($defs)) {
 
  487                $tpl->setCurrentBlock(
"down");
 
  488                $tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
 
  489                $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  492                    $this->ctrl->getLinkTarget($this, 
"moveDown")
 
  494                $tpl->parseCurrentBlock();
 
  496            $tpl->setCurrentBlock(
"submit_btns");
 
  497            $tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
 
  498            $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  499            $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI", 
"def", $def[
"id"]);
 
  502                $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI", 
"ilGlossaryDefPageGUI"), 
"edit")
 
  504            $tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
 
  507                $this->ctrl->getLinkTarget($this, 
"confirmDefinitionDeletion")
 
  509            $tpl->parseCurrentBlock();
 
  511            $tpl->setCurrentBlock(
"definition");
 
  512            $tpl->setVariable(
"PAGE_CONTENT", $output);
 
  513            $tpl->parseCurrentBlock();
 
  517        $this->toolbar->setItems([]);
 
  519        $this->tpl->setContent(
$tpl->get());
 
  538        $ilTabs->activateTab(
"definitions");
 
  543        $this->tpl->setTitle(
 
  544            $this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm()
 
  548        $dtpl = 
new ilTemplate(
"tpl.glossary_definition_delete.html", 
true, 
true, 
"Modules/Glossary");
 
  551        $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  555        $page_gui->setTemplateOutput(
false);
 
  556        $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
 
  557        $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  558        $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  559        $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  560        $output = $page_gui->preview();
 
  562        $dtpl->setCurrentBlock(
"definition");
 
  563        $dtpl->setVariable(
"PAGE_CONTENT", $output);
 
  564        $dtpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  567            $this->ctrl->getLinkTarget($this, 
"cancelDefinitionDeletion")
 
  569        $dtpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
 
  570        $this->ctrl->setParameter($this, 
"def", $definition->getId());
 
  573            $this->ctrl->getLinkTarget($this, 
"deleteDefinition")
 
  575        $dtpl->parseCurrentBlock();
 
  577        $this->tpl->setContent($dtpl->get());
 
  582        $this->ctrl->redirect($this, 
"listDefinitions");
 
  589        $definition->delete();
 
  590        $this->ctrl->redirect($this, 
"listDefinitions");
 
  600        $definition->moveUp();
 
  601        $this->ctrl->redirect($this, 
"listDefinitions");
 
  611        $definition->moveDown();
 
  612        $this->ctrl->redirect($this, 
"listDefinitions");
 
  623        $ilCtrl->setParameterByClass(
"ilobjglossarygui", 
"term_id", $this->term->getId());
 
  624        $ilCtrl->redirectByClass(
"ilobjglossarygui", 
"addDefinition");
 
  632        $this->ctrl->redirect($this, 
"listDefinitions");
 
  641        $def->setTermId(
$_GET[
"term_id"]);
 
  646        $this->ctrl->redirect($this, 
"listDefinitions");
 
  663        $gloss_loc->setTerm($this->term);
 
  664        $gloss_loc->setGlossary($this->glossary);
 
  666        $gloss_loc->display();
 
  679        $ilHelp->setScreenIdComponent(
"glo_term");
 
  682        if (
$_GET[
"term_id"] != 
"") {
 
  683            $this->tabs_gui->addTab(
 
  686                $this->ctrl->getLinkTarget($this, 
"editTerm")
 
  689            $this->tabs_gui->addTab(
 
  691                $lng->txt(
"cont_definitions"),
 
  692                $this->ctrl->getLinkTarget($this, 
"listDefinitions")
 
  695            $this->tabs_gui->addTab(
 
  698                $this->ctrl->getLinkTarget($this, 
"listUsages")
 
  702                $this->term_glossary,
 
  706            $mdtab = $mdgui->getTab();
 
  708                $this->tabs_gui->addTab(
 
  710                    $lng->txt(
"meta_data"),
 
  715            $this->tabs_gui->addNonTabbedLink(
 
  717                $this->lng->txt(
"glo_presentation_view"),
 
  719                "/goto.php?target=" .
 
  727        $this->tabs_gui->setBackTarget(
 
  728            $this->lng->txt(
"glossary"),
 
  729            $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui", 
"listTerms")
 
  738    public static function _goto($a_target, $a_ref_id = 
"")
 
  742        $rbacsystem = 
$DIC->rbac()->system();
 
  745        $ilAccess = 
$DIC->access();
 
  751            $ref_ids = array($a_ref_id);
 
  757        foreach ($ref_ids as $ref_id) {
 
  759            if ($ilAccess->checkAccess(
"read", 
"", $ref_id)) {
 
  760                $_GET[
"baseClass"] = 
"ilGlossaryPresentationGUI";
 
  761                $_GET[
"term_id"] = $a_target;
 
  762                $_GET[
"ref_id"] = $ref_id;
 
  763                $_GET[
"cmd"] = 
"listDefinitions";
 
  764                include_once(
"ilias.php");
 
  770                $lng->txt(
"msg_no_perm_read_item"),
 
  792        $ilTabs->activateTab(
"usage");
 
  794        $this->tpl->setTitle($this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm());
 
  799        $tpl->setContent($tab->getHTML());
 
  812        $tpl->setLeftNavContent($tab->getHTML());
 
An exception for terminatinating execution or to throw for unit testing.
Glossary definition page GUI class.
Glossary definition page object.
Class ilGlossaryDefinition.
static getDefinitionList($a_term_id)
static
GUI class for glossary terms.
getOfflineDirectory()
get offline directory
__construct($a_id=0)
Constructor @access public.
getOverlayHTML($a_close_el_id, $a_glo_ov_id="", $a_lang="", $a_outputmode="offline")
Get overlay html.
cancel()
cancel adding definition
moveUp()
move definition upwards
editTerm(ilPropertyFormGUI $a_form=null)
Edit term.
quickList()
Set quick term list cmd into left navigation URL.
listDefinitions()
list definitions
getInternalLinks()
get internal links
static _goto($a_target, $a_ref_id="")
redirect script
executeCommand()
execute command
cancelDefinitionDeletion()
setPageLinker($page_linker)
getEditTermForm()
Get edit term form.
addDefinition()
add definition
moveDown()
move definition downwards
displayLocator()
display locator
confirmDefinitionDeletion()
deletion confirmation screen
saveDefinition()
save definition
setOfflineDirectory($offdir)
set offline directory to offdir
create()
form for new content object creation
output($a_offline=false, $a_tpl="", $a_outputmode="presentation")
output glossary term definitions
static getNumberOfUsages($a_term_id)
Get number of usages.
static _lookGlossaryID($term_id)
get glossary id form term id
static getLogger($a_component_id)
Get component logger.
static getInstance()
Singleton: get instance.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static _getAllReferences($a_id)
get all reference ids of object
Taxonomy node <-> item assignment.
special template class to simplify handling of ITX/PEAR
GUI class for glossary term definition editor.
TableGUI class for media object usages listing.
This class represents a text property in a property form.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
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 getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples