ILIAS  release_8 Revision v8.24
ilDclFileuploadFieldModel Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilDclFileuploadFieldModel:
+ Collaboration diagram for ilDclFileuploadFieldModel:

Public Member Functions

 getRecordQuerySortObject (string $direction="asc", bool $sort_by_status=false)
 Returns a query-object for building the record-loader-sql-query. More...
 
 getRecordQueryFilterObject ( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
 Returns a query-object for building the record-loader-sql-query. More...
 
 getSupportedExtensions ()
 
 checkValidity ($value, ?int $record_id=null)
 
 getValidFieldProperties ()
 Returns all valid properties for a field-type. More...
 
 allowFilterInListView ()
 
- Public Member Functions inherited from ilDclBaseFieldModel
 __construct (int $a_id=0)
 
 setId ($a_id)
 Set field id. More...
 
 getId ()
 Get field id. More...
 
 setTableId (int $a_id)
 Set table id. More...
 
 getTableId ()
 Get table id. More...
 
 setTitle (string $a_title)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription (string $a_desc)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setDatatypeId (int $a_id)
 Set datatype id. More...
 
 getDatatypeId ()
 Get datatype_id. More...
 
 isUnique ()
 
 setUnique (?bool $unique)
 
 getDatatype ()
 
 getDatatypeTitle ()
 
 getPresentationTitle ()
 
 getPresentationDescription ()
 
 getStorageLocation ()
 Get storage location for the model. More...
 
 getExportable ()
 
 toArray ()
 
 isStandardField ()
 
 doRead ()
 
 buildFromDBRecord (array $rec)
 Builds model from db record. More...
 
 doCreate ()
 
 doUpdate ()
 
 updateProperties ()
 Update properties of this field in Database. More...
 
 doDelete ()
 Remove field and properties. More...
 
 getViewSettings ()
 
 getViewSetting (int $tableview_id)
 
 getOrder ()
 
 setOrder (string $order)
 
 hasProperty (string $key)
 Checks if a certain property for a field is set. More...
 
 getProperty (string $key)
 Returns a certain property of a field. More...
 
 getPropertyInstance (string $key)
 Return ActiveRecord of property. More...
 
 setProperty (string $key, $value)
 Set a property for a field (does not save) More...
 
 getValidFieldProperties ()
 Returns all valid properties for a field-type. More...
 
 checkValidityFromForm (ilPropertyFormGUI &$form, ?int $record_id=null)
 
 checkValidity ($value, ?int $record_id=null)
 Check if input is valid. More...
 
 cloneStructure (int $original_id)
 
 afterClone (array $records)
 
 cloneProperties (ilDclBaseFieldModel $originalField)
 
 setExportable (bool $exportable)
 
 allowFilterInListView ()
 
 getRecordQuerySortObject (string $direction="asc", bool $sort_by_status=false)
 Returns a query-object for building the record-loader-sql-query. More...
 
 getRecordQueryFilterObject ( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
 Returns a query-object for building the record-loader-sql-query. More...
 
 getSortField ()
 Returns the sort-field id. More...
 
 hasNumericSorting ()
 Set to true, when the sorting should be handled numerical. More...
 
 checkFieldCreationInput (ilPropertyFormGUI $form)
 Checks input of specific fields befor saving. More...
 
 getStorageLocationOverride ()
 
 setStorageLocationOverride (?int $storage_location_override)
 
 fillHeaderExcel (ilExcel $worksheet, int &$row, int &$col)
 
 checkTitlesForImport (array &$titles, array &$import_fields)
 
 storePropertiesFromForm (ilPropertyFormGUI $form)
 called when saving the 'edit field' form More...
 
 fillPropertiesForm (ilPropertyFormGUI &$form)
 called to fill the 'edit field' form More...
 
 isConfirmationRequired (ilPropertyFormGUI $form)
 called by ilDclFieldEditGUI when updating field properties if you overwrite this method, remember to also overwrite getConfirmationGUI More...
 
 getConfirmationGUI (ilPropertyFormGUI $form)
 called by ilDclFieldEditGUI if isConfirmationRequired returns true More...
 

Protected Member Functions

 parseSupportedExtensions (string $input_value)
 
- Protected Member Functions inherited from ilDclBaseFieldModel
 loadDatatype ()
 Load datatype for model. More...
 
 loadTableFieldSetting ()
 loadTableFieldSetting More...
 
 addToTableViews ()
 create ilDclTableViewFieldSettings for this field in each tableview More...
 
 updateTableFieldSetting ()
 update exportable and fieldorder More...
 
 loadProperties ()
 Get all properties of a field. More...
 
 normalizeValue ($value)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilDclBaseFieldModel
static _getTitleInvalidChars (bool $a_as_regex=true)
 All valid chars for filed titles. More...
 
static _getFieldIdByTitle (string $title, int $table_id)
 
- Data Fields inherited from ilDclBaseFieldModel
const PROP_LENGTH = "lenght"
 General properties. More...
 
const PROP_REGEX = "regex"
 
const PROP_REFERENCE = "table_id"
 
const PROP_URL = "url"
 
const PROP_TEXTAREA = "text_area"
 
const PROP_REFERENCE_LINK = "reference_link"
 
const PROP_WIDTH = "width"
 
const PROP_HEIGHT = "height"
 
const PROP_LEARNING_PROGRESS = "learning_progress"
 
const PROP_ILIAS_REFERENCE_LINK = "ILIAS_reference_link"
 
const PROP_N_REFERENCE = "multiple_selection"
 
const PROP_FORMULA_EXPRESSION = "expression"
 
const PROP_DISPLAY_COPY_LINK_ACTION_MENU = "display_action_menu"
 
const PROP_LINK_DETAIL_PAGE_TEXT = "link_detail_page_text"
 
const PROP_LINK_DETAIL_PAGE_MOB = "link_detail_page_mob"
 
const PROP_SUPPORTED_FILE_TYPES = "supported_file_types"
 
const PROP_PLUGIN_HOOK_NAME = "plugin_hook_name"
 
const EDIT_VIEW = 2
 
const EXPORTABLE_VIEW = 4
 
- Protected Attributes inherited from ilDclBaseFieldModel
string $id = ""
 
int $table_id = 0
 
string $title = ""
 
string $description = ""
 
int $datatypeId = 0
 
int $order = null
 
bool $unique = false
 
array $property = []
 
bool $exportable = false
 
ilDclDatatype $datatype = null
 
int $storage_location_override = null
 With this property the datatype-storage-location can be overwritten. More...
 
ilDBInterface $db
 
ilLanguage $lng
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilDclFileuploadFieldModel.php.

Member Function Documentation

◆ allowFilterInListView()

ilDclFileuploadFieldModel::allowFilterInListView ( )

Reimplemented from ilDclBaseFieldModel.

Reimplemented in ilDclMobFieldModel.

Definition at line 116 of file class.ilDclFileuploadFieldModel.php.

116 : bool
117 {
118 return false;
119 }

◆ checkValidity()

ilDclFileuploadFieldModel::checkValidity (   $value,
?int  $record_id = null 
)
Parameters
array | null$value
Exceptions
ilDclInputException$

Reimplemented from ilDclBaseFieldModel.

Definition at line 91 of file class.ilDclFileuploadFieldModel.php.

91 : bool
92 {
93 //Don't check empty values
94 if ($value == null || $value['size'] == 0) {
95 return true;
96 }
97
98 if ($this->isUnique()) {
99 $title = $value['name'];
100 $table = ilDclCache::getTableCache($this->getTableId());
101 foreach ($table->getRecords() as $record) {
102 if ($this->normalizeValue($record->getRecordFieldExportValue($this->getId())) == $this->normalizeValue($title) && ($record->getId() != $record_id || $record_id == 0)) {
104 }
105 }
106 }
107
108 return true;
109 }
static getTableCache(int $table_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilDclCache\getTableCache(), and ilDclInputException\UNIQUE_EXCEPTION.

+ Here is the call graph for this function:

◆ getRecordQueryFilterObject()

ilDclFileuploadFieldModel::getRecordQueryFilterObject (   $filter_value = "",
?ilDclBaseFieldModel  $sort_field = null 
)

Returns a query-object for building the record-loader-sql-query.

Reimplemented from ilDclBaseFieldModel.

Definition at line 45 of file class.ilDclFileuploadFieldModel.php.

49 global $DIC;
50 $ilDB = $DIC['ilDB'];
51
52 $join_str
53 = "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 = "
54 . $ilDB->quote($this->getId(), 'integer') . ") ";
55 $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) ";
56 $join_str .= "INNER JOIN object_data AS filter_object_data_{$this->getId()} ON (filter_object_data_{$this->getId()}.obj_id = filter_stloc_{$this->getId()}.value AND filter_object_data_{$this->getId()}.title LIKE "
57 . $ilDB->quote("%$filter_value%", 'text') . ") ";
58
59 $sql_obj = new ilDclRecordQueryObject();
60 $sql_obj->setJoinStatement($join_str);
61
62 return $sql_obj;
63 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

◆ getRecordQuerySortObject()

ilDclFileuploadFieldModel::getRecordQuerySortObject ( string  $direction = "asc",
bool  $sort_by_status = false 
)

Returns a query-object for building the record-loader-sql-query.

Parameters
bool$sort_by_statusThe specific sort object is a status field

Reimplemented from ilDclBaseFieldModel.

Definition at line 21 of file class.ilDclFileuploadFieldModel.php.

25 global $DIC;
26 $ilDB = $DIC['ilDB'];
27 $join_str
28 = "LEFT JOIN il_dcl_record_field AS sort_record_field_{$this->getId()} ON (sort_record_field_{$this->getId()}.record_id = record.id AND sort_record_field_{$this->getId()}.field_id = "
29 . $ilDB->quote($this->getId(), 'integer') . ") ";
30 $join_str .= "LEFT JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS sort_stloc_{$this->getId()} ON (sort_stloc_{$this->getId()}.record_field_id = sort_record_field_{$this->getId()}.id) ";
31 $join_str .= "LEFT JOIN object_data AS sort_object_data_{$this->getId()} ON (sort_object_data_{$this->getId()}.obj_id = sort_stloc_{$this->getId()}.value) ";
32 $select_str = " sort_object_data_{$this->getId()}.title AS field_{$this->getId()},";
33
34 $sql_obj = new ilDclRecordQueryObject();
35 $sql_obj->setSelectStatement($select_str);
36 $sql_obj->setJoinStatement($join_str);
37 $sql_obj->setOrderStatement("field_{$this->getId()} " . $direction);
38
39 return $sql_obj;
40 }

◆ getSupportedExtensions()

ilDclFileuploadFieldModel::getSupportedExtensions ( )

Definition at line 65 of file class.ilDclFileuploadFieldModel.php.

65 : array
66 {
68 return [];
69 }
70
72
73 return $this->parseSupportedExtensions($file_types);
74 }
hasProperty(string $key)
Checks if a certain property for a field is set.
getProperty(string $key)
Returns a certain property of a field.

References ilDclBaseFieldModel\PROP_SUPPORTED_FILE_TYPES.

◆ getValidFieldProperties()

ilDclFileuploadFieldModel::getValidFieldProperties ( )

Returns all valid properties for a field-type.

Reimplemented from ilDclBaseFieldModel.

Reimplemented in ilDclMobFieldModel.

Definition at line 111 of file class.ilDclFileuploadFieldModel.php.

111 : array
112 {
114 }

References ilDclBaseFieldModel\PROP_SUPPORTED_FILE_TYPES.

◆ parseSupportedExtensions()

ilDclFileuploadFieldModel::parseSupportedExtensions ( string  $input_value)
protected

Definition at line 76 of file class.ilDclFileuploadFieldModel.php.

76 : array
77 {
78 $supported_extensions = explode(",", $input_value);
79
80 $trim_function = function ($value) {
81 return trim(trim(strtolower($value)), ".");
82 };
83
84 return array_map($trim_function, $supported_extensions);
85 }

The documentation for this class was generated from the following file: