ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTermDefinitionEditorGUI Class Reference

GUI class for glossary term definition editor. More...

+ Collaboration diagram for ilTermDefinitionEditorGUI:

Public Member Functions

 ilTermDefinitionEditorGUI ()
 Constructor public.
executeCommand ()
 main_header ($a_header_title)
 output main header (title and locator)
 setTabs ()
 output tabs
 getTabs (&$tabs_gui)
 get tabs
 saveShortText ()

Data Fields

 $ilias
 $tpl
 $lng
 $glossary
 $definition
 $term

Detailed Description

GUI class for glossary term definition editor.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilTermDefinitionEditorGUI.php 56825 2015-01-07 10:52:43Z akill

ilTermDefinitionEditorGUI: ilGlossaryDefPageGUI, ilMDEditorGUI

Definition at line 19 of file class.ilTermDefinitionEditorGUI.php.

Member Function Documentation

& ilTermDefinitionEditorGUI::executeCommand ( )

Definition at line 49 of file class.ilTermDefinitionEditorGUI.php.

References $_GET, $cmd, $ilCtrl, $lng, $ret, $tpl, ilObjStyleSheet\getContentStylePath(), ilMD\getGeneral(), ilUtil\getImagePath(), ilGlossaryTerm\getNumberOfUsages(), ilPageObjectGUI\getPageObject(), ilObjStyleSheet\getSyntaxStylePath(), ilUtil\sendInfo(), ilPageObjectGUI\setEditPreview(), setTabs(), and ilMDBase\update().

