5require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
   59        $this->help = 
$DIC[
"ilHelp"];
 
   63        $ilTabs = 
$DIC->tabs();
 
   68        $this->ctrl->saveParameter($this, array(
"term_id"));
 
   69        $this->tabs_gui = $ilTabs;
 
   73        $this->ref_id = 
$_GET[
"ref_id"];
 
   77            require_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
 
   79                $this->term_glossary = 
new ilObjGlossary($this->ref_id, 
true);
 
   93        $next_class = $this->ctrl->getNextClass($this);
 
   94        $cmd = $this->ctrl->getCmd();
 
   96        $this->log->debug(
"glossary term, next class " . $next_class . 
", cmd: " . $cmd);
 
   98        switch ($next_class) {
 
   99            case "iltermdefinitioneditorgui":
 
  103                $ret = $this->ctrl->forwardCommand($def_edit);
 
  107            case "ilpropertyformgui":
 
  109                $this->ctrl->forwardCommand(
$form);
 
  112            case "ilobjectmetadatagui":
 
  114                $ilTabs->activateTab(
'meta_data');
 
  115                include_once 
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
 
  117                    $this->term_glossary,
 
  121                $this->ctrl->forwardCommand($md_gui);
 
  126                $ret = $this->$cmd();
 
  138        $this->offline_directory = $offdir;
 
  148        return $this->offline_directory;
 
  154        $this->glossary = $a_glossary;
 
  155        if (!is_object($this->term_glossary)) {
 
  156            $this->term_glossary = $a_glossary;
 
  162        $this->link_xml = $a_link_xml;
 
  198        $ilTabs->activateTab(
"properties");
 
  200        $this->tpl->setTitle($this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm());
 
  207        $this->tpl->setContent(
$ilCtrl->getHTML($a_form));
 
  223        include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  225        $form->setFormAction($this->ctrl->getFormAction($this, 
"updateTerm"));
 
  226        $form->setTitle($this->lng->txt(
"cont_edit_term"));
 
  229        $term->setRequired(
true);
 
  230        $term->setValue($this->term->getTerm());
 
  234        $lang->setRequired(
true);
 
  236        $lang->setValue($this->term->getLanguage());
 
  240        if ($this->term_glossary->getTaxonomyId() > 0) {
 
  241            include_once(
"./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
 
  242            $tax_node_assign = 
new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), 
"tax_node", 
true);
 
  244            include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
 
  245            $ta = 
new ilTaxNodeAssignment(
"glo", $this->term_glossary->getId(), 
"term", $this->term_glossary->getTaxonomyId());
 
  246            $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
 
  248            foreach ($assgnmts as $a) {
 
  249                $node_ids[] = $a[
"node_id"];
 
  251            $tax_node_assign->setValue($node_ids);
 
  253            $form->addItem($tax_node_assign);
 
  257        include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
 
  261            $this->term_glossary->getId(),
 
  265        $this->record_gui->setPropertyForm(
$form);
 
  266        $this->record_gui->parse();
 
  268        $form->addCommandButton(
"updateTerm", $this->lng->txt(
"save"));
 
  281        if (
$form->checkInput() &&
 
  282            $this->record_gui->importEditFormPostValues()) {
 
  285            $this->term->setLanguage(
$_POST[
"term_language"]);
 
  286            $this->term->update();
 
  289            if ($this->term_glossary->getTaxonomyId() > 0) {
 
  290                include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
 
  291                $ta = 
new ilTaxNodeAssignment(
"glo", $this->term_glossary->getId(), 
"term", $this->term_glossary->getTaxonomyId());
 
  292                $ta->deleteAssignmentsOfItem($this->term->getId());
 
  293                if (is_array(
$_POST[
"tax_node"])) {
 
  294                    foreach (
$_POST[
"tax_node"] as $node_id) {
 
  295                        $ta->addAssignment($node_id, $this->term->getId());
 
  300            $this->record_gui->writeEditForm();
 
  301            ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"), 
true);
 
  302            $this->ctrl->redirect($this, 
"editTerm");
 
  305        $form->setValuesByPost();
 
  315    public function getOverlayHTML($a_close_el_id, $a_glo_ov_id = 
"", $a_lang = 
"", $a_outputmode = 
"offline")
 
  320            $a_lang = 
$lng->getLangKey();
 
  323        $tpl = 
new ilTemplate(
"tpl.glossary_overlay.html", 
true, 
true, 
"Modules/Glossary");
 
  325        if ($a_outputmode == 
"preview") {
 
  326            $a_outputmode = 
"presentation";
 
  328        if ($a_outputmode == 
"offline") {
 
  333        if ($a_glo_ov_id != 
"") {
 
  334            $tpl->setCurrentBlock(
"glovlink");
 
  335            $tpl->setVariable(
"TXT_LINK", 
$lng->txtlng(
"content", 
"cont_sco_glossary", $a_lang));
 
  336            $tpl->setVariable(
"ID_LINK", $a_glo_ov_id);
 
  337            $tpl->parseCurrentBlock();
 
  339        $tpl->setVariable(
"TXT_CLOSE", 
$lng->txtlng(
"common", 
"close", $a_lang));
 
  340        $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
 
  349    public function output($a_offline = 
false, $a_tpl = 
"", $a_outputmode = 
"presentation")
 
  357        require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  358        require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
 
  362        $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  364        for ($j = 0; $j < count($defs); $j++) {
 
  367            $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  372                $page_gui->setFullscreenLink(
"fullscreen.html");        
 
  374            $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=" . 
$_GET[
"ref_id"]);
 
  377                $page_gui->setOutputMode($a_outputmode);
 
  379                $page_gui->setOutputMode(
"offline");
 
  386            $page_gui->setTemplateOutput(
false);
 
  387            $output = $page_gui->presentation($page_gui->getOutputMode());
 
  389            if (count($defs) > 1) {
 
  390                $tpl->setCurrentBlock(
"definition_header");
 
  393                    $this->lng->txt(
"cont_definition") . 
" " . ($j + 1)
 
  395                $tpl->parseCurrentBlock();
 
  398            include_once 
'./Services/MathJax/classes/class.ilMathJax.php';
 
  401            $tpl->setCurrentBlock(
"definition");
 
  403            $tpl->parseCurrentBlock();
 
  412        require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
  413        require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
 
  417        $term_links = array();
 
  418        for ($j = 0; $j < count($defs); $j++) {
 
  422            $page_links = $page->getInternalLinks();
 
  423            foreach ($page_links as 
$key => $page_link) {
 
  424                $term_links[
$key] = $page_link;
 
  441        $ilTabs->activateTab(
"definitions");
 
  442        require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
 
  445        $this->tpl->setCurrentBlock(
"ContentStyle");
 
  446        $this->tpl->setVariable(
 
  447            "LOCATION_CONTENT_STYLESHEET",
 
  450        $this->tpl->parseCurrentBlock();
 
  453        $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  454        $this->tpl->setVariable(
 
  455            "LOCATION_SYNTAX_STYLESHEET",
 
  458        $this->tpl->parseCurrentBlock();
 
  461        $this->tpl->addBlockfile(
"ADM_CONTENT", 
"def_list", 
"tpl.glossary_definition_list.html", 
true);
 
  465        $this->tpl->setTitle(
 
  466            $this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm()
 
  470        $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  472        $this->tpl->setCurrentBlock(
"add_def");
 
  473        $this->tpl->setVariable(
 
  474            "TXT_ADD_DEFINITION",
 
  475            $this->lng->txt(
"cont_add_definition")
 
  477        $this->tpl->setVariable(
"BTN_ADD", 
"addDefinition");
 
  478        $this->tpl->parseCurrentBlock();
 
  479        $this->tpl->setCurrentBlock(
"def_list");
 
  483        $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  485        for ($j = 0; $j < count($defs); $j++) {
 
  488            $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
 
  489            $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  490            $page_gui->setTemplateOutput(
false);
 
  491            $output = $page_gui->preview();
 
  493            if (count($defs) > 1) {
 
  494                $this->tpl->setCurrentBlock(
"definition_header");
 
  495                $this->tpl->setVariable(
 
  497                    $this->lng->txt(
"cont_definition") . 
" " . ($j + 1)
 
  499                $this->tpl->parseCurrentBlock();
 
  503                $this->tpl->setCurrentBlock(
"up");
 
  504                $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
 
  505                $this->ctrl->setParameter($this, 
"def", 
$def[
"id"]);
 
  506                $this->tpl->setVariable(
 
  508                    $this->ctrl->getLinkTarget($this, 
"moveUp")
 
  510                $this->tpl->parseCurrentBlock();
 
  513            if ($j + 1 < count($defs)) {
 
  514                $this->tpl->setCurrentBlock(
"down");
 
  515                $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
 
  516                $this->ctrl->setParameter($this, 
"def", 
$def[
"id"]);
 
  517                $this->tpl->setVariable(
 
  519                    $this->ctrl->getLinkTarget($this, 
"moveDown")
 
  521                $this->tpl->parseCurrentBlock();
 
  523            $this->tpl->setCurrentBlock(
"submit_btns");
 
  524            $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
 
  525            $this->ctrl->setParameter($this, 
"def", 
$def[
"id"]);
 
  526            $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI", 
"def", 
$def[
"id"]);
 
  527            $this->tpl->setVariable(
 
  529                $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI", 
"ilGlossaryDefPageGUI"), 
"edit")
 
  531            $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
 
  532            $this->tpl->setVariable(
 
  534                $this->ctrl->getLinkTarget($this, 
"confirmDefinitionDeletion")
 
  536            $this->tpl->parseCurrentBlock();
 
  538            $this->tpl->setCurrentBlock(
"definition");
 
  539            $this->tpl->setVariable(
"PAGE_CONTENT", 
$output);
 
  540            $this->tpl->parseCurrentBlock();
 
  559        $ilTabs->activateTab(
"definitions");
 
  562        $this->tpl->setCurrentBlock(
"ContentStyle");
 
  563        $this->tpl->setVariable(
 
  564            "LOCATION_CONTENT_STYLESHEET",
 
  567        $this->tpl->parseCurrentBlock();
 
  570        $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  571        $this->tpl->setVariable(
 
  572            "LOCATION_SYNTAX_STYLESHEET",
 
  575        $this->tpl->parseCurrentBlock();
 
  577        $this->tpl->setTitle(
 
  578            $this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm()
 
  582        $this->tpl->addBlockfile(
"ADM_CONTENT", 
"def_list", 
"tpl.glossary_definition_delete.html", 
true);
 
  585        $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
 
  589        $page_gui->setTemplateOutput(
false);
 
  590        $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
 
  591        $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  592        $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  593        $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . 
$_GET[
"ref_id"]);
 
  594        $output = $page_gui->preview();
 
  596        $this->tpl->setCurrentBlock(
"definition");
 
  597        $this->tpl->setVariable(
"PAGE_CONTENT", 
$output);
 
  598        $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  599        $this->tpl->setVariable(
 
  601            $this->ctrl->getLinkTarget($this, 
"cancelDefinitionDeletion")
 
  603        $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
 
  604        $this->ctrl->setParameter($this, 
"def", $definition->getId());
 
  605        $this->tpl->setVariable(
 
  607            $this->ctrl->getLinkTarget($this, 
"deleteDefinition")
 
  609        $this->tpl->parseCurrentBlock();
 
  614        $this->ctrl->redirect($this, 
"listDefinitions");
 
  621        $definition->delete();
 
  622        $this->ctrl->redirect($this, 
"listDefinitions");
 
  632        $definition->moveUp();
 
  633        $this->ctrl->redirect($this, 
"listDefinitions");
 
  643        $definition->moveDown();
 
  644        $this->ctrl->redirect($this, 
"listDefinitions");
 
  655        $ilCtrl->setParameterByClass(
"ilobjglossarygui", 
"term_id", $this->term->getId());
 
  656        $ilCtrl->redirectByClass(
"ilobjglossarygui", 
"addDefinition");
 
  664        $this->ctrl->redirect($this, 
"listDefinitions");
 
  678        $this->ctrl->redirect($this, 
"listDefinitions");
 
  694        require_once(
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
 
  696        $gloss_loc->setTerm($this->term);
 
  697        $gloss_loc->setGlossary($this->glossary);
 
  699        $gloss_loc->display();
 
  712        $ilHelp->setScreenIdComponent(
"glo_term");
 
  715        if (
$_GET[
"term_id"] != 
"") {
 
  716            $this->tabs_gui->addTab(
 
  719                $this->ctrl->getLinkTarget($this, 
"editTerm")
 
  722            $this->tabs_gui->addTab(
 
  724                $lng->txt(
"cont_definitions"),
 
  725                $this->ctrl->getLinkTarget($this, 
"listDefinitions")
 
  728            $this->tabs_gui->addTab(
 
  731                $this->ctrl->getLinkTarget($this, 
"listUsages")
 
  734            include_once 
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
 
  736                $this->term_glossary,
 
  740            $mdtab = $mdgui->getTab();
 
  742                $this->tabs_gui->addTab(
 
  744                    $lng->txt(
"meta_data"),
 
  749            $this->tabs_gui->addNonTabbedLink(
 
  751                $this->lng->txt(
"glo_presentation_view"),
 
  753                "/goto.php?target=" .
 
  755                "_" . 
$_GET[
"term_id"] . 
"_" . 
$_GET[
"ref_id"] . 
"&client_id=" . CLIENT_ID,
 
  761        $this->tabs_gui->setBackTarget(
 
  762            $this->lng->txt(
"glossary"),
 
  763            $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui", 
"listTerms")
 
  772    public static function _goto($a_target, $a_ref_id = 
"")
 
  776        $rbacsystem = 
$DIC->rbac()->system();
 
  779        $ilAccess = 
$DIC->access();
 
  785            $ref_ids = array($a_ref_id);
 
  791        foreach ($ref_ids as $ref_id) {
 
  793            if ($ilAccess->checkAccess(
"read", 
"", $ref_id)) {
 
  794                $_GET[
"baseClass"] = 
"ilGlossaryPresentationGUI";
 
  795                $_GET[
"term_id"] = $a_target;
 
  796                $_GET[
"ref_id"] = $ref_id;
 
  797                $_GET[
"cmd"] = 
"listDefinitions";
 
  798                include_once(
"ilias.php");
 
  802        if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID)) {
 
  804                $lng->txt(
"msg_no_perm_read_item"),
 
  826        $ilTabs->activateTab(
"usage");
 
  828        $this->tpl->setTitle($this->lng->txt(
"cont_term") . 
": " . $this->term->getTerm());
 
  831        include_once(
"./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
 
  849        include_once(
"./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
 
  851        $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()
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)
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)
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
if(isset($_POST['submit'])) $form