ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilDclDetailedViewDefinition.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public const PARENT_TYPE = 'dclf';
24  protected int $table_id;
25 
29  public function getParentType(): string
30  {
31  return self::PARENT_TYPE;
32  }
33 
37  public function getAvailablePlaceholders(): array
38  {
39  $all = [];
40 
41  $tableview = new ilDclTableView($this->getId());
42  $table_id = $tableview->getTableId();
43  $objTable = ilDclCache::getTableCache($table_id);
44  $fields = $objTable->getRecordFields();
45  $standardFields = $objTable->getStandardFields();
46 
47  foreach ($fields as $field) {
48  $all[] = "[" . $field->getTitle() . "]";
49 
50  if ($field->getDatatypeId() == ilDclDatatype::INPUTFORMAT_REFERENCE) {
51  $all[] = '[dclrefln field="' . $field->getTitle() . '"][/dclrefln]';
52  }
53  }
54 
55  foreach ($standardFields as $field) {
56  $all[] = "[" . $field->getId() . "]";
57  }
58 
59  return $all;
60  }
61 
62  public static function exists(int $id): bool
63  {
64  return parent::_exists(self::PARENT_TYPE, $id);
65  }
66 
67  public static function isActive(int $id): bool
68  {
69  if (!parent::_exists(self::PARENT_TYPE, $id)) {
70  return false;
71  }
72  return parent::_lookupActive($id, self::PARENT_TYPE);
73  }
74 }
static getTableCache(int $table_id=null)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
getAvailablePlaceholders()
Get all placeholders for table id.