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

@ilCtrl_IsCalledBy ilTutorialSupportBlockGUI: ilColumnGUI More...

+ Inheritance diagram for ilTutorialSupportBlockGUI:
+ Collaboration diagram for ilTutorialSupportBlockGUI:

Public Member Functions

 __construct ()
 
 getData ()
 
 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

 initRefIdFromQuery ()
 
 createTutorItem (string $mail_url, string $name, int $tutor_id,)
 
 getTutorData (ilObjUser $tutor)
 
 getTutorIds ()
 
 hasPublicProfile (ilObjUser $tutor)
 
 hasContactEnabled (int $tutor_id)
 
 isIliasInternalMailEnabled ()
 
 isTutorCurrentUser (int $tutor_id)
 
 isUserValid (ilObjUser $tutor)
 
 isCurrentUserAllowedToSeeTutorBlock ()
 
 areILIASGlobalProfilesEnabled ()
 
 createMailShyButton (string $mail_url)
 
 getMailUrlOfUser (ilObjUser $tutor)
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. 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

const BLOCK_TYPE = 'tusu'
 
const DATA_MAIL_URL = 'mail_url'
 
const DATA_NAME = 'name'
 
const DATA_TUTOR_ID = 'tutor_id'
 
const EMPTY_MAIL_URL_STRING = ''
 
const ITEM_LIMIT = 5
 
HttpServices $http
 
RefineryFactory $refinery
 
ilSetting $ilias_settings
 
ilRbacSystem $rbac_system
 
- 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 ilTutorialSupportBlockGUI: ilColumnGUI

Definition at line 34 of file class.ilTutorialSupportBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTutorialSupportBlockGUI::__construct ( )

Reimplemented from ilBlockGUI.

Definition at line 47 of file class.ilTutorialSupportBlockGUI.php.

48 {
49 global $DIC;
51 $this->http = $DIC->http();
52 $this->refinery = $DIC->refinery();
53 $this->ilias_settings = $DIC['ilSetting'];
54 $this->rbac_system = $DIC['rbacsystem'];
55 $this->setBlockId('tusu_' . $this->ctrl->getContextObjId());
56 $this->setLimit(self::ITEM_LIMIT);
57 $this->setTitle($this->lng->txt('tutorial_support_block_title'));
58 $this->setPresentation(self::PRES_MAIN_LIST);
59 }
setTitle(string $a_title)
setPresentation(int $type)
setBlockId(string $a_block_id="0")
setLimit(int $a_limit)
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilBlockGUI\setBlockId(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), and ilBlockGUI\setTitle().

+ Here is the call graph for this function:

Member Function Documentation

◆ areILIASGlobalProfilesEnabled()

ilTutorialSupportBlockGUI::areILIASGlobalProfilesEnabled ( )
protected

Definition at line 163 of file class.ilTutorialSupportBlockGUI.php.

163 : bool
164 {
165 return (bool) $this->ilias_settings->get('enable_global_profiles');
166 }

◆ createMailShyButton()

ilTutorialSupportBlockGUI::createMailShyButton ( string  $mail_url)
protected

Definition at line 168 of file class.ilTutorialSupportBlockGUI.php.

168 : ShyButton
169 {
170 return $this->ui->factory()->button()->shy(
171 $this->lng->txt('tutorial_support_block_send_mail'),
172 $mail_url
173 );
174 }

References ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by createTutorItem().

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

◆ createTutorItem()

ilTutorialSupportBlockGUI::createTutorItem ( string  $mail_url,
string  $name,
int  $tutor_id 
)
protected

Definition at line 72 of file class.ilTutorialSupportBlockGUI.php.

76 : Item {
77 $properties = [];
78 if ($mail_url !== self::EMPTY_MAIL_URL_STRING) {
79 $mail_button = $this->createMailShyButton($mail_url);
80 $property_name = $this->lng->txt('tutorial_support_block_contact');
81 $properties[$property_name] = $mail_button;
82 }
83 $avatar = new Picture(ilObjUser::_getPersonalPicturePath($tutor_id), $name);
84 $tutor_item = $this->ui->factory()->item()->standard($name)
85 ->withLeadAvatar($avatar)
86 ->withProperties($properties);
87 if (
88 $this->isTutorCurrentUser($tutor_id) ||
89 $this->user->isAnonymous() ||
90 !$this->hasContactEnabled($tutor_id)
91 ) {
92 return $tutor_item;
93 }
94 $dropdown_actions[] = $this->ui->factory()->legacy()->content(
96 );
97 $dropdown = $this->ui->factory()->dropdown()->standard($dropdown_actions);
98 return $tutor_item->withActions($dropdown);
99 }
static _getPersonalPicturePath(int $a_usr_id, string $a_size='small', bool $a_force_pic=false)
Common interface to all items.
Definition: Item.php:32

