36 include_once
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php";
37 include_once
"./Modules/LearningModule/classes/class.ilObjDlBook.php";
46 function ilObjDlBookGUI($a_data,$a_id = 0,$a_call_by_reference =
true, $a_prepare_output =
true)
50 # BETTER DO IT HERE THAN IN PARENT CLASS ( PROBLEMS FOR import, create)
56 $this->lm_tree =& $this->
object->getLMTree();
62 include_once(
"./Modules/LearningModule/classes/class.ilObjDlBook.php");
64 $this->link_params =
"ref_id=".$this->ref_id;
72 $this->tpl->setCurrentBlock(
"ContentStyle");
73 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
75 $this->tpl->parseCurrentBlock();
78 $this->tpl->setCurrentBlock(
"SyntaxStyle");
79 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
81 $this->tpl->parseCurrentBlock();
86 if(!count($parsed_post))
90 $this->ctrl->setParameterByClass(
'illmpresentationgui',
'frame',
'maincontent');
91 $this->ctrl->setParameterByClass(
'illmpresentationgui',
'obj_id',(
int)
$_GET[
'obj_id']);
92 $this->ctrl->redirectByClass(
'illmpresentationgui',
'layout');
94 $tmp_tpl =
new ilTemplate(
"tpl.citation.xsl",
true,
true,
"Modules/LearningModule");
95 $tmp_tpl->setVariable(
"CITATIONS",$this->lng->txt(
"cont_citations"));
99 $tmp_tpl->setCurrentBlock(
"citation_row");
101 $tmp_tpl->setVariable(
"PAGES_ROW",
$data[
"text"]);
102 $tmp_tpl->parseCurrentBlock();
104 $xsl = $tmp_tpl->get();
106 $this->
object->initBibItemObject();
107 $xml = $this->
object->bib_obj->getXML();
112 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
118 $this->tpl->setCurrentBlock(
"ilPage");
119 $this->tpl->setVariable(
"PAGE_CONTENT",$output);
120 $this->tpl->parseCurrentBlock();
130 if(count(
$_POST[
"tr_id"]) > 1)
133 $message_text = $this->lng->txt(
"cont_select_one_translation_warning");
136 else if(!$a_target_id and (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"details"))
139 $message_text = $this->lng->txt(
"cont_select_one_edition");
142 else if(is_array($a_target_id) and count($a_target_id) > 1)
145 $message_text = $this->lng->txt(
"cont_msg_multiple_editions");
148 else if(is_array($a_target_id))
150 $a_target_id = $a_target_id[0];
159 $this->
object->initBibItemObject();
162 $this->tpl->setCurrentBlock(
"ContentStyle");
163 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
165 $this->tpl->parseCurrentBlock();
168 $this->tpl->setCurrentBlock(
"SyntaxStyle");
169 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
171 $this->tpl->parseCurrentBlock();
174 $this->tpl->setCurrentBlock(
"ilPage");
176 $tmp_tpl =
new ilTemplate(
"tpl.bibliography.xsl",
true,
true,
"Modules/LearningModule");
177 $tmp_tpl->setVariable(
"TITLE",$this->lng->txt(
"title"));
178 $tmp_tpl->setVariable(
"EDITION",$this->lng->txt(
"cont_edition"));
179 $tmp_tpl->setVariable(
"AUTHORS",$this->lng->txt(
"authors"));
183 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"frame",
"maincontent");
184 $action = $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"layout");
185 $params = array (
'mode' =>
"view_full",
187 'target_id' =>
"$a_target_id");
189 $tmp_tpl->setVariable(
"BOOKTITLE",$this->lng->txt(
"cont_booktitle"));
190 $tmp_tpl->setVariable(
"CROSS_REFERENCE",$this->lng->txt(
"cont_cross_reference"));
191 $tmp_tpl->setVariable(
"DETAILS",$this->lng->txt(
"cont_details"));
192 $tmp_tpl->setVariable(
"EDITOR",$this->lng->txt(
"editor"));
193 $tmp_tpl->setVariable(
"HOW_PUBLISHED",$this->lng->txt(
"cont_how_published"));
194 $tmp_tpl->setVariable(
"WHERE_PUBLISHED",$this->lng->txt(
"cont_where_published"));
195 $tmp_tpl->setVariable(
"INSTITUTION",$this->lng->txt(
"institution"));
196 $tmp_tpl->setVariable(
"JOURNAL",$this->lng->txt(
"cont_journal"));
197 $tmp_tpl->setVariable(
"KEYWORD",$this->lng->txt(
"cont_keyword"));
198 $tmp_tpl->setVariable(
"PAGES",$this->lng->txt(
"cont_pages"));
199 $tmp_tpl->setVariable(
"SCHOOL",$this->lng->txt(
"cont_school"));
200 $tmp_tpl->setVariable(
"MONTH",$this->lng->txt(
"cont_month"));
201 $tmp_tpl->setVariable(
"PUBLISHER",$this->lng->txt(
"cont_publisher"));
202 $tmp_tpl->setVariable(
"SERIES",$this->lng->txt(
"cont_series"));
203 $tmp_tpl->setVariable(
"SERIES_TITLE",$this->lng->txt(
"cont_series_title"));
204 $tmp_tpl->setVariable(
"SERIES_EDITOR",$this->lng->txt(
"cont_series_editor"));
205 $tmp_tpl->setVariable(
"SERIES_VOLUME",$this->lng->txt(
"cont_series_volume"));
206 $tmp_tpl->setVariable(
"YEAR",$this->lng->txt(
"cont_year"));
207 $tmp_tpl->setVariable(
"ISBN",$this->lng->txt(
"cont_isbn"));
208 $tmp_tpl->setVariable(
"URL",$this->lng->txt(
"cont_url"));
212 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"frame",
"maincontent");
213 $action = $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"layout");
214 $params = array (
'mode' =>
"view_simple",
215 'action' => $action);
216 $this->ctrl->clearParametersByClass(
"illmpresentationgui");
217 if($translations = $this->object->getTranslations())
219 foreach($translations as $tr_id)
223 $tmp_tpl->setCurrentBlock(
"TRANSLATION_ROW");
224 $tmp_tpl->setVariable(
"ROW_TITLE",$tmp_obj->getTitle());
225 $tmp_tpl->setVariable(
"ROW_ID",$tr_id);
226 $tmp_tpl->parseCurrentBlock();
229 $tmp_tpl->setCurrentBlock(
"TRANSLATION");
230 $tmp_tpl->setVariable(
"TRANSLATION_HEADER",$this->lng->txt(
"cont_translations"));
231 $tmp_tpl->parseCurrentBlock();
233 $tmp_tpl->setVariable(
"DETAILS",$this->lng->txt(
"cont_details"));
234 $tmp_tpl->setVariable(
"SHOW",$this->lng->txt(
"cont_show"));
235 $tmp_tpl->setVariable(
"SHOW_CITATION",$this->lng->txt(
"cont_show_citation"));
236 $tmp_tpl->setVariable(
"GO",$this->lng->txt(
"go"));
244 $xsl = $tmp_tpl->get();
245 $xml = $this->
object->bib_obj->getXML();
251 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
256 $this->tpl->setVariable(
"PAGE_CONTENT",$output);
267 #$this->object =& new ilObjDlBook($this->id, true);
268 $this->
object->export(
$_GET[
"ref_id"]);
283 $this->tpl->addBlockfile(
"CONTENT",
"offline_content",
"tpl.offline_export.html",
"Modules/LearningModule");
284 $this->tpl->touchBlock(
"offline_content");
286 $this->tpl->setVariable(
"TXT_TYPE",
"Export-Type");
288 if (
$_GET[
"print"]==1)
290 $this->tpl->setVariable(
"TXT_ACTION",
"Digilib-Book - print");
291 $this->tpl->setVariable(
"TXT_PRINTEXPORT",$this->lng->txt(
"Print") );
292 $this->tpl->setVariable(
"PRINT_CHECKED",
"checked");
293 $this->tpl->setVariable(
"EXPORT_TARGET",
"_blank");
297 $this->tpl->setVariable(
"TXT_ACTION",
"Digilib-Book - download");
298 $this->tpl->setVariable(
"TXT_HTMLEXPORT",$this->lng->txt(
"HTML export") );
299 $this->tpl->setVariable(
"TXT_PDFEXPORT",$this->lng->txt(
"PDF export") );
300 $this->tpl->setVariable(
"TXT_XMLEXPORT",$this->lng->txt(
"XML export (only complete book)") );
301 $this->tpl->setVariable(
"OFFLINE_CHECKED",
"checked");
304 $this->tpl->setVariable(
"TXT_PAGES",$this->lng->txt(
"Pages") );
305 $this->tpl->setVariable(
"TXT_PAGESALL",$this->lng->txt(
"all"));
306 $this->tpl->setVariable(
"TXT_PAGESCHAPTER",$this->lng->txt(
"chapter") );
307 if (
$_GET[
"obj_id"] !=
"") $this->tpl->setVariable(
"TXT_PAGESPAGE",$this->lng->txt(
"this page"));
308 $this->tpl->setVariable(
"TXT_PAGESFROM",$this->lng->txt(
"pages from") );
309 $this->tpl->setVariable(
"TXT_PAGESTO",$this->lng->txt(
"to") );
311 $this->tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"start export") );
312 $this->tpl->setVariable(
"BTN_C_VALUE",$this->lng->txt(
"cancel") );
314 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
315 $this->tpl->setVariable(
"EXPORT_ACTION",
316 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"offlineexport"));
317 $this->ctrl->clearParametersByClass(
"illmpresentationgui");
323 include_once(
"./classes/class.ilTemplate.php");
325 $tpl_menu =&
new ilTemplate(
"tpl.buttons.html",
true,
true);
327 $tpl_menu->setCurrentBlock(
"btn_cell");
329 #$tpl_menu->setVariable("BTN_LINK","./ilias.php?frame=maincontent&ref_id=".$_GET["ref_id"].
330 #"&obj_id=".$_GET["obj_id"]);
331 $this->ctrl->setParameterByClass(
'illmpresentationgui',
'frame',
'maincontent');
332 $this->ctrl->setParameterByClass(
'illmpresentationgui',
'obj_id',(
int)
$_GET[
'obj_id']);
333 $tpl_menu->setVariable(
'BTN_LINK',$this->ctrl->getLinkTargetByClass(
'illmpresentationgui',
'layout'));
334 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"back"));
335 $tpl_menu->parseCurrentBlock();
337 $tpl_menu->setCurrentBlock(
"btn_row");
338 $tpl_menu->parseCurrentBlock();
340 return $tpl_menu->get();
349 include_once(
"./classes/class.ilTemplate.php");
351 $tpl_menu =&
new ilTemplate(
"tpl.lm_menu.html",
true,
true,
"Modules/LearningModule");
353 $tpl_menu->setCurrentBlock(
"lm_menu_btn");
356 if (
$_POST[
"action"]==
"details" && count(
$_POST[
"target"])==1)
358 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
359 $tpl_menu->setVariable(
"BTN_LINK",
360 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"exportbibinfo"));
361 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"download"));
362 $tpl_menu->parseCurrentBlock();
364 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"print",
"1");
365 $tpl_menu->setVariable(
"BTN_LINK",
366 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"exportbibinfo"));
367 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"print"));
368 $tpl_menu->parseCurrentBlock();
369 $this->ctrl->clearParametersByClass(
"illmpresentationgui");
374 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
375 $tpl_menu->setVariable(
"BTN_LINK",
376 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"offlineexportform"));
377 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"download"));
378 $tpl_menu->parseCurrentBlock();
380 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"print",
"1");
381 $tpl_menu->setVariable(
"BTN_LINK",
382 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"offlineexportform"));
383 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"print") );
384 $tpl_menu->parseCurrentBlock();
386 $this->ctrl->clearParametersByClass(
"illmpresentationgui");
388 $tpl_menu->setCurrentBlock(
"btn_row");
389 $tpl_menu->parseCurrentBlock();
391 return $tpl_menu->get();
401 $this->tpl->setVariable(
"BTN1_NAME",
"addTranslation");
402 $this->tpl->setVariable(
"BTN1_TEXT",$this->lng->txt(
"cont_new_assignment"));
404 if($trs = $this->object->getTranslations())
406 include_once
"./classes/class.ilObjectFactory.php";
410 $this->tpl->setCurrentBlock(
"TRANSLATION_ROW");
411 $this->tpl->setVariable(
"ROW_ID",$tr);
412 $this->tpl->setVariable(
"ROW_TITLE",$tmp_obj->getTitle());
413 $this->tpl->parseCurrentBlock();
417 $this->tpl->setVariable(
"BTN2_NAME",
"deleteTranslation");
418 $this->tpl->setVariable(
"BTN2_TEXT",$this->lng->txt(
"cont_del_assignment"));
420 $this->tpl->setCurrentBlock(
"TRANSLATION");
421 $this->tpl->setVariable(
"TRANSLATION_HEADER",$this->lng->txt(
"cont_translations"));
422 $this->tpl->parseCurrentBlock();
430 if(isset(
$_POST[
"cancel"]))
432 $this->ctrl->redirect($this,
"properties");
435 if(isset(
$_POST[
"select"]))
437 if(is_array(
$_POST[
"id"]))
439 foreach(
$_POST[
"id"] as $id)
441 if($id != $this->object->getRefId())
443 $this->
object->addTranslation($id);
447 $this->ctrl->redirect($this,
"properties");
453 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.dbk_search_translation.html",
"Modules/LearningModule");
454 $this->tpl->setVariable(
"F_ACTION",
455 $this->ctrl->getLinkTarget($this,
"addTranslation"));
467 if(
$result[
"meta"][0][
"id"] == $this->object->getRefId())
474 $show_search =
false;
480 $this->lng->loadLanguageModule(
"search");
482 $this->tpl->setVariable(
"SEARCH_TXT",$this->lng->txt(
"cont_insert_search"));
483 $this->tpl->setVariable(
"SEARCH_ASSIGN_TR",$this->lng->txt(
"cont_assign_translation"));
484 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
485 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
486 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
496 $this->ctrl->redirect($this,
"properties");
499 $this->
object->deleteTranslations(
$_POST[
"id"]);
501 $this->ctrl->redirect($this,
"properties");
507 include_once
"./classes/class.ilObjectFactory.php";
509 foreach($a_result[
"meta"] as $book)
517 $this->tpl->setCurrentBlock(
"TR_SELECT_ROW");
518 $this->tpl->setVariable(
"ROW_ID",$book[
"id"]);
519 $this->tpl->setVariable(
"ROW_TITLE",$tmp_obj->getTitle());
520 $this->tpl->setVariable(
"ROW_DESCRIPTION",$tmp_obj->getDescription());
521 $this->tpl->setVariable(
"ROW_KONTEXT",$path);
522 $this->tpl->parseCurrentBlock();
526 $this->tpl->setCurrentBlock(
"TR_SELECT");
527 $this->tpl->setVariable(
"SELECT_TXT",$this->lng->txt(
"cont_select_translation"));
528 $this->tpl->setVariable(
"SELECT_TITLE",$this->lng->txt(
"title"));
529 $this->tpl->setVariable(
"SELECT_DESCRIPTION",$this->lng->txt(
"description"));
530 $this->tpl->setVariable(
"SELECT_KONTEXT",$this->lng->txt(
"context"));
532 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"assign"));
533 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
534 $this->tpl->parseCurrentBlock();
540 include_once(
"./classes/class.ilSearch.php");
543 $search->setPerformUpdate(
false);
544 $search->setSearchString(
$_POST[
"search_str"]);
545 $search->setCombination(
"and");
546 $search->setSearchFor(array(0 =>
'dbk'));
547 $search->setSearchIn(array(
'dbk' =>
'meta'));
548 $search->setSearchType(
'new');
550 if($search->validate($message))
552 $search->performSearch();
557 $this->ctrl->redirect($this,
"addTranslation");
560 return $search->getResultByType(
'dbk');
567 include_once(
"./Services/Tree/classes/class.ilTree.php");
571 if(!
$tree->isInTree($a_startnode_id) or !
$tree->isInTree($a_endnode_id))
575 $tmpPath =
$tree->getPathFull($a_endnode_id, $a_startnode_id);
578 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
585 $path .= $tmpPath[$i][
"title"];
594 $message =
"SELECT ONE<br />";
602 if(!is_array(
$_POST[
"pgt_id"]))
611 $output[] = array(
"text" => $id,
616 $output[] = array(
"text" => $id.
"f",
621 $output[] = array(
"text" => $id.
"ff",
632 $output[] = array(
"text" =>
$start.
"".$id,
641 return $output ? $output : array();
650 $xsl = file_get_contents($tpl->tplPath.
"/tpl.citation_paragraph.xsl");
651 $args = array(
'/_xml' => $page_xml,
'/_xsl' => $xsl );
653 $params = array (
'start_id' => $a_start,