ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPDTasksBlockGUI Class Reference

BlockGUI class for Tasks on PD. More...

+ Inheritance diagram for ilPDTasksBlockGUI:
+ Collaboration diagram for ilPDTasksBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getBlockType ()
 
 executeCommand ()
 execute command More...
 
 getOverview ()
 Get overview. More...
 
 getHTML ()
 
 getNoItemFoundContent ()
 No item entry. More...
 
- 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 ()
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getScreenMode ()
 

Static Public Attributes

static string $block_type = "pdtasks"
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getListItemForData (array $data)
 Get list item for data array.
Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item
More...
 
- 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

array $tasks = []
 
- 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

- 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

BlockGUI class for Tasks on PD.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

@ilCtrl_IsCalledBy ilPDTasksBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDTasksBlockGUI::__construct ( )

Constructor.

Reimplemented from ilBlockGUI.

Definition at line 37 of file class.ilPDTasksBlockGUI.php.

38 {
39 global $DIC;
40
41 $this->ctrl = $DIC->ctrl();
42 $this->lng = $DIC->language();
43 $this->user = $DIC->user();
44 $lng = $DIC->language();
45
47
48 $this->setLimit(5);
49 $lng->loadLanguageModule("task");
50 $this->setTitle($lng->txt("task_derived_tasks"));
51
52 $this->setPresentation(self::PRES_SEC_LIST);
53 }
ilLanguage $lng
setTitle(string $a_title)
setPresentation(int $type)
setLimit(int $a_limit)
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilBlockGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), ilBlockGUI\setTitle(), ilLanguage\txt(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilPDTasksBlockGUI::executeCommand ( )

execute command

Definition at line 82 of file class.ilPDTasksBlockGUI.php.

83 {
84 $ilCtrl = $this->ctrl;
85
86 $cmd = $ilCtrl->getCmd("getHTML");
87
88 return $this->$cmd();
89 }
getCmd(?string $fallback_command=null)
@inheritDoc

References ilBlockGUI\$ctrl, and ilCtrl\getCmd().

+ Here is the call graph for this function:

◆ getBlockType()

ilPDTasksBlockGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

Definition at line 58 of file class.ilPDTasksBlockGUI.php.

58 : string
59 {
60 return self::$block_type;
61 }

References $block_type.

◆ getHTML()

ilPDTasksBlockGUI::getHTML ( )

Reimplemented from ilBlockGUI.

Definition at line 126 of file class.ilPDTasksBlockGUI.php.

126 : string
127 {
128 global $DIC;
129 $collector = $DIC->task()->derived()->factory()->collector();
130
131 $this->tasks = $collector->getEntries($this->user->getId());
132
133 $this->getListRowData();
134
135 return parent::getHTML();
136 }

References $DIC, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getListItemForData()

ilPDTasksBlockGUI::getListItemForData ( array  $data)
protected

Get list item for data array.

Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item

Reimplemented from ilBlockGUI.

Definition at line 141 of file class.ilPDTasksBlockGUI.php.

141 : ?Item
142 {
143 $factory = $this->ui->factory();
145
146 $title = $data["title"];
147 $props = [];
148
149 if ($data["ref_id"] > 0) {
150 $obj_id = ilObject::_lookupObjId($data["ref_id"]);
151 $obj_type = ilObject::_lookupType($obj_id);
152 $url = $data['url'] == "" ? ilLink::_getStaticLink($data["ref_id"]) : $data['url'];
153 $link = $url;
154 $title = $factory->link()->standard($data["title"], $link);
155 $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
156 }
157
158 if ($data["wsp_id"] > 0) {
159 $wst = new ilWorkspaceTree($this->user->getId());
160 $obj_id = $wst->lookupObjectId($data["wsp_id"]);
161 $obj_type = ilObject::_lookupType($obj_id);
162 $url = $data['url'] == "" ? ilLink::_getStaticLink($data["wsp_id"]) : $data['url'];
163 $link = $url;
164 $title = $factory->link()->standard($data["title"], $link);
165 $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
166 }
167
168 if ($data["starting_time"] > 0) {
169 $start = new ilDateTime($data["starting_time"], IL_CAL_UNIX);
170 $props[$lng->txt("task_start")] = ilDatePresentation::formatDate($start);
171 }
172
173 $factory = $this->ui->factory();
174 $item = $factory->item()->standard($title)
175 ->withProperties($props);
176
177 if ($data["deadline"] > 0) {
178 $end = new ilDateTime($data["deadline"], IL_CAL_UNIX);
179 //$props[$lng->txt("task_deadline")] =
180 // ilDatePresentation::formatDate($end);
181 $item = $item->withDescription(ilDatePresentation::formatDate($end));
182 }
183
184
185 return $item;
186 }
const IL_CAL_UNIX
Factory $factory
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Common interface to all items.
Definition: Item.php:32
$url
Definition: shib_logout.php:68

References ilBlockGUI\$data, ilBlockGUI\$factory, ilBlockGUI\$lng, ilBlockGUI\$title, $url, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilPDTasksBlockGUI::getNoItemFoundContent ( )

No item entry.

Reimplemented from ilBlockGUI.

Definition at line 191 of file class.ilPDTasksBlockGUI.php.

191 : string
192 {
193 return $this->lng->txt("task_no_task_items");
194 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getOverview()

ilPDTasksBlockGUI::getOverview ( )

Get overview.

Definition at line 116 of file class.ilPDTasksBlockGUI.php.

116 : string
117 {
119
120 return '<div class="small">' . (count($this->tasks)) . " " . $lng->txt("task_derived_tasks") . "</div>";
121 }

References ilBlockGUI\$lng, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getScreenMode()

static ilPDTasksBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 74 of file class.ilPDTasksBlockGUI.php.

74 : string
75 {
76 return IL_SCREEN_SIDE;
77 }
const IL_SCREEN_SIDE

References IL_SCREEN_SIDE.

◆ isRepositoryObject()

ilPDTasksBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Reimplemented from ilBlockGUI.

Definition at line 66 of file class.ilPDTasksBlockGUI.php.

66 : bool
67 {
68 return false;
69 }

Field Documentation

◆ $block_type

string ilPDTasksBlockGUI::$block_type = "pdtasks"
static

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

Referenced by getBlockType().

◆ $tasks

array ilPDTasksBlockGUI::$tasks = []
protected

Definition at line 32 of file class.ilPDTasksBlockGUI.php.


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