References createMailShyButton(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getBlockType()

ilTutorialSupportBlockGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

Definition at line 223 of file class.ilTutorialSupportBlockGUI.php.

223 : string
224 {
225 return self::BLOCK_TYPE;
226 }

◆ getData()

ilTutorialSupportBlockGUI::getData ( )

Reimplemented from ilBlockGUI.

Definition at line 194 of file class.ilTutorialSupportBlockGUI.php.

194 : array
195 {
197 return [];
198 }
199 $data = [];
200 $tutor_ids = $this->getTutorIds();
201 foreach ($tutor_ids as $tutor_id) {
202 $tutor = new ilObjUser($tutor_id);
203 if (
204 !$this->isUserValid($tutor) ||
205 $this->user->isAnonymous()
206 ) {
207 continue;
208 }
209 $data[] = $this->getTutorData($tutor);
210 }
211 return $data;
212 }
User class.

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

+ Here is the call graph for this function:

◆ getListItemForData()

ilTutorialSupportBlockGUI::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 214 of file class.ilTutorialSupportBlockGUI.php.

214 : Item
215 {
216 return $this->createTutorItem(
217 (string) $data[self::DATA_MAIL_URL],
218 (string) $data[self::DATA_NAME],
219 (int) $data[self::DATA_TUTOR_ID]
220 );
221 }
createTutorItem(string $mail_url, string $name, int $tutor_id,)

References $data.

◆ getMailUrlOfUser()

ilTutorialSupportBlockGUI::getMailUrlOfUser ( ilObjUser  $tutor)
protected

Definition at line 176 of file class.ilTutorialSupportBlockGUI.php.

176 : string
177 {
178 if (
180 ) {
181 return (string) self::EMPTY_MAIL_URL_STRING;
182 }
184 $this->http->request()->getUri()->__toString(),
185 '',
186 [],
187 [
188 'type' => 'new',
189 'rcp_to' => $tutor->getLogin()
190 ]
191 );
192 }
static getLinkTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])

References ilMailFormCall\getLinkTarget(), ilObjUser\getLogin(), and ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

◆ getTutorData()

ilTutorialSupportBlockGUI::getTutorData ( ilObjUser  $tutor)
protected

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

101 : array
102 {
103 return [
104 self::DATA_MAIL_URL => $this->getMailUrlOfUser($tutor),
105 self::DATA_NAME => $tutor->getFullname(),
106 self::DATA_TUTOR_ID => $tutor->getId(),
107 ];
108 }
getFullname(int $max_strlen=0)

References ilObjUser\getFullname(), and ilObject\getId().

+ Here is the call graph for this function:

◆ getTutorIds()

ilTutorialSupportBlockGUI::getTutorIds ( )
protected

Definition at line 110 of file class.ilTutorialSupportBlockGUI.php.

110 : array
111 {
112 $crs_ref_id = $this->initRefIdFromQuery();
113 if (is_null($crs_ref_id)) {
114 return [];
115 }
116 $crs_obj_id = ilObjCourse::_lookupObjId($crs_ref_id);
117 $course_members = new ilCourseParticipants($crs_obj_id);
118 return $course_members->getContacts();
119 }
static _lookupObjId(int $ref_id)

References ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ hasContactEnabled()

ilTutorialSupportBlockGUI::hasContactEnabled ( int  $tutor_id)
protected

Definition at line 130 of file class.ilTutorialSupportBlockGUI.php.

130 : bool
131 {
132 if (!ilBuddySystem::getInstance()->isEnabled()) {
133 return false;
134 }
135 $setting_value = ilObjUser::_lookupPref($tutor_id, 'bs_allow_to_contact_me');
136 return is_null($setting_value) ? false : $setting_value === 'y';
137 }
static _lookupPref(int $a_usr_id, string $a_keyword)

References ilObjUser\_lookupPref(), and ilBuddySystem\getInstance().

+ Here is the call graph for this function:

◆ hasPublicProfile()

ilTutorialSupportBlockGUI::hasPublicProfile ( ilObjUser  $tutor)
protected

