ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\LearningModule\Table\SubObjectRetrieval Class Reference
+ Inheritance diagram for ILIAS\LearningModule\Table\SubObjectRetrieval:
+ Collaboration diagram for ILIAS\LearningModule\Table\SubObjectRetrieval:

Public Member Functions

 __construct (protected \ilLMTree $lm_tree, protected $type="", protected $current_node=0, protected $transl="")
 
 getChildTitle (array $child)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter=[], array $parameters=[])
 

Protected Member Functions

 getChilds ()
 

Protected Attributes

ilLanguage $lng
 
ILIAS UI Factory $f
 
array $childs = null
 

Detailed Description

Definition at line 26 of file SubObjectRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LearningModule\Table\SubObjectRetrieval::__construct ( protected \ilLMTree  $lm_tree,
protected  $type = "",
protected  $current_node = 0,
protected  $transl = "" 
)

Definition at line 32 of file SubObjectRetrieval.php.

References $DIC, and ILIAS\Repository\lng().

37  {
38  global $DIC;
39  $this->f = $DIC->ui()->factory();
40  $this->lng = $DIC->language();
41  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ count()

ILIAS\LearningModule\Table\SubObjectRetrieval::count ( array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\LearningModule\Table\RetrievalInterface.

Definition at line 118 of file SubObjectRetrieval.php.

References ILIAS\LearningModule\Table\SubObjectRetrieval\getChilds().

121  : int {
122  return count($this->getChilds());
123  }
count(array $filter=[], array $parameters=[])
+ Here is the call graph for this function:

◆ getChilds()

ILIAS\LearningModule\Table\SubObjectRetrieval::getChilds ( )
protected

Definition at line 52 of file SubObjectRetrieval.php.

References ILIAS\LearningModule\Table\SubObjectRetrieval\$childs.

Referenced by ILIAS\LearningModule\Table\SubObjectRetrieval\count(), and ILIAS\LearningModule\Table\SubObjectRetrieval\getData().

52  : array
53  {
54  $current_node = ($this->current_node > 0)
55  ? $this->current_node
56  : $this->lm_tree->readRootId();
57  if (is_null($this->childs)) {
58  $this->childs = $this->lm_tree->getChildsByType($current_node, $this->type);
59  }
60  return $this->childs;
61  }
+ Here is the caller graph for this function:

◆ getChildTitle()

ILIAS\LearningModule\Table\SubObjectRetrieval::getChildTitle ( array  $child)

Definition at line 43 of file SubObjectRetrieval.php.

Referenced by ILIAS\LearningModule\Table\SubObjectRetrieval\getData().

43  : string
44  {
45  if (!in_array($this->transl, ["-", ""])) {
46  $lmobjtrans = new \ilLMObjTranslation($child["child"], $this->transl);
47  return $lmobjtrans->getTitle();
48  }
49  return $child["title"];
50  }
+ Here is the caller graph for this function:

◆ getData()

ILIAS\LearningModule\Table\SubObjectRetrieval::getData ( array  $fields,
?Range  $range = null,
?Order  $order = null,
array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\LearningModule\Table\RetrievalInterface.

Definition at line 63 of file SubObjectRetrieval.php.

References $lm_set, ilPageObject\_isScheduledActivation(), ilPageObject\_lookupActive(), ilPageObject\_lookupContainsDeactivatedElements(), ILIAS\LearningModule\Table\SubObjectRetrieval\getChilds(), ILIAS\LearningModule\Table\SubObjectRetrieval\getChildTitle(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

69  : \Generator {
70  foreach ($this->getChilds() as $child) {
71  if ($child["type"] === "pg") {
72  // check activation
73  $lm_set = new \ilSetting("lm");
74  $active = \ilLMPage::_lookupActive(
75  $child["obj_id"],
76  "lm",
77  (bool) $lm_set->get("time_scheduled_page_activation")
78  );
79 
80  // is page scheduled?
81  $img_sc = ((bool) $lm_set->get("time_scheduled_page_activation") &&
82  \ilLMPage::_isScheduledActivation($child["obj_id"], "lm"))
83  ? "_sc"
84  : "";
85 
86  if (!$active) {
87  $img = "standard/icon_pg_d" . $img_sc . ".svg";
88  $alt = $this->lng->txt("cont_page_deactivated");
89  } else {
91  $child["obj_id"],
92  "lm"
93  )) {
94  $img = "standard/icon_pg_del" . $img_sc . ".svg";
95  $alt = $this->lng->txt("cont_page_deactivated_elements");
96  } else {
97  $img = "standard/icon_pg" . $img_sc . ".svg";
98  $alt = $this->lng->txt("pg");
99  }
100  }
101  } else {
102  $img = "standard/icon_st.svg";
103  $alt = $this->lng->txt("st");
104  }
105  $trans_title = "";
106  if (!in_array($this->transl, ["-", ""])) {
107  $trans_title = $this->getChildTitle($child);
108  }
109  yield [
110  "id" => $child["child"],
111  "type" => $this->f->symbol()->icon()->custom(\ilUtil::getImagePath($img), $alt),
112  "title" => $child["title"],
113  "trans_title" => $trans_title
114  ];
115  }
116  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _isScheduledActivation(int $a_id, string $a_parent_type, string $a_lang="-")
Check whether page is activated by time schedule.
static _lookupContainsDeactivatedElements(int $a_id, string $a_parent_type, string $a_lang="-")
lookup whether page contains deactivated elements
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$lm_set
+ Here is the call graph for this function:

Field Documentation

◆ $childs

array ILIAS\LearningModule\Table\SubObjectRetrieval::$childs = null
protected

◆ $f

ILIAS UI Factory ILIAS\LearningModule\Table\SubObjectRetrieval::$f
protected

Definition at line 29 of file SubObjectRetrieval.php.

◆ $lng

ilLanguage ILIAS\LearningModule\Table\SubObjectRetrieval::$lng
protected

Definition at line 28 of file SubObjectRetrieval.php.


The documentation for this class was generated from the following file: