ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 52 of file class.ilDclTextRecordFieldModel.php.

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

53  {
54  if ($this->field->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
55  $value = $this->getValue();
56  if (is_array($value)) {
57  $confirmation->addHiddenItem('field_' . $this->field->getId(), $value['link']);
58  $confirmation->addHiddenItem('field_' . $this->field->getId() . '_title', $value['title']);
59  }
60  return;
61  }
62  parent::addHiddenItemsToConfirmation($confirmation);
63  }
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
ilExcel$worksheet
$row
$col
Exceptions
PHPExcel_Exception

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

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

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

◆ getExportValue()

ilDclTextRecordFieldModel::getExportValue ( )
Returns
mixed|string

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

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

Referenced by fillExcelExport().

87  {
88  $value = $this->getValue();
89 
90  // TODO: Handle line-breaks for excel
91  if (is_array($value) && !$this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
92  return $value['link'];
93  } else {
94  return $value;
95  }
96  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPlainText()

ilDclTextRecordFieldModel::getPlainText ( )
Returns
string

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

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

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

◆ getValueFromExcel()

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

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

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

99  {
100  $value = parent::getValueFromExcel($excel, $row, $col);
101  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
102  $title = '';
103  if ($excel->getCell(1, $col+1) == $this->getField()->getTitle() . '_title') {
104  $title = $excel->getCell($row, $col + 1);
105  }
106  $value = array('link' => $value, 'title' => $title);
107  }
108  return $value;
109  }
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 130 of file class.ilDclTextRecordFieldModel.php.

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

131  {
132  if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
133  if (is_array($value)) {
134  return isset($value['title']) ? $value['title'] : $value['link'];
135  } else {
136  return $value;
137  }
138  } else {
139  return $value;
140  }
141  }
+ 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 $form, ilDclBaseRecordFieldModel\$value, array, ilDclBaseRecordFieldModel\getField(), ilDclBaseRecordFieldModel\getId(), ilDclBaseFieldModel\PROP_URL, and ilDclBaseRecordFieldModel\setValue().

14  {
15  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
16  $value = array(
17  "link" => $form->getInput("field_" . $this->getField()->getId()),
18  "title" => $form->getInput("field_" . $this->getField()->getId() . '_title'));
19  } else {
20  $value = $form->getInput("field_" . $this->getField()->getId());
21  }
22  $this->setValue($value);
23  }
setValue($value, $omit_parsing=false)
Set value for record field.
if(isset($_POST['submit'])) $form
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: