ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 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"
 

Protected Attributes

 $obj_definition
 
- 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
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

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

47 {
48 global $DIC;
49
50 $this->ctrl = $DIC->ctrl();
51 $this->lng = $DIC->language();
52 $this->user = $DIC->user();
53 $this->obj_definition = $DIC["objDefinition"];
54 $this->access = $DIC->access();
55 $lng = $DIC->language();
56
57 parent::__construct();
58
59 $lng->loadLanguageModule("tagging");
60
61 $this->setTitle($lng->txt("tagging_my_tags"));
62 $this->setEnableNumInfo(false);
63 $this->setLimit(99999);
64 $this->setAvailableDetailLevels(1, 0);
65 }
user()
Definition: user.php:4
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 $DIC
Definition: saml.php:7

References $DIC, ilBlockGUI\$lng, ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setLimit(), ilBlockGUI\setTitle(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilPDTaggingBlockGUI::executeCommand ( )

execute command

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

108 {
110
111 $next_class = $ilCtrl->getNextClass();
112 $cmd = $ilCtrl->getCmd("getHTML");
113
114 return $this->$cmd();
115 }
global $ilCtrl
Definition: ilias.php:18

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ fillDataSection()

ilPDTaggingBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

133 {
135
136 include_once("./Services/Tagging/classes/class.ilTagging.php");
137 $this->tags = ilTagging::getTagsForUser($ilUser->getId(), 1000000);
138
139 if ($this->getCurrentDetailLevel() > 1 && (count($this->tags) > 0)) {
140 $this->setDataSection($this->getTagCloud());
141 } else {
142 if ($this->num_bookmarks == 0 && $this->num_folders == 0) {
143 $this->setEnableDetailRow(false);
144 }
145 $this->setDataSection($this->getOverview());
146 }
147 }
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.
$ilUser
Definition: imgupload.php:18

References $ilUser, ilBlockGUI\$user, 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 332 of file class.ilPDTaggingBlockGUI.php.

333 {
334 $this->fillFooterLinks();
335 $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
336 if ($this->tpl->blockExists("block_footer")) {
337 $this->tpl->setCurrentBlock("block_footer");
338 $this->tpl->parseCurrentBlock();
339 }
340 }
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
getColSpan()
Get Columns Span.

References ilBlockGUI\fillFooterLinks(), and ilBlockGUI\getColSpan().

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

73 {
74 return self::$block_type;
75 }

References $block_type.

◆ getHTML()

ilPDTaggingBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

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

118 {
119 // workaround to show details row
120 $this->setData(array("dummy"));
121
122 if ($this->getCurrentDetailLevel() == 0) {
123 return "";
124 } else {
125 return parent::getHTML();
126 }
127 }
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 346 of file class.ilPDTaggingBlockGUI.php.

347 {
349
350 return '<div class="small">' . $lng->txt("tagging_tag_info") . "</div>";
351 }

References ilBlockGUI\$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 91 of file class.ilPDTaggingBlockGUI.php.

92 {
93 switch ($_GET["cmd"]) {
94 case "showResourcesForTag":
95 return IL_SCREEN_CENTER;
96 break;
97
98 default:
99 return IL_SCREEN_SIDE;
100 break;
101 }
102 }
$_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 152 of file class.ilPDTaggingBlockGUI.php.

153 {
155
156 $showdetails = ($this->getCurrentDetailLevel() > 2);
157 $tpl = new ilTemplate(
158 "tpl.tag_cloud.html",
159 true,
160 true,
161 "Services/Tagging"
162 );
163 $max = 1;
164 foreach ($this->tags as $tag) {
165 $max = max($tag["cnt"], $max);
166 }
167 reset($this->tags);
168
169 foreach ($this->tags as $tag) {
170 $tpl->setCurrentBlock("linked_tag");
171 $ilCtrl->setParameter($this, "tag", rawurlencode($tag["tag"]));
172 $tpl->setVariable(
173 "HREF_TAG",
174 $ilCtrl->getLinkTarget($this, "showResourcesForTag")
175 );
176 $tpl->setVariable("TAG_TITLE", $tag["tag"]);
177 $tpl->setVariable(
178 "REL_CLASS",
180 );
181 $tpl->parseCurrentBlock();
182 }
183 return $tpl->get();
184 }
static getRelevanceClass($cnt, $max)
Get style class for tag relevance.
special template class to simplify handling of ITX/PEAR
if(function_exists( 'posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35

References ilBlockGUI\$ctrl, $ilCtrl, $tag, ilBlockGUI\$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 82 of file class.ilPDTaggingBlockGUI.php.

83 {
84 return false;
85 }

◆ removeTagsWithoutAccess()

ilPDTaggingBlockGUI::removeTagsWithoutAccess ( )

Remove tasg without access.

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

288 {
290 $ilAccess = $this->access;
293
294 // get resources
295 include_once("./Services/Tagging/classes/class.ilTagging.php");
296 $objs = ilTagging::getObjectsForTagAndUser($ilUser->getId(), $_GET["tag"]);
297
298 foreach ($objs as $key => $obj) {
299 $ref_ids = ilObject::_getAllReferences($obj["obj_id"]);
300 if (count($ref_ids) == 0) {
301 $inaccessible = true;
302 } else {
303 $inaccessible = false;
304 }
305 foreach ($ref_ids as $ref_id) {
306 $type = $obj["obj_type"];
307
308 if ($type == "") {
309 $inaccessible = true;
310 continue;
311 }
312 if (!$ilAccess->checkAccess("visible", "", $ref_id) &&
313 !$ilAccess->checkAccess("read", "", $ref_id) &&
314 !$ilAccess->checkAccess("write", "", $ref_id)) {
315 $inaccessible = true;
316 }
317 if ($inaccessible) {
318 ilTagging::deleteTagOfObjectForUser($ilUser->getId(), $obj["obj_id"], $obj["obj_type"], $obj["sub_obj_id"], $obj["sub_obj_type"], $_GET["tag"]);
319 }
320 }
321 }
322
323 ilUtil::sendSuccess($lng->txt("tag_tags_deleted"), true);
324
325 $ilCtrl->returnToParent($this);
326 }
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.
$key
Definition: croninfo.php:18
$type

References $_GET, ilBlockGUI\$access, ilBlockGUI\$ctrl, $ilCtrl, $ilUser, $key, ilBlockGUI\$lng, $type, ilBlockGUI\$user, ilObject\_getAllReferences(), ilTagging\deleteTagOfObjectForUser(), ilTagging\getObjectsForTagAndUser(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ showResourcesForTag()

ilPDTaggingBlockGUI::showResourcesForTag ( )

List resources for tag.

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

190 {
194 $objDefinition = $this->obj_definition;
195
196 $_GET["tag"] = str_replace("-->", "", $_GET["tag"]);
197
198 $tpl = new ilTemplate("tpl.resources_for_tag.html", true, true, "Services/Tagging");
199 include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
200 $content_block = new ilPDContentBlockGUI();
201 $content_block->setColSpan(2);
202 $content_block->setTitle(sprintf(
203 $lng->txt("tagging_resources_for_tag"),
204 "<i>" . $_GET["tag"] . "</i>"
205 ));
206 $content_block->setImage(ilUtil::getImagePath("icon_tag.svg"));
207 $content_block->addHeaderCommand(
208 $ilCtrl->getParentReturn($this),
209 $lng->txt("selected_items_back")
210 );
211
212 // get resources
213 include_once("./Services/Tagging/classes/class.ilTagging.php");
214 $objs = ilTagging::getObjectsForTagAndUser($ilUser->getId(), $_GET["tag"]);
215
216 $unaccessible = false;
217 foreach ($objs as $key => $obj) {
218 $ref_ids = ilObject::_getAllReferences($obj["obj_id"]);
219 foreach ($ref_ids as $ref_id) {
220 $type = $obj["obj_type"];
221
222 if ($type == "") {
223 $unaccessible = true;
224 continue;
225 }
226
227 // get list gui class for each object type
228 if (empty($this->item_list_gui[$type])) {
229 $class = $objDefinition->getClassName($type);
230 $location = $objDefinition->getLocation($type);
231
232 $full_class = "ilObj" . $class . "ListGUI";
233
234 include_once($location . "/class." . $full_class . ".php");
235 $this->item_list_gui[$type] = new $full_class();
236 $this->item_list_gui[$type]->enableDelete(false);
237 $this->item_list_gui[$type]->enablePath(true);
238 $this->item_list_gui[$type]->enableCut(false);
239 $this->item_list_gui[$type]->enableCopy(false);
240 $this->item_list_gui[$type]->enableSubscribe(false);
241 $this->item_list_gui[$type]->enableLink(false);
242 $this->item_list_gui[$type]->enableIcon(true);
243 }
244 $html = $this->item_list_gui[$type]->getListItemHTML(
245 $ref_id,
246 $obj["obj_id"],
247 ilObject::_lookupTitle($obj["obj_id"]),
248 ilObject::_lookupDescription($obj["obj_id"])
249 );
250
251 if ($html != "") {
252 $css = ($css != "tblrow1") ? "tblrow1" : "tblrow2";
253
254 $tpl->setCurrentBlock("res_row");
255 $tpl->setVariable("ROWCLASS", $css);
256 $tpl->setVariable("RESOURCE_HTML", $html);
257 $tpl->setVariable("ALT_TYPE", $lng->txt("obj_" . $type));
258 $tpl->setVariable(
259 "IMG_TYPE",
260 ilUtil::getImagePath("icon_" . $type . ".svg")
261 );
262 $tpl->parseCurrentBlock();
263 } else {
264 $unaccessible = true;
265 }
266 }
267 }
268
269 if ($unaccessible) {
270 $tpl->setCurrentBlock("no_access");
271 $tpl->setVariable("SOME_OBJ_WITHOUT_ACCESS", $lng->txt("tag_some_obj_tagged_without_access"));
272 $ilCtrl->saveParameter($this, "tag");
273 $tpl->setVariable("HREF_REMOVE_TAGS", $ilCtrl->getLinkTarget($this, "removeTagsWithoutAccess"));
274 $tpl->setVariable("REMOVE_TAGS", $lng->txt("tag_remove_tags_of_obj_without_access"));
275 $tpl->parseCurrentBlock();
276 }
277
278 $content_block->setContent($tpl->get());
279 //$content_block->setContent("test");
280
281 return $content_block->getHTML();
282 }
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, ilBlockGUI\$ctrl, $html, $ilCtrl, $ilUser, $key, ilBlockGUI\$lng, $location, $obj_definition, ilBlockGUI\$tpl, $type, ilBlockGUI\$user, 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 41 of file class.ilPDTaggingBlockGUI.php.

Referenced by getBlockType().

◆ $obj_definition

ilPDTaggingBlockGUI::$obj_definition
protected

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

Referenced by showResourcesForTag().


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