{
global $tpl, $ilCtrl, $lng;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
// content style
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
$this->tpl->parseCurrentBlock();
// syntax style
$this->tpl->setCurrentBlock("SyntaxStyle");
$this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
$this->tpl->parseCurrentBlock();
require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
$gloss_loc =& new ilGlossaryLocatorGUI();
$gloss_loc->setTerm($this->term);
$gloss_loc->setGlossary($this->glossary);
$gloss_loc->setDefinition($this->definition);
$this->tpl->getStandardTemplate();
$this->tpl->setTitle($this->term->getTerm()." - ".
$this->lng->txt("cont_definition")." ".
$this->definition->getNr());
if ($this->ctrl->getNextClass() == "ilglossarydefpagegui")
{
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
}
switch ($next_class)
{
case "ilglossarydefpagegui":
// output number of usages
if ($ilCtrl->getCmd() == "edit" &&
$ilCtrl->getCmdClass() == "ilglossarydefpagegui")
{
if ($nr > 0)
{
$link = "[<a href='".
$ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages").
"'>".$lng->txt("glo_list_usages")."</a>]";
ilUtil::sendInfo(sprintf($lng->txt("glo_term_is_used_n_times"),
$nr)." ".$link);
}
}
// not so nice, to do: revise locator handling
if ($this->ctrl->getNextClass() == "ilglossarydefpagegui"
|| $this->ctrl->getCmdClass() == "ileditclipboardgui")
{
$gloss_loc->display();
}
$this->setTabs();
$this->ctrl->setReturnByClass("ilGlossaryDefPageGUI", "edit");
$this->ctrl->setReturn($this, "listDefinitions");
$page_gui = new ilGlossaryDefPageGUI($this->definition->getId());
$page = $page_gui->getPageObject();
$this->definition->assignPageObject($page);
$page->addUpdateListener($this, "saveShortText");
$page_gui->setEditPreview(true);
// metadata
// ... set title to term, if no title is given
include_once("./Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($this->glossary->getId(), $this->definition->getId(), "gdf");
$md_gen = $md->getGeneral();
if ($md_gen->getTitle() == "")
{
$md_gen->setTitle($this->term->getTerm());
$md_gen->update();
}
$page_gui->activateMetaDataEditor($this->glossary->getId(),
$this->definition->getId(), "gdf");
// $this->obj, "MDUpdateListener");
$page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
$page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=fullscreen&amp;ref_id=".$_GET["ref_id"]);
$page_gui->setTemplateTargetVar("ADM_CONTENT");
$page_gui->setOutputMode("edit");
$page_gui->setStyleId($this->glossary->getStyleSheetId());
$page_gui->setLocator($gloss_loc);
$page_gui->setIntLinkReturn($this->ctrl->getLinkTargetByClass("ilobjglossarygui", "quickList",
"", false, false));
$page_gui->setPageBackTitle($this->lng->txt("cont_definition"));
$page_gui->setLinkParams("ref_id=".$_GET["ref_id"]);
$page_gui->setHeader($this->term->getTerm());
$page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=".$_GET["ref_id"]);
$page_gui->setPresentationTitle($this->term->getTerm());
$ret =& $this->ctrl->forwardCommand($page_gui);
$tpl->setContent($ret);
break;
default:
$this->setTabs();
$gloss_loc->display();
$ret =& $this->$cmd();
break;
}
}

+ Here is the call graph for this function:

ilTermDefinitionEditorGUI::getTabs ( $tabs_gui)

get tabs

Definition at line 187 of file class.ilTermDefinitionEditorGUI.php.

Referenced by setTabs().

{
// back to glossary
$tabs_gui->setBack2Target($this->lng->txt("glossary"),
$this->ctrl->getParentReturn($this));
// back to upper context
$tabs_gui->setBackTarget($this->lng->txt("term"),
$this->ctrl->getLinkTargetByClass("ilglossarytermgui", "editTerm"));
}

+ Here is the caller graph for this function:

ilTermDefinitionEditorGUI::ilTermDefinitionEditorGUI ( )

Constructor public.

Definition at line 32 of file class.ilTermDefinitionEditorGUI.php.

References $_GET, $ilCtrl, $ilias, $lng, and $tpl.

{
global $ilias, $tpl, $lng, $objDefinition, $ilCtrl;
// initiate variables
$this->ilias =& $ilias;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->ctrl =& $ilCtrl;
$this->glossary =& new ilObjGlossary($_GET["ref_id"], true);
$this->definition =& new ilGlossaryDefinition($_GET["def"]);
$this->term =& new ilGlossaryTerm($this->definition->getTermId());
$this->ctrl->saveParameter($this, array("def"));
}
ilTermDefinitionEditorGUI::main_header (   $a_header_title)

output main header (title and locator)

Definition at line 163 of file class.ilTermDefinitionEditorGUI.php.

References $lng.

{
global $lng;
$this->tpl->getStandardTemplate();
$this->tpl->setTitle($a_header_title);
$this->displayLocator();
//$this->setAdminTabs($a_type);
}
ilTermDefinitionEditorGUI::saveShortText ( )

Definition at line 200 of file class.ilTermDefinitionEditorGUI.php.

{
$this->definition->updateShortText();
}
ilTermDefinitionEditorGUI::setTabs ( )

output tabs

Definition at line 176 of file class.ilTermDefinitionEditorGUI.php.

References getTabs().

Referenced by executeCommand().

{
global $ilTabs;
// catch feedback message
$this->getTabs($ilTabs);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilTermDefinitionEditorGUI::$definition

Definition at line 25 of file class.ilTermDefinitionEditorGUI.php.

ilTermDefinitionEditorGUI::$glossary

Definition at line 24 of file class.ilTermDefinitionEditorGUI.php.

ilTermDefinitionEditorGUI::$ilias

Definition at line 21 of file class.ilTermDefinitionEditorGUI.php.

Referenced by ilTermDefinitionEditorGUI().

ilTermDefinitionEditorGUI::$lng
ilTermDefinitionEditorGUI::$term

Definition at line 26 of file class.ilTermDefinitionEditorGUI.php.

ilTermDefinitionEditorGUI::$tpl

The documentation for this class was generated from the following file: