ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilDclMobRecordRepresentation Class Reference

Class ilDclMobRecordRepresentation. More...

+ Inheritance diagram for ilDclMobRecordRepresentation:
+ Collaboration diagram for ilDclMobRecordRepresentation:

Public Member Functions

 getHTML ($link=true)
 Outputs html of a certain field. More...
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
 getHTML ($link=true)
 Outputs html of a certain field. More...
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
- Public Member Functions inherited from ilDclBaseRecordRepresentation
 __construct (ilDclBaseRecordFieldModel $record_field)
 
 getFormGUI (ilPropertyFormGUI $formGUI)
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
 fillFormInput ($form)
 Fills the form with the value of a record. More...
 
 getHTML ($link=true)
 Outputs html of a certain field. More...
 
 getSingleHTML (array $options=null, $link=true)
 Returns data for single record view. More...
 
 getConfirmationHTML ()
 Returns data for confirmation list When returning false, attribute is ignored in list. More...
 
 fillRow (ilTemplate $tpl)
 Fills row with record data. More...
 
 getRecordField ()
 Get Record Field. More...
 
 getField ()
 Getter shortcut for field. More...
 
 getRecord ()
 Getter shortcut for record. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilDclBaseRecordRepresentation
 getFormInput ()
 Gets the value from from the record field. More...
 
- Protected Attributes inherited from ilDclBaseRecordRepresentation
 $record_field
 
 $lng
 
 $access
 
 $ctrl
 

Detailed Description

Member Function Documentation

◆ getHTML()

ilDclMobRecordRepresentation::getHTML (   $link = true)

Outputs html of a certain field.

Parameters
mixed$value
bool | true$link
Returns
string

Reimplemented from ilDclFileuploadRecordRepresentation.

Definition at line 20 of file class.ilDclMobRecordRepresentation.php.

21 {
22 $value = $this->getRecordField()->getValue();
23
24 // the file is only temporary uploaded. Still need to be confirmed before stored
25 if (is_array($value) && $_POST['ilfilehash']) {
26 $this->ctrl->setParameterByClass("ildclrecordlistgui", "ilfilehash", $_POST['ilfilehash']);
27 $this->ctrl->setParameterByClass("ildclrecordlistgui", "field_id", $this->getRecordField()->getField()->getId());
28
29 return '<a href="' . $this->ctrl->getLinkTargetByClass("ildclrecordlistgui", "sendFile") . '">' . $value['name'] . '</a>';
30 }
31
32 $mob = new ilObjMediaObject($value, false);
33 $med = $mob->getMediaItem('Standard');
34
35 if (!$med || $med->getLocation() == null) {
36 return "";
37 }
38
39 $field = $this->getRecordField()->getField();
40
41 $is_linked_field = $field->getProperty(ilDclBaseFieldModel::PROP_LINK_DETAIL_PAGE_TEXT);
42 $has_view = ilDclDetailedViewDefinition::isActive($_GET['tableview_id']);
43
44 if (in_array($med->getSuffix(), array('jpg', 'jpeg', 'png', 'gif'))) {
45 // Image
46 $dir = ilObjMediaObject::_getDirectory($mob->getId());
47 $width = (int) $field->getProperty(ilDclBaseFieldModel::PROP_WIDTH);
48 $height = (int) $field->getProperty(ilDclBaseFieldModel::PROP_HEIGHT);
49
50 $html = ilUtil::img(ilWACSignedPath::signFile($dir . "/" . $med->getLocation()), '', $width, $height);
51
52 if ($is_linked_field && $has_view && $link) {
53 $this->ctrl->setParameterByClass('ilDclDetailedViewGUI', 'record_id', $this->getRecordField()->getRecord()->getId());
54 $html = '<a href="' . $this->ctrl->getLinkTargetByClass("ilDclDetailedViewGUI", 'renderRecord') . '">' . $html . '</a>';
55 }
56 } else {
57 // Video/Audio
58 $mpl = new ilMediaPlayerGUI($med->getId(), '');
59 $mpl->setFile(ilObjMediaObject::_getURL($mob->getId()) . "/" . $med->getLocation());
60 $mpl->setMimeType($med->getFormat());
61 $mpl->setDisplayWidth((int) $field->getProperty(ilDclBaseFieldModel::PROP_WIDTH) . 'px');
62 $mpl->setDisplayHeight((int) $field->getProperty(ilDclBaseFieldModel::PROP_HEIGHT) . 'px');
63 $mpl->setVideoPreviewPic($mob->getVideoPreviewPic());
64 $html = $mpl->getPreviewHtml();
65
66 if ($is_linked_field && $has_view) {
67 $this->ctrl->setParameterByClass('ilDclDetailedViewGUI', 'record_id', $this->getRecordField()->getRecord()->getId());
68 $html = $html . '<a href="' . $this->ctrl->getLinkTargetByClass("ilDclDetailedViewGUI", 'renderRecord') . '">' . $this->lng->txt('details') . '</a>';
69 }
70 }
71
72 return $html;
73 }
$_GET["client_id"]
$_POST["username"]
User interface for media player.
Class ilObjMediaObject.
static _getDirectory($a_mob_id)
Get absolute directory.
static _getURL($a_mob_id)
get directory for files of media object (static)
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static signFile($path_to_file)
$html
Definition: example_001.php:87

References $_GET, $_POST, $html, ilObjMediaObject\_getDirectory(), ilObjMediaObject\_getURL(), ilDclBaseRecordRepresentation\getField(), ilDclBaseRecordRepresentation\getRecord(), ilDclBaseRecordRepresentation\getRecordField(), ilUtil\img(), ilDclDetailedViewDefinition\isActive(), ilDclBaseFieldModel\PROP_HEIGHT, ilDclBaseFieldModel\PROP_LINK_DETAIL_PAGE_TEXT, ilDclBaseFieldModel\PROP_WIDTH, and ilWACSignedPath\signFile().

+ Here is the call graph for this function:

◆ parseFormInput()

ilDclMobRecordRepresentation::parseFormInput (   $value)

function parses stored value to the variable needed to fill into the form for editing.

Parameters
$value
Returns
mixed

Reimplemented from ilDclFileuploadRecordRepresentation.

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

84 {
85 if (is_array($value)) {
86 return $value;
87 }
88
89 if (!ilObject2::_exists($value) || ilObject2::_lookupType($value, false) != "mob") {
90 return "";
91 }
92
93 return $value;
94 }
static _lookupType($a_id, $a_reference=false)
lookup object type
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public

References ilObject2\_exists(), and ilObject2\_lookupType().

+ Here is the call graph for this function:

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