ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilPDTaggingBlockGUI Class Reference

ilPDTaggingBlockGUI displays personal tag cloud on personal desktop. More...

+ Inheritance diagram for ilPDTaggingBlockGUI:
+ Collaboration diagram for ilPDTaggingBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 getHTML ()
 Handle config status. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getTagCloud ()
 get tree bookmark list for personal desktop More...
 
 showResourcesForTag ()
 List resources for tag. More...
 
 removeTagsWithoutAccess ()
 Remove tasg without access. More...
 
 fillFooter ()
 block footer More...
 
 setFooterLinks ()
 Set footer links. More...
 
 getOverview ()
 Get overview. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Is block used in repository object? More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "pdtag"
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Detailed Description

ilPDTaggingBlockGUI displays personal tag cloud on personal desktop.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_IsCalledBy ilPDTaggingBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDTaggingBlockGUI::__construct ( )

Constructor.

Reimplemented from ilBlockGUI.

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

42 {
43 global $ilCtrl, $lng, $ilUser;
44
45 parent::__construct();
46
47 $lng->loadLanguageModule("tagging");
48
49 $this->setTitle($lng->txt("tagging_my_tags"));
50 $this->setEnableNumInfo(false);
51 $this->setLimit(99999);
52 $this->setAvailableDetailLevels(1,0);
53 }
setLimit($a_limit)
Set Limit.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:18

References $ilCtrl, $ilUser, $lng, ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setLimit(), and ilBlockGUI\setTitle().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilPDTaggingBlockGUI::executeCommand ( )

execute command

Definition at line 96 of file class.ilPDTaggingBlockGUI.php.

97 {
98 global $ilCtrl;
99
100 $next_class = $ilCtrl->getNextClass();
101 $cmd = $ilCtrl->getCmd("getHTML");
102
103 return $this->$cmd();
104 }
$cmd
Definition: sahs_server.php:35

References $cmd, and $ilCtrl.

◆ fillDataSection()

ilPDTaggingBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

Definition at line 124 of file class.ilPDTaggingBlockGUI.php.

125 {
126 global $ilUser;
127
128 include_once("./Services/Tagging/classes/class.ilTagging.php");
129 $this->tags = ilTagging::getTagsForUser($ilUser->getId(), 1000000);
130
131 if ($this->getCurrentDetailLevel() > 1 && (count($this->tags) > 0))
132 {
133 $this->setDataSection($this->getTagCloud());
134 }
135 else
136 {
137 if ($this->num_bookmarks == 0 && $this->num_folders == 0)
138 {
139 $this->setEnableDetailRow(false);
140 }
141 $this->setDataSection($this->getOverview());
142 }
143 }
getCurrentDetailLevel()
Get Current Detail Level.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
getTagCloud()
get tree bookmark list for personal desktop
static getTagsForUser($a_user_id, $a_max=0, $a_only_online=true)
Get tags for a user.

References $ilUser, ilBlockGUI\getCurrentDetailLevel(), getOverview(), getTagCloud(), ilTagging\getTagsForUser(), ilBlockGUI\setDataSection(), and ilBlockGUI\setEnableDetailRow().

+ Here is the call graph for this function:

◆ fillFooter()

ilPDTaggingBlockGUI::fillFooter ( )

block footer

Reimplemented from ilBlockGUI.

Definition at line 323 of file class.ilPDTaggingBlockGUI.php.

324 {
325 global $ilCtrl, $lng, $ilUser;
326
327 $this->setFooterLinks();
328 $this->fillFooterLinks();
329 $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
330 if ($this->tpl->blockExists("block_footer"))
331 {
332 $this->tpl->setCurrentBlock("block_footer");
333 $this->tpl->parseCurrentBlock();
334 }
335 }
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
getColSpan()
Get Columns Span.
setFooterLinks()
Set footer links.

References $ilCtrl, $ilUser, $lng, ilBlockGUI\fillFooterLinks(), ilBlockGUI\getColSpan(), and setFooterLinks().

