3 declare(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)) {
104 public function setId(
string $id): void
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;
295 $this->
setChildren(array_merge($this->children, $children));
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());
347 $path_array = self::array_iunique(explode(
"/", $path_components));
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,
if($err=$client->getError()) $namespace
Container to hold rules of UI Components.
setNamespace(string $namespace)
Abstract Entry Part to share some common entry functionality.
setStatusImplementation(string $status_implementation)
setDescription(ComponentEntryDescription $description)
ComponentEntryRules $rules
getFeatureWikiReferences()
string $examples_namespace
setChildren(array $children)
getCaseInsensitiveExampleFolder()
Note case handling of is dir is different from OS to OS, therefore while reading the examples from th...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setBackground(string $background)
setRules(ComponentEntryRules $rules)
string $status_implementation
Stores Information of UI Components parsed from YAML, examples and less files.
setParent(string $parent)
setIsAbstract(bool $is_abstract)
addChildren(array $children)
array $status_list_implementation
setSelector(string $selector)
getStatusImplementation()
setStatusEntry(string $status_entry)
setLessVariables(array $less_variables)
setContext(array $context)
__construct(Container $dic, ilPlugin $plugin)
array $feature_wiki_references
Container to hold description of UI Components.
setFeatureWikiReferences(array $feature_wiki_references)
ComponentEntryDescription $description
static array_iunique(array $array)