ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjGlossaryGUI Class Reference

Class ilGlossaryGUI. More...

+ Inheritance diagram for ilObjGlossaryGUI:
+ Collaboration diagram for ilObjGlossaryGUI:

Public Member Functions

 ilObjGlossaryGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
executeCommand ()
 execute command
 assignObject ()
 createObject ()
 form for new content object creation
 importObject ()
 saveObject ()
 save new content object to db
 importFileObject ()
 display status information or report errors messages in case of error
 showInfoScreen ()
 Show info screen.
 addUsagesToInfo ($info, $glo_id)
 Add usages to info.
 viewObject ()
 list childs of current object
 properties ()
 edit properties of object (admin form)
 initSettingsForm ($a_mode="edit")
 Init settings form.
 getSettingsValues ()
 Get current values for settings from.
 saveProperties ()
 save properties
 frameset ()
 glossary edit frameset
 quickList ()
 quick term list
 listTerms ()
 list terms
 showActions ($a_actions)
 show possible action (form buttons)
 addTerm ()
 add term
 moveDefinitionUp ()
 move a definiton up
 moveDefinitionDown ()
 move a definiton down
 confirmDefinitionDeletion ()
 deletion confirmation screen
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 cancelDefinitionDeletion ()
 deleteDefinition ()
 editTerm ()
 edit term
 updateTerm ()
 update term
 exportList ()
 export ()
 export content object
 exportHTML ()
 create html package
 downloadExportFile ()
 download export file
 publishExportFile ()
 download export file
 viewExportLog ()
 confirmDeleteExportFile ()
 confirmation screen for export file deletion
 cancelDeleteExportFile ()
 cancel deletion of export files
 deleteExportFile ()
 delete export files
 confirmTermDeletion ()
 confirm term deletion
 cancelTermDeletion ()
 cancel deletion of object
 deleteTerms ()
 delete selected terms
 setLocator ($a_tree="", $a_id="")
 set Locator
 view ()
 view content
 create ()
 create new (subobject) in glossary
 saveTerm ()
 addDefinition ()
 add definition
 getTemplate ()
 setTabs ()
 output tabs
 getTabs (&$tabs_gui)
 get tabs
 _goto ($a_target)
 redirect script
 applyFilter ()
 Apply filter.
 resetFilter ()
 Reset filter (note: this function existed before data table filter has been introduced.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Data Fields

 $admin_tabs
 $mode
 $term
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Class ilGlossaryGUI.

GUI class for ilGlossary

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilObjGlossaryGUI.php 25863 2010-10-06 09:53:43Z akill

ilObjGlossaryGUI: ilGlossaryTermGUI, ilMDEditorGUI, ilPermissionGUI ilObjGlossaryGUI: ilInfoScreenGUI

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

Member Function Documentation

ilObjGlossaryGUI::_goto (   $a_target)

redirect script

Parameters
string$a_target

Definition at line 1627 of file class.ilObjGlossaryGUI.php.

References $_GET, $ilErr, ilObjectGUI\$lng, ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

{
global $rbacsystem, $ilErr, $lng, $ilAccess;
if ($ilAccess->checkAccess("read", "", $a_target))
{
$_GET["ref_id"] = $a_target;
$_GET["baseClass"] = "ilGlossaryPresentationGUI";
include("ilias.php");
}
else if ($ilAccess->checkAccess("visible", "", $a_target))
{
$_GET["ref_id"] = $a_target;
$_GET["cmd"] = "infoScreen";
$_GET["baseClass"] = "ilGlossaryPresentationGUI";
include("ilias.php");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
include("repository.php");
}
$ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::addDefinition ( )

add definition

Definition at line 1484 of file class.ilObjGlossaryGUI.php.

References $_POST, $ilCtrl, $term, ilUtil\sendFailure(), and ilUtil\stripSlashes().

{
global $ilCtrl;
if (count($_POST["id"]) < 1)
{
ilUtil::sendFailure($this->lng->txt("cont_select_term"), true);
$ilCtrl->redirect($this, "listTerms");
}
if (count($_POST["id"]) > 1)
{
ilUtil::sendFailure($this->lng->txt("cont_select_max_one_term"), true);
$ilCtrl->redirect($this, "listTerms");
}
// add term
include_once ("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
$term =& new ilGlossaryTerm($_POST["id"][0]);
// add first definition
$def =& new ilGlossaryDefinition();
$def->setTermId($term->getId());
$def->setTitle(ilUtil::stripSlashes($term->getTerm()));
$def->create();
$this->ctrl->setParameterByClass("ilpageobjectgui", "term_id", $term->getId());
$this->ctrl->setParameterByClass("ilpageobjectgui", "def", $def->getId());
$this->ctrl->redirectByClass(array("ilglossarytermgui",
"iltermdefinitioneditorgui", "ilpageobjectgui"), "edit");
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::addTerm ( )

add term

Definition at line 802 of file class.ilObjGlossaryGUI.php.

References $_POST, $_SESSION, $ilCtrl, ilObjectGUI\$lng, $term, ilUtil\sendFailure(), and ilUtil\stripSlashes().

{
global $lng, $ilCtrl;
if (trim($_POST["new_term"]) == "")
{
ilUtil::sendFailure($lng->txt("cont_please_enter_a_term"), true);
$ilCtrl->redirect($this, "listTerms");
}
// add term
include_once ("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
$term->setGlossary($this->object);
$term->setTerm(ilUtil::stripSlashes($_POST["new_term"]));
$term->setLanguage($_POST["term_language"]);
$_SESSION["il_text_lang_".$_GET["ref_id"]] = $_POST["term_language"];
$term->create();
// add first definition
$def =& new ilGlossaryDefinition();
$def->setTermId($term->getId());
$def->setTitle(ilUtil::stripSlashes($_POST["new_term"]));
$def->create();
$this->ctrl->setParameterByClass("ilpageobjectgui", "term_id", $term->getId());
$this->ctrl->setParameterByClass("ilpageobjectgui", "def", $def->getId());
$this->ctrl->redirectByClass(array("ilglossarytermgui",
"iltermdefinitioneditorgui", "ilpageobjectgui"), "edit");
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::addUsagesToInfo (   $info,
  $glo_id 
)

Add usages to info.

Parameters
@return

Definition at line 399 of file class.ilObjGlossaryGUI.php.

References ilObjectGUI\$lng, ilObject\_getAllReferences(), ilLink\_getLink(), ilObject\_lookupTitle(), and ilObjSAHSLearningModule\getScormModulesForGlossary().

Referenced by ilGlossaryPresentationGUI\outputInfoScreen(), and showInfoScreen().

{
global $lng, $ilAccess;
$info->addSection($lng->txt("glo_usages"));
include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
foreach ($sms as $sm)
{
$link = false;
foreach ($refs as $ref)
{
if ($link === false)
{
if ($ilAccess->checkAccess("write", "", $ref))
{
include_once("./classes/class.ilLink.php");
$link = ilLink::_getLink($ref,'sahs');
}
}
}
$entry = ilObject::_lookupTitle($sm);
if ($link !== false)
{
$entry = "<a href='".$link."' target='_top'>".$entry."</a>";
}
$info->addProperty($lng->txt("obj_sahs"), $entry);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGlossaryGUI::applyFilter ( )

Apply filter.

Definition at line 1663 of file class.ilObjGlossaryGUI.php.

References listTerms().

{
global $ilTabs;
include_once("./Modules/Glossary/classes/class.ilTermListTableGUI.php");
$prtab = new ilTermListTableGUI($this, "listTerms");
$prtab->resetOffset();
$prtab->writeFilterToSession();
$this->listTerms();
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::assignObject ( )

Reimplemented from ilObjectGUI.

Definition at line 148 of file class.ilObjGlossaryGUI.php.

{
include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
$this->object =& new ilObjGlossary($this->id, true);
}
ilObjGlossaryGUI::cancelDefinitionDeletion ( )

Definition at line 938 of file class.ilObjGlossaryGUI.php.

{
$this->ctrl->redirect($this, "listTerms");
}
ilObjGlossaryGUI::cancelDeleteExportFile ( )

cancel deletion of export files

Definition at line 1283 of file class.ilObjGlossaryGUI.php.

{
session_unregister("ilExportFiles");
$this->ctrl->redirect($this, "exportList");
}
ilObjGlossaryGUI::cancelObject (   $in_rep = false)

cancel action and go back to previous page public

Reimplemented from ilObjectGUI.

Definition at line 932 of file class.ilObjGlossaryGUI.php.

References $_GET, and ilUtil\redirect().

{
ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
//$this->ctrl->redirectByClass("ilrepositorygui", "frameset");
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::cancelTermDeletion ( )

cancel deletion of object

public

Definition at line 1392 of file class.ilObjGlossaryGUI.php.

{
session_unregister("term_delete");
$this->ctrl->redirect($this, "listTerms");
}
ilObjGlossaryGUI::confirmDefinitionDeletion ( )

deletion confirmation screen

Definition at line 862 of file class.ilObjGlossaryGUI.php.

References $_GET, $ilCtrl, ilObjectGUI\$lng, $term, ilObjStyleSheet\getContentStylePath(), ilGlossaryTerm\getNumberOfUsages(), ilObjStyleSheet\getSyntaxStylePath(), ilUtil\sendQuestion(), and ilPageObjectGUI\setTemplateOutput().

{
global $ilCtrl, $lng;
//$this->getTemplate();
//$this->displayLocator();
//$this->setTabs();
$term = new ilGlossaryTerm($_GET["term_id"]);
$add = "";
if ($nr > 0)
{
$ilCtrl->setParameterByClass("ilglossarytermgui",
"term_id", $_GET["term_id"]);
$link = "[<a href='".
$ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages").
"'>".$lng->txt("glo_list_usages")."</a>]";
$add = "<br/>".sprintf($lng->txt("glo_term_is_used_n_times"), $nr)." ".$link;
}
// content style
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$this->tpl->parseCurrentBlock();
// syntax style
$this->tpl->setCurrentBlock("SyntaxStyle");
$this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
$this->tpl->parseCurrentBlock();
//$this->tpl->setVariable("HEADER",
// $this->lng->txt("cont_term").": ".$term->getTerm());
$this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
ilUtil::sendQuestion($this->lng->txt("info_delete_sure").$add);
$this->tpl->setVariable("TXT_TERM", $term->getTerm());
$definition =& new ilGlossaryDefinition($_GET["def"]);
//$page =& new ilPageObject("gdf", $definition->getId());
$page_gui =& new ilPageObjectGUI("gdf", $definition->getId());
$page_gui->setTemplateOutput(false);
$page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
$page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
$page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
$output = $page_gui->preview();
$this->tpl->setCurrentBlock("definition");
$this->tpl->setVariable("PAGE_CONTENT", $output);
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("LINK_CANCEL",
$this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion"));
$this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
$this->ctrl->setParameter($this, "def", $definition->getId());
$this->tpl->setVariable("LINK_CONFIRM",
$this->ctrl->getLinkTarget($this, "deleteDefinition"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::confirmDeleteExportFile ( )

confirmation screen for export file deletion

Definition at line 1233 of file class.ilObjGlossaryGUI.php.

References $_POST, $_SESSION, $file, ilUtil\getImagePath(), ilUtil\sendQuestion(), setTabs(), and ilUtil\switchColor().

{
if(!isset($_POST["file"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
$this->setTabs();
// SAVE POST VALUES
$_SESSION["ilExportFiles"] = $_POST["file"];
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.confirm_deletion.html", "Modules/Glossary");
ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
// BEGIN TABLE HEADER
$this->tpl->setCurrentBlock("table_header");
$this->tpl->setVariable("TEXT",$this->lng->txt("objects"));
$this->tpl->parseCurrentBlock();
// BEGIN TABLE DATA
$counter = 0;
foreach($_POST["file"] as $file)
{
$file = explode(":", $file);
$this->tpl->setCurrentBlock("table_row");
$this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
$this->tpl->setVariable("TEXT_CONTENT", $file[1]." (".$file[0].")");
$this->tpl->parseCurrentBlock();
}
// cancel/confirm button
$this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
$buttons = array( "cancelDeleteExportFile" => $this->lng->txt("cancel"),
"deleteExportFile" => $this->lng->txt("confirm"));
foreach ($buttons as $name => $value)
{
$this->tpl->setCurrentBlock("operation_btn");
$this->tpl->setVariable("BTN_NAME",$name);
$this->tpl->setVariable("BTN_VALUE",$value);
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::confirmTermDeletion ( )

confirm term deletion

Definition at line 1316 of file class.ilObjGlossaryGUI.php.

References $_POST, $_SESSION, $ilCtrl, ilObjectGUI\$lng, $term, ilUtil\getImagePath(), ilGlossaryTerm\getNumberOfUsages(), ilUtil\sendFailure(), ilUtil\sendQuestion(), and ilUtil\switchColor().

{
global $ilCtrl, $lng;
//$this->prepareOutput();
if (!isset($_POST["id"]))
{
ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "listTerms");
}
// save values to
$_SESSION["term_delete"] = $_POST["id"];
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.obj_confirm.html");
ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
// output table header
$cols = array("cont_term");
foreach ($cols as $key)
{
$this->tpl->setCurrentBlock("table_header");
$this->tpl->setVariable("TEXT",$this->lng->txt($key));
$this->tpl->parseCurrentBlock();
}
foreach($_POST["id"] as $id)
{
$term = new ilGlossaryTerm($id);
$add = "";
if ($nr > 0)
{
$ilCtrl->setParameterByClass("ilglossarytermgui",
"term_id", $id);
$link = "[<a href='".
$ilCtrl->getLinkTargetByClass("ilglossarytermgui", "listUsages").
"'>".$lng->txt("glo_list_usages")."</a>]";
$add = "<div class='small'>".
sprintf($lng->txt("glo_term_is_used_n_times"), $nr)." ".$link."</div>";
}
// output title
$this->tpl->setCurrentBlock("table_cell");
$this->tpl->setVariable("TEXT_CONTENT", $term->getTerm().$add);
$this->tpl->parseCurrentBlock();
// output table row
$this->tpl->setCurrentBlock("table_row");
$this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
$this->tpl->parseCurrentBlock();
}
// cancel and confirm button
$buttons = array( "cancelTermDeletion" => $this->lng->txt("cancel"),
"deleteTerms" => $this->lng->txt("confirm"));
$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
foreach($buttons as $name => $value)
{
$this->tpl->setCurrentBlock("operation_btn");
$this->tpl->setVariable("BTN_NAME",$name);
$this->tpl->setVariable("BTN_VALUE",$value);
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::create ( )

create new (subobject) in glossary

Definition at line 1457 of file class.ilObjGlossaryGUI.php.

References $_POST.

{
switch($_POST["new_type"])
{
case "term":
$term_gui =& new ilGlossaryTermGUI();
$term_gui->create();
break;
}
}
ilObjGlossaryGUI::createObject ( )

form for new content object creation

Reimplemented from ilObjectGUI.

Definition at line 159 of file class.ilObjGlossaryGUI.php.

References $_GET, $_POST, $_SESSION, ilObjectGUI\$data, ilFrameTargetInfo\_getFrame(), formSelect(), ilUtil\getImagePath(), ilObjectGUI\getTemplateFile(), ilUtil\prepareFormOutput(), and ilUtil\stripSlashes().

Referenced by importObject().

{
global $rbacsystem;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$stati = array(
"none"=>$this->lng->txt("glo_mode_normal"),
"level"=>$this->lng->txt("glo_mode_level"),
"subtree"=>$this->lng->txt("glo_mode_subtree")
);
$glo_type = $_SESSION["error_post_vars"]["glo_type"];
$opts = ilUtil::formSelect("none","glo_mode",$stati,false,true);
// fill in saved values in case of error
$data = array();
$data["fields"] = array();
$data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
$data["fields"]["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);
$this->getTemplateFile("create", $new_type);
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_glo.gif'));
$this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_glo"));
foreach ($data["fields"] as $key => $val)
{
$this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
$this->tpl->setVariable(strtoupper($key), $val);
if ($this->prepare_output)
{
$this->tpl->parseCurrentBlock();
}
}
$this->ctrl->setParameter($this, "new_type", $new_type);
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "save"));
//$this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".
// $_GET["ref_id"]."&new_type=".$new_type));
$this->tpl->setVariable("TXT_HEADER", $this->lng->txt($new_type."_new"));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($new_type."_add"));
$this->tpl->setVariable("CMD_SUBMIT", "save");
$this->tpl->setVariable("TARGET", ' target="'.
ilFrameTargetInfo::_getFrame("MainContent").'" ');
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
$this->tpl->setVariable("SELECT_GLO_MODE", $opts);
$this->tpl->setVariable("TXT_GLO_MODE", $this->lng->txt("glo_mode"));
$this->tpl->setVariable("TXT_GLO_MODE_DESC", $this->lng->txt("glo_mode_desc"));
$this->tpl->setVariable("TXT_IMPORT_GLO", $this->lng->txt("import_glossary"));
$this->tpl->setVariable("TXT_GLO_FILE", $this->lng->txt("glo_upload_file"));
$this->tpl->setVariable("TXT_IMPORT", $this->lng->txt("import"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGlossaryGUI::deleteDefinition ( )

Definition at line 944 of file class.ilObjGlossaryGUI.php.

References $_GET.

{
$definition =& new ilGlossaryDefinition($_GET["def"]);
$definition->delete();
$this->ctrl->redirect($this, "listTerms");
}
ilObjGlossaryGUI::deleteExportFile ( )

delete export files

Definition at line 1292 of file class.ilObjGlossaryGUI.php.

References $_SESSION, $file, and ilUtil\delDir().

{
foreach($_SESSION["ilExportFiles"] as $file)
{
$file = explode(":", $file);
$export_dir = $this->object->getExportDirectory($file[0]);
$exp_file = $export_dir."/".$file[1];
$exp_dir = $export_dir."/".substr($file, 0, strlen($file) - 4);
if (@is_file($exp_file))
{
unlink($exp_file);
}
if (@is_dir($exp_dir))
{
ilUtil::delDir($exp_dir);
}
}
$this->ctrl->redirect($this, "exportList");
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::deleteTerms ( )

delete selected terms

Definition at line 1401 of file class.ilObjGlossaryGUI.php.

References $_SESSION, and $term.

{
foreach($_SESSION["term_delete"] as $id)
{
$term = new ilGlossaryTerm($id);
$term->delete();
}
session_unregister("term_delete");
$this->ctrl->redirect($this, "listTerms");
}
ilObjGlossaryGUI::downloadExportFile ( )

download export file

Definition at line 1157 of file class.ilObjGlossaryGUI.php.

References $_POST, $file, and ilUtil\deliverFile().

{
if(!isset($_POST["file"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
if (count($_POST["file"]) > 1)
{
$this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
}
$file = explode(":", $_POST["file"][0]);
$export_dir = $this->object->getExportDirectory($file[0]);
ilUtil::deliverFile($export_dir."/".$file[1],
$file[1]);
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::editTerm ( )

edit term

Definition at line 954 of file class.ilObjGlossaryGUI.php.

{
/*
$term = new ilGlossaryTerm($_GET["term_id"]);
//$this->tpl->setVariable("HEADER", $this->lng->txt("cont_term").": ".$term->getTerm());
// load template for table
$this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.glossary_term_edit.html", true);
$this->ctrl->setParameter($this, "term_id", $_GET["term_id"]);
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_edit_term"));
$this->tpl->setVariable("TXT_TERM", $this->lng->txt("cont_term"));
$this->tpl->setVariable("INPUT_TERM", "term");
$this->tpl->setVariable("VALUE_TERM", htmlspecialchars($term->getTerm()));
$this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
$lang = ilMDLanguageItem::_getLanguages();
$select_language = ilUtil::formSelect ($term->getLanguage(),"term_language",$lang,false,true);
$this->tpl->setVariable("SELECT_LANGUAGE", $select_language);
$this->tpl->setVariable("BTN_NAME", "updateTerm");
$this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
*/
}
& ilObjGlossaryGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 50 of file class.ilObjGlossaryGUI.php.

References $_GET, $_POST, $cmd, ilObjectGUI\$lng, $ret, ilMDEditorGUI\addObserver(), ilObjectGUI\getCreationMode(), getTemplate(), ilObjectGUI\prepareOutput(), ilObjectGUI\setLocator(), setTabs(), and showInfoScreen().

{
global $lng, $ilAccess;
$cmd = $this->ctrl->getCmd();
$next_class = $this->ctrl->getNextClass($this);
switch ($next_class)
{
case 'ilmdeditorgui':
$this->getTemplate();
$this->setTabs();
$this->setLocator();
include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
$md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
$md_gui->addObserver($this->object,'MDUpdateListener','General');
$this->ctrl->forwardCommand($md_gui);
break;
case "ilglossarytermgui":
$this->ctrl->setReturn($this, "listTerms");
$term_gui =& new ilGlossaryTermGUI($_GET["term_id"]);
$term_gui->setGlossary($this->object);
//$ret =& $term_gui->executeCommand();
$ret =& $this->ctrl->forwardCommand($term_gui);
break;
case "ilinfoscreengui":
$this->showInfoScreen();
break;
case 'ilpermissiongui':
if (strtolower($_GET["baseClass"]) == "iladministrationgui")
{
$this->prepareOutput();
}
else
{
$this->getTemplate();
$this->setTabs();
$this->setLocator();
}
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
$cmd = $this->ctrl->getCmd("frameset");
if (($cmd == "create") && ($_POST["new_type"] == "term"))
{
$this->ctrl->setCmd("create");
$this->ctrl->setCmdClass("ilGlossaryTermGUI");
$ret =& $this->executeCommand();
return;
}
else
{
if (!in_array($cmd, array("frameset", "quickList")))
{
if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
$this->getCreationMode() == true)
{
$this->prepareOutput();
$cmd.= "Object";
}
else
{
$this->getTemplate();
$this->setTabs();
$this->setLocator();
}
}
$ret =& $this->$cmd();
}
break;
}
if (!in_array($cmd, array("frameset", "quickList")))
{
if (strtolower($_GET["baseClass"]) != "iladministrationgui")
{
if (!$this->getCreationMode())
{
$this->tpl->show();
}
}
}
else
{
$this->tpl->show(false);
}
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::export ( )

export content object

Definition at line 1133 of file class.ilObjGlossaryGUI.php.

{
require_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
$glo_exp = new ilGlossaryExport($this->object);
$glo_exp->buildExportFile();
$this->ctrl->redirect($this, "exportList");
}
ilObjGlossaryGUI::exportHTML ( )

create html package

Definition at line 1144 of file class.ilObjGlossaryGUI.php.

{
require_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
$glo_exp = new ilGlossaryExport($this->object, "html");
$glo_exp->buildExportFile();
//echo $this->tpl->get();
$this->ctrl->redirect($this, "exportList");
}
ilObjGlossaryGUI::exportList ( )

Definition at line 996 of file class.ilObjGlossaryGUI.php.

References $_GET, ilObjectGUI\$tree, ilUtil\getImagePath(), and ilUtil\switchColor().

{
global $tree;
//$this->setTabs();
//add template for view button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
// create export file button (xml)
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "export"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_create_export_file_xml"));
$this->tpl->parseCurrentBlock();
// create export file button (html)
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "exportHTML"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_create_export_file_html"));
$this->tpl->parseCurrentBlock();
// view last export log button
if (is_file($this->object->getExportDirectory()."/export.log"))
{
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "viewExportLog"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_view_last_export_log"));
$this->tpl->parseCurrentBlock();
}
$export_dir = $this->object->getExportDirectory();
$export_files = $this->object->getExportFiles();
// create table
require_once("./Services/Table/classes/class.ilTableGUI.php");
$tbl = new ilTableGUI();
// load files templates
$this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
// load template for table content data
$this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.glo_export_file_row.html", true);
$num = 0;
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$tbl->setTitle($this->lng->txt("cont_export_files"));
$tbl->setHeaderNames(array("", $this->lng->txt("type"),
$this->lng->txt("cont_file"),
$this->lng->txt("cont_size"), $this->lng->txt("date") ));
$cols = array("", "type", "file", "size", "date");
$header_params = array("ref_id" => $_GET["ref_id"],
"cmd" => "exportList", "cmdClass" => get_class($this));
$tbl->setHeaderVars($cols, $header_params);
$tbl->setColumnWidth(array("1%", "9%", "40%", "25%", "25%"));
$tbl->disable("sort");
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount($this->maxcount); // ???
$this->tpl->setVariable("COLUMN_COUNTS", 5);
// delete button
$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "confirmDeleteExportFile");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "downloadExportFile");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("download"));
$this->tpl->parseCurrentBlock();
// public access
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "publishExportFile");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("cont_public_access"));
$this->tpl->parseCurrentBlock();
// footer
$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
//$tbl->disable("footer");
$tbl->setMaxCount(count($export_files));
$export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
$tbl->render();
if(count($export_files) > 0)
{
$i=0;
foreach($export_files as $exp_file)
{
$this->tpl->setCurrentBlock("tbl_content");
$this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
$css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
$public_str = ($exp_file["file"] == $this->object->getPublicExportFile($exp_file["type"]))
? " <b>(".$this->lng->txt("public").")<b>"
: "";
$this->tpl->setVariable("TXT_TYPE", $exp_file["type"].$public_str);
$this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"].":".$exp_file["file"]);
$file_arr = explode("__", $exp_file["file"]);
$this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s",$file_arr[0]));
$this->tpl->parseCurrentBlock();
}
} //if is_array
else
{
//$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->setVariable("NUM_COLS", 3);
//$this->tpl->parseCurrentBlock();
}
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::frameset ( )

glossary edit frameset

Definition at line 593 of file class.ilObjGlossaryGUI.php.

References exit.

{
include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
$fs_gui = new ilFramesetGUI();
$fs_gui->setFramesetTitle($this->object->getTitle());
$fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this, "listTerms"));
$fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this, "quickList"));
$fs_gui->setMainFrameName("content");
$fs_gui->setSideFrameName("tree");
$fs_gui->show();
}
ilObjGlossaryGUI::getSettingsValues ( )

Get current values for settings from.

Definition at line 547 of file class.ilObjGlossaryGUI.php.

Referenced by properties().

{
$values = array();
$values["cobj_online"] = $this->object->getOnline();
$values["glo_mode"] = $this->object->getVirtualMode();
// $values["glo_act_menu"] = $this->object->isActiveGlossaryMenu();
$values["glo_act_downloads"] = $this->object->isActiveDownloads();
$values["pres_mode"] = $this->object->getPresentationMode();
$values["snippet_length"] = $this->object->getSnippetLength();
$this->form->setValuesByArray($values);
}

+ Here is the caller graph for this function:

ilObjGlossaryGUI::getTabs ( $tabs_gui)

get tabs

Reimplemented from ilObjectGUI.

Definition at line 1564 of file class.ilObjGlossaryGUI.php.

References $_GET.

Referenced by setTabs().

{
global $rbacsystem;
// list terms
$force_active = ($_GET["cmd"] == "" || $_GET["cmd"] == "listTerms")
? true
: false;
$tabs_gui->addTarget("cont_terms",
$this->ctrl->getLinkTarget($this, "listTerms"), array("listTerms", ""),
get_class($this), "", $force_active);
$force_active = false;
if ($this->ctrl->getCmd() == "showSummary" ||
strtolower($this->ctrl->getNextClass()) == "ilinfoscreengui")
{
$force_active = true;
}
$tabs_gui->addTarget("info_short",
$this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "",
"ilInfoScreenGUI", "", $force_active);
// properties
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this, "properties"), "properties",
get_class($this));
// meta data
$tabs_gui->addTarget("meta_data",
$this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
"", "ilmdeditorgui");
// export
$tabs_gui->addTarget("export",
$this->ctrl->getLinkTarget($this, "exportList"),
array("exportList", "viewExportLog"), get_class($this));
// permissions
if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
{
/*$tabs_gui->addTarget("permission_settings",
$this->ctrl->getLinkTarget($this, "perm"),
array("perm", "info"),
get_class($this));
*/
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
$tabs_gui->addNonTabbedLink("presentation_view",
$this->lng->txt("glo_presentation_view"),
"ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$this->object->getRefID(),
"_top"
);
}

+ Here is the caller graph for this function:

ilObjGlossaryGUI::getTemplate ( )

Definition at line 1517 of file class.ilObjGlossaryGUI.php.

References $_GET, $title, ilGlossaryTerm\_lookGlossaryTerm(), and ilUtil\getImagePath().

Referenced by executeCommand(), and showInfoScreen().

{
$this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
$title = $this->object->getTitle();
if ($_GET["term_id"] > 0)
{
//$this->tpl->setCurrentBlock("header_image");
//$this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_glo_b.gif"));
//$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("HEADER", $this->lng->txt("term").": ".
}
else
{
$this->tpl->setCurrentBlock("header_image");
$this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_glo_b.gif"));
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("HEADER", $this->lng->txt("glo").": ".$title);
}
//$this->setAdminTabs($_POST["new_type"]);
//$this->setLocator();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGlossaryGUI::ilObjGlossaryGUI (   $a_data,
  $a_id = 0,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Constructor public.

Definition at line 35 of file class.ilObjGlossaryGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

{
global $ilCtrl, $lng;
$this->ctrl =& $ilCtrl;
$this->ctrl->saveParameter($this, array("ref_id", "offset"));
$lng->loadLanguageModule("content");
$this->type = "glo";
parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, false);
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::importFileObject ( )

display status information or report errors messages in case of error

public

Definition at line 276 of file class.ilObjGlossaryGUI.php.

References $_GET, $file, ilObject\_writeImportId(), ilUtil\delDir(), ilUtil\moveUploadedFile(), ilUtil\redirect(), ilUtil\sendSuccess(), and ilUtil\unzip().

{
global $_FILES, $rbacsystem;
// check if file was uploaded
$source = $_FILES["xmldoc"]["tmp_name"];
if (($source == 'none') || (!$source))
{
$this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
}
// check create permission
/*
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $_GET["new_type"]))
{
$this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
}*/
// check correct file type
// check correct file type
$info = pathinfo($_FILES["xmldoc"]["name"]);
if (strtolower($info["extension"]) != "zip")
{
$this->ilias->raiseError($this->lng->txt("cont_no_zip_file"),
$this->ilias->error_obj->MESSAGE);
}
// create and insert object in objecttree
include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
$newObj = new ilObjGlossary();
$newObj->setType($_GET["new_type"]);
$newObj->setTitle($_FILES["xmldoc"]["name"]);
$newObj->create(true);
$newObj->createReference();
$newObj->putInTree($_GET["ref_id"]);
$newObj->setPermissions($_GET["ref_id"]);
$newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
// create import directory
$newObj->createImportDirectory();
// copy uploaded file to import directory
$file = pathinfo($_FILES["xmldoc"]["name"]);
$full_path = $newObj->getImportDirectory()."/".$_FILES["xmldoc"]["name"];
ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"],
$_FILES["xmldoc"]["name"], $full_path);
// unzip file
ilUtil::unzip($full_path);
// determine filename of xml file
$subdir = basename($file["basename"],".".$file["extension"]);
$xml_file = $newObj->getImportDirectory()."/".$subdir."/".$subdir.".xml";
// check whether subdirectory exists within zip file
if (!is_dir($newObj->getImportDirectory()."/".$subdir))
{
$this->ilias->raiseError(sprintf($this->lng->txt("cont_no_subdir_in_zip"), $subdir),
$this->ilias->error_obj->MESSAGE);
}
// check whether xml file exists within zip file
if (!is_file($xml_file))
{
$this->ilias->raiseError(sprintf($this->lng->txt("cont_zip_file_invalid"), $subdir."/".$subdir.".xml"),
$this->ilias->error_obj->MESSAGE);
}
include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
$contParser = new ilContObjParser($newObj, $xml_file, $subdir);
$contParser->startParsing();
ilObject::_writeImportId($newObj->getId(), $newObj->getImportId());
// delete import directory
ilUtil::delDir($newObj->getImportDirectory());
ilUtil::sendSuccess($this->lng->txt("glo_added"),true);
ilUtil::redirect("ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
//ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::importObject ( )

Definition at line 224 of file class.ilObjGlossaryGUI.php.

References createObject().

{
$this->createObject();
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::initSettingsForm (   $a_mode = "edit")

Init settings form.

Parameters
int$a_modeEdit Mode

Definition at line 481 of file class.ilObjGlossaryGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilRadioOption\setInfo(), ilSelectInputGUI\setOptions(), ilCheckboxInputGUI\setValue(), ilRadioGroupInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by properties(), and saveProperties().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// online
$cb = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
$cb->setValue("y");
$this->form->addItem($cb);
// glossary mode
$options = array(
"none"=>$this->lng->txt("glo_mode_normal"),
"level"=>$this->lng->txt("glo_mode_level"),
"subtree"=>$this->lng->txt("glo_mode_subtree")
);
$si = new ilSelectInputGUI($lng->txt("glo_mode"), "glo_mode");
$si->setOptions($options);
$si->setInfo($lng->txt("glo_mode_desc"));
$this->form->addItem($si);
// presentation mode
$radg = new ilRadioGroupInputGUI($lng->txt("glo_presentation_mode"), "pres_mode");
$radg->setValue("table");
$op1 = new ilRadioOption($lng->txt("glo_table_form"), "table", $lng->txt("glo_table_form_info"));
// short text length
$ni = new ilNumberInputGUI($lng->txt("glo_text_snippet_length"), "snippet_length");
$ni->setMaxValue(3000);
$ni->setMinValue(100);
$ni->setMaxLength(4);
$ni->setSize(4);
$ni->setInfo($lng->txt("glo_text_snippet_length_info"));
$ni->setValue(200);
$op1->addSubItem($ni);
$radg->addOption($op1);
$op2 = new ilRadioOption($lng->txt("glo_full_definitions"), "full_def", $lng->txt("glo_full_definitions_info"));
$radg->addOption($op2);
$this->form->addItem($radg);
// menu enabled?
/*
$cb = new ilCheckboxInputGUI($lng->txt("cont_glo_menu"), "glo_act_menu");
$cb->setValue("y");
$this->form->addItem($cb);*/
// downloads
$cb = new ilCheckboxInputGUI($lng->txt("cont_downloads"), "glo_act_downloads");
$cb->setValue("y");
$cb->setInfo($lng->txt("cont_downloads_desc"));
$this->form->addItem($cb);
// save and cancel commands
$this->form->addCommandButton("saveProperties", $lng->txt("save"));
$this->form->setTitle($lng->txt("cont_glo_properties"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGlossaryGUI::listTerms ( )

list terms

Definition at line 728 of file class.ilObjGlossaryGUI.php.

References $_GET, $_SESSION, $ilCtrl, $lang, ilObjectGUI\$lng, $tab, ilObjectGUI\$tpl, ilMDLanguageItem\_getLanguages(), ilTextInputGUI\setMaxLength(), and ilSelectInputGUI\setOptions().

Referenced by applyFilter(), and resetFilter().

{
global $ilUser, $ilToolbar, $lng, $ilCtrl, $tpl;
// term
include_once("./Services/Form/classes/class.ilTextInputGUI.php");
$ti = new ilTextInputGUI($lng->txt("cont_new_term"), "new_term");
$ti->setMaxLength(80);
$ti->setSize(20);
$ilToolbar->addInputItem($ti, true);
// language
$this->lng->loadLanguageModule("meta");
if ($_SESSION["il_text_lang_".$_GET["ref_id"]] != "")
{
$s_lang = $_SESSION["il_text_lang_".$_GET["ref_id"]];
}
else
{
$s_lang = $ilUser->getLanguage();
}
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI($lng->txt("language"), "term_language");
$si->setValue($s_lang);
$ilToolbar->addInputItem($si, true);
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$ilToolbar->addFormButton($lng->txt("glo_add_new_term"), "addTerm");
//$select_language = ilUtil::formSelect ($s_lang, "term_language",$lang,false,true);
//$this->tpl->setVariable("SELECT_LANGUAGE", $select_language);
include_once("./Modules/Glossary/classes/class.ilTermListTableGUI.php");
$tab = new ilTermListTableGUI($this, "listTerms");
$tpl->setContent($tab->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGlossaryGUI::moveDefinitionDown ( )

move a definiton down

Definition at line 849 of file class.ilObjGlossaryGUI.php.

References $_GET.

{
include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
$definition =& new ilGlossaryDefinition($_GET["def"]);
$definition->moveDown();
$this->ctrl->redirect($this, "listTerms");
}
ilObjGlossaryGUI::moveDefinitionUp ( )

move a definiton up

Definition at line 836 of file class.ilObjGlossaryGUI.php.

References $_GET.

{
include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
$definition =& new ilGlossaryDefinition($_GET["def"]);
$definition->moveUp();
$this->ctrl->redirect($this, "listTerms");
}
ilObjGlossaryGUI::properties ( )

edit properties of object (admin form)

public

Definition at line 467 of file class.ilObjGlossaryGUI.php.

References ilObjectGUI\$tpl, ilObjectGUI\$tree, getSettingsValues(), and initSettingsForm().

{
global $rbacsystem, $tree, $tpl;
$this->initSettingsForm();
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::publishExportFile ( )

download export file

Definition at line 1178 of file class.ilObjGlossaryGUI.php.

References $_POST, and $file.

{
if(!isset($_POST["file"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
if (count($_POST["file"]) > 1)
{
$this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
}
$file = explode(":", $_POST["file"][0]);
$export_dir = $this->object->getExportDirectory($file[0]);
if ($this->object->getPublicExportFile($file[0]) ==
$file[1])
{
$this->object->setPublicExportFile($file[0], "");
}
else
{
$this->object->setPublicExportFile($file[0], $file[1]);
}
$this->object->update();
$this->ctrl->redirect($this, "exportList");
}
ilObjGlossaryGUI::quickList ( )

quick term list

Definition at line 609 of file class.ilObjGlossaryGUI.php.

References $_GET, $term, ilGlossaryDefinition\getDefinitionList(), and ilUtil\switchColor().

{
global $ilUser;
$this->tpl->addBlockFile("CONTENT", "content", "tpl.glossary_short_list.html",
"Modules/Glossary");
// $this->tpl->addBlockFile("EXPLORER_TOP", "exp_top", "tpl.explorer_top.html");
// $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.gif", false));
$this->tpl->setVariable("FORMACTION1", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("CMD_REFR", "quickList");
$this->tpl->setVariable("TXT_REFR", $this->lng->txt("refresh"));
$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_terms"));
include_once "./Services/Table/classes/class.ilTableGUI.php";
// glossary term list template
// load template for table
$this->tpl->addBlockfile("SHORT_LIST", "list", "tpl.table.html");
// load template for table content data
$this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.term_short_tbl_row.html", true);
$num = 0;
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
// create table
$tbl = new ilTableGUI();
// title & header columns
//$tbl->setTitle($this->lng->txt("cont_terms"));
//$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
$tbl->setHeaderNames(array($this->lng->txt("cont_term")));
$cols = array("term");
$header_params = $this->ctrl->getParameterArrayByClass("ilobjglossarygui", "listTerms");
$header_params["cmd"] = "quickList";
$tbl->setHeaderVars($cols, $header_params);
$tbl->setColumnWidth(array("100%"));
$tbl->disable("title");
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->disable("header");
$term_list = $this->object->getTermList();
$tbl->setMaxCount(count($term_list));
$this->tpl->setVariable("COLUMN_COUNT", 1);
// footer
$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
// sorting array
$term_list = array_slice($term_list, $_GET["offset"], $_GET["limit"]);
// render table
$tbl->render();
if (count($term_list) > 0)
{
$i=1;
foreach($term_list as $key => $term)
{
$sep = ": ";
for($j=0; $j<count($defs); $j++)
{
$def = $defs[$j];
// edit
$this->tpl->setCurrentBlock("definition");
$this->tpl->setVariable("SEP", $sep);
$this->ctrl->setParameterByClass("ilpageobjectgui", "term_id", $term["id"]);
$this->ctrl->setParameterByClass("ilpageobjectgui", "def", $def["id"]);
$this->tpl->setVariable("LINK_EDIT_DEF",
$this->ctrl->getLinkTargetByClass(array("ilglossarytermgui",
"iltermdefinitioneditorgui",
"ilpageobjectgui"), "edit"));
$this->tpl->setVariable("TEXT_DEF", $this->lng->txt("glo_definition_abbr").($j+1));
$this->tpl->parseCurrentBlock();
$sep = ", ";
}
$this->tpl->setCurrentBlock("tbl_content");
$css_row = ilUtil::switchColor(++$i,"tblrow1","tblrow2");
// edit term link
$this->tpl->setVariable("TEXT_TERM", $term["term"]);
$this->ctrl->setParameter($this, "term_id", $term["id"]);
$this->tpl->setVariable("LINK_EDIT_TERM",
$this->ctrl->getLinkTargetByClass("ilglossarytermgui", "editTerm"));
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->parseCurrentBlock();
}
} //if is_array
else
{
//$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->setVariable("NUM_COLS", $num);
//$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::resetFilter ( )

Reset filter (note: this function existed before data table filter has been introduced.

Definition at line 1679 of file class.ilObjGlossaryGUI.php.

References listTerms().

{
include_once("./Modules/Glossary/classes/class.ilTermListTableGUI.php");
$prtab = new ilTermListTableGUI($this, "listTerms");
$prtab->resetOffset();
$prtab->resetFilter();
$this->listTerms();
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::saveObject ( )

save new content object to db

Reimplemented from ilObjectGUI.

Definition at line 232 of file class.ilObjGlossaryGUI.php.

References $_GET, $_POST, ilUtil\redirect(), and ilUtil\sendSuccess().

{
global $rbacadmin, $rbacsystem;
// always call parent method first to create an object_data entry & a reference
//$newObj = parent::saveObject();
// TODO: fix MetaDataGUI implementation to make it compatible to use parent call
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $_GET["new_type"]))
{
$this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
}
// check required fields
if (empty($_POST["Fobject"]["title"]))
{
$this->ilErr->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilErr->MESSAGE);
}
// create and insert object in objecttree
include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
$newObj = new ilObjGlossary();
$newObj->setType($this->type);
$newObj->setTitle($_POST["Fobject"]["title"]);
$newObj->setDescription($_POST["Fobject"]["desc"]);
$newObj->setVirtualMode($_POST["glo_mode"]);
$newObj->create();
$newObj->createReference();
$newObj->putInTree($_GET["ref_id"]);
$newObj->setPermissions($_GET["ref_id"]);
$newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
// always send a message
ilUtil::sendSuccess($this->lng->txt("glo_added"),true);
ilUtil::redirect("ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=".$newObj->getRefId());
//ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::saveProperties ( )

save properties

Definition at line 564 of file class.ilObjGlossaryGUI.php.

References $_POST, ilObjectGUI\$tpl, initSettingsForm(), ilUtil\sendSuccess(), ilGlossaryDefinition\setShortTextsDirty(), and ilUtil\yn2tf().

{
global $tpl;
$this->initSettingsForm();
if ($this->form->checkInput())
{
$this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
$this->object->setVirtualMode($_POST["glo_mode"]);
// $this->object->setActiveGlossaryMenu(ilUtil::yn2tf($_POST["glo_act_menu"]));
$this->object->setActiveDownloads(ilUtil::yn2tf($_POST["glo_act_downloads"]));
$this->object->setPresentationMode($_POST["pres_mode"]);
$this->object->setSnippetLength($_POST["snippet_length"]);
$this->object->update();
// set definition short texts dirty
include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "properties");
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::saveTerm ( )

Definition at line 1468 of file class.ilObjGlossaryGUI.php.

References $ilCtrl, and ilUtil\sendSuccess().

{
$term_gui =& new ilGlossaryTermGUI();
$term_gui->setGlossary($this->object);
$term_gui->save();
ilUtil::sendSuccess($this->lng->txt("cont_added_term"),true);
//ilUtil::redirect("glossary_edit.php?ref_id=".$_GET["ref_id"]."&cmd=listTerms");
$ilCtrl->redirect($this, "listTerms");
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::setLocator (   $a_tree = "",
  $a_id = "" 
)

set Locator

Parameters
objecttree object
integerreference id public

Definition at line 1419 of file class.ilObjGlossaryGUI.php.

References $_GET, and ilObjectGUI\setLocator().

{
global $ilias_locator;
if(strtolower($_GET["baseClass"]) != "ilglossaryeditorgui")
{
parent::setLocator($a_tree, $a_id);
}
else
{
if(is_object($this->object))
{
require_once("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
$gloss_loc =& new ilGlossaryLocatorGUI();
if (is_object($this->term))
{
$gloss_loc->setTerm($this->term);
}
$gloss_loc->setGlossary($this->object);
//$gloss_loc->setDefinition($this->definition);
$gloss_loc->display();
}
}
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::setTabs ( )

output tabs

Reimplemented from ilObjectGUI.

Definition at line 1549 of file class.ilObjGlossaryGUI.php.

References getTabs().

Referenced by confirmDeleteExportFile(), executeCommand(), showInfoScreen(), and viewExportLog().

{
// catch feedback message
#include_once("classes/class.ilTabsGUI.php");
#$tabs_gui =& new ilTabsGUI();
$this->getTabs($this->tabs_gui);
#$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGlossaryGUI::showActions (   $a_actions)

show possible action (form buttons)

public

Definition at line 771 of file class.ilObjGlossaryGUI.php.

References $d, ilObjectGUI\$lng, and ilUtil\getImagePath().

{
foreach ($a_actions as $name => $lng)
{
$d[$name] = array("name" => $name, "lng" => $lng);
}
$notoperations = array();
$operations = array();
$operations = $d;
if (count($operations) > 0)
{
foreach ($operations as $val)
{
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", $val["name"]);
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("tbl_action_row");
$this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::showInfoScreen ( )

Show info screen.

Parameters
@return

Definition at line 363 of file class.ilObjGlossaryGUI.php.

References $_GET, addUsagesToInfo(), getTemplate(), ilObjectGUI\setLocator(), and setTabs().

Referenced by executeCommand().

{
global $ilAccess;
$this->getTemplate();
$this->setTabs();
$this->setLocator();
$this->lng->loadLanguageModule("meta");
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
$info->enableNews();
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
$info->enableNewsEditing();
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
if ($enable_internal_rss)
{
$info->setBlockProperty("news", "settings", true);
}
}
$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
ilObjGlossaryGUI::addUsagesToInfo($info, $this->object->getId());
$this->ctrl->forwardCommand($info);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGlossaryGUI::updateTerm ( )

update term

Definition at line 981 of file class.ilObjGlossaryGUI.php.

References $_GET, $_POST, $term, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
$term = new ilGlossaryTerm($_GET["term_id"]);
$term->setTerm(ilUtil::stripSlashes($_POST["term"]));
$term->setLanguage($_POST["term_language"]);
$term->update();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
$this->ctrl->redirect($this, "listTerms");
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::view ( )

view content

Definition at line 1448 of file class.ilObjGlossaryGUI.php.

References viewObject().

{
//$this->prepareOutput();
$this->viewObject();
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::viewExportLog ( )

Definition at line 1208 of file class.ilObjGlossaryGUI.php.

References ilObjectGUI\$tree, and setTabs().

{
global $tree;
$this->setTabs();
//add template for view button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
// create export file button
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "exportList"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_export_files"));
$this->tpl->parseCurrentBlock();
// load files templates
$this->tpl->setVariable("ADM_CONTENT",
nl2br(file_get_contents($this->object->getExportDirectory()."/export.log")));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilObjGlossaryGUI::viewObject ( )

list childs of current object

public

Reimplemented from ilObjectGUI.

Definition at line 433 of file class.ilObjGlossaryGUI.php.

References $_GET, and ilFrameTargetInfo\_getFrame().

Referenced by view().

{
global $rbacsystem;
if (strtolower($_GET["baseClass"]) == "iladministrationgui")
{
return;
}
if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
// edit button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK",
"ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$this->object->getRefID());
$this->tpl->setVariable("BTN_TARGET"," target=\"".
ilFrameTargetInfo::_getFrame("MainContent")."\" ");
$this->tpl->setVariable("BTN_TXT",$this->lng->txt("view"));
$this->tpl->parseCurrentBlock();
//parent::viewObject();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjGlossaryGUI::$admin_tabs

Definition at line 27 of file class.ilObjGlossaryGUI.php.

ilObjGlossaryGUI::$mode

Definition at line 28 of file class.ilObjGlossaryGUI.php.


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