+ Here is the call graph for this function:

◆ getBlockType()

static ilPDTaggingBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Definition at line 60 of file class.ilPDTaggingBlockGUI.php.

61 {
62 return self::$block_type;
63 }

References $block_type.

◆ getHTML()

ilPDTaggingBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

Definition at line 106 of file class.ilPDTaggingBlockGUI.php.

107 {
108 // workaround to show details row
109 $this->setData(array("dummy"));
110
111 if ($this->getCurrentDetailLevel() == 0)
112 {
113 return "";
114 }
115 else
116 {
117 return parent::getHTML();
118 }
119 }
setData($a_data)
Set Data.

References ilBlockGUI\getCurrentDetailLevel(), and ilBlockGUI\setData().

+ Here is the call graph for this function:

◆ getOverview()

ilPDTaggingBlockGUI::getOverview ( )

Get overview.

Definition at line 386 of file class.ilPDTaggingBlockGUI.php.

387 {
388 global $ilUser, $lng, $ilCtrl;
389
390 return '<div class="small">'.$lng->txt("tagging_tag_info")."</div>";
391 }

References $ilCtrl, $ilUser, and $lng.

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDTaggingBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 79 of file class.ilPDTaggingBlockGUI.php.

80 {
81 switch($_GET["cmd"])
82 {
83 case "showResourcesForTag":
84 return IL_SCREEN_CENTER;
85 break;
86
87 default:
88 return IL_SCREEN_SIDE;
89 break;
90 }
91 }
$_GET["client_id"]
const IL_SCREEN_SIDE
const IL_SCREEN_CENTER

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

◆ getTagCloud()

ilPDTaggingBlockGUI::getTagCloud ( )

get tree bookmark list for personal desktop

Definition at line 148 of file class.ilPDTaggingBlockGUI.php.

149 {
150 global $ilCtrl, $ilUser;
151
152 $showdetails = ($this->getCurrentDetailLevel() > 2);
153 $tpl = new ilTemplate("tpl.tag_cloud.html", true, true,
154 "Services/Tagging");
155 $max = 1;
156 foreach($this->tags as $tag)
157 {
158 $max = max($tag["cnt"], $max);
159 }
160 reset($this->tags);
161
162 foreach($this->tags as $tag)
163 {
164 $tpl->setCurrentBlock("linked_tag");
165 $ilCtrl->setParameter($this, "tag", rawurlencode($tag["tag"]));
166 $tpl->setVariable("HREF_TAG",
167 $ilCtrl->getLinkTarget($this, "showResourcesForTag"));
168 $tpl->setVariable("TAG_TITLE", $tag["tag"]);
169 $tpl->setVariable("REL_CLASS",
170 ilTagging::getRelevanceClass($tag["cnt"], $max));
171 $tpl->parseCurrentBlock();
172 }
173 return $tpl->get();
174 }
global $tpl
Definition: ilias.php:8
static getRelevanceClass($cnt, $max)
Get style class for tag relevance.
special template class to simplify handling of ITX/PEAR

References $ilCtrl, $ilUser, $tpl, ilBlockGUI\getCurrentDetailLevel(), and ilTagging\getRelevanceClass().

Referenced by fillDataSection().

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

◆ isRepositoryObject()

static ilPDTaggingBlockGUI::isRepositoryObject ( )
static

Is block used in repository object?

Returns
string Block type.

Reimplemented from ilBlockGUI.

Definition at line 70 of file class.ilPDTaggingBlockGUI.php.

71 {
72 return false;
73 }

◆ removeTagsWithoutAccess()

ilPDTaggingBlockGUI::removeTagsWithoutAccess ( )

Remove tasg without access.

Definition at line 274 of file class.ilPDTaggingBlockGUI.php.

