2 require_once(
"./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldModel.php");
3 require_once (
'./Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordQueryObject.php');
4 require_once(
"./Modules/DataCollection/classes/Helpers/class.ilDclRecordQueryObject.php");
21 $join_str =
"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 = " 22 .
$ilDB->quote($this->
getId(),
'integer') .
") ";
23 $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 " 24 .
$ilDB->quote(
"%$filter_value%",
'text') .
") ";
27 $sql_obj->setJoinStatement($join_str);
40 return parent::getRecordQuerySortObject($direction, $sort_by_status);
51 if ($has_url_property) {
53 'link' => $form->
getInput(
"field_" . $this->getId()),
54 'title' => $form->
getInput(
"field_" . $this->getId() .
"_title")
58 parent::checkValidityFromForm($form, $record_id);
68 if ($has_url_property) {
81 foreach ($table->getRecords() as $record) {
83 $record_value = $record->getRecordFieldValue($this->
getId());
86 && ($record->getId() != $record_id
105 if (!is_array($value)) {
106 $value =
array(
'link' => $value,
'title' =>
'');
110 if (!$value[
'link']) {
117 $link = (substr($value[
'link'], 0, 3) ===
'www') ?
'http://' . $value[
'link'] : $value[
'link'];
118 if (! filter_var($link, FILTER_VALIDATE_URL) && ! filter_var($link, FILTER_VALIDATE_EMAIL) && $link !=
'') {
124 foreach ($table->getRecords() as $record) {
125 $record_value = $record->getRecordFieldValue($this->
getId());
127 if ($record_value == $value
128 && ($record->getId() != $record_id
148 $inputObj->setAlert(
$lng->txt(
"form_msg_value_too_high"));
171 if (substr($regex, 0, 1) !=
"/") {
172 $regex =
"/" . $regex;
174 if (substr($regex, - 1) !=
"/") {
186 $preg_match = preg_match($regex, $value);
187 }
catch (ErrorException $e) {
191 if ($preg_match ==
false) {
203 public function strlen($value, $encoding =
'UTF-8') {
205 case function_exists(
'mb_strlen'):
206 return mb_strlen($value, $encoding);
207 case function_exists(
'iconv_strlen'):
208 return iconv_strlen($value, $encoding);
215 parent::fillHeaderExcel($worksheet,
$row, $col);
227 foreach ($titles as $k =>
$title) {
232 $import_fields[$k] = $this;
234 unset($titles[$k+1]);
getValidFieldProperties()
Class ilDclBaseFieldModel.
checkRegexAndLength($value)
fillHeaderExcel(ilExcel $worksheet, &$row, &$col)
checkTitlesForImport(array &$titles, array &$import_fields)
Class ilDclRecordQueryObject.
checkValidity($value, $record_id=NULL)
checkFieldCreationInput(ilPropertyFormGUI $form)
static getTableCache($table_id=0)
getTableId()
Get table id.
const PROP_LINK_DETAIL_PAGE_TEXT
hasProperty($key)
Checks if a certain property for a field is set.
const PROP_LENGTH
General properties.
getRecordQueryFilterObject($filter_value="", ilDclBaseFieldModel $sort_field=null)
Create styles array
The data for the language used.
setCell($a_row, $a_col, $a_value)
Set cell value.
getProperty($key)
Returns a certain property of a field.
checkValidityOfURLField($value, $record_id)
strlen($value, $encoding='UTF-8')
Class ilDclTextRecordQueryObject.
checkValidityFromForm(ilPropertyFormGUI &$form, $record_id=NULL)
getRecordQuerySortObject($direction="asc", $sort_by_status=false)
Class ilDclTextFieldModel.
static isUtf8($a_str)
Check whether string is utf-8.