ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilDataCollectionTreePickInputGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Form/classes/class.ilCustomInputGUI.php");
5 include_once("./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
6 
22 
23  private $customHTML;
27  private $title_input;
28 
32  private $search_input;
33 
37  protected $lng;
38 
39  public function __construct($title, $post_var){
40  global $lng;
41  parent::__construct($title, $post_var);
42  $this->title_input = new ilTextInputGUI($this->getTitle(), "display_".$this->getPostVar());
43  $this->title_input->setDisabled(true);
44  $this->title_input->setInfo($lng->txt("dcl_ilias_refere nce_info"));
45  $this->search_input = new ilTextInputGUI($this->getTitle(), "search_".$this->getPostVar());
46  $this->search_input->setDisabled(false);
47  $this->search_input->setInfo($lng->txt('dcl_ilias_reference_info'));
48  $this->hidden_input = new ilHiddenInputGUI($this->getPostVar());
49  $this->lng = $lng;
50  }
51 
52  public function getHtml(){
53  global $ilCtrl;
54  $tpl = new ilTemplate("tpl.dcl_tree.html", true, true, "Modules/DataCollection");
55  $tpl->setVariable("FIELD_ID", $this->getPostVar());
56  $tpl->setVariable("AJAX_LINK", $ilCtrl->getLinkTargetByClass("ildatacollectionrecordeditgui", "searchObjects"));
57  $tpl->setVariable("LOADER_PATH", ilUtil::getImagePath("loader.gif"));
58 
59  return $this->title_input->getToolbarHTML()."<br /><br />".$this->search_input->getTableFilterHTML().$this->hidden_input->getToolbarHTML()." <a href='#' id='search_button_".$this->getPostVar()."'>" . $this->lng->txt('search') . "</a>".$tpl->get();
60  }
61 
62  public function setValueByArray($value){
64  include_once './Services/Tree/classes/class.ilPathGUI.php';
65  $path = new ilPathGUI();
66  $reference = $value[$this->getPostVar()];
67  if($reference){
68  $pathString = $path->getPath(ROOT_FOLDER_ID, $reference);
69  $id = ilObject::_lookupObjId($reference);
70  $this->title_input->setValue($pathString." > ".ilObject::_lookupTitle($id));
71  $this->hidden_input->setValue($reference);
72  }
73  }
74 
75 }
76 
77 ?>