ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
Prompt.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4 
6 
11 use ILIAS\UI\Component\Counter\Factory as CounterFactory;
13 
17 abstract class Prompt extends Slate implements ISlate\Prompt
18 {
22  protected $counter_factory;
23 
24  public function __construct(
25  SignalGeneratorInterface $signal_generator,
26  CounterFactory $counter_factory,
27  string $name,
29  ) {
30  $this->counter_factory = $counter_factory;
31  parent::__construct($signal_generator, $name, $symbol);
32  }
33 
34  protected function getCounterFactory() : CounterFactory
35  {
37  }
38 
39  protected function updateCounter(Counter $counter) : ISlate\Prompt
40  {
41  $clone = clone $this;
42  $clone->symbol = $clone->symbol->withCounter($counter);
43  return $clone;
44  }
45 
46  public function withUpdatedStatusCounter(int $count) : ISlate\Prompt
47  {
48  $counter = $this->getCounterFactory()->status($count);
49  return $this->updateCounter($counter);
50  }
51 
52  public function withUpdatedNoveltyCounter(int $count) : ISlate\Prompt
53  {
54  $counter = $this->getCounterFactory()->novelty($count);
55  return $this->updateCounter($counter);
56  }
57 }
withUpdatedStatusCounter(int $count)
Set the Prompt&#39;s Status Counter to $count.
Definition: Prompt.php:46
This tags a counter object.
Definition: Counter.php:10
This is how the factory for UI elements looks.
Definition: Factory.php:9
__construct(SignalGeneratorInterface $signal_generator, CounterFactory $counter_factory, string $name, Glyph $symbol)
Definition: Prompt.php:24
withUpdatedNoveltyCounter(int $count)
Set the Prompt&#39;s Novelty Counter to $count.
Definition: Prompt.php:52
This describes how a glyph could be modified during construction of UI.
Definition: Glyph.php:13
Prompts are notifications from the system to the user.
Definition: Prompt.php:10
Prompts are notifications from the system to the user.
Definition: Prompt.php:17
__construct(Container $dic, ilPlugin $plugin)