18 declare(strict_types=1);
30 =
"INNER JOIN il_dcl_record_field AS filter_record_field_{$this->getId()} ON (filter_record_field_{$this->getId()}.record_id = record.id AND filter_record_field_{$this->getId()}.field_id = " 31 . $this->db->quote($this->
getId(),
'integer') .
") ";
32 $join_str .=
"INNER JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS filter_stloc_{$this->getId()} ON (filter_stloc_{$this->getId()}.record_field_id = filter_record_field_{$this->getId()}.id AND filter_stloc_{$this->getId()}.value LIKE " 33 . $this->db->quote(
"%$filter_value%",
'text') .
") ";
36 $sql_obj->setJoinStatement($join_str);
46 'title' => $form->
getInput(
"field_" . $this->
getId() .
"_title"),
56 if (isset($value[
'link'])) {
57 $value = $value[
'link'];
58 $link = (substr($value, 0, 3) ===
'www') ?
'https://' . $value : $value;
59 if (!filter_var($link, FILTER_VALIDATE_URL) && !filter_var($link, FILTER_VALIDATE_EMAIL) && $link !=
'') {
64 return parent::checkValidity($value, $record_id);
67 protected function areEqual($value_1, $value_2): bool
69 return parent::areEqual($value_1[
'link'] ?? $value_1, $value_2[
'link'] ?? $value_2);
77 $inputObj->setAlert($this->
lng->txt(
"form_msg_value_too_high"));
108 if (substr($regex, 0, 1) !=
"/") {
109 $regex =
"/" . $regex;
111 if (substr($regex, -1) !=
"/") {
116 $preg_match = preg_match($regex, $value);
121 if ($preg_match ===
false) {
127 public function strlen(
string $value,
string $encoding =
'UTF-8'):
int 130 case function_exists(
'mb_strlen'):
131 return mb_strlen($value, $encoding);
132 case function_exists(
'iconv_strlen'):
133 return iconv_strlen($value, $encoding);
141 parent::fillHeaderExcel($worksheet, $row, $col);
150 foreach ($titles as $k =>
$title) {
151 if (!mb_detect_encoding(
$title,
"UTF-8",
true) ==
"UTF-8") {
152 $title = mb_convert_encoding(
$title,
'UTF-8',
'ISO-8859-1');
155 $import_fields[$k] = $this;
157 unset($titles[$k + 1]);
getValidFieldProperties()
hasProperty(string $key)
Checks if a certain property for a field is set.
fillHeaderExcel(ilExcel $worksheet, int &$row, int &$col)
checkTitlesForImport(array &$titles, array &$import_fields)
checkRegexAndLength(string $value)
checkFieldCreationInput(ilPropertyFormGUI $form)
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
getRecordQueryFilterObject( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
checkValidity($value, ?int $record_id=null)
const PROP_LINK_DETAIL_PAGE_TEXT
strlen(string $value, string $encoding='UTF-8')
const PROP_LENGTH
General properties.
checkValidityFromForm(ilPropertyFormGUI &$form, ?int $record_id=null)
areEqual($value_1, $value_2)