Definition at line 121 of file class.ilTutorialSupportBlockGUI.php.

121 : bool
122 {
123 return $tutor->getPref('public_profile') === 'g' ||
124 (
125 !$this->user->isAnonymous() &&
126 $tutor->getPref('public_profile') === 'y'
127 );
128 }
getPref(string $a_keyword)

References ilObjUser\getPref(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ initRefIdFromQuery()

ilTutorialSupportBlockGUI::initRefIdFromQuery ( )
protected

Definition at line 61 of file class.ilTutorialSupportBlockGUI.php.

61 : int|null
62 {
63 if ($this->http->wrapper()->query()->has('ref_id')) {
64 return $this->http->wrapper()->query()->retrieve(
65 'ref_id',
66 $this->refinery->kindlyTo()->int()
67 );
68 }
69 return null;
70 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ isCurrentUserAllowedToSeeTutorBlock()

ilTutorialSupportBlockGUI::isCurrentUserAllowedToSeeTutorBlock ( )
protected

Definition at line 154 of file class.ilTutorialSupportBlockGUI.php.

154 : bool
155 {
156 return !$this->user->isAnonymous() ||
157 (
158 $this->user->isAnonymous() &&
160 );
161 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ isIliasInternalMailEnabled()

ilTutorialSupportBlockGUI::isIliasInternalMailEnabled ( )
protected

Definition at line 139 of file class.ilTutorialSupportBlockGUI.php.

139 : bool
140 {
141 return $this->rbac_system->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId());
142 }

References ilMailGlobalServices\getMailObjectRefId().

+ Here is the call graph for this function:

◆ isRepositoryObject()

ilTutorialSupportBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Reimplemented from ilBlockGUI.

Definition at line 228 of file class.ilTutorialSupportBlockGUI.php.

228 : bool
229 {
230 return false;
231 }

◆ isTutorCurrentUser()

ilTutorialSupportBlockGUI::isTutorCurrentUser ( int  $tutor_id)
protected

Definition at line 144 of file class.ilTutorialSupportBlockGUI.php.

145 {
146 return $tutor_id === $this->user->getId();
147 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ isUserValid()

ilTutorialSupportBlockGUI::isUserValid ( ilObjUser  $tutor)
protected

Definition at line 149 of file class.ilTutorialSupportBlockGUI.php.

149 : bool
150 {
151 return !$tutor->isAnonymous() && $this->hasPublicProfile($tutor);
152 }

References ilObjUser\isAnonymous().

+ Here is the call graph for this function:

Field Documentation

◆ $http

HttpServices ilTutorialSupportBlockGUI::$http
protected

Definition at line 42 of file class.ilTutorialSupportBlockGUI.php.

◆ $ilias_settings

ilSetting ilTutorialSupportBlockGUI::$ilias_settings
protected

Definition at line 44 of file class.ilTutorialSupportBlockGUI.php.

◆ $rbac_system

ilRbacSystem ilTutorialSupportBlockGUI::$rbac_system
protected

Definition at line 45 of file class.ilTutorialSupportBlockGUI.php.

◆ $refinery

RefineryFactory ilTutorialSupportBlockGUI::$refinery
protected

Definition at line 43 of file class.ilTutorialSupportBlockGUI.php.

◆ BLOCK_TYPE

const ilTutorialSupportBlockGUI::BLOCK_TYPE = 'tusu'
protected

Definition at line 36 of file class.ilTutorialSupportBlockGUI.php.

◆ DATA_MAIL_URL

const ilTutorialSupportBlockGUI::DATA_MAIL_URL = 'mail_url'
protected

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

◆ DATA_NAME

const ilTutorialSupportBlockGUI::DATA_NAME = 'name'
protected

Definition at line 38 of file class.ilTutorialSupportBlockGUI.php.

◆ DATA_TUTOR_ID

const ilTutorialSupportBlockGUI::DATA_TUTOR_ID = 'tutor_id'
protected

Definition at line 39 of file class.ilTutorialSupportBlockGUI.php.

◆ EMPTY_MAIL_URL_STRING

const ilTutorialSupportBlockGUI::EMPTY_MAIL_URL_STRING = ''
protected

Definition at line 40 of file class.ilTutorialSupportBlockGUI.php.

◆ ITEM_LIMIT

const ilTutorialSupportBlockGUI::ITEM_LIMIT = 5
protected

Definition at line 41 of file class.ilTutorialSupportBlockGUI.php.


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