ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilLPProgressBlockGUI Class Reference

@ilCtrl_IsCalledBy ilLPProgressBlockGUI: ilColumnGUI More...

+ Inheritance diagram for ilLPProgressBlockGUI:
+ Collaboration diagram for ilLPProgressBlockGUI:

Public Member Functions

 __construct ()
 
 getBlockType ()
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 checkOffset (int $offset)
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 getNoItemFoundContent ()
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 setActions ()
 
 supportsMembers (int $ref_id)
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getActionsForPanel ()
 
 send (string $output)
 Send. More...
 

Protected Attributes

DataRetrievalFactoryInterface $data_retrieval
 
RendererInterface $tracking_renderer
 
- Protected Attributes inherited from ilBlockGUI
ILIAS UI Renderer $renderer
 
Factory $factory
 
object $gui_object
 
ILIAS Container Block StandardGUIRequest $request
 
ILIAS Container Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 

Detailed Description

@ilCtrl_IsCalledBy ilLPProgressBlockGUI: ilColumnGUI

Definition at line 28 of file class.ilLPProgressBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLPProgressBlockGUI::__construct ( )

Reimplemented from ilBlockGUI.

Definition at line 33 of file class.ilLPProgressBlockGUI.php.

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 $this->setActions();
47 }
setTitle(string $a_title)
setPresentation(int $type)
setBlockId(string $a_block_id="0")
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), setActions(), ilBlockGUI\setBlockId(), ilBlockGUI\setPresentation(), and ilBlockGUI\setTitle().

+ Here is the call graph for this function:

Member Function Documentation

◆ getBlockType()

ilLPProgressBlockGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

Definition at line 49 of file class.ilLPProgressBlockGUI.php.

49 : string
50 {
51 return 'lpprogress';
52 }

◆ getLegacyContent()

ilLPProgressBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

Definition at line 59 of file class.ilLPProgressBlockGUI.php.

59 : string
60 {
61 $filter = $this->data_retrieval
62 ->filter()
63 ->withObjectIds(ilObject::_lookupObjectId($this->requested_ref_id))
64 ->withUserIds($this->user->getId());
65 $lp_info = $this->data_retrieval
66 ->service()
67 ->retrieveViewInfo($filter)
68 ->lpInfoIterator()
69 ->current();
70
71 $status = $lp_info->getLPStatus();
72
73 $progress = $this->tracking_renderer->fixedSizeProgressMeter($lp_info);
74 $mode_and_status = $this->ui->factory()->item()->standard(
76 )->withDescription(
77 $this->lng->txt('trac_mode_collection')
78 );
79
80 return $this->ui->renderer()->render([
81 $progress,
82 $mode_and_status
83 ]);
84 }
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static _lookupObjectId(int $ref_id)

References ilLearningProgressBaseGUI\_getStatusText(), ilObject\_lookupObjectId(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ isRepositoryObject()

ilLPProgressBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Reimplemented from ilBlockGUI.

Definition at line 54 of file class.ilLPProgressBlockGUI.php.

54 : bool
55 {
56 return false;
57 }

◆ setActions()

ilLPProgressBlockGUI::setActions ( )
protected

Definition at line 86 of file class.ilLPProgressBlockGUI.php.

86 : void
87 {
88 $read_only_allowed = true;
89 if ($this->supportsMembers($this->requested_ref_id)) {
90 $read_only_allowed = ilParticipants::_isParticipant($this->requested_ref_id, $this->user->getId());
91 }
92 if (!ilLearningProgressAccess::checkAccess($this->requested_ref_id, $read_only_allowed)) {
93 return;
94 }
95 $this->ctrl->setParameterByClass(ilLearningProgressGUI::class, 'ref_id', $this->requested_ref_id);
96 $link = $this->ctrl->getLinkTargetByClass(ilLearningProgressGUI::class);
97 $this->ctrl->clearParameterByClass(ilLearningProgressGUI::class, 'ref_id');
98 $this->addBlockCommand($link, $this->lng->txt('trac_progress_block_details'));
99 }
addBlockCommand(string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.

References ilParticipants\_isParticipant(), ilBlockGUI\addBlockCommand(), ilLearningProgressAccess\checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), supportsMembers(), and ILIAS\Repository\user().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ supportsMembers()

ilLPProgressBlockGUI::supportsMembers ( int  $ref_id)
protected

Definition at line 101 of file class.ilLPProgressBlockGUI.php.

101 : bool
102 {
103 try {
105 return true;
106 } catch (Exception) {
107 return false;
108 }
109 }
static getInstance(int $a_ref_id)
$ref_id
Definition: ltiauth.php:66

References $ref_id, and ilParticipants\getInstance().

Referenced by setActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $data_retrieval

DataRetrievalFactoryInterface ilLPProgressBlockGUI::$data_retrieval
protected

Definition at line 30 of file class.ilLPProgressBlockGUI.php.

◆ $tracking_renderer

RendererInterface ilLPProgressBlockGUI::$tracking_renderer
protected

Definition at line 31 of file class.ilLPProgressBlockGUI.php.


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