4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
39 public function __construct($a_parent_obj, $a_parent_cmd, $a_tax_node)
43 $this->glossary = $a_parent_obj->object;
44 $this->
setId(
"glotl" . $this->glossary->getId());
45 $this->tax_node = $a_tax_node;
47 $this->lng = $DIC->language();
48 $this->ctrl = $DIC->ctrl();
50 $this->selectable_cols = array();
52 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTermPermission.php");
55 include_once(
"./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php");
58 foreach ($this->adv_fields as
$f) {
59 $this->selectable_cols[
"md_" . $f[
"id"]] = array(
66 $this->selectable_cols[
"language"] = array(
67 "txt" => $this->lng->txt(
"language"),
69 $this->selectable_cols[
"usage"] = array(
70 "txt" => $this->lng->txt(
"cont_usage"),
75 parent::__construct($a_parent_obj, $a_parent_cmd);
76 $this->
setTitle($this->lng->txt(
"cont_terms"));
81 include_once(
"./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php");
85 foreach ($this->adv_cols_order as
$c) {
87 $this->
addColumn($this->lng->txt(
"cont_term"),
"term");
89 if (in_array(
"md_" . $c[
"id"], $this->selected_cols)) {
90 $this->
addColumn($c[
"text"],
"md_" . $c[
"id"]);
95 foreach (array(
"language",
"usage") as $c) {
96 if (in_array($c, $this->selected_cols)) {
97 $this->
addColumn($this->selectable_cols[$c][
"txt"]);
103 $this->
addColumn($this->lng->txt(
"cont_definitions"));
106 $this->
addColumn($this->lng->txt(
"obj_glo"));
112 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
113 $this->
setRowTemplate(
"tpl.term_tbl_row.html",
"Modules/Glossary");
117 $this->
addMultiCommand(
"referenceTerms", $this->lng->txt(
"glo_reference"));
118 $this->
addMultiCommand(
"confirmTermDeletion", $this->lng->txt(
"delete"));
124 $this->
setData($this->glossary->getTermList(
125 $this->filter[
"term"],
127 $this->filter[
"definition"],
145 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTermReferences.php");
147 $this->glossary->getVirtualMode(),
148 array(
"level",
"subtree")
161 return $this->selectable_cols;
171 if (substr($a_field, 0, 3) ==
"md_") {
172 $md_id = (int) substr($a_field, 3);
186 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
190 $ti->setSubmitFormOnEnter(
true);
192 $ti->readFromSession();
193 $this->filter[
"term"] = $ti->getValue();
196 if ($this->glossary->supportsLongTextQuery()) {
197 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
198 $ti =
new ilTextInputGUI($this->lng->txt(
"cont_definition"),
"defintion");
201 $ti->setSubmitFormOnEnter(
true);
203 $ti->readFromSession();
204 $this->filter[
"definition"] = $ti->getValue();
213 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
216 $this->ctrl->setParameterByClass(
"ilobjglossarygui",
"term_id", $term[
"id"]);
217 $this->ctrl->setParameterByClass(
"ilglossarytermgui",
"term_id", $term[
"id"]);
218 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"term_id", $term[
"id"]);
223 if ($this->term_perm->checkPermission(
"write", $term[
"id"]) ||
224 $this->term_perm->checkPermission(
"edit_content", $term[
"id"])) {
225 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
226 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTermReferences.php");
230 $list->addItem($this->lng->txt(
"cont_edit_term"),
"", $this->ctrl->getLinkTargetByClass(
"ilglossarytermgui",
"editTerm"));
231 if (count($defs) > 1) {
232 $list->addItem($this->lng->txt(
"cont_edit_definitions"),
"", $this->ctrl->getLinkTargetByClass(
"ilglossarytermgui",
"listDefinitions"));
233 } elseif (count($defs) == 1) {
234 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"def", $defs[0][
"id"]);
235 $list->addItem($this->lng->txt(
"cont_edit_definition"),
"", $this->ctrl->getLinkTargetByClass(array(
"ilglossarytermgui",
236 "iltermdefinitioneditorgui",
237 "ilglossarydefpagegui"),
"edit"));
239 $list->addItem($this->lng->txt(
"cont_add_definition"),
"", $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui",
"addDefinition"));
240 $this->ctrl->setParameterByClass(
"ilglossarydefpagegui",
"def",
"");
242 $list->setId(
"act_term_" . $term[
"id"]);
243 $list->setListTitle($this->lng->txt(
"actions"));
244 $this->tpl->setVariable(
"ACTIONS",
$list->getHTML());
249 for ($j = 0; $j < count($defs); $j++) {
254 $this->tpl->setCurrentBlock(
"definition");
255 $short_str =
$def[
"short_text"];
257 if (
$def[
"short_text_dirty"]) {
260 $def_obj->updateShortText();
261 $short_str = $def_obj->getShortText();
266 $ltexs = strrpos($short_str,
"[tex]");
267 $ltexe = strrpos($short_str,
"[/tex]");
268 if ($ltexs > $ltexe) {
271 $short_str = $page->getFirstParagraphText();
272 $short_str = strip_tags($short_str,
"<br>");
273 $ltexe = strpos($short_str,
"[/tex]", $ltexs);
277 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
281 $this->tpl->setVariable(
"DEF_SHORT", $short_str);
282 $this->tpl->parseCurrentBlock();
284 $this->tpl->setCurrentBlock(
"definition_row");
285 $this->tpl->parseCurrentBlock();
288 $this->tpl->setCurrentBlock(
"check_col");
289 $this->tpl->setVariable(
"CHECKBOX_ID", $term[
"id"]);
290 $this->tpl->parseCurrentBlock();
292 $this->ctrl->setParameter($this->parent_obj,
"term_id", $term[
"id"]);
298 if ($nr_usage > 0 && $this->glossary->getId() == $term[
"glo_id"]) {
299 $this->tpl->setCurrentBlock(
"link_usage");
300 $this->ctrl->setParameterByClass(
"ilglossarytermgui",
"term_id", $term[
"id"]);
302 $this->tpl->setVariable(
304 $this->ctrl->getLinkTargetByClass(
"ilglossarytermgui",
"listUsages")
306 $this->ctrl->setParameterByClass(
"ilglossarytermgui",
"term_id",
"");
307 $this->tpl->parseCurrentBlock();
309 $this->tpl->setCurrentBlock(
"usage");
311 $this->tpl->parseCurrentBlock();
313 $this->tpl->setCurrentBlock(
"td_usage");
314 $this->tpl->parseCurrentBlock();
319 $this->tpl->setCurrentBlock(
"glossary");
321 $this->tpl->parseCurrentBlock();
326 $this->tpl->setCurrentBlock(
"td_lang");
327 $this->tpl->setVariable(
"TEXT_LANGUAGE", $this->lng->txt(
"meta_l_" . $term[
"language"]));
328 $this->tpl->parseCurrentBlock();
332 foreach ($this->adv_cols_order as
$c) {
334 $this->tpl->setCurrentBlock(
"td");
335 $this->tpl->setVariable(
"TD_VAL", $term[
"term"]);
336 $this->tpl->parseCurrentBlock();
338 if (in_array(
"md_" . $c[
"id"], $this->selected_cols)) {
339 $id = (int) $c[
"id"];
342 if (isset($term[
"md_" .
$id .
"_presentation"])) {
343 $pb = $term[
"md_" . $id .
"_presentation"]->getHTML();
349 $this->tpl->setCurrentBlock(
"td");
350 $this->tpl->setVariable(
"TD_VAL", $val);
351 $this->tpl->parseCurrentBlock();
static hasReferences($a_glossary_id)
Check if a glossary uses references.
static getInstance()
Get instance.
if(isset($_REQUEST['delete'])) $list
static getDefinitionList($a_term_id)
static
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static isReferenced($a_glo_id, $a_term_id)
Is a term referenced by one or multiple glossaries.
static getNumberOfUsages($a_term_id)
Get number of usages.
if(!array_key_exists('StateId', $_REQUEST)) $id
showGlossaryColumn()
Show glossary column.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static _lookupTitle($a_id)
lookup object title
static xml2output($a_text, $a_wysiwyg=false, $a_replace_lists=true, $unmask=true)
Converts xml from DB to output in edit textarea.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
numericOrdering($a_field)
Should this field be sorted numeric?
addMultiCommand($a_cmd, $a_text)
Add Command button.
This class represents a text property in a property form.
getSelectedColumns()
Get selected columns.
setMaxLength($a_maxlength)
Set Max Length.
Glossary definition page object.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookGlossaryID($term_id)
get glossary id form term id
Class ilGlossaryDefinition.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct($a_parent_obj, $a_parent_cmd, $a_tax_node)
Constructor.
static getInstance()
Singleton: get instance.
fillRow($term)
Fill table row.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
getSelectableColumns()
Get selectable columns.
setEnableTitle($a_enabletitle)
Set Enable Title.