ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPDTaggingBlockGUI Class Reference

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

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

Public Member Functions

 ilPDTaggingBlockGUI ()
 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
 ilBlockGUI ()
 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.

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 }
global $ilCtrl
Definition: ilias.php:18
$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.
global $ilUser
Definition: imgupload.php:15

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 324 of file class.ilPDTaggingBlockGUI.php.

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

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 387 of file class.ilPDTaggingBlockGUI.php.

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

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:

◆ ilPDTaggingBlockGUI()

ilPDTaggingBlockGUI::ilPDTaggingBlockGUI ( )

Constructor.

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

42 {
43 global $ilCtrl, $lng, $ilUser;
44
45 parent::ilBlockGUI();
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.

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

+ Here is the call 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 275 of file class.ilPDTaggingBlockGUI.php.

276 {
277 global $ilCtrl, $ilAccess, $ilUser, $lng;
278
279 // get resources
280 include_once("./Services/Tagging/classes/class.ilTagging.php");
281 $objs = ilTagging::getObjectsForTagAndUser($ilUser->getId(), $_GET["tag"]);
282
283 foreach($objs as $key => $obj)
284 {
285 $ref_ids = ilObject::_getAllReferences($obj["obj_id"]);
286 if (count($ref_ids) == 0)
287 {
288 $inaccessible = true;
289 }
290 else
291 {
292 $inaccessible = false;
293 }
294 foreach ($ref_ids as $ref_id)
295 {
296 $type = $obj["obj_type"];
297
298 if ($type == "") {
299 $inaccessible = true;
300 continue;
301 }
302 if (!$ilAccess->checkAccess("visible", "", $ref_id) &&
303 !$ilAccess->checkAccess("read", "", $ref_id) &&
304 !$ilAccess->checkAccess("write", "", $ref_id))
305 {
306 $inaccessible = true;
307 }
308 if ($inaccessible)
309 {
310 ilTagging::deleteTagOfObjectForUser($ilUser->getId(), $obj["obj_id"], $obj["obj_type"], $obj["sub_obj_id"], $obj["sub_obj_type"], $_GET["tag"]);
311 }
312 }
313 }
314
315 ilUtil::sendSuccess($lng->txt("tag_tags_deleted"), true);
316
317 $ilCtrl->returnToParent($this);
318 }
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 341 of file class.ilPDTaggingBlockGUI.php.

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

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]->enablePayment(false);
228 $this->item_list_gui[$type]->enableLink(false);
229 $this->item_list_gui[$type]->enableIcon(true);
230 }
231 $html = $this->item_list_gui[$type]->getListItemHTML(
232 $ref_id,
233 $obj["obj_id"],
234 ilObject::_lookupTitle($obj["obj_id"]),
235 ilObject::_lookupDescription($obj["obj_id"]));
236
237 if ($html != "")
238 {
239 $css = ($css != "tblrow1") ? "tblrow1" : "tblrow2";
240
241 $tpl->setCurrentBlock("res_row");
242 $tpl->setVariable("ROWCLASS", $css);
243 $tpl->setVariable("RESOURCE_HTML", $html);
244 $tpl->setVariable("ALT_TYPE", $lng->txt("obj_".$type));
245 $tpl->setVariable("IMG_TYPE",
246 ilUtil::getImagePath("icon_".$type.".svg"));
247 $tpl->parseCurrentBlock();
248 }
249 else
250 {
251 $unaccessible = true;
252 }
253 }
254 }
255
256 if ($unaccessible)
257 {
258 $tpl->setCurrentBlock("no_access");
259 $tpl->setVariable("SOME_OBJ_WITHOUT_ACCESS", $lng->txt("tag_some_obj_tagged_without_access"));
260 $ilCtrl->saveParameter($this, "tag");
261 $tpl->setVariable("HREF_REMOVE_TAGS", $ilCtrl->getLinkTarget($this, "removeTagsWithoutAccess"));
262 $tpl->setVariable("REMOVE_TAGS", $lng->txt("tag_remove_tags_of_obj_without_access"));
263 $tpl->parseCurrentBlock();
264 }
265
266 $content_block->setContent($tpl->get());
267 //$content_block->setContent("test");
268
269 return $content_block->getHTML();
270 }
$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(), and ilTagging\getObjectsForTagAndUser().

+ 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: