21 if ($this->
getField()->isMulti() && !is_array($this->value)) {
22 return array($this->value);
24 if (!$this->
getField()->isMulti() && is_array($this->value)) {
25 return (count($this->value) == 1) ? array_shift($this->value) :
'';
33 parent::setValueFromForm(
$form);
45 return is_array($values) ? implode(
"; ", $values) : $values;
60 $string = parent::getValueFromExcel($excel,
$row, $col);
64 $has_value = count($string);
66 $string = $this->getValueFromString($string);
70 if (!$has_value &&
$old) {
90 $delimiter = strpos($stringValues,
'; ') ?
'; ' :
', ';
91 $slicedStrings = explode(
$delimiter, $stringValues);
92 $slicedReferences =
array();
94 for (
$i = 0;
$i < count($slicedStrings);
$i++) {
97 $searchString = implode(array_slice($slicedStrings, $resolved,
$i - $resolved + 1));
98 if ($ref = $this->getValueFromString($searchString)) {
99 $slicedReferences[] = $ref;
106 $searchString = $slicedStrings[
$i];
107 if ($ref = $this->getValueFromString($searchString)) {
108 $slicedReferences[] = $ref;
113 return $slicedReferences;
124 protected function getValueFromString($string)
129 if ($opt->getValue() == $string) {
130 return $opt->getOptId();
static getValues($field_id, $opt_ids)
Class ilDclBaseFieldModel.
getMultipleValuesFromString($stringValues)
Copied from reference field and slightly adjusted.
Class ilDclSelectionRecordFieldModel.
if(isset($_POST['submit'])) $form
Create styles array
The data for the language used.
const PROP_SELECTION_TYPE
const PROP_SELECTION_OPTIONS
static getExcelCharForInteger($int)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
getValueFromExcel($excel, $row, $col)