ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDataCollectionRecordViewGUI Class Reference

Class ilDataCollectionRecordViewGUI. More...

+ Collaboration diagram for ilDataCollectionRecordViewGUI:

Public Member Functions

 __construct ($a_dcl_object)
executeCommand ()
 execute command
 renderRecord ()
 showRecord a_val =
 doReplace ($found)
 doExtReplace ($found)

Static Public Member Functions

static _getViewDefinitionId ($record_obj)

Protected Attributes

 $dcl_gui_object

Private Member Functions

 setOptions ($link_name)
 setOptions string $link_name

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionRecordViewGUI::__construct (   $a_dcl_object)

Definition at line 30 of file class.ilDataCollectionRecordViewGUI.php.

References $_GET, $tpl, ilObjStyleSheet\getContentStylePath(), ilDataCollectionCache\getRecordCache(), and ilObjStyleSheet\getSyntaxStylePath().

{
global $tpl;
$this->dcl_gui_object = $a_dcl_object;
$this->record_id = $_GET['record_id'];
$this->record_obj = ilDataCollectionCache::getRecordCache($this->record_id);
// content style (using system defaults)
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$tpl->setCurrentBlock("SyntaxStyle");
$tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("ContentStyle");
$tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilDataCollectionRecordViewGUI::_getViewDefinitionId (   $record_obj)
static
Parameters
$record_objilDataCollectionRecord
Returns
int|NULL returns the id of the viewdefinition if one is declared and NULL otherwise

Definition at line 74 of file class.ilDataCollectionRecordViewGUI.php.

References ilDataCollectionRecordViewViewdefinition\getIdByTableId().

Referenced by ilDataCollectionRecordListTableGUI\buildData(), and renderRecord().

{
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionRecordViewGUI::doExtReplace (   $found)

Definition at line 147 of file class.ilDataCollectionRecordViewGUI.php.

References $tpl, and ilDataCollectionCache\getRecordCache().

{
$ref_rec_ids = $this->record_obj->getRecordFieldValue($this->currentField->getId());
if(!is_array($ref_rec_ids))
$ref_rec_ids = array($ref_rec_ids);
if(!count($ref_rec_ids) || !$ref_rec_ids)
return;
$ref_recs = array();
foreach($ref_rec_ids as $ref_rec_id)
$ref_recs[] = ilDataCollectionCache::getRecordCache($ref_rec_id);
$field = $ref_recs[0]->getTable()->getFieldByTitle($found[1]);
$tpl = new ilTemplate("tpl.reference_list.html", true, true, "Modules/DataCollection");
$tpl->setCurrentBlock("reference_list");
if(!$field){
// if(ilObjDataCollection::_hasWriteAccess($this->dcl_gui_object->ref_id))
// ilUtil::sendInfo("Bad Viewdefinition at [ext tableOf=\"".$field->getTitle()."\" ...]", true);
return;
}
foreach($ref_recs as $ref_record){
$tpl->setCurrentBlock("reference");
$tpl->setVariable("CONTENT", $ref_record->getRecordFieldHTML($field->getId()));
$tpl->parseCurrentBlock();
}
//$ref_rec->getRecordFieldHTML($field->getId())
if($field)
return $tpl->get();
}

+ Here is the call graph for this function:

ilDataCollectionRecordViewGUI::doReplace (   $found)

Definition at line 143 of file class.ilDataCollectionRecordViewGUI.php.

References setOptions().

{
return $this->record_obj->getRecordFieldSingleHTML($this->currentField->getId(),$this->setOptions($found[1]));
}

+ Here is the call graph for this function:

& ilDataCollectionRecordViewGUI::executeCommand ( )

execute command

Definition at line 56 of file class.ilDataCollectionRecordViewGUI.php.

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$cmd = $ilCtrl->getCmd();
switch($cmd)
{
default:
$this->$cmd();
break;
}
}
ilDataCollectionRecordViewGUI::renderRecord ( )

showRecord a_val =

Definition at line 83 of file class.ilDataCollectionRecordViewGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, _getViewDefinitionId(), ilObjStyleSheet\getEffectiveContentStyleId(), ilDataCollectionCache\getTableCache(), and setOptions().

{
global $ilTabs, $tpl, $ilCtrl, $lng;
$rctpl = new ilTemplate("tpl.record_view.html", true, true, "Modules/DataCollection");
$ilTabs->setTabActive("id_content");
$view_id = self::_getViewDefinitionId($this->record_obj);
if(!$view_id){
$ilCtrl->redirectByClass("ildatacollectionrecordlistgui", "listRecords");
}
// see ilObjDataCollectionGUI->executeCommand about instantiation
include_once("./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php");
$pageObj = new ilDataCollectionRecordViewViewdefinitionGUI($this->record_obj->getTableId(), $view_id);
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$pageObj->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "dcl"));
$html = $pageObj->getHTML();
$rctpl->addCss("./Services/COPage/css/content.css");
$rctpl->fillCssFiles();
$table = ilDataCollectionCache::getTableCache($this->record_obj->getTableId());
foreach($table->getFields() as $field)
{
//ILIAS_Ref_Links
$pattern = '/\[dcliln field="'.preg_quote($field->getTitle(), "/").'"\](.*?)\[\/dcliln\]/';
if (preg_match($pattern,$html)) {
$html = preg_replace($pattern, $this->record_obj->getRecordFieldSingleHTML($field->getId(),$this->setOptions("$1")), $html);
}
//DataCollection Ref Links
$pattern = '/\[dclrefln field="'.preg_quote($field->getTitle(), "/").'"\](.*?)\[\/dclrefln\]/';
if (preg_match($pattern ,$html)) {
$this->currentField = $field;
$html = preg_replace_callback($pattern, array($this, "doReplace"), $html);
}
$pattern = '/\[ext tableOf="'.preg_quote($field->getTitle(), "/").'" field="(.*?)"\]/';
if (preg_match($pattern ,$html)) {
$this->currentField = $field;
$html = preg_replace_callback($pattern, array($this, "doExtReplace"), $html);
}
$html = str_ireplace("[".$field->getTitle()."]", $this->record_obj->getRecordFieldHTML($field->getId()), $html);
}
$rctpl->setVariable("CONTENT",$html);
//Permanent Link
include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
$perma_link = new ilPermanentLinkGUI("dcl", $_GET["ref_id"], "_".$_GET['record_id']);
$rctpl->setVariable("PERMA_LINK", $perma_link->getHTML());
$tpl->setContent($rctpl->get());
}

+ Here is the call graph for this function:

ilDataCollectionRecordViewGUI::setOptions (   $link_name)
private

setOptions string $link_name

Definition at line 182 of file class.ilDataCollectionRecordViewGUI.php.

Referenced by doReplace(), and renderRecord().

{
$options = array();
$options['link']['display'] = true;
$options['link']['name'] = $link_name;
return $options;
}

+ Here is the caller graph for this function:

Field Documentation

ilDataCollectionRecordViewGUI::$dcl_gui_object
protected

Definition at line 28 of file class.ilDataCollectionRecordViewGUI.php.


The documentation for this class was generated from the following file: