3declare(strict_types=1);
37 protected string $id =
"";
61 $this->
assert()->isIndex(
'id', $entry_data);
62 $this->
setId($entry_data[
'id']);
63 $this->
assert()->isIndex(
'title', $entry_data);
64 $this->
setTitle($entry_data[
'title']);
65 $this->
assert()->isIndex(
'namespace', $entry_data);
70 if (array_key_exists(
'description', $entry_data)) {
73 if (array_key_exists(
'rules', $entry_data) && is_array($entry_data[
'rules'])) {
77 $this->
assert()->isIndex(
'path', $entry_data);
78 $this->
setPath($entry_data[
'path']);
80 if (array_key_exists(
'background', $entry_data)) {
83 if (array_key_exists(
'context', $entry_data)) {
86 if (array_key_exists(
'featurewiki', $entry_data)) {
89 if (array_key_exists(
'parent', $entry_data)) {
90 $this->
setParent((
string) $entry_data[
'parent']);
92 if (array_key_exists(
'children', $entry_data)) {
106 $this->
assert()->isString($id,
false);
117 $this->
assert()->isString($title,
false);
138 $this->
assert()->isString($status_entry);
149 $this->
assert()->isString($status_implementation);
161 return $this->description->getDescription();
169 $this->
assert()->isTypeOf($description, ComponentEntryDescription::class);
180 $this->
assert()->isString($background);
191 $this->
assert()->isArray($context);
202 $this->
assert()->isArray($feature_wiki_references);
214 return $this->rules->getRules();
222 $this->
assert()->isTypeOf($rules, ComponentEntryRules::class);
233 $this->
assert()->isString($selector);
239 $this->
assert()->isArray($less_variables);
255 $this->
assert()->isString($path);
287 $this->children[] = $child;
305 $this->examples = array();
307 if (is_dir($case_insensitive_path)) {
308 foreach (scandir($case_insensitive_path) as $file_name) {
310 if (is_file($example_path) && pathinfo($example_path)[
"extension"] ==
"php") {
311 $example_name = str_replace(
".php",
"", $file_name);
312 $this->examples[$example_name] = $example_path;
327 if (is_dir($parent_folder)) {
328 foreach (scandir($parent_folder) as $folder_name) {
329 if (strtolower($folder_name) == strtolower(basename($this->
getExamplesPath()))) {
330 return $parent_folder .
"/" . $folder_name;
340 if (!$this->examples_path) {
341 $path_components = str_replace(
344 str_replace(
"Component",
"examples", $this->
getPath())
346 .
"/" . str_replace(
" ",
"", $this->
getTitle());
348 $this->examples_path = implode(
"/", $path_array);
355 if (!$this->examples_namespace) {
356 $this->examples_namespace = str_replace(
377 return array_intersect_key(
379 array_unique(array_map(
"StrToLower", $array))
389 $description_serialized =
"";
396 $rules_serialized =
"";
399 'id' => $this->
getId(),
404 'description' => $description_serialized,
409 'rules' => $rules_serialized,
Abstract Entry Part to share some common entry functionality.
Container to hold description of UI Components.
Container to hold rules of UI Components.
Stores Information of UI Components parsed from YAML, examples and less files.
setLessVariables(array $less_variables)
ComponentEntryDescription $description
getStatusImplementation()
array $feature_wiki_references
setChildren(array $children)
setFeatureWikiReferences(array $feature_wiki_references)
setIsAbstract(bool $is_abstract)
setStatusEntry(string $status_entry)
setContext(array $context)
setStatusImplementation(string $status_implementation)
setBackground(string $background)
setDescription(ComponentEntryDescription $description)
getFeatureWikiReferences()
getCaseInsensitiveExampleFolder()
Note case handling of is dir is different from OS to OS, therefore while reading the examples from th...
ComponentEntryRules $rules
static array_iunique(array $array)
string $status_implementation
string $examples_namespace
setNamespace(string $namespace)
array $status_list_implementation
setSelector(string $selector)
addChildren(array $children)
setRules(ComponentEntryRules $rules)
setParent(string $parent)
if($err=$client->getError()) $namespace
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...