19 declare(strict_types=1);
43 return self::TYPE_TEXT;
71 $definition->setActiveLanguages($field_translations->getActivatedLanguages($this->getFieldId(),
true));
72 $definition->setDefaultLanguage($field_translations->getDefaultLanguage());
100 $this->multi = $a_value;
116 $this->
setMulti((
bool) ($a_def[self::KEY_MULTI] ??
false));
117 $multilingual_values = (bool) ($a_def[
'multilingual_values'] ??
true);
125 self::KEY_MULTI => $this->
isMulti(),
156 bool $a_disabled =
false,
167 $max->setSuffix(
$lng->
txt(
"characters"));
168 $max->setMinValue(1);
169 $max->setMaxValue(4000);
173 $multi->setValue(
"1");
174 $multi->setChecked($this->
isMulti());
178 $max->setDisabled(
true);
179 $multi->setDisabled(
true);
182 if (!count($record_translations->getTranslations())) {
186 $lng->
txt(
'md_adv_text_multi_val'),
189 $multilingual_values->setInfo(
$lng->
txt(
'md_adv_text_multi_val_info'));
191 $multilingual_values->setValue(
"1");
192 $a_form->
addItem($multilingual_values);
215 $a_writer->
xmlElement(
'FieldValue', array(
"id" => self::KEY_MULTI), $this->
isMulti());
221 if ($a_key ===
"max") {
224 if ($a_key === self::KEY_MULTI) {
227 if ($a_key ==
'multilingual_values') {
229 $a_value !=
'' ?
true :
false 239 $translations = $element->getTranslations();
240 $serialized_values = [];
241 foreach ($translations as $lang_key => $translation) {
242 $serialized_values[] = $lang_key . self::XML_SEPARATOR_TRANSLATION . $translation;
244 return implode(self::XML_SEPARATOR_TRANSLATIONS, $serialized_values);
253 if (strpos($a_cdata, self::XML_SEPARATOR_TRANSLATION) ===
false) {
254 $this->
getADT()->setText($a_cdata);
256 $this->
getADT()->setTranslation($record->getDefaultLanguage(), $a_cdata);
260 $translations = explode(self::XML_SEPARATOR_TRANSLATIONS, $a_cdata);
261 foreach ($translations as $translation) {
262 $parts = explode(self::XML_SEPARATOR_TRANSLATION, $translation);
270 public function importFromECS(
string $a_ecs_type, $a_value,
string $a_sub_id): bool
273 switch ($a_ecs_type) {
275 $value = implode(
',', (array) $a_value);
279 $value = (
int) $a_value;
283 $value = (string) $a_value;
288 $value = $a_value->{
'get' . ucfirst($a_sub_id)}();
293 if (trim((
string) $value)) {
294 $this->
getADT()->setText(is_null($value) ?
null : (
string) $value);
303 $this->
logger->warning(
'Passed ' . get_class($a_bridge));
306 $a_bridge->setMulti($this->
isMulti());
311 return (
string) $a_adt_search->getADT()->getText();
318 $ilDB = $DIC->database();
323 foreach ($a_records as $record) {
324 if ($record[
"sub_type"] ==
"-") {
326 $obj_ids[$record[
"obj_id"]] = $record;
330 $sql =
"SELECT obj_id,type" .
331 " FROM object_data" .
332 " WHERE " .
$ilDB->in(
"obj_id", array_keys($obj_ids),
false,
"integer") .
333 " AND " .
$ilDB->in(
"type", $a_object_types,
false,
"text");
334 $set =
$ilDB->query($sql);
335 while ($row =
$ilDB->fetchAssoc($set)) {
336 $row[
"found"] = array();
337 foreach ($obj_ids[(
int) $row[
"obj_id"]] as $field => $value) {
338 if (substr($field, 0, 5) ==
"found") {
339 $row[
"found"][$field] = $value;
351 array $a_object_types,
353 string $a_search_type
370 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)
searchObjects(ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, string $a_locate, string $a_search_type)
loadLanguageModule(string $a_module)
Load language module.
importXMLProperty(string $a_key, string $a_value)
const TYPE_LOCALIZED_TEXT
setMultilingualValueSupport(bool $multilingual_value_support)
prepareElementForEditor(ilADTFormBridge $a_bridge)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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)
ADT search bridge base class.
isMultilingualValueSupport()
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)
bool $multilingual_value_support
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.
static getInstanceByRecordId(int $record_id)