19 declare(strict_types=1);
41 return self::TYPE_TEXT;
69 $definition->setActiveLanguages($field_translations->getActivatedLanguages($this->getFieldId(),
true));
70 $definition->setDefaultLanguage($field_translations->getDefaultLanguage());
91 $this->multi = $a_value;
106 $this->
setMaxLength(isset($a_def[
"max"]) ? (
int) $a_def[
"max"] : null);
107 $this->
setMulti((
bool) ($a_def[self::KEY_MULTI] ??
false));
114 self::KEY_MULTI => $this->
isMulti()
144 bool $a_disabled =
false,
154 $max->setSuffix(
$lng->
txt(
"characters"));
155 $max->setMinValue(1);
156 $max->setMaxValue(4000);
161 $multi->setChecked($this->
isMulti());
165 $max->setDisabled(
true);
166 $multi->setDisabled(
true);
178 $this->
setMaxLength(($max !==
"" && $max !== null) ? (
int) $max : null);
189 $a_writer->
xmlElement(
'FieldValue', array(
"id" => self::KEY_MULTI), $this->
isMulti());
194 if ($a_key ===
"max") {
195 $this->
setMaxLength($a_value !==
"" ? (
int) $a_value : null);
197 if ($a_key === self::KEY_MULTI) {
207 $translations = $element->getTranslations();
208 $serialized_values = [];
209 foreach ($translations as $lang_key => $translation) {
210 $serialized_values[] = $lang_key . self::XML_SEPARATOR_TRANSLATION . $translation;
212 return implode(self::XML_SEPARATOR_TRANSLATIONS, $serialized_values);
221 if (strpos($a_cdata, self::XML_SEPARATOR_TRANSLATION) ===
false) {
222 $this->
getADT()->setText($a_cdata);
224 $this->
getADT()->setTranslation($record->getDefaultLanguage(), $a_cdata);
228 $translations = explode(self::XML_SEPARATOR_TRANSLATIONS, $a_cdata);
229 foreach ($translations as $translation) {
230 $parts = explode(self::XML_SEPARATOR_TRANSLATION, $translation);
238 public function importFromECS(
string $a_ecs_type, $a_value,
string $a_sub_id): bool
241 switch ($a_ecs_type) {
243 $value = implode(
',', (array) $a_value);
247 $value = (
int) $a_value;
251 $value = (string) $a_value;
256 $value = $a_value->{
'get' . ucfirst($a_sub_id)}();
261 if (trim((
string) $value)) {
262 $this->
getADT()->setText(is_null($value) ? null : (
string) $value);
271 $this->
logger->warning(
'Passed ' . get_class($a_bridge));
274 $a_bridge->setMulti($this->
isMulti());
279 return (
string) $a_adt_search->getADT()->getText();
286 $ilDB = $DIC->database();
291 foreach ($a_records as $record) {
292 if ($record[
"sub_type"] ==
"-") {
294 $obj_ids[$record[
"obj_id"]] = $record;
298 $sql =
"SELECT obj_id,type" .
299 " FROM object_data" .
300 " WHERE " .
$ilDB->in(
"obj_id", array_keys($obj_ids),
false,
"integer") .
301 " AND " .
$ilDB->in(
"type", $a_object_types,
false,
"text");
302 $set =
$ilDB->query($sql);
303 while ($row =
$ilDB->fetchAssoc($set)) {
304 $row[
"found"] = array();
305 foreach ($obj_ids[(
int) $row[
"obj_id"]] as $field => $value) {
306 if (substr($field, 0, 5) ==
"found") {
307 $row[
"found"][$field] = $value;
319 array $a_object_types,
321 string $a_search_type
338 if (isset($objects) && count($objects)) {
addCustomFieldToDefinitionForm(ilPropertyFormGUI $a_form, bool $a_disabled=false, string $language='')
Add input elements to definition form.
getFieldDefinitionForTableGUI(string $content_language)
getValueForXML(ilADT $element)
Representation of ECS EContent Time Place.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const XML_SEPARATOR_TRANSLATIONS
getADTDefinition()
Get ADT definition instance.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
addPropertiesToXML(ilXmlWriter $a_writer)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
searchObjects(ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, string $a_locate, string $a_search_type)
importXMLProperty(string $a_key, string $a_value)
const TYPE_LOCALIZED_TEXT
prepareElementForEditor(ilADTFormBridge $a_bridge)
static _getInstanceByRecordId(int $a_record_id)
Class ilADTLocalizedTextDBBridge.
getSQLCondition(string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
Get SQL condition for current value(s)
importFromECS(string $a_ecs_type, $a_value, string $a_sub_id)
getSearchQueryParserValue(ilADTSearchBridge $a_adt_search)
setMaxLength(?int $max_length)
static getInstanceByRecordId(int $record_id)
importValueFromXML(string $a_cdata)
getQuotedWords(bool $with_quotation=false)
importCustomDefinitionFormPostValues(ilPropertyFormGUI $a_form, string $language='')
Import custom post values from definition form.
importFieldDefinition(array $a_def)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parseSearchObjects(array $a_records, array $a_object_types)
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
ADT definition base class.
getRecordId()
Get record id.
getFieldId()
Get field_id.
const XML_SEPARATOR_TRANSLATION
static find(string $a_table, string $a_type, int $a_field_id, string $a_condition, ?string $a_additional_fields=null)
Find entries.