ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLPProgressBlockGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\Tracking\View\Factory as ViewFactory;
22use ILIAS\Tracking\View\DataRetrieval\FactoryInterface as DataRetrievalFactoryInterface;
24
29{
30 protected DataRetrievalFactoryInterface $data_retrieval;
31 protected RendererInterface $tracking_renderer;
32
33 public function __construct()
34 {
36
37 $view_factory = new ViewFactory();
38 $this->data_retrieval = $view_factory->dataRetrieval();
39 $this->tracking_renderer = $view_factory->renderer()->service();
40
41 $this->lng->loadLanguageModule('trac');
42
43 $this->setBlockId('lpprogress_' . $this->ctrl->getContextObjId());
44 $this->setTitle($this->lng->txt('trac_progress_block_title'));
45 $this->setPresentation(self::PRES_SEC_LEG);
46 }
47
48 public function getBlockType(): string
49 {
50 return 'lpprogress';
51 }
52
53 protected function isRepositoryObject(): bool
54 {
55 return false;
56 }
57
58 protected function getLegacyContent(): string
59 {
60 $filter = $this->data_retrieval
61 ->filter()
62 ->withObjectIds(ilObject::_lookupObjectId($this->requested_ref_id))
63 ->withUserIds($this->user->getId());
64 $lp_info = $this->data_retrieval
65 ->service()
66 ->retrieveViewInfo($filter)
67 ->lpInfoIterator()
68 ->current();
69
70 $status = $lp_info->getLPStatus();
71
72 $progress = $this->tracking_renderer->fixedSizeProgressMeter($lp_info);
73 $mode_and_status = $this->ui->factory()->item()->standard(
75 )->withDescription(
76 $this->lng->txt('trac_mode_collection')
77 );
78
79 return $this->ui->renderer()->render([
80 $progress,
81 $mode_and_status
82 ]);
83 }
84}
This class represents a block method of a block.
setTitle(string $a_title)
setPresentation(int $type)
setBlockId(string $a_block_id="0")
@ilCtrl_IsCalledBy ilLPProgressBlockGUI: ilColumnGUI
DataRetrievalFactoryInterface $data_retrieval
RendererInterface $tracking_renderer
getLegacyContent()
Get legacy content.
isRepositoryObject()
Returns whether block has a corresponding repository object.
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static _lookupObjectId(int $ref_id)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc