ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 fillDataSection ()
 Fill data section. More...
 
 getTagCloud ()
 get tree bookmark list for personal desktop More...
 
 showResourcesForTag ()
 List resources for tag. 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)
 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 Public Member Functions inherited from ilBlockGUI
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$

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.

References $cmd, and $ilCtrl.

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

◆ fillDataSection()

ilPDTaggingBlockGUI::fillDataSection ( )

Fill data section.

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

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

125  {
126  global $ilUser;
127 
128  include_once("./Services/Tagging/classes/class.ilTagging.php");
129  $this->tags = ilTagging::getTagsForUser($ilUser->getId(), 100);
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  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
static getTagsForUser($a_user_id, $a_max=0, $a_only_online=true)
Get tags for a user.
global $ilUser
Definition: imgupload.php:15
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
getTagCloud()
get tree bookmark list for personal desktop
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ fillFooter()

ilPDTaggingBlockGUI::fillFooter ( )

block footer

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

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

258  {
259  global $ilCtrl, $lng, $ilUser;
260 
261  $this->setFooterLinks();
262  $this->fillFooterLinks();
263  $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
264  if ($this->tpl->blockExists("block_footer"))
265  {
266  $this->tpl->setCurrentBlock("block_footer");
267  $this->tpl->parseCurrentBlock();
268  }
269  }
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
global $ilCtrl
Definition: ilias.php:18
setFooterLinks()
Set footer links.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
getColSpan()
Get Columns Span.
+ Here is the call graph for this function:

◆ getBlockType()

static ilPDTaggingBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

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

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

◆ getHTML()

ilPDTaggingBlockGUI::getHTML ( )

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

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

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.
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getOverview()

ilPDTaggingBlockGUI::getOverview ( )

Get overview.

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

References $ilCtrl, $ilUser, and $lng.

Referenced by fillDataSection().

321  {
322  global $ilUser, $lng, $ilCtrl;
323 
324  return '<div class="small">'.$lng->txt("tagging_tag_info")."</div>";
325  }
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDTaggingBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

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_CENTER
const IL_SCREEN_SIDE

◆ getTagCloud()

ilPDTaggingBlockGUI::getTagCloud ( )

get tree bookmark list for personal desktop

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

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

Referenced by fillDataSection().

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("FONT_SIZE",
170  ilTagging::calculateFontSize($tag["cnt"], $max)."%");
171  $tpl->parseCurrentBlock();
172  }
173  $tpl->setVariable("CLOUD_STYLE", ' class="small" ');
174  return $tpl->get();
175  }
static calculateFontSize($cnt, $max)
Returns 100(%) for 1 and 150(%) for $max y = a + mx 100 = a + m (1) 150 = a + m * max (2) (1): a = 10...
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $ilUser
Definition: imgupload.php:15
getCurrentDetailLevel()
Get Current Detail Level.
+ 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.

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

42  {
43  global $ilCtrl, $lng, $ilUser;
44 
45  parent::ilBlockGUI();
46 
47  $lng->loadLanguageModule("tagging");
48  $this->setImage(ilUtil::getImagePath("icon_tag_s.png"));
49  $this->setTitle($lng->txt("tagging_my_tags"));
50  $this->setEnableNumInfo(false);
51  $this->setLimit(99999);
52  $this->setAvailableDetailLevels(1,0);
53  }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
setImage($a_image)
Set Image.
setTitle($a_title)
Set Title.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setLimit($a_limit)
Set Limit.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ isRepositoryObject()

static ilPDTaggingBlockGUI::isRepositoryObject ( )
static

Is block used in repository object?

Returns
string Block type.

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

71  {
72  return false;
73  }

◆ setFooterLinks()

ilPDTaggingBlockGUI::setFooterLinks ( )

Set footer links.

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

References $ilCtrl, $ilUser, and $lng.

Referenced by fillFooter().

