19 declare(strict_types=1);
31 =
"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 = " 32 . $this->db->quote($this->
getId(),
'integer') .
") ";
33 $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 " 34 . $this->db->quote(
"%$filter_value%",
'text') .
") ";
37 $sql_obj->setJoinStatement($join_str);
50 'title' => $form->
getInput(
"field_" . $this->
getId() .
"_title"),
61 if (isset($value[
'link'])) {
62 $value = $value[
'link'];
63 $link = (substr($value, 0, 3) ===
'www') ?
'https://' . $value : $value;
64 if (!filter_var($link, FILTER_VALIDATE_URL) && !filter_var($link, FILTER_VALIDATE_EMAIL) && $link !=
'') {
69 return parent::checkValidity($value, $record_id);
72 protected function areEqual($value_1, $value_2): bool
74 return parent::areEqual($value_1[
'link'] ?? $value_1, $value_2[
'link'] ?? $value_2);
79 return parent::checkFieldCreationInput($form) && $this->
checkUniqueProp($form);
104 if (substr($regex, 0, 1) !=
"/") {
105 $regex =
"/" . $regex;
107 if (substr($regex, -1) !=
"/") {
112 $preg_match = preg_match($regex, $value);
117 if ($preg_match ===
false) {
123 public function strlen(
string $value,
string $encoding =
'UTF-8'):
int 126 case function_exists(
'mb_strlen'):
127 return mb_strlen($value, $encoding);
128 case function_exists(
'iconv_strlen'):
129 return iconv_strlen($value, $encoding);
137 parent::fillHeaderExcel($worksheet, $row, $col);
146 foreach ($titles as $k =>
$title) {
147 if (!mb_detect_encoding(
$title,
"UTF-8",
true) ==
"UTF-8") {
148 $title = mb_convert_encoding(
$title,
'UTF-8',
'ISO-8859-1');
151 $import_fields[$k] = $this;
153 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)
checkUniqueProp(ilPropertyFormGUI $form)
checkRegexAndLength(string $value)
checkFieldCreationInput(ilPropertyFormGUI $form)
checkValidityFromForm(ilPropertyFormGUI &$form, ?int $record_id)
getRecordQueryFilterObject( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
checkUnique($value, ?int $record_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const PROP_LINK_DETAIL_PAGE_TEXT
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
strlen(string $value, string $encoding='UTF-8')
checkValidity($value, ?int $record_id)
const PROP_LENGTH
General properties.
areEqual($value_1, $value_2)