4 require_once
"Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php";
35 return self::TYPE_TEXT;
64 $definition->setActiveLanguages($field_translations->getActivatedLanguages($this->getFieldId(),
true));
65 $definition->setDefaultLanguage($field_translations->getDefaultLanguage());
81 if ($a_value !== null) {
82 $a_value = (int) $a_value;
84 $this->max_length = $a_value;
104 $this->multi = (bool) $a_value;
148 $res[
$lng->txt(
"md_adv_text_multi")] =
$lng->txt(
"yes");
169 $max->setSuffix(
$lng->txt(
"characters"));
170 $max->setMinValue(1);
171 $max->setMaxValue(4000);
180 $max->setDisabled(
true);
181 $multi->setDisabled(
true);
210 if ($a_key ==
"max") {
213 if ($a_key ==
"multi") {
214 $this->
setMulti($a_value !=
"" ? $a_value : null);
223 $translations = $element->getTranslations();
224 $serialized_values = [];
225 foreach ($translations as $lang_key => $translation) {
226 $serialized_values[] = $lang_key . self::XML_SEPARATOR_TRANSLATION . $translation;
228 return implode(self::XML_SEPARATOR_TRANSLATIONS, $serialized_values);
237 if (strpos($a_cdata, self::XML_SEPARATOR_TRANSLATION) ===
false) {
238 $this->
getADT()->setText($a_cdata);
242 $translations = explode(self::XML_SEPARATOR_TRANSLATIONS, $a_cdata);
243 foreach ($translations as $translation) {
244 $parts = explode(self::XML_SEPARATOR_TRANSLATION, $translation);
245 if ($parts ===
false) {
248 $this->
getADT()->setTranslation((
string) $parts[0], (
string) $parts[1]);
254 switch ($a_ecs_type) {
256 $value = implode(
',', (array) $a_value);
260 $value = (int) $a_value;
264 $value = (string) $a_value;
269 $value = $a_value->{
'get' . ucfirst($a_sub_id)}();
275 $this->
getADT()->setText($value);
284 $this->logger->warning(
'Passed ' . get_class($form));
287 $form->setMulti($this->
isMulti());
293 return $a_adt_search->getADT()->getText();
300 $ilDB = $DIC[
'ilDB'];
305 foreach ($a_records as $record) {
306 if ($record[
"sub_type"] ==
"-") {
308 $obj_ids[$record[
"obj_id"]] = $record;
312 $sql =
"SELECT obj_id,type" .
313 " FROM object_data" .
314 " WHERE " .
$ilDB->in(
"obj_id", array_keys($obj_ids),
"",
"integer") .
315 " AND " .
$ilDB->in(
"type", $a_object_types,
"",
"text");
316 $set =
$ilDB->query($sql);
317 while ($row =
$ilDB->fetchAssoc($set)) {
318 $row[
"found"] = array();
319 foreach ($obj_ids[$row[
"obj_id"]] as $field => $value) {
320 if (substr($field, 0, 5) ==
"found") {
321 $row[
"found"][$field] = $value;
344 include_once(
'Services/ADT/classes/ActiveRecord/class.ilADTActiveRecordByType.php');
357 if (isset($objects) && count($objects)) {
getFieldDefinitionForTableGUI(string $content_language)
getValueForXML(ilADT $element)
Representation of ECS EContent Time Place.
const XML_SEPARATOR_TRANSLATIONS
getQuotedWords($with_quotation=false)
getADTDefinition()
Get ADT definition instance.
setMulti($a_value)
Set multi-line.
getADT()
Get ADT instance.
addPropertiesToXML(ilXmlWriter $a_writer)
searchObjects(ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, $a_locate, $a_search_type)
Search.
addCustomFieldToDefinitionForm(ilPropertyFormGUI $a_form, $a_disabled=false, string $language='')
Add input elements to definition form.
static getInstance()
Get singleton.
const TYPE_LOCALIZED_TEXT
getMaxLength()
Get max length.
static find($a_table, $a_type, $a_field_id, $a_condition, $a_additional_fields=null)
Find entries.
Class ilADTLocalizedTextDBBridge.
foreach($_POST as $key=> $value) $res
getSearchQueryParserValue(ilADTSearchBridge $a_adt_search)
importValueFromXML($a_cdata)
importXMLProperty($a_key, $a_value)
static getInstanceByRecordId(int $record_id)
importCustomDefinitionFormPostValues(ilPropertyFormGUI $a_form, string $language='')
Import custom post values from definition form.
importFieldDefinition(array $a_def)
ADT search bridge base class.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
importFromECS($a_ecs_type, $a_value, $a_sub_id)
parseSearchObjects(array $a_records, array $a_object_types)
prepareElementForEditor(ilADTFormBridge $form)
getSQLCondition($a_element_id)
Get SQL condition for current value(s)
getRecordId()
Get record id.
getFieldId()
Get field_id.
const XML_SEPARATOR_TRANSLATION
setMaxLength($a_value)
Set max length.