275 {
276 global $ilCtrl, $ilAccess, $ilUser, $lng;
277
278 // get resources
279 include_once("./Services/Tagging/classes/class.ilTagging.php");
280 $objs = ilTagging::getObjectsForTagAndUser($ilUser->getId(), $_GET["tag"]);
281
282 foreach($objs as $key => $obj)
283 {
284 $ref_ids = ilObject::_getAllReferences($obj["obj_id"]);
285 if (count($ref_ids) == 0)
286 {
287 $inaccessible = true;
288 }
289 else
290 {
291 $inaccessible = false;
292 }
293 foreach ($ref_ids as $ref_id)
294 {
295 $type = $obj["obj_type"];
296
297 if ($type == "") {
298 $inaccessible = true;
299 continue;
300 }
301 if (!$ilAccess->checkAccess("visible", "", $ref_id) &&
302 !$ilAccess->checkAccess("read", "", $ref_id) &&
303 !$ilAccess->checkAccess("write", "", $ref_id))
304 {
305 $inaccessible = true;
306 }
307 if ($inaccessible)
308 {
309 ilTagging::deleteTagOfObjectForUser($ilUser->getId(), $obj["obj_id"], $obj["obj_type"], $obj["sub_obj_id"], $obj["sub_obj_type"], $_GET["tag"]);
310 }
311 }
312 }
313
314 ilUtil::sendSuccess($lng->txt("tag_tags_deleted"), true);
315
316 $ilCtrl->returnToParent($this);
317 }
static _getAllReferences($a_id)
get all reference ids of object
static deleteTagOfObjectForUser($a_user_id, $a_obj_id, $a_obj_type, $a_sub_obj_id, $a_sub_obj_type, $a_tag)
Deletes tag of an object.
static getObjectsForTagAndUser($a_user_id, $a_tag)
Get objects for tag and user.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$ref_id
Definition: sahs_server.php:39

