Public Member Functions | |
ilGlossaryPresentationGUI () | |
Constructor public. | |
executeCommand () | |
executer command ("listTerms" | "listDefinitions") | |
prepareOutput () | |
searchTerms () | |
listTerms () | |
listTermByGiven ($term_list, $filter="") | |
list glossary terms | |
listDefinitions () | |
list definitions of a term | |
fullscreen () | |
show fullscreen view | |
media () | |
show media object | |
setLocator ($a_tree="", $a_id="") | |
set Locator | |
downloadFile () | |
download file of file lists | |
setTabs () | |
output tabs | |
getLinkXML ($a_int_links) | |
get link targets | |
getTabs (&$tabs_gui) | |
get tabs | |
download_paragraph () | |
Data Fields | |
$admin_tabs | |
$glossary | |
$ilias | |
$tpl | |
$lng |
Definition at line 42 of file class.ilGlossaryPresentationGUI.php.
ilGlossaryPresentationGUI::download_paragraph | ( | ) |
Definition at line 607 of file class.ilGlossaryPresentationGUI.php.
References $_GET.
{ require_once("content/classes/Pages/class.ilPageObject.php"); $pg_obj =& new ilPageObject("gdf", $_GET["pg_id"]); $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]); }
ilGlossaryPresentationGUI::downloadFile | ( | ) |
download file of file lists
Definition at line 505 of file class.ilGlossaryPresentationGUI.php.
ilGlossaryPresentationGUI::executeCommand | ( | ) |
executer command ("listTerms" | "listDefinitions")
Definition at line 71 of file class.ilGlossaryPresentationGUI.php.
References $_GET, $cmd, and prepareOutput().
{ $cmd = $_GET["cmd"]; if ($cmd != "listDefinitions") { $this->prepareOutput(); } if($cmd == "") { $cmd = "listTerms"; } $this->$cmd(); $this->tpl->show(); }
ilGlossaryPresentationGUI::fullscreen | ( | ) |
show fullscreen view
Definition at line 367 of file class.ilGlossaryPresentationGUI.php.
References $_GET.
{ $page =& new ilPageObject("gdf", $_GET["def_id"]); $page_gui =& new ilPageObjectGUI($page); $page_gui->showMediaFullscreen(); }
ilGlossaryPresentationGUI::getLinkXML | ( | $ | a_int_links | ) |
get link targets
Definition at line 532 of file class.ilGlossaryPresentationGUI.php.
References $lm_id, $target_arr, $target_id, $type, and ilLMObject::_lookupContObjID().
Referenced by listDefinitions().
{ if ($a_layoutframes == "") { $a_layoutframes = array(); } $link_info = "<IntLinkInfos>"; foreach ($a_int_links as $int_link) { $target = $int_link["Target"]; if (substr($target, 0, 4) == "il__") { $target_arr = explode("_", $target); $target_id = $target_arr[count($target_arr) - 1]; $type = $int_link["Type"]; $targetframe = ($int_link["TargetFrame"] != "") ? $int_link["TargetFrame"] : "None"; switch($type) { case "PageObject": case "StructureObject": $lm_id = ilLMObject::_lookupContObjID($target_id); $cont_obj =& $this->content_object; if ($type == "PageObject") { $href = "../goto.php?target=pg_".$target_id; } else { $href = "../goto.php?target=st_".$target_id; } $ltarget = "ilContObj".$lm_id; break; case "GlossaryItem": //$ltarget = $nframe = "_new"; $href = "glossary_presentation.php?cmd=listDefinitions&ref_id=".$_GET["ref_id"]. "&term_id=".$target_id; break; case "MediaObject": $ltarget = $nframe = "_new"; $href = "glossary_presentation.php?obj_type=$type&cmd=media&ref_id=".$_GET["ref_id"]. "&mob_id=".$target_id; break; } $link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ". "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" />"; } } $link_info.= "</IntLinkInfos>"; return $link_info; }
ilGlossaryPresentationGUI::getTabs | ( | &$ | tabs_gui | ) |
get tabs
Definition at line 594 of file class.ilGlossaryPresentationGUI.php.
References $_GET, and $_REQUEST.
Referenced by setTabs().
{ // back to upper context if (!empty ($_REQUEST["term"])) { $append = "&cmd=searchTerms&term=".$_REQUEST["term"]."&oldoffset=".$_GET["oldoffset"]; } $tabs_gui->addTarget("cont_back", "glossary_presentation.php?ref_id=".$_GET["ref_id"]."&offset=".$_GET["offset"].$append, "", ""); }
ilGlossaryPresentationGUI::ilGlossaryPresentationGUI | ( | ) |
Constructor public.
Definition at line 54 of file class.ilGlossaryPresentationGUI.php.
ilGlossaryPresentationGUI::listDefinitions | ( | ) |
list definitions of a term
Definition at line 258 of file class.ilGlossaryPresentationGUI.php.
References $_GET, $output, ilObjStyleSheet::getContentStylePath(), ilGlossaryDefinition::getDefinitionList(), getLinkXML(), ilObjStyleSheet::getSyntaxStylePath(), setLocator(), and setTabs().
{ require_once("content/classes/Pages/class.ilPageObjectGUI.php"); $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html"); $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html"); $this->setLocator(); $this->setTabs(); // content style $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); $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", "def_list", "tpl.glossary_definition_list.html", true); //$this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html"); $this->tpl->setVariable("FORMACTION", "glossary_edit.php?ref_id=".$_GET["ref_id"]. "&cmd=post&term_id=".$_GET["term_id"]."&offset=".$_GET["offset"]); /* $this->tpl->setVariable("TXT_ADD_DEFINITION", $this->lng->txt("cont_add_definition")); $this->tpl->setVariable("BTN_ADD", "addDefinition");*/ $defs = ilGlossaryDefinition::getDefinitionList($_GET["term_id"]); $this->tpl->setVariable("TXT_TERM", $term->getTerm()); for($j=0; $j<count($defs); $j++) { $def = $defs[$j]; $page =& new ilPageObject("gdf", $def["id"]); $page_gui =& new ilPageObjectGUI($page); // internal links $page->buildDom(); $int_links = $page->getInternalLinks(); $link_xml = $this->getLinkXML($int_links); $page_gui->setLinkXML($link_xml); $page_gui->setSourcecodeDownloadScript("glossary_presentation.php?ref_id=".$_GET["ref_id"]); $page_gui->setFullscreenLink("glossary_presentation.php?cmd=fullscreen". "&ref_id=".$_GET["ref_id"]."&def_id=".$def["id"]); //$page_gui->setOutputMode("edit"); //$page_gui->setPresentationTitle($this->term->getTerm()); $page_gui->setTemplateOutput(false); $page_gui->setFileDownloadLink("glossary_presentation.php?cmd=downloadFile". "&ref_id=".$_GET["ref_id"]); $output = $page_gui->preview(); if (count($defs) > 1) { $this->tpl->setCurrentBlock("definition_header"); $this->tpl->setVariable("TXT_DEFINITION", $this->lng->txt("cont_definition")." ".($j+1)); $this->tpl->parseCurrentBlock(); } /* if ($j > 0) { $this->tpl->setCurrentBlock("up"); $this->tpl->setVariable("TXT_UP", $this->lng->txt("up")); $this->tpl->setVariable("LINK_UP", "glossary_edit.php?ref_id=".$_GET["ref_id"]."&cmd=moveUp&def=".$def["id"]."&offset=".$_GET["offset"]); $this->tpl->parseCurrentBlock(); } if ($j+1 < count($defs)) { $this->tpl->setCurrentBlock("down"); $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down")); $this->tpl->setVariable("LINK_DOWN", "glossary_edit.php?ref_id=".$_GET["ref_id"]."&cmd=moveDown&def=".$def["id"]."&offset=".$_GET["offset"]); $this->tpl->parseCurrentBlock(); }*/ $this->tpl->setCurrentBlock("definition"); $this->tpl->setVariable("PAGE_CONTENT", $output); /*$this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit")); $this->tpl->setVariable("LINK_EDIT", "glossary_edit.php?ref_id=".$_GET["ref_id"]."&cmd=view&def=".$def["id"]."&offset=".$_GET["offset"]); $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete")); $this->tpl->setVariable("LINK_DELETE", "glossary_edit.php?ref_id=".$_GET["ref_id"]."&cmd=confirmDefinitionDeletion&def=".$def["id"]."&offset=".$_GET["offset"]); */ $this->tpl->parseCurrentBlock(); } //$this->tpl->setCurrentBlock("def_list"); //$this->tpl->parseCurrentBlock(); }
ilGlossaryPresentationGUI::listTermByGiven | ( | $ | term_list, | |
$ | filter = "" | |||
) |
list glossary terms
Definition at line 129 of file class.ilGlossaryPresentationGUI.php.
References $_GET, $num, $tbl, ilGlossaryDefinition::getDefinitionList(), ilUtil::switchColor(), and ilPCParagraph::xml2output().
Referenced by listTerms(), and searchTerms().
{ $this->lng->loadLanguageModule("meta"); include_once "./classes/class.ilTableGUI.php"; // load template for table // $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html"); $oldoffset = (is_numeric ($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"]; $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.glossary_search_term.html", true); $this->tpl->setVariable("FORMACTION1", "glossary_presentation.php?ref_id=".$_GET["ref_id"]."&cmd=searchTerms&offset=0&oldoffset=$oldoffset"); $this->tpl->setVariable("TXT_TERM", $this->lng->txt("cont_term")); $this->tpl->setVariable("TXT_SEARCH", $this->lng->txt("search")); $this->tpl->setVariable("TXT_CLEAR", $this->lng->txt("clear")); $this->tpl->setVariable("TERM", $filter); // load template for table $this->tpl->addBlockfile("TERM_TABLE", "term_table", "tpl.table.html"); // load template for table content data $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.term_tbl_pres_row.html", true); $num = 2; $obj_str = ($this->call_by_reference) ? "" : "&obj_id=".$this->obj_id; $this->tpl->setVariable("FORMACTION", "glossary_edit.php?ref_id=".$this->ref_id."$obj_str&cmd=post&offset=".$_GET["offset"]); // create table $tbl = new ilTableGUI(); // title & header columns $tbl->setTitle($this->lng->txt("cont_terms").(($filter=="")?"":"*")); //$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help")); $tbl->setHeaderNames(array($this->lng->txt("cont_term"), $this->lng->txt("cont_definitions"))); $cols = array("term", "definitions"); $header_params = array("ref_id" => $_GET["ref_id"], "cmd" => "listTerms"); if (!empty ($filter)) { $header_params ["cmd"] = "searchTerms"; $header_params ["term"] = $filter; $header_params ["oldoffset"] = $_GET["oldoffset"]; } $tbl->setHeaderVars($cols, $header_params); $tbl->setColumnWidth(array("30%", "70%")); // 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", 4); // footer $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next")); //$tbl->disable("footer"); // $term_list = $this->glossary->getTermList(); $tbl->setMaxCount(count($term_list)); // sorting array //$term_list = ilUtil::sortArray($term_list, $_GET["sort_by"], $_GET["sort_order"]); $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) { $css_row = ilUtil::switchColor($i++,"tblrow1","tblrow2"); $defs = ilGlossaryDefinition::getDefinitionList($term["id"]); for($j=0; $j<count($defs); $j++) { $def = $defs[$j]; if (count($defs) > 1) { $this->tpl->setCurrentBlock("definition"); $this->tpl->setVariable("DEF_TEXT", $this->lng->txt("cont_definition")." ".($j + 1)); $this->tpl->parseCurrentBlock(); } // $this->tpl->setCurrentBlock("definition"); $short_str = ilPCParagraph::xml2output($def["short_text"]); //$short_str = str_replace("<", "<", $short_str); //$short_str = str_replace(">", ">", $short_str); $this->tpl->setVariable("DEF_SHORT", $short_str); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("definition_row"); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("view_term"); $this->tpl->setVariable("TEXT_TERM", $term["term"]); if (!empty ($filter)) { $append = "&term=$filter&oldoffset=".$_GET["oldoffset"]; } $this->tpl->setVariable("LINK_VIEW_TERM", "glossary_presentation.php?ref_id=". $_GET["ref_id"]."&cmd=listDefinitions&term_id=".$term["id"]."&offset=".$_GET["offset"].$append); $this->tpl->parseCurrentBlock(); $this->tpl->setVariable("CSS_ROW", $css_row); $this->tpl->setVariable("TEXT_LANGUAGE", $this->lng->txt("meta_l_".$term["language"])); $this->tpl->setCurrentBlock("tbl_content"); $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(); } }
ilGlossaryPresentationGUI::listTerms | ( | ) |
Definition at line 120 of file class.ilGlossaryPresentationGUI.php.
References listTermByGiven().
{ $term_list = $this->glossary->getTermList(); $this->listTermByGiven($term_list); }
ilGlossaryPresentationGUI::media | ( | ) |
show media object
Definition at line 378 of file class.ilGlossaryPresentationGUI.php.
References $_GET, $args, $output, $params, $xh, $xml, $xsl, ilMediaItem::_getMapAreasIntLinks(), ilObjStyleSheet::getContentStylePath(), ilUtil::getImagePath(), ilUtil::getStyleSheetLocation(), ilUtil::getWebspaceDir(), xslt_create(), xslt_error(), xslt_free(), and xslt_process().
{ $this->tpl =& new ilTemplate("tpl.fullscreen.html", true, true, "content"); include_once("classes/class.ilObjStyleSheet.php"); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); //$int_links = $page_object->getInternalLinks(); $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]); // later //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets()); $link_xlm = ""; require_once("content/classes/Media/class.ilObjMediaObject.php"); $media_obj =& new ilObjMediaObject($_GET["mob_id"]); $xml = "<dummy>"; // todo: we get always the first alias now (problem if mob is used multiple // times in page) $xml.= $media_obj->getXML(IL_MODE_ALIAS); $xml.= $media_obj->getXML(IL_MODE_OUTPUT); $xml.= $link_xml; $xml.="</dummy>"; $xsl = file_get_contents("./content/page.xsl"); $args = array( '/_xml' => $xml, '/_xsl' => $xsl ); $xh = xslt_create(); $wb_path = ilUtil::getWebspaceDir("output"); $mode = "media"; $enlarge_path = ilUtil::getImagePath("enlarge.gif", false, "output"); $fullscreen_link = "glossary_presentation.php?ref_id=".$_GET["ref_id"]."&obj_type=MediaObject&cmd=fullscreen" ; $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path, 'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link, 'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path); $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params); echo xslt_error($xh); xslt_free($xh); // unmask user html $this->tpl->setVariable("MEDIA_CONTENT", $output); $this->tpl->parseCurrentBlock(); $this->tpl->show(); }
ilGlossaryPresentationGUI::prepareOutput | ( | ) |
Definition at line 88 of file class.ilGlossaryPresentationGUI.php.
References sendInfo(), and setLocator().
Referenced by executeCommand().
{ $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html"); $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html"); $title = $this->glossary->getTitle(); // catch feedback message sendInfo(); if (!empty($title)) { $this->tpl->setVariable("HEADER", $title); } $this->setLocator(); }
ilGlossaryPresentationGUI::searchTerms | ( | ) |
Definition at line 105 of file class.ilGlossaryPresentationGUI.php.
References $_GET, $_POST, $_REQUEST, and listTermByGiven().
{ if (isset ($_POST["clear"])) { $searchterm =""; $_GET["offset"] = $_GET["oldoffset"]; } else { $searchterm = $_REQUEST ["term"]; } $term_list = $this->glossary->getTermList($searchterm); $this->listTermByGiven($term_list, $searchterm); }
ilGlossaryPresentationGUI::setLocator | ( | $ | a_tree = "" , |
|
$ | a_id = "" | |||
) |
set Locator
object | tree object | |
integer | reference id public |
Definition at line 440 of file class.ilGlossaryPresentationGUI.php.
References $_GET, and $ilias_locator.
Referenced by listDefinitions(), and prepareOutput().
{ global $ilias_locator; //$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html"); require_once ("content/classes/class.ilGlossaryLocatorGUI.php"); $gloss_loc =& new ilGlossaryLocatorGUI(); $gloss_loc->setMode("presentation"); if (!empty($_GET["term_id"])) { $term =& new ilGlossaryTerm($_GET["term_id"]); $gloss_loc->setTerm($term); } $gloss_loc->setGlossary($this->glossary); //$gloss_loc->setDefinition($this->definition); $gloss_loc->display(); return; // ### AA 03.11.10 added new locator GUI class ### $i = 1; //$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html"); if (!empty($_GET["term_id"])) { $this->tpl->touchBlock("locator_separator"); } $this->tpl->setCurrentBlock("locator_item"); $this->tpl->setVariable("ITEM", $this->glossary->getTitle()); // TODO: SCRIPT NAME HAS TO BE VARIABLE!!! $this->tpl->setVariable("LINK_ITEM", "glossary_presentation.php?ref_id=".$_GET["ref_id"]."&cmd=listTerms"); $this->tpl->parseCurrentBlock(); // ### AA 03.11.10 added new locator GUI class ### // navigate locator $ilias_locator->navigate($i++,$this->glossary->getTitle(),"glossary_presentation.php?ref_id=".$_GET["ref_id"]."&cmd=listTerms"."&offset=".$_GET["offset"],"bottom"); if (!empty($_GET["term_id"])) { $term =& new ilGlossaryTerm($_GET["term_id"]); $this->tpl->setCurrentBlock("locator_item"); $this->tpl->setVariable("ITEM", $term->getTerm()); $this->tpl->setVariable("LINK_ITEM", "glossary_presentation.php?ref_id=".$_GET["ref_id"]. "&cmd=listDefinitions&term_id=".$term->getId()."&offset=".$_GET["offset"]); $this->tpl->parseCurrentBlock(); // ### AA 03.11.10 added new locator GUI class ### // navigate locator $ilias_locator->navigate($i++,$term->getTerm(),"glossary_edit.php?ref_id=".$_GET["ref_id"]. "&cmd=listDefinitions&term_id=".$term->getId()."&offset=".$_GET["offset"],"bottom"); } //$this->tpl->touchBlock("locator_separator"); $this->tpl->setCurrentBlock("locator"); $this->tpl->setVariable("TXT_LOCATOR",$debug.$this->lng->txt("locator")); $this->tpl->parseCurrentBlock(); }
ilGlossaryPresentationGUI::setTabs | ( | ) |
output tabs
Definition at line 517 of file class.ilGlossaryPresentationGUI.php.
References getTabs().
Referenced by listDefinitions().
{ // catch feedback message include_once("classes/class.ilTabsGUI.php"); $tabs_gui =& new ilTabsGUI(); $this->getTabs($tabs_gui); $this->tpl->setVariable("TABS", $tabs_gui->getHTML()); }
ilGlossaryPresentationGUI::$admin_tabs |
Definition at line 44 of file class.ilGlossaryPresentationGUI.php.
ilGlossaryPresentationGUI::$glossary |
Definition at line 45 of file class.ilGlossaryPresentationGUI.php.
ilGlossaryPresentationGUI::$ilias |
Definition at line 46 of file class.ilGlossaryPresentationGUI.php.
Referenced by ilGlossaryPresentationGUI().
ilGlossaryPresentationGUI::$lng |
Definition at line 48 of file class.ilGlossaryPresentationGUI.php.
Referenced by ilGlossaryPresentationGUI().
ilGlossaryPresentationGUI::$tpl |
Definition at line 47 of file class.ilGlossaryPresentationGUI.php.
Referenced by ilGlossaryPresentationGUI().