ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDclTextRecordFieldModel Class Reference

Class ilDclTextRecordFieldModel. More...

+ Inheritance diagram for ilDclTextRecordFieldModel:
+ Collaboration diagram for ilDclTextRecordFieldModel:

Public Member Functions

 setValueFromForm ($form)
 
 fillExcelExport (ilExcel $worksheet, &$row, &$col)
 
 addHiddenItemsToConfirmation (ilConfirmationGUI &$confirmation)
 
 getPlainText ()
 
 getExportValue ()
 
 getValueFromExcel ($excel, $row, $col)
 
 parseValue ($value)
 
 parseSortingValue ($value, $link=true)
 Returns sortable value for the specific field-types. More...
 
- Public Member Functions inherited from ilDclBaseRecordFieldModel
 __construct (ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
 
 doCreate ()
 Creates an Id and a database entry. More...
 
 doUpdate ()
 Update object in database. More...
 
 delete ()
 Delete record field in database. More...
 
 getValue ()
 
 getValueForRepresentation ()
 
 serializeData ($value)
 Serialize data before storing to db. More...
 
 deserializeData ($value)
 Deserialize data before applying to field. More...
 
 setValue ($value, $omit_parsing=false)
 Set value for record field. More...
 
 setValueFromForm ($form)
 
 parseExportValue ($value)
 Function to parse incoming data from form input value $value. More...
 
 getValueFromExcel ($excel, $row, $col)
 
 parseValue ($value)
 Function to parse incoming data from form input value $value. More...
 
 getExportValue ()
 
 fillExcelExport (ilExcel $worksheet, &$row, &$col)
 
 getPlainText ()
 
 getSortingValue ($link=true)
 
 addHiddenItemsToConfirmation (ilConfirmationGUI &$confirmation)
 
 parseSortingValue ($value, $link=true)
 Returns sortable value for the specific field-types. More...
 
 cloneStructure (ilDclBaseRecordFieldModel $old_record_field)
 
 afterClone ()
 
 getField ()
 
 getId ()
 
 getRecord ()
 
 getRecordRepresentation ()
 
 setRecordRepresentation ($record_representation)
 
 getFieldRepresentation ()
 
 setFieldRepresentation ($field_representation)
 

Additional Inherited Members

- Protected Member Functions inherited from ilDclBaseRecordFieldModel
 doRead ()
 Read object data from database. More...
 
 loadValue ()
 Load the value. More...
 
- Protected Attributes inherited from ilDclBaseRecordFieldModel
 $id
 
 $field
 
 $record
 
 $record_representation
 
 $field_representation
 
 $value
 
 $user
 
 $ctrl
 
 $db
 
 $lng
 

Detailed Description

Member Function Documentation

◆ addHiddenItemsToConfirmation()

ilDclTextRecordFieldModel::addHiddenItemsToConfirmation ( ilConfirmationGUI $confirmation)

Definition at line 49 of file class.ilDclTextRecordFieldModel.php.

References ilDclBaseRecordFieldModel\$value, ilConfirmationGUI\addHiddenItem(), ilDclBaseRecordFieldModel\getValue(), and ilDclBaseFieldModel\PROP_URL.

49  {
50  if ($this->field->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
51  $value = $this->getValue();
52  if (is_array($value)) {
53  $confirmation->addHiddenItem('field_'.$this->field->getId(), $value['link']);
54  $confirmation->addHiddenItem('field_'.$this->field->getId().'_title', $value['title']);
55  }
56  return;
57  }
58  parent::addHiddenItemsToConfirmation($confirmation);
59  }
addHiddenItem($a_post_var, $a_value)
Add hidden item.
+ Here is the call graph for this function:

◆ fillExcelExport()

ilDclTextRecordFieldModel::fillExcelExport ( ilExcel  $worksheet,
$row,
$col 
)
Parameters
$worksheet
$row
$col

Definition at line 29 of file class.ilDclTextRecordFieldModel.php.

References $row, ilDclBaseRecordFieldModel\$value, getExportValue(), ilDclBaseRecordFieldModel\getField(), ilDclBaseFieldModel\PROP_URL, and ilExcel\setCell().

29  {
30  $value = $this->getExportValue();
31 
32  if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
33  if (is_array($value)) {
34  $worksheet->setCell($row, $col, $value['link']);
35  $col++;
36  $worksheet->setCell($row, $col, $value['title']);
37  $col++;
38  } else {
39  $worksheet->setCell($row, $col, $value);
40  $col+= 2;
41  }
42  } else {
43  $worksheet->setCell($row, $col, $value);
44  $col++;
45  }
46  }
setCell($a_row, $a_col, $a_value)
Set cell value.
+ Here is the call graph for this function:

◆ getExportValue()

ilDclTextRecordFieldModel::getExportValue ( )
Returns
mixed|string

Definition at line 81 of file class.ilDclTextRecordFieldModel.php.

References ilDclBaseRecordFieldModel\$value, ilDclBaseRecordFieldModel\getField(), ilDclBaseRecordFieldModel\getValue(), and ilDclBaseFieldModel\PROP_URL.

Referenced by fillExcelExport().

81  {
82  $value = $this->getValue();
83 
84  // TODO: Handle line-breaks for excel
85  if (is_array($value) && !$this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
86  return $value['link'];
87  } else {
88  return $value;
89  }
90  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPlainText()

ilDclTextRecordFieldModel::getPlainText ( )
Returns
string

Definition at line 65 of file class.ilDclTextRecordFieldModel.php.

References ilDclBaseRecordFieldModel\$value, and ilDclBaseRecordFieldModel\getValue().

65  {
66  $value = $this->getValue();
67 
68  if (is_array($value)) {
69  if ($value['title']) {
70  return $value['title'];
71  }
72  return isset($value['link']) ? $value['link'] : '';
73  } else {
74  return $value;
75  }
76  }
+ Here is the call graph for this function:

◆ getValueFromExcel()

ilDclTextRecordFieldModel::getValueFromExcel (   $excel,
  $row,
  $col 
)

Definition at line 92 of file class.ilDclTextRecordFieldModel.php.

References $row, $title, ilDclBaseRecordFieldModel\$value, array, ilDclBaseRecordFieldModel\getField(), and ilDclBaseFieldModel\PROP_URL.

92  {
93  $value = parent::getValueFromExcel($excel, $row, $col);
94  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
95  $title = '';
96  if ($excel->getCell(1, $col+1) == $this->getField()->getTitle().'_title') {
97  $title = $excel->getCell($row, $col + 1);
98  }
99  $value = array('link' => $value, 'title' => $title);
100  }
101  return $value;
102  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ parseSortingValue()

ilDclTextRecordFieldModel::parseSortingValue (   $value,
  $link = true 
)

Returns sortable value for the specific field-types.

Parameters
$value
ilDclBaseRecordFieldModel$record_field
bool | true$link
Returns
int|string

Definition at line 122 of file class.ilDclTextRecordFieldModel.php.

References ilDclBaseRecordFieldModel\$value, ilDclBaseRecordFieldModel\getField(), and ilDclBaseFieldModel\PROP_URL.

122  {
123  if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
124  if (is_array($value)) {
125  return isset($value['title']) ? $value['title'] : $value['link'];
126  } else {
127  return $value;
128  }
129  } else {
130  return $value;
131  }
132  }
+ Here is the call graph for this function:

◆ parseValue()

ilDclTextRecordFieldModel::parseValue (   $value)

◆ setValueFromForm()

ilDclTextRecordFieldModel::setValueFromForm (   $form)
Parameters
$formilPropertyFormGUI

Definition at line 13 of file class.ilDclTextRecordFieldModel.php.

References ilDclBaseRecordFieldModel\$value, array, ilDclBaseRecordFieldModel\getField(), ilDclBaseRecordFieldModel\getId(), ilDclBaseFieldModel\PROP_URL, and ilDclBaseRecordFieldModel\setValue().

13  {
14  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
15  $value = array(
16  "link" => $form->getInput("field_" . $this->getField()->getId()),
17  "title" => $form->getInput("field_" . $this->getField()->getId() . '_title'));
18  } else {
19  $value = $form->getInput("field_" . $this->getField()->getId());
20  }
21  $this->setValue($value);
22  }
setValue($value, $omit_parsing=false)
Set value for record field.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

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