References $_GET, $ilCtrl, $ilUser, $lng, $ref_id, ilObject\_getAllReferences(), ilTagging\deleteTagOfObjectForUser(), ilTagging\getObjectsForTagAndUser(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ setFooterLinks()

ilPDTaggingBlockGUI::setFooterLinks ( )

Set footer links.

Definition at line 340 of file class.ilPDTaggingBlockGUI.php.

341 {
342 global $ilUser, $ilCtrl, $lng;
343return;
344/*
345 if ($this->num_bookmarks == 0 && $this->num_folders == 0)
346 {
347 return;
348 }
349
350 // flat
351 if ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
352 {
353 $this->addFooterLink( $lng->txt("flatview"),
354 $ilCtrl->getLinkTarget($this, "setPdFlatMode"),
355 $ilCtrl->getLinkTarget($this, "setPdFlatMode",
356 "", true),
357 "block_".$this->getBlockType()."_".$this->block_id);
358 }
359 else
360 {
361 $this->addFooterLink($lng->txt("flatview"));
362 }
363
364 // as tree
365 if ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
366 {
367 $this->addFooterLink($lng->txt("treeview"));
368 }
369 else
370 {
371 $this->addFooterLink($lng->txt("treeview"),
372 $ilCtrl->getLinkTarget($this,
373 "setPdTreeMode"),
374 $ilCtrl->getLinkTarget($this,
375 "setPdTreeMode", "", true),
376 "block_".$this->getBlockType()."_".$this->block_id
377 );
378 }
379*/
380 }

References $ilCtrl, $ilUser, and $lng.

Referenced by fillFooter().

+ Here is the caller graph for this function:

◆ showResourcesForTag()

ilPDTaggingBlockGUI::showResourcesForTag ( )

List resources for tag.

Definition at line 179 of file class.ilPDTaggingBlockGUI.php.

180 {
181 global $lng, $ilCtrl, $ilUser, $objDefinition;
182
183 $_GET["tag"] = str_replace("-->","", $_GET["tag"]);
184
185 $tpl = new ilTemplate("tpl.resources_for_tag.html", true, true, "Services/Tagging");
186 include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
187 $content_block = new ilPDContentBlockGUI();
188 $content_block->setColSpan(2);
189 $content_block->setTitle(sprintf($lng->txt("tagging_resources_for_tag"),
190 "<i>".$_GET["tag"]."</i>"));
191 $content_block->setImage(ilUtil::getImagePath("icon_tag.svg"));
192 $content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
193 $lng->txt("selected_items_back"));
194
195 // get resources
196 include_once("./Services/Tagging/classes/class.ilTagging.php");
197 $objs = ilTagging::getObjectsForTagAndUser($ilUser->getId(), $_GET["tag"]);
198
199 $unaccessible = false;
200 foreach($objs as $key => $obj)
201 {
202 $ref_ids = ilObject::_getAllReferences($obj["obj_id"]);
203 foreach($ref_ids as $ref_id)
204 {
205 $type = $obj["obj_type"];
206
207 if ($type == "") {
208 $unaccessible = true;
209 continue;
210 }
211
212 // get list gui class for each object type
213 if (empty($this->item_list_gui[$type]))
214 {
215 $class = $objDefinition->getClassName($type);
216 $location = $objDefinition->getLocation($type);
217
218 $full_class = "ilObj".$class."ListGUI";
219
220 include_once($location."/class.".$full_class.".php");
221 $this->item_list_gui[$type] = new $full_class();
222 $this->item_list_gui[$type]->enableDelete(false);
223 $this->item_list_gui[$type]->enablePath(true);
224 $this->item_list_gui[$type]->enableCut(false);
225 $this->item_list_gui[$type]->enableCopy(false);
226 $this->item_list_gui[$type]->enableSubscribe(false);
227 $this->item_list_gui[$type]->enableLink(false);
228 $this->item_list_gui[$type]->enableIcon(true);
229 }
230 $html = $this->item_list_gui[$type]->getListItemHTML(
231 $ref_id,
232 $obj["obj_id"],
233 ilObject::_lookupTitle($obj["obj_id"]),
234 ilObject::_lookupDescription($obj["obj_id"]));
235
236 if ($html != "")
237 {
238 $css = ($css != "tblrow1") ? "tblrow1" : "tblrow2";
239
240 $tpl->setCurrentBlock("res_row");
241 $tpl->setVariable("ROWCLASS", $css);
242 $tpl->setVariable("RESOURCE_HTML", $html);
243 $tpl->setVariable("ALT_TYPE", $lng->txt("obj_".$type));
244 $tpl->setVariable("IMG_TYPE",
245 ilUtil::getImagePath("icon_".$type.".svg"));
246 $tpl->parseCurrentBlock();
247 }
248 else
249 {
250 $unaccessible = true;
251 }
252 }
253 }
254
255 if ($unaccessible)
256 {
257 $tpl->setCurrentBlock("no_access");
258 $tpl->setVariable("SOME_OBJ_WITHOUT_ACCESS", $lng->txt("tag_some_obj_tagged_without_access"));
259 $ilCtrl->saveParameter($this, "tag");
260 $tpl->setVariable("HREF_REMOVE_TAGS", $ilCtrl->getLinkTarget($this, "removeTagsWithoutAccess"));
261 $tpl->setVariable("REMOVE_TAGS", $lng->txt("tag_remove_tags_of_obj_without_access"));
262 $tpl->parseCurrentBlock();
263 }
264
265 $content_block->setContent($tpl->get());
266 //$content_block->setContent("test");
267
268 return $content_block->getHTML();
269 }
sprintf('%.4f', $callTime)
$location
Definition: buildRTE.php:44
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
BlockGUI class for (centered) Content on Personal Desktop.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$html
Definition: example_001.php:87

References $_GET, $html, $ilCtrl, $ilUser, $lng, $location, $ref_id, $tpl, ilObject\_getAllReferences(), ilObject\_lookupDescription(), ilObject\_lookupTitle(), ilUtil\getImagePath(), ilTagging\getObjectsForTagAndUser(), and sprintf.

+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilPDTaggingBlockGUI::$block_type = "pdtag"
static

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

Referenced by getBlockType().


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