00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00036 include_once "content/classes/class.ilObjContentObjectGUI.php";
00037 include_once "content/classes/class.ilObjDlBook.php";
00038
00039 class ilObjDlBookGUI extends ilObjContentObjectGUI
00040 {
00046 function ilObjDlBookGUI($a_data,$a_id = 0,$a_call_by_reference = true, $a_prepare_output = true)
00047 {
00048 $this->type = "dbk";
00049 parent::ilObjContentObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
00050 # BETTER DO IT HERE THAN IN PARENT CLASS ( PROBLEMS FOR import, create)
00051 $this->assignObject();
00052
00053
00054 if($a_id != 0)
00055 {
00056 $this->lm_tree =& $this->object->getLMTree();
00057 }
00058 }
00059
00060 function assignObject()
00061 {
00062 include_once("content/classes/class.ilObjDlBook.php");
00063
00064 $this->link_params = "ref_id=".$this->ref_id;
00065 $this->object =& new ilObjDlBook($this->id, true);
00066 }
00067
00068
00069 function showCitation($page_xml)
00070 {
00071
00072 $this->tpl->setCurrentBlock("ContentStyle");
00073 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
00074 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
00075 $this->tpl->parseCurrentBlock();
00076
00077
00078 $this->tpl->setCurrentBlock("SyntaxStyle");
00079 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
00080 ilObjStyleSheet::getSyntaxStylePath());
00081 $this->tpl->parseCurrentBlock();
00082
00083 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
00084
00085 $parsed_post = $this->__parseCitationPost();
00086 if(!count($parsed_post))
00087 {
00088 $_SESSION["citation_error"] = 1;
00089
00090 $this->ctrl->setParameterByClass('illmpresentationgui','frame','maincontent');
00091 $this->ctrl->setParameterByClass('illmpresentationgui','obj_id',(int) $_GET['obj_id']);
00092 $this->ctrl->redirectByClass('illmpresentationgui','layout');
00093 #header("location: lm_presentation.php?cmd=layout&frame=maincontent&ref_id=$_GET[ref_id]&obj_id=$_GET[obj_id]");
00094 #exit;
00095 }
00096 $tmp_tpl = new ilTemplate("tpl.citation.xsl",true,true,"content");
00097 $tmp_tpl->setVariable("CITATIONS",$this->lng->txt("cont_citations"));
00098
00099 foreach($parsed_post as $key => $data)
00100 {
00101 $tmp_tpl->setCurrentBlock("citation_row");
00102 $tmp_tpl->setVariable("CITATION",$this->__applyCitationText($page_xml,$data["start"],$data["end"]));
00103 $tmp_tpl->setVariable("PAGES_ROW",$data["text"]);
00104 $tmp_tpl->parseCurrentBlock();
00105 }
00106 $xsl = $tmp_tpl->get();
00107
00108 $this->object->initBibItemObject();
00109 $xml = $this->object->bib_obj->getXML();
00110 if(empty($xml))
00111 {
00112 return true;
00113 }
00114 $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
00115 $xh = xslt_create();
00116 $params = array ('target_id' => $_SESSION["bib_id"]);
00117
00118 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
00119
00120 $this->tpl->setCurrentBlock("ilPage");
00121 $this->tpl->setVariable("PAGE_CONTENT",$output);
00122 $this->tpl->parseCurrentBlock();
00123
00124 return true;
00125 }
00126
00130 function showAbstract($a_target_id)
00131 {
00132 if(count($_POST["tr_id"]) > 1)
00133 {
00134 $message = true;
00135 $message_text = $this->lng->txt("cont_select_one_translation_warning");
00136 $show_full = false;
00137 }
00138 else if(!$a_target_id and ($_POST["action"] == "show" or $_POST["action"] == "details"))
00139 {
00140 $message = true;
00141 $message_text = $this->lng->txt("cont_select_one_edition");
00142 $show_full = false;
00143 }
00144 else if(is_array($a_target_id) and count($a_target_id) > 1)
00145 {
00146 $message = true;
00147 $message_text = $this->lng->txt("cont_msg_multiple_editions");
00148 $show_full = false;
00149 }
00150 else if(is_array($a_target_id))
00151 {
00152 $a_target_id = $a_target_id[0];
00153 $show_full = true;
00154 }
00155 else
00156 {
00157 $a_target_id = 0;
00158 $show_full = false;
00159 }
00160
00161 $this->object->initBibItemObject();
00162
00163
00164 $this->tpl->setCurrentBlock("ContentStyle");
00165 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
00166 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
00167 $this->tpl->parseCurrentBlock();
00168
00169
00170 $this->tpl->setCurrentBlock("SyntaxStyle");
00171 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
00172 ilObjStyleSheet::getSyntaxStylePath());
00173 $this->tpl->parseCurrentBlock();
00174
00175 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
00176 $this->tpl->setCurrentBlock("ilPage");
00177
00178 $tmp_tpl = new ilTemplate("tpl.bibliography.xsl",true,true,"content");
00179 $tmp_tpl->setVariable("TITLE",$this->lng->txt("title"));
00180 $tmp_tpl->setVariable("EDITION",$this->lng->txt("cont_edition"));
00181 $tmp_tpl->setVariable("AUTHORS",$this->lng->txt("authors"));
00182
00183 if($show_full)
00184 {
00185
00186 $params = array ('mode' => "view_full",
00187 'action' => "lm_presentation.php?cmd=layout&frame=maincontent&ref_id=$_GET[ref_id]",
00188 'target_id' => "$a_target_id");
00189
00190 $tmp_tpl->setVariable("BOOKTITLE",$this->lng->txt("cont_booktitle"));
00191 $tmp_tpl->setVariable("CROSS_REFERENCE",$this->lng->txt("cont_cross_reference"));
00192 $tmp_tpl->setVariable("DETAILS",$this->lng->txt("cont_details"));
00193 $tmp_tpl->setVariable("EDITOR",$this->lng->txt("editor"));
00194 $tmp_tpl->setVariable("HOW_PUBLISHED",$this->lng->txt("cont_how_published"));
00195 $tmp_tpl->setVariable("WHERE_PUBLISHED",$this->lng->txt("cont_where_published"));
00196 $tmp_tpl->setVariable("INSTITUTION",$this->lng->txt("institution"));
00197 $tmp_tpl->setVariable("JOURNAL",$this->lng->txt("cont_journal"));
00198 $tmp_tpl->setVariable("KEYWORD",$this->lng->txt("cont_keyword"));
00199 $tmp_tpl->setVariable("PAGES",$this->lng->txt("cont_pages"));
00200 $tmp_tpl->setVariable("SCHOOL",$this->lng->txt("cont_school"));
00201 $tmp_tpl->setVariable("MONTH",$this->lng->txt("cont_month"));
00202 $tmp_tpl->setVariable("PUBLISHER",$this->lng->txt("cont_publisher"));
00203 $tmp_tpl->setVariable("SERIES",$this->lng->txt("cont_series"));
00204 $tmp_tpl->setVariable("SERIES_TITLE",$this->lng->txt("cont_series_title"));
00205 $tmp_tpl->setVariable("SERIES_EDITOR",$this->lng->txt("cont_series_editor"));
00206 $tmp_tpl->setVariable("SERIES_VOLUME",$this->lng->txt("cont_series_volume"));
00207 $tmp_tpl->setVariable("YEAR",$this->lng->txt("cont_year"));
00208 $tmp_tpl->setVariable("ISBN",$this->lng->txt("cont_isbn"));
00209 $tmp_tpl->setVariable("URL",$this->lng->txt("cont_url"));
00210 }
00211 else
00212 {
00213 $this->ctrl->setParameterByClass("illmpresentationgui", "frame", "maincontent");
00214 $action = $this->ctrl->getLinkTargetByClass("illmpresentationgui", "layout");
00215
00216
00217 $params = array ('mode' => "view_simple",
00218 'action' => $action);
00219 $this->ctrl->clearParametersByClass("illmpresentationgui");
00220 if($translations = $this->object->getTranslations())
00221 {
00222 foreach($translations as $tr_id)
00223 {
00224 $tmp_obj = ilObjectFactory::getInstanceByRefId($tr_id);
00225
00226 $tmp_tpl->setCurrentBlock("TRANSLATION_ROW");
00227 $tmp_tpl->setVariable("ROW_TITLE",$tmp_obj->getTitle());
00228 $tmp_tpl->setVariable("ROW_ID",$tr_id);
00229 $tmp_tpl->parseCurrentBlock();
00230 unset($tmp_obj);
00231 }
00232 $tmp_tpl->setCurrentBlock("TRANSLATION");
00233 $tmp_tpl->setVariable("TRANSLATION_HEADER",$this->lng->txt("cont_translations"));
00234 $tmp_tpl->parseCurrentBlock();
00235 }
00236 $tmp_tpl->setVariable("DETAILS",$this->lng->txt("cont_details"));
00237 $tmp_tpl->setVariable("SHOW",$this->lng->txt("cont_show"));
00238 $tmp_tpl->setVariable("SHOW_CITATION",$this->lng->txt("cont_show_citation"));
00239 $tmp_tpl->setVariable("GO",$this->lng->txt("go"));
00240 }
00241
00242
00243 if($message)
00244 {
00245 sendInfo($message_text);
00246 }
00247 $xsl = $tmp_tpl->get();
00248 $xml = $this->object->bib_obj->getXML();
00249
00250 if(empty($xml))
00251 {
00252 return true;
00253 }
00254 $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
00255 $xh = xslt_create();
00256
00257
00258 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
00259 $this->tpl->setVariable("PAGE_CONTENT",$output);
00260
00261 return $output;
00262 }
00263
00267 function export()
00268 {
00269
00270 #$this->object =& new ilObjDlBook($this->id, true);
00271 $this->object->export($_GET["ref_id"]);
00272 }
00273
00281 function offlineexportform()
00282 {
00283
00284
00285
00286 $this->tpl->addBlockfile("CONTENT", "offline_content", "tpl.offline_export.html", true);
00287 $this->tpl->touchBlock("offline_content");
00288
00289 $this->tpl->setVariable("TXT_TYPE","Export-Type");
00290
00291 if ($_GET["print"]==1)
00292 {
00293 $this->tpl->setVariable("TXT_ACTION","Digilib-Book - print");
00294 $this->tpl->setVariable("TXT_PRINTEXPORT",$this->lng->txt("Print") );
00295 $this->tpl->setVariable("PRINT_CHECKED","checked");
00296 $this->tpl->setVariable("EXPORT_TARGET","_blank");
00297 }
00298 else
00299 {
00300 $this->tpl->setVariable("TXT_ACTION","Digilib-Book - download");
00301 $this->tpl->setVariable("TXT_HTMLEXPORT",$this->lng->txt("HTML export") );
00302 $this->tpl->setVariable("TXT_PDFEXPORT",$this->lng->txt("PDF export") );
00303 $this->tpl->setVariable("TXT_XMLEXPORT",$this->lng->txt("XML export (only complete book)") );
00304 $this->tpl->setVariable("OFFLINE_CHECKED","checked");
00305 }
00306
00307 $this->tpl->setVariable("TXT_PAGES",$this->lng->txt("Pages") );
00308 $this->tpl->setVariable("TXT_PAGESALL",$this->lng->txt("all"));
00309 $this->tpl->setVariable("TXT_PAGESCHAPTER",$this->lng->txt("chapter") );
00310 if ($_GET["obj_id"] != "") $this->tpl->setVariable("TXT_PAGESPAGE",$this->lng->txt("this page"));
00311 $this->tpl->setVariable("TXT_PAGESFROM",$this->lng->txt("pages from") );
00312 $this->tpl->setVariable("TXT_PAGESTO",$this->lng->txt("to") );
00313
00314 $this->tpl->setVariable("BTN_VALUE",$this->lng->txt("start export") );
00315 $this->tpl->setVariable("BTN_C_VALUE",$this->lng->txt("cancel") );
00316
00317 $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]);
00318 $this->tpl->setVariable("EXPORT_ACTION",
00319 $this->ctrl->getLinkTargetByClass("illmpresentationgui", "offlineexport"));
00320 $this->ctrl->clearParametersByClass("illmpresentationgui");
00321 $this->tpl->show();
00322
00323 }
00324 function setilCitationMenu()
00325 {
00326 include_once("./classes/class.ilTemplate.php");
00327
00328 $tpl_menu =& new ilTemplate("tpl.buttons.html",true,true);
00329
00330 $tpl_menu->setCurrentBlock("btn_cell");
00331
00332 #$tpl_menu->setVariable("BTN_LINK","./ilias.php?frame=maincontent&ref_id=".$_GET["ref_id"].
00333 #"&obj_id=".$_GET["obj_id"]);
00334 $this->ctrl->setParameterByClass('illmpresentationgui','frame','maincontent');
00335 $this->ctrl->setParameterByClass('illmpresentationgui','obj_id',(int) $_GET['obj_id']);
00336 $tpl_menu->setVariable('BTN_LINK',$this->ctrl->getLinkTargetByClass('illmpresentationgui','layout'));
00337 $tpl_menu->setVariable("BTN_TXT",$this->lng->txt("back"));
00338 $tpl_menu->parseCurrentBlock();
00339
00340 $tpl_menu->setCurrentBlock("btn_row");
00341 $tpl_menu->parseCurrentBlock();
00342
00343 return $tpl_menu->get();
00344 }
00345
00349
00350 function setilLMMenu()
00351 {
00352 include_once("./classes/class.ilTemplate.php");
00353
00354 $tpl_menu =& new ilTemplate("tpl.lm_menu.html", true, true, true);
00355
00356 $tpl_menu->setCurrentBlock("lm_menu_btn");
00357
00358
00359 if ($_POST["action"]=="details" && count($_POST["target"])==1)
00360 {
00361 $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]);
00362 $tpl_menu->setVariable("BTN_LINK",
00363 $this->ctrl->getLinkTargetByClass("illmpresentationgui", "exportbibinfo"));
00364 $tpl_menu->setVariable("BTN_TXT",$this->lng->txt("download"));
00365 $tpl_menu->parseCurrentBlock();
00366
00367 $this->ctrl->setParameterByClass("illmpresentationgui", "print", "1");
00368 $tpl_menu->setVariable("BTN_LINK",
00369 $this->ctrl->getLinkTargetByClass("illmpresentationgui", "exportbibinfo"));
00370 $tpl_menu->setVariable("BTN_TXT",$this->lng->txt("print"));
00371 $tpl_menu->parseCurrentBlock();
00372 $this->ctrl->clearParametersByClass("illmpresentationgui");
00373 }
00374 else
00375 {
00376
00377 $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]);
00378 $tpl_menu->setVariable("BTN_LINK",
00379 $this->ctrl->getLinkTargetByClass("illmpresentationgui", "offlineexportform"));
00380 $tpl_menu->setVariable("BTN_TXT",$this->lng->txt("download"));
00381 $tpl_menu->parseCurrentBlock();
00382
00383 $this->ctrl->setParameterByClass("illmpresentationgui", "print", "1");
00384 $tpl_menu->setVariable("BTN_LINK",
00385 $this->ctrl->getLinkTargetByClass("illmpresentationgui", "offlineexportform"));
00386 $tpl_menu->setVariable("BTN_TXT",$this->lng->txt("print") );
00387 $tpl_menu->parseCurrentBlock();
00388
00389 $this->ctrl->clearParametersByClass("illmpresentationgui");
00390 }
00391 $tpl_menu->setCurrentBlock("btn_row");
00392 $tpl_menu->parseCurrentBlock();
00393
00394 return $tpl_menu->get();
00395
00396 }
00397
00398 function properties()
00399 {
00400
00401 parent::properties();
00402
00403
00404 $this->tpl->setVariable("BTN1_NAME","addTranslation");
00405 $this->tpl->setVariable("BTN1_TEXT",$this->lng->txt("cont_new_assignment"));
00406
00407 if($trs = $this->object->getTranslations())
00408 {
00409 include_once "./classes/class.ilObjectFactory.php";
00410 foreach($trs as $tr)
00411 {
00412 $tmp_obj = ilObjectFactory::getInstanceByRefId($tr);
00413 $this->tpl->setCurrentBlock("TRANSLATION_ROW");
00414 $this->tpl->setVariable("ROW_ID",$tr);
00415 $this->tpl->setVariable("ROW_TITLE",$tmp_obj->getTitle());
00416 $this->tpl->parseCurrentBlock();
00417
00418 unset($tmp_obj);
00419 }
00420 $this->tpl->setVariable("BTN2_NAME","deleteTranslation");
00421 $this->tpl->setVariable("BTN2_TEXT",$this->lng->txt("cont_del_assignment"));
00422 }
00423 $this->tpl->setCurrentBlock("TRANSLATION");
00424 $this->tpl->setVariable("TRANSLATION_HEADER",$this->lng->txt("cont_translations"));
00425 $this->tpl->parseCurrentBlock();
00426 }
00427
00428 function addTranslation()
00429 {
00430 $this->setTabs();
00431
00432
00433 if(isset($_POST["cancel"]))
00434 {
00435 $this->ctrl->redirect($this, "properties");
00436 exit;
00437 }
00438 if(isset($_POST["select"]))
00439 {
00440 if(is_array($_POST["id"]))
00441 {
00442 foreach($_POST["id"] as $id)
00443 {
00444 if($id != $this->object->getRefId())
00445 {
00446 $this->object->addTranslation($id);
00447 }
00448 }
00449 sendInfo($this->lng->txt("cont_translations_assigned"),true);
00450 $this->ctrl->redirect($this, "properties");
00451 exit;
00452 }
00453 }
00454 $show_search = true;
00455
00456 $this->tpl->addBlockfile("ADM_CONTENT","adm_content","tpl.dbk_search_translation.html",true);
00457 $this->tpl->setVariable("F_ACTION",
00458 $this->ctrl->getLinkTarget($this, "addTranslation"));
00459
00460 if($_POST["search_str"])
00461 {
00462 $result = $this->searchTranslation($_POST["search_str"]);
00463
00464 switch(count($result["meta"]))
00465 {
00466 case 0:
00467 sendInfo($this->lng->txt("cont_no_object_found"));
00468 break;
00469 case 1:
00470 if($result["meta"][0]["id"] == $this->object->getRefId())
00471 {
00472 sendInfo($this->lng->txt("cont_no_assign_itself"));
00473 break;
00474 }
00475 default:
00476 $this->showTranslationSelect($result);
00477 $show_search = false;
00478 break;
00479 }
00480 }
00481 if($show_search)
00482 {
00483 $this->lng->loadLanguageModule("search");
00484
00485 $this->tpl->setVariable("SEARCH_TXT",$this->lng->txt("cont_insert_search"));
00486 $this->tpl->setVariable("SEARCH_ASSIGN_TR",$this->lng->txt("cont_assign_translation"));
00487 $this->tpl->setVariable("SEARCH_SEARCH_TERM",$this->lng->txt("search_search_term"));
00488 $this->tpl->setVariable("BTN1_VALUE",$this->lng->txt("search"));
00489 $this->tpl->setVariable("BTN2_VALUE",$this->lng->txt("cancel"));
00490 }
00491
00492 }
00493
00494 function deleteTranslation()
00495 {
00496 if(!$_POST["id"])
00497 {
00498 sendInfo($this->lng->txt("cont_select_one_translation"));
00499 $this->ctrl->redirect($this, "properties");
00500 exit;
00501 }
00502 $this->object->deleteTranslations($_POST["id"]);
00503 sendInfo($this->lng->txt("cont_assignments_deleted"));
00504 $this->ctrl->redirect($this, "properties");
00505 exit;
00506 }
00507
00508 function showTranslationSelect($a_result)
00509 {
00510 include_once "./classes/class.ilObjectFactory.php";
00511
00512 foreach($a_result["meta"] as $book)
00513 {
00514 if(!($path = $this->getContextPath($book["id"])))
00515 {
00516 continue;
00517 }
00518 $tmp_obj = ilObjectFactory::getInstanceByRefId($book["id"]);
00519
00520 $this->tpl->setCurrentBlock("TR_SELECT_ROW");
00521 $this->tpl->setVariable("ROW_ID",$book["id"]);
00522 $this->tpl->setVariable("ROW_TITLE",$tmp_obj->getTitle());
00523 $this->tpl->setVariable("ROW_DESCRIPTION",$tmp_obj->getDescription());
00524 $this->tpl->setVariable("ROW_KONTEXT",$path);
00525 $this->tpl->parseCurrentBlock();
00526
00527 unset($tmp_obj);
00528 }
00529 $this->tpl->setCurrentBlock("TR_SELECT");
00530 $this->tpl->setVariable("SELECT_TXT",$this->lng->txt("cont_select_translation"));
00531 $this->tpl->setVariable("SELECT_TITLE",$this->lng->txt("title"));
00532 $this->tpl->setVariable("SELECT_DESCRIPTION",$this->lng->txt("description"));
00533 $this->tpl->setVariable("SELECT_KONTEXT",$this->lng->txt("context"));
00534
00535 $this->tpl->setVariable("BTN1_VALUE",$this->lng->txt("assign"));
00536 $this->tpl->setVariable("BTN2_VALUE",$this->lng->txt("cancel"));
00537 $this->tpl->parseCurrentBlock();
00538
00539 }
00540
00541 function searchTranslation($a_search_str)
00542 {
00543 include_once("./classes/class.ilSearch.php");
00544
00545 $search =& new ilSearch($_SESSION["AccountId"]);
00546 $search->setPerformUpdate(false);
00547 $search->setSearchString($_POST["search_str"]);
00548 $search->setCombination("and");
00549 $search->setSearchFor(array(0 => 'dbk'));
00550 $search->setSearchIn(array('dbk' => 'meta'));
00551 $search->setSearchType('new');
00552
00553 if($search->validate($message))
00554 {
00555 $search->performSearch();
00556 }
00557 else
00558 {
00559 sendInfo($message,true);
00560 $this->ctrl->redirect($this, "addTranslation");
00561 exit;
00562 }
00563 return $search->getResultByType('dbk');
00564 }
00565
00566 function getContextPath($a_endnode_id, $a_startnode_id = 1)
00567 {
00568 $path = "";
00569
00570 include_once("./classes/class.ilTree.php");
00571
00572 $tree = new ilTree(1);
00573
00574 if(!$tree->isInTree($a_startnode_id) or !$tree->isInTree($a_endnode_id))
00575 {
00576 return '';
00577 }
00578 $tmpPath = $tree->getPathFull($a_endnode_id, $a_startnode_id);
00579
00580
00581 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
00582 {
00583 if ($path != "")
00584 {
00585 $path .= " > ";
00586 }
00587
00588 $path .= $tmpPath[$i]["title"];
00589 }
00590 return $path;
00591 }
00592
00593 function __checkCitationPost(&$message)
00594 {
00595 if(!$_POST["pgt_id"])
00596 {
00597 $message = "SELECT ONE<br />";
00598 return false;
00599 }
00600 return true;
00601 }
00602
00603 function __parseCitationPost()
00604 {
00605 if(!is_array($_POST["pgt_id"]))
00606 {
00607 return array();
00608 }
00609 foreach($_POST["pgt_id"] as $key => $id)
00610 {
00611 switch($_POST["ct_option"][$key])
00612 {
00613 case "single":
00614 $output[] = array("text" => $id,
00615 "start" => $key,
00616 "end" => $key);
00617 break;
00618 case "f":
00619 $output[] = array("text" => $id."f",
00620 "start" => $key,
00621 "end" => $key);
00622 break;
00623 case "ff":
00624 $output[] = array("text" => $id."ff",
00625 "start" => $key,
00626 "end" => $key);
00627 break;
00628 case "from":
00629 $start = $id."-";
00630 $start_v = $key;
00631 break;
00632 case "to":
00633 if($start)
00634 {
00635 $output[] = array("text" => $start."".$id,
00636 "start" => $start_v,
00637 "end" => $key);
00638 }
00639 unset($start);
00640 unset($start_v);
00641 break;
00642 }
00643 }
00644 return $output ? $output : array();
00645 }
00646
00647 function __applyCitationText($page_xml,$a_start,$a_end)
00648 {
00649 global $tpl;
00650
00651 return true;
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667 # var_dump("<pre>",htmlentities($page_xml),"</pre>");exit;
00668
00669 #$tmp_tpl = new ilTemplate("tpl.citation_paragraph.xsl",true,true,"content");
00670 #$xsl = $tmp_tpl->get();
00671
00672 $xsl = file_get_contents($tpl->tplPath."/tpl.citation_paragraph.xsl");
00673 $args = array( '/_xml' => $page_xml, '/_xsl' => $xsl );
00674 $xh = xslt_create();
00675 $params = array ('start_id' => $a_start,
00676 'end_id' => $a_end);
00677
00678 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
00679
00680 return $output;
00681 }
00682 }
00683
00684 ?>