5 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionTable.php');
6 require_once(
'./Services/COPage/classes/class.ilPageObjectGUI.php');
7 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecord.php');
8 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionField.php');
9 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinition.php');
34 $this->dcl_gui_object = $a_dcl_object;
36 $this->record_id =
$_GET[
'record_id'];
40 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
42 $tpl->setCurrentBlock(
"SyntaxStyle");
43 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
45 $tpl->parseCurrentBlock();
47 $tpl->setCurrentBlock(
"ContentStyle");
48 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
50 $tpl->parseCurrentBlock();
60 $cmd = $ilCtrl->getCmd();
87 $rctpl =
new ilTemplate(
"tpl.record_view.html",
true,
true,
"Modules/DataCollection");
89 $ilTabs->setTabActive(
"id_content");
94 $ilCtrl->redirectByClass(
"ildatacollectionrecordlistgui",
"listRecords");
98 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php");
100 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
104 $html = $pageObj->getHTML();
105 $rctpl->addCss(
"./Services/COPage/css/content.css");
106 $rctpl->fillCssFiles();
108 foreach($table->getFields() as $field)
111 $pattern =
'/\[dcliln field="'.preg_quote($field->getTitle(),
"/").
'"\](.*?)\[\/dcliln\]/';
112 if (preg_match($pattern,$html)) {
113 $html = preg_replace($pattern, $this->record_obj->getRecordFieldSingleHTML($field->getId(),$this->
setOptions(
"$1")), $html);
117 $pattern =
'/\[dclrefln field="'.preg_quote($field->getTitle(),
"/").
'"\](.*?)\[\/dclrefln\]/';
118 if (preg_match($pattern ,$html)) {
119 $this->currentField = $field;
120 $html = preg_replace_callback($pattern, array($this,
"doReplace"), $html);
123 $pattern =
'/\[ext tableOf="'.preg_quote($field->getTitle(),
"/").
'" field="(.*?)"\]/';
124 if (preg_match($pattern ,$html)) {
125 $this->currentField = $field;
126 $html = preg_replace_callback($pattern, array($this,
"doExtReplace"), $html);
129 $html = str_ireplace(
"[".$field->getTitle().
"]", $this->record_obj->getRecordFieldHTML($field->getId()), $html);
132 $rctpl->setVariable(
"CONTENT",$html);
135 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
137 $rctpl->setVariable(
"PERMA_LINK", $perma_link->getHTML());
140 $tpl->setContent($rctpl->get());
144 return $this->record_obj->getRecordFieldSingleHTML($this->currentField->getId(),$this->
setOptions($found[1]));
148 $ref_rec_ids = $this->record_obj->getRecordFieldValue($this->currentField->getId());
149 if(!is_array($ref_rec_ids))
150 $ref_rec_ids = array($ref_rec_ids);
151 if(!count($ref_rec_ids) || !$ref_rec_ids)
154 foreach($ref_rec_ids as $ref_rec_id)
156 $field = $ref_recs[0]->getTable()->getFieldByTitle($found[1]);
158 $tpl =
new ilTemplate(
"tpl.reference_list.html",
true,
true,
"Modules/DataCollection");
159 $tpl->setCurrentBlock(
"reference_list");
167 foreach($ref_recs as $ref_record){
168 $tpl->setCurrentBlock(
"reference");
169 $tpl->setVariable(
"CONTENT", $ref_record->getRecordFieldHTML($field->getId()));
170 $tpl->parseCurrentBlock();
185 $options[
'link'][
'display'] =
true;
186 $options[
'link'][
'name'] = $link_name;