ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 
 getFormulaValue ()
 
 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 55 of file class.ilDclTextRecordFieldModel.php.

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

56  {
57  if ($this->field->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
58  $value = $this->getValue();
59  if (is_array($value)) {
60  $confirmation->addHiddenItem('field_' . $this->field->getId(), $value['link']);
61  $confirmation->addHiddenItem('field_' . $this->field->getId() . '_title', $value['title']);
62  }
63 
64  return;
65  }
66  parent::addHiddenItemsToConfirmation($confirmation);
67  }
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 34 of file class.ilDclTextRecordFieldModel.php.

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

35  {
36  $value = $this->getExportValue();
37 
38  if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
39  if (is_array($value)) {
40  $worksheet->setCell($row, $col, $value['link']);
41  $col++;
42  $worksheet->setCell($row, $col, $value['title']);
43  $col++;
44  } else {
45  $worksheet->setCell($row, $col, $value);
46  $col += 2;
47  }
48  } else {
49  $worksheet->setCell($row, $col, $value, DataType::TYPE_STRING);
50  $col++;
51  }
52  }
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
$row
+ Here is the call graph for this function:

◆ getExportValue()

ilDclTextRecordFieldModel::getExportValue ( )
Returns
mixed|string

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

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

Referenced by fillExcelExport().

93  {
94  $value = $this->getValue();
95 
96  // TODO: Handle line-breaks for excel
97  if (is_array($value) && !$this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
98  return $value['link'];
99  } else {
100  return $value;
101  }
102  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPlainText()

ilDclTextRecordFieldModel::getPlainText ( )
Returns
string

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

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

74  {
75  $value = $this->getValue();
76 
77  if (is_array($value)) {
78  if ($value['title']) {
79  return $value['title'];
80  }
81 
82  return isset($value['link']) ? $value['link'] : '';
83  } else {
84  return $value;
85  }
86  }
+ Here is the call graph for this function:

◆ getValueFromExcel()

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

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

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

106  {
107  $value = parent::getValueFromExcel($excel, $row, $col);
108  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
109  $title = '';
110  if ($excel->getCell(1, $col + 1) == $this->getField()->getTitle() . '_title') {
111  $title = $excel->getCell($row, $col + 1);
112  }
113  $value = array('link' => $value, 'title' => $title);
114  }
115 
116  return $value;
117  }
$row
+ 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 141 of file class.ilDclTextRecordFieldModel.php.

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

142  {
143  if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
144  if (is_array($value)) {
145  return isset($value['title']) ? $value['title'] : $value['link'];
146  } else {
147  return $value;
148  }
149  } else {
150  return $value;
151  }
152  }
+ Here is the call graph for this function:

◆ parseValue()

ilDclTextRecordFieldModel::parseValue (   $value)

◆ setValueFromForm()

ilDclTextRecordFieldModel::setValueFromForm (   $form)
Parameters
$formilPropertyFormGUI

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

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

17  {
18  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
19  $value = array(
20  "link" => $form->getInput("field_" . $this->getField()->getId()),
21  "title" => $form->getInput("field_" . $this->getField()->getId() . '_title'));
22  } else {
23  $value = $form->getInput("field_" . $this->getField()->getId());
24  }
25  $this->setValue($value);
26  }
setValue($value, $omit_parsing=false)
Set value for record field.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

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