275  {
276  global $ilUser, $ilCtrl, $lng;
277 return;
278 /*
279  if ($this->num_bookmarks == 0 && $this->num_folders == 0)
280  {
281  return;
282  }
283 
284  // flat
285  if ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
286  {
287  $this->addFooterLink( $lng->txt("flatview"),
288  $ilCtrl->getLinkTarget($this, "setPdFlatMode"),
289  $ilCtrl->getLinkTarget($this, "setPdFlatMode",
290  "", true),
291  "block_".$this->getBlockType()."_".$this->block_id);
292  }
293  else
294  {
295  $this->addFooterLink($lng->txt("flatview"));
296  }
297 
298  // as tree
299  if ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
300  {
301  $this->addFooterLink($lng->txt("treeview"));
302  }
303  else
304  {
305  $this->addFooterLink($lng->txt("treeview"),
306  $ilCtrl->getLinkTarget($this,
307  "setPdTreeMode"),
308  $ilCtrl->getLinkTarget($this,
309  "setPdTreeMode", "", true),
310  "block_".$this->getBlockType()."_".$this->block_id
311  );
312  }
313 */
314  }
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ showResourcesForTag()

ilPDTaggingBlockGUI::showResourcesForTag ( )

List resources for tag.

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

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

181  {
182  global $lng, $ilCtrl, $ilUser, $objDefinition;
183 
184  $_GET["tag"] = str_replace("-->","", $_GET["tag"]);
185 
186  $tpl = new ilTemplate("tpl.resources_for_tag.html", true, true, "Services/Tagging");
187  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
188  $content_block = new ilPDContentBlockGUI();
189  $content_block->setColSpan(2);
190  $content_block->setTitle(sprintf($lng->txt("tagging_resources_for_tag"),
191  "<i>".$_GET["tag"]."</i>"));
192  $content_block->setImage(ilUtil::getImagePath("icon_tag.png"));
193  $content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
194  $lng->txt("selected_items_back"));
195 
196  // get resources
197  include_once("./Services/Tagging/classes/class.ilTagging.php");
198  $objs = ilTagging::getObjectsForTagAndUser($ilUser->getId(), $_GET["tag"]);
199 
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 == "") continue;
208 
209  // get list gui class for each object type
210  if (empty($this->item_list_gui[$type]))
211  {
212  $class = $objDefinition->getClassName($type);
213  $location = $objDefinition->getLocation($type);
214 
215  $full_class = "ilObj".$class."ListGUI";
216 
217  include_once($location."/class.".$full_class.".php");
218  $this->item_list_gui[$type] = new $full_class();
219  $this->item_list_gui[$type]->enableDelete(false);
220  $this->item_list_gui[$type]->enablePath(true);
221  $this->item_list_gui[$type]->enableCut(false);
222  $this->item_list_gui[$type]->enableCopy(false);
223  $this->item_list_gui[$type]->enableSubscribe(false);
224  $this->item_list_gui[$type]->enablePayment(false);
225  $this->item_list_gui[$type]->enableLink(false);
226  $this->item_list_gui[$type]->enableIcon(true);
227  }
228  $html = $this->item_list_gui[$type]->getListItemHTML(
229  $ref_id,
230  $obj["obj_id"],
231  ilObject::_lookupTitle($obj["obj_id"]),
232  ilObject::_lookupDescription($obj["obj_id"]));
233 
234  if ($html != "")
235  {
236  $css = ($css != "tblrow1") ? "tblrow1" : "tblrow2";
237 
238  $tpl->setCurrentBlock("res_row");
239  $tpl->setVariable("ROWCLASS", $css);
240  $tpl->setVariable("RESOURCE_HTML", $html);
241  $tpl->setVariable("ALT_TYPE", $lng->txt("obj_".$type));
242  $tpl->setVariable("IMG_TYPE",
243  ilUtil::getImagePath("icon_".$type.".png"));
244  $tpl->parseCurrentBlock();
245  }
246  }
247  }
248  $content_block->setContent($tpl->get());
249  //$content_block->setContent("test");
250 
251  return $content_block->getHTML();
252  }
$_GET["client_id"]
$location
Definition: buildRTE.php:44
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupDescription($a_id)
lookup object description
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
global $lng
Definition: privfeed.php:40
static getObjectsForTagAndUser($a_user_id, $a_tag)
Get objects for tag and user.
BlockGUI class for (centered) Content on Personal Desktop.
+ 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.


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