19 declare(strict_types=1);
    27     public const ID = 
'adv_md_records_tbl';
    36         $a_in_object_type_context = 
""    38         $this->permissions = $a_permissions;
    39         $this->in_object_type_context = $a_in_object_type_context;
    41         $this->
setId(self::ID);
    44         $this->
addColumn($this->
lng->txt(
'md_adv_col_presentation_ordering'), 
'position');
    47         $this->
addColumn($this->
lng->txt(
'md_adv_scope'), 
'first_scope');
    49         $this->
addColumn($this->
lng->txt(
'md_adv_active'), 
'active');
    54         $this->
setRowTemplate(
"tpl.show_records_row.html", 
"Services/AdvancedMetaData");
    62         if ($a_field == 
'position') {
    65         return parent::numericOrdering($a_field);
    68     protected function fillRow(array $a_set): void
    73         if ($this->in_object_type_context === 
"") {
    76                 0 => $this->
lng->txt(
"meta_obj_type_inactive"),
    77                 1 => $this->
lng->txt(
"meta_obj_type_mandatory"),
    78                 2 => $this->
lng->txt(
"meta_obj_type_optional")
    83                 0 => $this->
lng->txt(
"meta_obj_type_inactive"),
    84                 1 => $this->
lng->txt(
"meta_obj_type_active")
    98             if ($obj_type[
"obj_type"] == 
"prtf" && $obj_type[
"sub_type"] == 
"pfpg") {
   102             if ($obj_type[
"obj_type"] == 
"tals" && $obj_type[
"sub_type"] == 
"etal") {
   107             foreach ($a_set[
'obj_types'] as $t) {
   108                 if ($obj_type[
"obj_type"] == $t[
"obj_type"] &&
   109                     $obj_type[
"sub_type"] == $t[
"sub_type"]) {
   111                     $value = $t[
"optional"]
   115                     if (!$a_set[
"local"] && $a_set[
"readonly"]) {
   123                         $value = (isset($a_set[
"local_selected"][$obj_type[
"obj_type"]]) &&
   124                             in_array($obj_type[
"sub_type"], $a_set[
"local_selected"][$obj_type[
"obj_type"]]))
   134             if ($this->in_object_type_context !== 
"" && $this->in_object_type_context !== $obj_type[
"obj_type"]) {
   140             if ($this->in_object_type_context !== 
"" && !$a_set[
"local"] && !$assigned) {
   145                 $this->tpl->setCurrentBlock(
'ass_obj_types');
   146                 $this->tpl->setVariable(
'VAL_OBJ_TYPE', $obj_type[
"text"]);
   148                 $type_options = $options;
   149                 switch ($obj_type[
"obj_type"]) {
   152                         unset($type_options[1]);
   156                         unset($type_options[2]);
   161                     "obj_types[" . $a_set[
'id'] . 
"][" . $obj_type[
"obj_type"] . 
":" . $obj_type[
"sub_type"] . 
"]",
   167                     array(
"style" => 
"min-width:125px"),
   168                     $disabled || $do_disable
   170                 $this->tpl->setVariable(
'VAL_OBJ_TYPE_CLASS', $hidden ? 
'hidden' : 
'std');
   171                 $this->tpl->setVariable(
'VAL_OBJ_TYPE_STATUS', $select);
   172                 $this->tpl->parseCurrentBlock();
   175                 $this->tpl->setCurrentBlock(
'ass_obj_only');
   176                 $this->tpl->setVariable(
'VAL_OBJ_TYPE', $obj_type[
"text"]);
   177                 $this->tpl->parseCurrentBlock();
   182         if (!$a_set[
'local'] && count($record->getScopeRefIds())) {
   183             $this->tpl->setCurrentBlock(
'scope_txt');
   184             $this->tpl->setVariable(
'LOCAL_OR_GLOBAL', $this->
lng->txt(
'md_adv_scope_list_header'));
   185             $this->tpl->parseCurrentBlock();
   187             foreach ($record->getScopeRefIds() as 
$ref_id) {
   188                 $this->tpl->setCurrentBlock(
'scope_entry');
   189                 $this->tpl->setVariable(
'LINK_HREF', ilLink::_getLink(
$ref_id));
   191                 $this->tpl->parseCurrentBlock();
   194             $this->tpl->setCurrentBlock(
'scope_txt');
   195             $this->tpl->setVariable(
   197                 $a_set[
'local'] ? $this->
lng->txt(
'meta_local') : $this->
lng->txt(
'meta_global')
   199             $this->tpl->parseCurrentBlock();
   202         if (!$a_set[
"readonly"] || $a_set[
"local"]) {
   203             $this->tpl->setCurrentBlock(
'check_bl');
   204             $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
   205             $this->tpl->parseCurrentBlock();
   208         $this->tpl->setVariable(
'R_ID', $a_set[
'id']);
   209         $this->tpl->setVariable(
'VAL_POS', $a_set[
'position']);
   210         $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
   211         if (strlen($a_set[
'description'])) {
   212             $this->tpl->setVariable(
'VAL_DESCRIPTION', $a_set[
'description']);
   216             $this->tpl->setVariable(
'TXT_FIELDS', $this->
lng->txt(
'md_adv_no_fields'));
   218         foreach ($defs as $definition_obj) {
   219             $this->tpl->setCurrentBlock(
'field_entry');
   220             $this->tpl->setVariable(
'FIELD_NAME', $definition_obj->getTitle() .
   221                 ": " . $this->
lng->txt($definition_obj->getTypeTitle()));
   222             $this->tpl->parseCurrentBlock();
   225         $this->tpl->setVariable(
'ACTIVE_CHECKED', $a_set[
'active'] ? 
' checked="checked" ' : 
'');
   226         $this->tpl->setVariable(
'ACTIVE_ID', $a_set[
'id']);
   228         if (($a_set[
"readonly"]) ||
   230             $this->tpl->setVariable(
'ACTIVE_DISABLED', 
'disabled="disabled"');
   233         if (!$a_set[
"readonly"]) {
   234             $this->
ctrl->setParameter($this->parent_obj, 
'record_id', $a_set[
'id']);
   237                 $this->tpl->setVariable(
'EDIT_LINK', $this->
ctrl->getLinkTarget($this->parent_obj, 
'editRecord'));
   238                 $this->tpl->setVariable(
'TXT_EDIT_RECORD', $this->
lng->txt(
'edit'));
   241                 $this->tpl->setVariable(
   243                     $this->
ctrl->getLinkTarget($this->parent_obj, 
'editFields')
   245                 $this->tpl->setVariable(
'TXT_EDIT_FIELDS', $this->
lng->txt(
'md_adv_field_table'));
 const ACTION_RECORD_EDIT_PROPERTY
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
static _getAssignableObjectTypes(bool $a_include_text=false)
Get assignable object type  public. 
 
__construct( $a_parent_obj, $a_parent_cmd, ilAdvancedMDPermissionHelper $a_permissions, $a_in_object_type_context="")
 
static getInstancesByRecordId( $a_record_id, $a_only_searchable=false, string $language='')
Get definitions by record id. 
 
static _lookupObjId(int $ref_id)
 
static _getInstanceByRecordId(int $a_record_id)
 
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector. 
 
Advanced metadata permission helper. 
 
static _lookupTitle(int $obj_id)
 
setDefaultOrderField(string $a_defaultorderfield)
 
const SUBACTION_RECORD_OBJECT_TYPES
 
const ACTION_RECORD_TOGGLE_ACTIVATION
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
setDefaultOrderDirection(string $a_defaultorderdirection)
 
const ACTION_RECORD_EDIT_FIELDS
 
ilAdvancedMDPermissionHelper $permissions
 
string $in_object_type_context
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
numericOrdering(string $a_field)