37 include_once
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php";
38 include_once
"./Modules/LearningModule/classes/class.ilObjDlBook.php";
47 function ilObjDlBookGUI($a_data,$a_id = 0,$a_call_by_reference =
true, $a_prepare_output =
true)
51 # BETTER DO IT HERE THAN IN PARENT CLASS ( PROBLEMS FOR import, create)
57 $this->lm_tree =& $this->
object->getLMTree();
63 include_once(
"./Modules/LearningModule/classes/class.ilObjDlBook.php");
65 $this->link_params =
"ref_id=".$this->ref_id;
73 $this->tpl->setCurrentBlock(
"ContentStyle");
74 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
76 $this->tpl->parseCurrentBlock();
79 $this->tpl->setCurrentBlock(
"SyntaxStyle");
80 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
82 $this->tpl->parseCurrentBlock();
87 if(!count($parsed_post))
91 $this->ctrl->setParameterByClass(
'illmpresentationgui',
'frame',
'maincontent');
92 $this->ctrl->setParameterByClass(
'illmpresentationgui',
'obj_id',(
int)
$_GET[
'obj_id']);
93 $this->ctrl->redirectByClass(
'illmpresentationgui',
'layout');
95 $tmp_tpl =
new ilTemplate(
"tpl.citation.xsl",
true,
true,
"Modules/LearningModule");
96 $tmp_tpl->setVariable(
"CITATIONS",$this->lng->txt(
"cont_citations"));
98 foreach($parsed_post as $key =>
$data)
100 $tmp_tpl->setCurrentBlock(
"citation_row");
102 $tmp_tpl->setVariable(
"PAGES_ROW",
$data[
"text"]);
103 $tmp_tpl->parseCurrentBlock();
105 $xsl = $tmp_tpl->get();
107 $this->
object->initBibItemObject();
108 $xml = $this->
object->bib_obj->getXML();
113 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
115 $params = array (
'target_id' =>
$_SESSION[
"bib_id"]);
117 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
119 $this->tpl->setCurrentBlock(
"ilPage");
120 $this->tpl->setVariable(
"PAGE_CONTENT",$output);
121 $this->tpl->parseCurrentBlock();
131 if(count(
$_POST[
"tr_id"]) > 1)
134 $message_text = $this->lng->txt(
"cont_select_one_translation_warning");
137 else if(!$a_target_id and (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"details"))
140 $message_text = $this->lng->txt(
"cont_select_one_edition");
143 else if(is_array($a_target_id) and count($a_target_id) > 1)
146 $message_text = $this->lng->txt(
"cont_msg_multiple_editions");
149 else if(is_array($a_target_id))
151 $a_target_id = $a_target_id[0];
160 $this->
object->initBibItemObject();
163 $this->tpl->setCurrentBlock(
"ContentStyle");
164 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
166 $this->tpl->parseCurrentBlock();
169 $this->tpl->setCurrentBlock(
"SyntaxStyle");
170 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
172 $this->tpl->parseCurrentBlock();
175 $this->tpl->setCurrentBlock(
"ilPage");
177 $tmp_tpl =
new ilTemplate(
"tpl.bibliography.xsl",
true,
true,
"Modules/LearningModule");
178 $tmp_tpl->setVariable(
"TITLE",$this->lng->txt(
"title"));
179 $tmp_tpl->setVariable(
"EDITION",$this->lng->txt(
"cont_edition"));
180 $tmp_tpl->setVariable(
"AUTHORS",$this->lng->txt(
"authors"));
184 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"frame",
"maincontent");
185 $action = $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"layout");
186 $params = array (
'mode' =>
"view_full",
188 'target_id' =>
"$a_target_id");
190 $tmp_tpl->setVariable(
"BOOKTITLE",$this->lng->txt(
"cont_booktitle"));
191 $tmp_tpl->setVariable(
"CROSS_REFERENCE",$this->lng->txt(
"cont_cross_reference"));
192 $tmp_tpl->setVariable(
"DETAILS",$this->lng->txt(
"cont_details"));
193 $tmp_tpl->setVariable(
"EDITOR",$this->lng->txt(
"editor"));
194 $tmp_tpl->setVariable(
"HOW_PUBLISHED",$this->lng->txt(
"cont_how_published"));
195 $tmp_tpl->setVariable(
"WHERE_PUBLISHED",$this->lng->txt(
"cont_where_published"));
196 $tmp_tpl->setVariable(
"INSTITUTION",$this->lng->txt(
"institution"));
197 $tmp_tpl->setVariable(
"JOURNAL",$this->lng->txt(
"cont_journal"));
198 $tmp_tpl->setVariable(
"KEYWORD",$this->lng->txt(
"cont_keyword"));
199 $tmp_tpl->setVariable(
"PAGES",$this->lng->txt(
"cont_pages"));
200 $tmp_tpl->setVariable(
"SCHOOL",$this->lng->txt(
"cont_school"));
201 $tmp_tpl->setVariable(
"MONTH",$this->lng->txt(
"cont_month"));
202 $tmp_tpl->setVariable(
"PUBLISHER",$this->lng->txt(
"cont_publisher"));
203 $tmp_tpl->setVariable(
"SERIES",$this->lng->txt(
"cont_series"));
204 $tmp_tpl->setVariable(
"SERIES_TITLE",$this->lng->txt(
"cont_series_title"));
205 $tmp_tpl->setVariable(
"SERIES_EDITOR",$this->lng->txt(
"cont_series_editor"));
206 $tmp_tpl->setVariable(
"SERIES_VOLUME",$this->lng->txt(
"cont_series_volume"));
207 $tmp_tpl->setVariable(
"YEAR",$this->lng->txt(
"cont_year"));
208 $tmp_tpl->setVariable(
"ISBN",$this->lng->txt(
"cont_isbn"));
209 $tmp_tpl->setVariable(
"URL",$this->lng->txt(
"cont_url"));
213 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"frame",
"maincontent");
214 $action = $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"layout");
215 $params = array (
'mode' =>
"view_simple",
216 'action' => $action);
217 $this->ctrl->clearParametersByClass(
"illmpresentationgui");
218 if($translations = $this->object->getTranslations())
220 foreach($translations as $tr_id)
224 $tmp_tpl->setCurrentBlock(
"TRANSLATION_ROW");
225 $tmp_tpl->setVariable(
"ROW_TITLE",$tmp_obj->getTitle());
226 $tmp_tpl->setVariable(
"ROW_ID",$tr_id);
227 $tmp_tpl->parseCurrentBlock();
230 $tmp_tpl->setCurrentBlock(
"TRANSLATION");
231 $tmp_tpl->setVariable(
"TRANSLATION_HEADER",$this->lng->txt(
"cont_translations"));
232 $tmp_tpl->parseCurrentBlock();
234 $tmp_tpl->setVariable(
"DETAILS",$this->lng->txt(
"cont_details"));
235 $tmp_tpl->setVariable(
"SHOW",$this->lng->txt(
"cont_show"));
236 $tmp_tpl->setVariable(
"SHOW_CITATION",$this->lng->txt(
"cont_show_citation"));
237 $tmp_tpl->setVariable(
"GO",$this->lng->txt(
"go"));
245 $xsl = $tmp_tpl->get();
246 $xml = $this->
object->bib_obj->getXML();
252 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
256 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
257 $this->tpl->setVariable(
"PAGE_CONTENT",$output);
268 #$this->object =& new ilObjDlBook($this->id, true);
269 $this->
object->export(
$_GET[
"ref_id"]);
281 $this->tpl->addBlockfile(
"CONTENT",
"offline_content",
"tpl.offline_export.html",
"Modules/LearningModule");
282 $this->tpl->touchBlock(
"offline_content");
284 $this->tpl->setVariable(
"TXT_TYPE",
"Export-Type");
286 if (
$_GET[
"print"]==1)
288 $this->tpl->setVariable(
"TXT_ACTION",
"Digilib-Book - print");
289 $this->tpl->setVariable(
"TXT_PRINTEXPORT",$this->lng->txt(
"Print") );
290 $this->tpl->setVariable(
"PRINT_CHECKED",
"checked");
291 $this->tpl->setVariable(
"EXPORT_TARGET",
"_blank");
295 $this->tpl->setVariable(
"TXT_ACTION",
"Digilib-Book - download");
296 $this->tpl->setVariable(
"TXT_HTMLEXPORT",$this->lng->txt(
"HTML export") );
297 $this->tpl->setVariable(
"TXT_PDFEXPORT",$this->lng->txt(
"PDF export") );
298 $this->tpl->setVariable(
"TXT_XMLEXPORT",$this->lng->txt(
"XML export (only complete book)") );
299 $this->tpl->setVariable(
"OFFLINE_CHECKED",
"checked");
302 $this->tpl->setVariable(
"TXT_PAGES",$this->lng->txt(
"Pages") );
303 $this->tpl->setVariable(
"TXT_PAGESALL",$this->lng->txt(
"all"));
304 $this->tpl->setVariable(
"TXT_PAGESCHAPTER",$this->lng->txt(
"chapter") );
305 if (
$_GET[
"obj_id"] !=
"") $this->tpl->setVariable(
"TXT_PAGESPAGE",$this->lng->txt(
"this page"));
306 $this->tpl->setVariable(
"TXT_PAGESFROM",$this->lng->txt(
"pages from") );
307 $this->tpl->setVariable(
"TXT_PAGESTO",$this->lng->txt(
"to") );
309 $this->tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"start export") );
310 $this->tpl->setVariable(
"BTN_C_VALUE",$this->lng->txt(
"cancel") );
312 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
313 $this->tpl->setVariable(
"EXPORT_ACTION",
314 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"offlineexport"));
315 $this->ctrl->clearParametersByClass(
"illmpresentationgui");
321 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
323 $tpl_menu =&
new ilTemplate(
"tpl.buttons.html",
true,
true);
325 $tpl_menu->setCurrentBlock(
"btn_cell");
327 #$tpl_menu->setVariable("BTN_LINK","./ilias.php?frame=maincontent&ref_id=".$_GET["ref_id"].
328 #"&obj_id=".$_GET["obj_id"]);
329 $this->ctrl->setParameterByClass(
'illmpresentationgui',
'frame',
'maincontent');
330 $this->ctrl->setParameterByClass(
'illmpresentationgui',
'obj_id',(
int)
$_GET[
'obj_id']);
331 $tpl_menu->setVariable(
'BTN_LINK',$this->ctrl->getLinkTargetByClass(
'illmpresentationgui',
'layout'));
332 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"back"));
333 $tpl_menu->parseCurrentBlock();
335 $tpl_menu->setCurrentBlock(
"btn_row");
336 $tpl_menu->parseCurrentBlock();
338 return $tpl_menu->get();
347 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
349 $tpl_menu =&
new ilTemplate(
"tpl.lm_menu.html",
true,
true,
"Modules/LearningModule");
351 $tpl_menu->setCurrentBlock(
"lm_menu_btn");
354 if (
$_POST[
"action"]==
"details" && count(
$_POST[
"target"])==1)
356 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
357 $tpl_menu->setVariable(
"BTN_LINK",
358 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"exportbibinfo"));
359 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"download"));
360 $tpl_menu->parseCurrentBlock();
362 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"print",
"1");
363 $tpl_menu->setVariable(
"BTN_LINK",
364 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"exportbibinfo"));
365 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"print"));
366 $tpl_menu->parseCurrentBlock();
367 $this->ctrl->clearParametersByClass(
"illmpresentationgui");
372 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
373 $tpl_menu->setVariable(
"BTN_LINK",
374 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"offlineexportform"));
375 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"download"));
376 $tpl_menu->parseCurrentBlock();
378 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"print",
"1");
379 $tpl_menu->setVariable(
"BTN_LINK",
380 $this->ctrl->getLinkTargetByClass(
"illmpresentationgui",
"offlineexportform"));
381 $tpl_menu->setVariable(
"BTN_TXT",$this->lng->txt(
"print") );
382 $tpl_menu->parseCurrentBlock();
384 $this->ctrl->clearParametersByClass(
"illmpresentationgui");
386 $tpl_menu->setCurrentBlock(
"btn_row");
387 $tpl_menu->parseCurrentBlock();
389 return $tpl_menu->get();
399 $this->tpl->setVariable(
"BTN1_NAME",
"addTranslation");
400 $this->tpl->setVariable(
"BTN1_TEXT",$this->lng->txt(
"cont_new_assignment"));
402 if($trs = $this->object->getTranslations())
404 include_once
"./Services/Object/classes/class.ilObjectFactory.php";
408 $this->tpl->setCurrentBlock(
"TRANSLATION_ROW");
409 $this->tpl->setVariable(
"ROW_ID",$tr);
410 $this->tpl->setVariable(
"ROW_TITLE",$tmp_obj->getTitle());
411 $this->tpl->parseCurrentBlock();
415 $this->tpl->setVariable(
"BTN2_NAME",
"deleteTranslation");
416 $this->tpl->setVariable(
"BTN2_TEXT",$this->lng->txt(
"cont_del_assignment"));
418 $this->tpl->setCurrentBlock(
"TRANSLATION");
419 $this->tpl->setVariable(
"TRANSLATION_HEADER",$this->lng->txt(
"cont_translations"));
420 $this->tpl->parseCurrentBlock();
428 if(isset(
$_POST[
"cancel"]))
430 $this->ctrl->redirect($this,
"properties");
433 if(isset(
$_POST[
"select"]))
435 if(is_array(
$_POST[
"id"]))
437 foreach(
$_POST[
"id"] as $id)
439 if($id != $this->object->getRefId())
441 $this->
object->addTranslation($id);
445 $this->ctrl->redirect($this,
"properties");
451 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.dbk_search_translation.html",
"Modules/LearningModule");
452 $this->tpl->setVariable(
"F_ACTION",
453 $this->ctrl->getLinkTarget($this,
"addTranslation"));
465 if(
$result[
"meta"][0][
"id"] == $this->object->getRefId())
472 $show_search =
false;
478 $this->lng->loadLanguageModule(
"search");
480 $this->tpl->setVariable(
"SEARCH_TXT",$this->lng->txt(
"cont_insert_search"));
481 $this->tpl->setVariable(
"SEARCH_ASSIGN_TR",$this->lng->txt(
"cont_assign_translation"));
482 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
483 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
484 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
494 $this->ctrl->redirect($this,
"properties");
497 $this->
object->deleteTranslations(
$_POST[
"id"]);
499 $this->ctrl->redirect($this,
"properties");
505 include_once
"./Services/Object/classes/class.ilObjectFactory.php";
507 foreach($a_result[
"meta"] as $book)
515 $this->tpl->setCurrentBlock(
"TR_SELECT_ROW");
516 $this->tpl->setVariable(
"ROW_ID",$book[
"id"]);
517 $this->tpl->setVariable(
"ROW_TITLE",$tmp_obj->getTitle());
518 $this->tpl->setVariable(
"ROW_DESCRIPTION",$tmp_obj->getDescription());
519 $this->tpl->setVariable(
"ROW_KONTEXT",
$path);
520 $this->tpl->parseCurrentBlock();
524 $this->tpl->setCurrentBlock(
"TR_SELECT");
525 $this->tpl->setVariable(
"SELECT_TXT",$this->lng->txt(
"cont_select_translation"));
526 $this->tpl->setVariable(
"SELECT_TITLE",$this->lng->txt(
"title"));
527 $this->tpl->setVariable(
"SELECT_DESCRIPTION",$this->lng->txt(
"description"));
528 $this->tpl->setVariable(
"SELECT_KONTEXT",$this->lng->txt(
"context"));
530 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"assign"));
531 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
532 $this->tpl->parseCurrentBlock();
538 include_once(
"./Services/Search/classes/class.ilSearch.php");
541 $search->setPerformUpdate(
false);
542 $search->setSearchString(
$_POST[
"search_str"]);
543 $search->setCombination(
"and");
544 $search->setSearchFor(array(0 =>
'dbk'));
545 $search->setSearchIn(array(
'dbk' =>
'meta'));
546 $search->setSearchType(
'new');
548 if($search->validate($message))
550 $search->performSearch();
555 $this->ctrl->redirect($this,
"addTranslation");
558 return $search->getResultByType(
'dbk');
565 include_once(
"./Services/Tree/classes/class.ilTree.php");
569 if(!
$tree->isInTree($a_startnode_id) or !
$tree->isInTree($a_endnode_id))
573 $tmpPath =
$tree->getPathFull($a_endnode_id, $a_startnode_id);
576 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
583 $path .= $tmpPath[$i][
"title"];
592 $message =
"SELECT ONE<br />";
600 if(!is_array(
$_POST[
"pgt_id"]))
604 foreach(
$_POST[
"pgt_id"] as $key => $id)
606 switch(
$_POST[
"ct_option"][$key])
609 $output[] = array(
"text" => $id,
614 $output[] = array(
"text" => $id.
"f",
619 $output[] = array(
"text" => $id.
"ff",
630 $output[] = array(
"text" => $start.
"".$id,
639 return $output ? $output : array();
648 $xsl = file_get_contents($tpl->tplPath.
"/tpl.citation_paragraph.xsl");
649 $args = array(
'/_xml' => $page_xml,
'/_xsl' => $xsl );
651 $params = array (
'start_id' => $a_start,
654 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);