ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilBibliographicDetailsGUI.php
Go to the documentation of this file.
1 <?php
2 
3 require_once "./Modules/Bibliographic/classes/class.ilBibliographicEntry.php";
4 
10 {
16  public function showDetails(ilObjBibliographic $bibl_obj)
17  {
18  global $tpl, $ilTabs, $ilCtrl, $lng;
19 
20  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
21  $form = new ilPropertyFormGUI();
22 
23 
24  $ilTabs->clearTargets();
25  $ilTabs->setBackTarget("back", $ilCtrl->getLinkTarget($this, 'showContent'));
26 
27  $form->setTitle($lng->txt('detail_view'));
28 
29 
30  $entry = new ilBibliographicEntry($bibl_obj->getFiletype(), $_GET['entryId']);
31  $attributes = $entry->getAttributes();
32 
33  //translate array key in order to sort by those keys
34  foreach($attributes as $key => $attribute)
35  {
36  //Check if there is a specific language entry
37  if($lng->exists($key))
38  {
39  $strDescTranslated = $lng->txt($key);
40  }
41  //If not: get the default language entry
42  else
43  {
44  $arrKey = explode("_",$key);
45  $strDescTranslated = $lng->txt($arrKey[0]."_default_".$arrKey[2]);
46  }
47  unset($attributes[$key]);
48  $attributes[$strDescTranslated] = $attribute;
49  }
50 
51  // sort attributes alphabetically by their array-key
52  ksort($attributes, SORT_STRING);
53 
54  // render attributes to html
55  foreach($attributes as $key => $attribute)
56  {
57  $ci = new ilCustomInputGUI($key);
58  $ci->setHtml($attribute);
59  $form->addItem($ci);
60  }
61 
62  // set content and title
63  $tpl->setContent($form->getHTML());
64 
65  //Permanent Link
66  $tpl->setPermanentLink("bibl", $bibl_obj->getRefId(),"_".$_GET['entryId']);
67 
68  }
69 
70 
71 
72 }
73 
74 ?>