49 $this->ui_factory = $DIC->ui()->factory();
50 $this->ui_renderer = $DIC->ui()->renderer();
55 $this->
setId(self::RECORD_LANGUAGE_TABLE_ID_PREFIX . (
string) $this->record->getRecordId());
63 $this->lng->loadLanguageModule(
'meta');
64 $this->
setTitle($this->lng->txt(
'md_adv_record_lng_table'));
67 $this->
addColumn($this->lng->txt(
'md_adv_record_lng_table_lng'), self::COL_LANGUAGE,
'25%');
68 $this->
addColumn($this->lng->txt(
'md_adv_record_lng_table_default'), self::COL_DEFAULT,
'25%');
69 $this->
addColumn($this->lng->txt(
'md_adv_record_lng_table_active'), self::COL_ACTIVE,
'25%');
70 $this->
addColumn($this->lng->txt(
'md_adv_record_lng_table_inst'), self::COL_INSTALLED,
'25%');
72 $this->
addMultiCommand(self::CMD_SAVE_ACTION,$this->lng->txt(
'md_adv_record_activate_languages'));
74 $this->
enable(
'select_all');
76 $this->
setRowTemplate(
'tpl.record_language_selection_row.html',
'Services/AdvancedMetaData');
80 $this->
setFormAction($this->ctrl->getFormAction($this->getParentObject()));
92 foreach ($all_languages as $language_code) {
95 $row[self::COL_LANGUAGE_CODE] = $language_code;
96 $row[self::COL_LANGUAGE] = $this->lng->txt(
'meta_l_' . $language_code);
97 $row[self::COL_INSTALLED] = in_array($language_code, $installed_languages);
98 if ($this->record_translation->isConfigured($language_code)) {
99 $row[self::COL_ACTIVE] =
true;
100 $translation = $this->record_translation->getTranslation($language_code);
101 $row[self::COL_DEFAULT] = ($translation->getLangKey() == $this->record->getDefaultLanguage());
104 $row[self::COL_ACTIVE] =
false;
105 $row[self::COL_DEFAULT] =
false;
116 $this->tpl->setVariable(
'VAL_ID', $row[self::COL_LANGUAGE_CODE]);
118 if ($row[self::COL_ACTIVE]) {
119 $this->tpl->setVariable(
'ACTIVATION_CHECKED',
'checked="checked"');
122 $this->tpl->setVariable(
'TXT_LANGUAGE', $row[self::COL_LANGUAGE]);
123 if ($row[self::COL_DEFAULT]) {
124 $this->tpl->setVariable(
'DEFAULT_CHECKED',
'checked="checked"');
126 if ($row[self::COL_ACTIVE]) {
127 $this->tpl->setVariable(
129 $this->ui_renderer->render(
130 $this->ui_factory->symbol()->glyph()->apply()
134 if ($row[self::COL_INSTALLED]) {
135 $this->tpl->setVariable(
137 $this->ui_renderer->render(
138 $this->ui_factory->symbol()->glyph()->apply()
150 $parsed_languages = [];
151 foreach ($languages as $language) {
152 $parsed_languages[] = $language[
'title'];
154 return $parsed_languages;
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
const RECORD_LANGUAGE_TABLE_ID_PREFIX
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
addMultiCommand($a_cmd, $a_text)
Add Command button.
enable($a_module_name)
enables particular modules of table
__construct(ilAdvancedMDRecord $record, $a_parent_obj, $a_parent_cmd="")
ilAdvancedMDRecordLanguageTableGUI constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct(Container $dic, ilPlugin $plugin)
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setMaxCount($a_max_count)
set max.
static _getInstalledLanguages()
Class ilAdvancedMDRecordLanguageTableGUI.
static getInstanceByRecordId(int $record_id)