58        $this->
help = $DIC[
"ilHelp"];
 
   62        $ilTabs = 
$DIC->tabs();
 
   67        $this->ctrl->saveParameter($this, array(
"term_id"));
 
   68        $this->tabs_gui = $ilTabs;
 
   72        $this->ref_id = 
$_GET[
"ref_id"];
 
   77                $this->term_glossary = 
new ilObjGlossary($this->ref_id, 
true);
 
   91        $next_class = $this->ctrl->getNextClass($this);
 
   92        $cmd = $this->ctrl->getCmd();
 
   94        $this->log->debug(
"glossary term, next class " . $next_class . 
", cmd: " . $cmd);
 
   96        switch ($next_class) {
 
   97            case "iltermdefinitioneditorgui":
 
  101                $ret = $this->ctrl->forwardCommand($def_edit);
 
  105            case "ilpropertyformgui":
 
  107                $this->ctrl->forwardCommand($form);
 
  110            case "ilobjectmetadatagui":
 
  112                $ilTabs->activateTab(
'meta_data');
 
  114                    $this->term_glossary,
 
  118                $this->ctrl->forwardCommand($md_gui);
 
  123                $ret = $this->$cmd();
 
  135        $this->offline_directory = $offdir;
 
  145        return $this->offline_directory;
 
  151        $this->glossary = $a_glossary;
 
  152        if (!is_object($this->term_glossary)) {
 
  153            $this->term_glossary = $a_glossary;
 
  190        $ilTabs->activateTab(
"properties");
 
  192        $this->tpl->setTitle($this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm());
 
  199        $this->tpl->setContent(
$ilCtrl->getHTML($a_form));
 
  216        $form->setFormAction($this->ctrl->getFormAction($this, 
"updateTerm"));
 
  217        $form->setTitle($this->lng->txt(
"cont_edit_term"));
 
  220        $term->setRequired(
true);
 
  221        $term->setValue($this->term->getTerm());
 
  222        $form->addItem(
$term);
 
  225        $lang->setRequired(
true);
 
  227        $lang->setValue($this->term->getLanguage());
 
  228        $form->addItem(
$lang);
 
  231        if ($this->term_glossary->getTaxonomyId() > 0) {
 
  232            $tax_node_assign = 
new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), 
"tax_node", 
true);
 
  234            $ta = 
new ilTaxNodeAssignment(
"glo", $this->term_glossary->getId(), 
"term", $this->term_glossary->getTaxonomyId());
 
  235            $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
 
  237            foreach ($assgnmts as 
$a) {
 
  238                $node_ids[] = 
$a[
"node_id"];
 
  240            $tax_node_assign->setValue($node_ids);
 
  242            $form->addItem($tax_node_assign);
 
  249            $this->term_glossary->getId(),
 
  253        $this->record_gui->setPropertyForm($form);
 
  254        $this->record_gui->parse();
 
  256        $form->addCommandButton(
"updateTerm", $this->lng->txt(
"save"));
 
  269        if ($form->checkInput() &&
 
  270            $this->record_gui->importEditFormPostValues()) {
 
  273            $this->term->setLanguage(
$_POST[
"term_language"]);
 
  274            $this->term->update();
 
  277            if ($this->term_glossary->getTaxonomyId() > 0) {
 
  278                $ta = 
new ilTaxNodeAssignment(
"glo", $this->term_glossary->getId(), 
"term", $this->term_glossary->getTaxonomyId());
 
  279                $ta->deleteAssignmentsOfItem($this->term->getId());
 
  280                if (is_array(
$_POST[
"tax_node"])) {
 
  281                    foreach (
$_POST[
"tax_node"] as $node_id) {
 
  282                        $ta->addAssignment($node_id, $this->term->getId());
 
  287            $this->record_gui->writeEditForm();
 
  288            ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"), 
true);
 
  289            $this->ctrl->redirect($this, 
"editTerm");
 
  292        $form->setValuesByPost();
 
  302    public function getOverlayHTML($a_close_el_id, $a_glo_ov_id = 
"", $a_lang = 
"", $a_outputmode = 
"offline")
 
  307            $a_lang = 
$lng->getLangKey();
 
  310        $tpl = 
new ilTemplate(
"tpl.glossary_overlay.html", 
true, 
true, 
"Modules/Glossary");
 
  312        if ($a_outputmode == 
"preview") {
 
  313            $a_outputmode = 
"presentation";
 
  315        if ($a_outputmode == 
"offline") {
 
  320        if ($a_glo_ov_id != 
"") {
 
  321            $tpl->setCurrentBlock(
"glovlink");
 
  322            $tpl->setVariable(
"TXT_LINK", 
$lng->txtlng(
"content", 
"cont_sco_glossary", $a_lang));
 
  323            $tpl->setVariable(
"ID_LINK", $a_glo_ov_id);
 
  324            $tpl->parseCurrentBlock();
 
  326        $tpl->setVariable(
"TXT_CLOSE", 
$lng->txtlng(
"common", 
"close", $a_lang));
 
  327        $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
 
  336    public function output($a_offline = 
false, $a_tpl = 
"", $a_outputmode = 
"presentation")
 
  346        $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  348        for ($j = 0; $j < count($defs); $j++) {
 
  351            $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  356                $page_gui->setFullscreenLink(
"fullscreen.html");        
 
  358            $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=" . 
$_GET[
"ref_id"]);
 
  361                $page_gui->setOutputMode($a_outputmode);
 
  363                $page_gui->setOutputMode(
"offline");
 
  369            $page_gui->setPageLinker($this->page_linker);
 
  370            $page_gui->setTemplateOutput(
false);
 
  371            $output = $page_gui->presentation($page_gui->getOutputMode());
 
  373            if (count($defs) > 1) {
 
  374                $tpl->setCurrentBlock(
"definition_header");
 
  377                    $this->lng->txt(
"cont_definition") . 
" " . ($j + 1)
 
  379                $tpl->parseCurrentBlock();
 
  384            $tpl->setCurrentBlock(
"definition");
 
  385            $tpl->setVariable(
"PAGE_CONTENT", $output);
 
  386            $tpl->parseCurrentBlock();
 
  397        $term_links = array();
 
  398        for ($j = 0; $j < count($defs); $j++) {
 
  402            $page_links = $page->getInternalLinks();
 
  403            foreach ($page_links as $key => $page_link) {
 
  404                $term_links[$key] = $page_link;
 
  421        $ilTabs->activateTab(
"definitions");
 
  429        $tpl = 
new ilTemplate(
"tpl.glossary_definition_list.html", 
true, 
true, 
"Modules/Glossary");
 
  431        $this->tpl->setTitle(
 
  432            $this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm()
 
  436        $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  438        $tpl->setCurrentBlock(
"add_def");
 
  440            "TXT_ADD_DEFINITION",
 
  441            $this->lng->txt(
"cont_add_definition")
 
  443        $tpl->setVariable(
"BTN_ADD", 
"addDefinition");
 
  444        $tpl->parseCurrentBlock();
 
  449        $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  451        for ($j = 0; $j < count($defs); $j++) {
 
  454            $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
 
  455            $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  456            $page_gui->setTemplateOutput(
false);
 
  457            $output = $page_gui->preview();
 
  459            if (count($defs) > 1) {
 
  460                $tpl->setCurrentBlock(
"definition_header");
 
  463                    $this->lng->txt(
"cont_definition") . 
" " . ($j + 1)
 
  465                $tpl->parseCurrentBlock();
 
  469                $tpl->setCurrentBlock(
"up");
 
  470                $tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
 
  471                $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  474                    $this->ctrl->getLinkTarget($this, 
"moveUp")
 
  476                $tpl->parseCurrentBlock();
 
  479            if ($j + 1 < count($defs)) {
 
  480                $tpl->setCurrentBlock(
"down");
 
  481                $tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
 
  482                $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  485                    $this->ctrl->getLinkTarget($this, 
"moveDown")
 
  487                $tpl->parseCurrentBlock();
 
  489            $tpl->setCurrentBlock(
"submit_btns");
 
  490            $tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
 
  491            $this->ctrl->setParameter($this, 
"def", $def[
"id"]);
 
  492            $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI", 
"def", $def[
"id"]);
 
  495                $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI", 
"ilGlossaryDefPageGUI"), 
"edit")
 
  497            $tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
 
  500                $this->ctrl->getLinkTarget($this, 
"confirmDefinitionDeletion")
 
  502            $tpl->parseCurrentBlock();
 
  504            $tpl->setCurrentBlock(
"definition");
 
  505            $tpl->setVariable(
"PAGE_CONTENT", $output);
 
  506            $tpl->parseCurrentBlock();
 
  509        $this->tpl->setContent(
$tpl->get());
 
  528        $ilTabs->activateTab(
"definitions");
 
  533        $this->tpl->setTitle(
 
  534            $this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm()
 
  538        $dtpl = 
new ilTemplate(
"tpl.glossary_definition_delete.html", 
true, 
true, 
"Modules/Glossary");
 
  541        $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  545        $page_gui->setTemplateOutput(
false);
 
  546        $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
 
  547        $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  548        $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  549        $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  550        $output = $page_gui->preview();
 
  552        $dtpl->setCurrentBlock(
"definition");
 
  553        $dtpl->setVariable(
"PAGE_CONTENT", $output);
 
  554        $dtpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  557            $this->ctrl->getLinkTarget($this, 
"cancelDefinitionDeletion")
 
  559        $dtpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
 
  560        $this->ctrl->setParameter($this, 
"def", $definition->getId());
 
  563            $this->ctrl->getLinkTarget($this, 
"deleteDefinition")
 
  565        $dtpl->parseCurrentBlock();
 
  567        $this->tpl->setContent($dtpl->get());
 
  572        $this->ctrl->redirect($this, 
"listDefinitions");
 
  579        $definition->delete();
 
  580        $this->ctrl->redirect($this, 
"listDefinitions");
 
  590        $definition->moveUp();
 
  591        $this->ctrl->redirect($this, 
"listDefinitions");
 
  601        $definition->moveDown();
 
  602        $this->ctrl->redirect($this, 
"listDefinitions");
 
  613        $ilCtrl->setParameterByClass(
"ilobjglossarygui", 
"term_id", $this->term->getId());
 
  614        $ilCtrl->redirectByClass(
"ilobjglossarygui", 
"addDefinition");
 
  622        $this->ctrl->redirect($this, 
"listDefinitions");
 
  631        $def->setTermId(
$_GET[
"term_id"]);
 
  636        $this->ctrl->redirect($this, 
"listDefinitions");
 
  653        $gloss_loc->setTerm($this->term);
 
  654        $gloss_loc->setGlossary($this->glossary);
 
  656        $gloss_loc->display();
 
  669        $ilHelp->setScreenIdComponent(
"glo_term");
 
  672        if (
$_GET[
"term_id"] != 
"") {
 
  673            $this->tabs_gui->addTab(
 
  676                $this->ctrl->getLinkTarget($this, 
"editTerm")
 
  679            $this->tabs_gui->addTab(
 
  681                $lng->txt(
"cont_definitions"),
 
  682                $this->ctrl->getLinkTarget($this, 
"listDefinitions")
 
  685            $this->tabs_gui->addTab(
 
  688                $this->ctrl->getLinkTarget($this, 
"listUsages")
 
  692                $this->term_glossary,
 
  696            $mdtab = $mdgui->getTab();
 
  698                $this->tabs_gui->addTab(
 
  700                    $lng->txt(
"meta_data"),
 
  705            $this->tabs_gui->addNonTabbedLink(
 
  707                $this->lng->txt(
"glo_presentation_view"),
 
  709                "/goto.php?target=" .
 
  711                "_" . 
$_GET[
"term_id"] . 
"_" . 
$_GET[
"ref_id"] . 
"&client_id=" . CLIENT_ID,
 
  717        $this->tabs_gui->setBackTarget(
 
  718            $this->lng->txt(
"glossary"),
 
  719            $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui", 
"listTerms")
 
  728    public static function _goto($a_target, $a_ref_id = 
"")
 
  732        $rbacsystem = 
$DIC->rbac()->system();
 
  735        $ilAccess = 
$DIC->access();
 
  741            $ref_ids = array($a_ref_id);
 
  747        foreach ($ref_ids as $ref_id) {
 
  749            if ($ilAccess->checkAccess(
"read", 
"", $ref_id)) {
 
  750                $_GET[
"baseClass"] = 
"ilGlossaryPresentationGUI";
 
  751                $_GET[
"term_id"] = $a_target;
 
  752                $_GET[
"ref_id"] = $ref_id;
 
  753                $_GET[
"cmd"] = 
"listDefinitions";
 
  754                include_once(
"ilias.php");
 
  758        if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID)) {
 
  760                $lng->txt(
"msg_no_perm_read_item"),
 
  782        $ilTabs->activateTab(
"usage");
 
  784        $this->tpl->setTitle($this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm());
 
  802        $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