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

Static Public Member Functions

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

Static Public Attributes

static $block_type = "pdtag"

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
- 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 = ""

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

& ilPDTaggingBlockGUI::executeCommand ( )

execute command

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

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd("getHTML");
return $this->$cmd();
}
ilPDTaggingBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

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

{
global $ilUser;
include_once("./Services/Tagging/classes/class.ilTagging.php");
$this->tags = ilTagging::getTagsForUser($ilUser->getId(), 100);
if ($this->getCurrentDetailLevel() > 1 && (count($this->tags) > 0))
{
$this->setDataSection($this->getTagCloud());
}
else
{
if ($this->num_bookmarks == 0 && $this->num_folders == 0)
{
$this->setEnableDetailRow(false);
}
$this->setDataSection($this->getOverview());
}
}

+ Here is the call graph for this function:

ilPDTaggingBlockGUI::fillFooter ( )

block footer

Reimplemented from ilBlockGUI.

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

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

{
global $ilCtrl, $lng, $ilUser;
$this->setFooterLinks();
$this->fillFooterLinks();
$this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
if ($this->tpl->blockExists("block_footer"))
{
$this->tpl->setCurrentBlock("block_footer");
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

static ilPDTaggingBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

References $block_type.

{
}
ilPDTaggingBlockGUI::getHTML ( )

Get HTML.

Reimplemented from ilBlockGUI.

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

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

{
// workaround to show details row
$this->setData(array("dummy"));
if ($this->getCurrentDetailLevel() == 0)
{
return "";
}
else
{
return parent::getHTML();
}
}

+ Here is the call graph for this function:

ilPDTaggingBlockGUI::getOverview ( )

Get overview.

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

References $ilCtrl, and $lng.

Referenced by fillDataSection().

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

+ Here is the caller graph for this function:

static ilPDTaggingBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

{
switch($_GET["cmd"])
{
case "showResourcesForTag":
break;
default:
break;
}
}
ilPDTaggingBlockGUI::getTagCloud ( )

get tree bookmark list for personal desktop

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

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

Referenced by fillDataSection().

{
global $ilCtrl, $ilUser;
$showdetails = ($this->getCurrentDetailLevel() > 2);
$tpl = new ilTemplate("tpl.tag_cloud.html", true, true,
"Services/Tagging");
$max = 1;
foreach($this->tags as $tag)
{
$max = max($tag["cnt"], $max);
}
reset($this->tags);
foreach($this->tags as $tag)
{
$tpl->setCurrentBlock("linked_tag");
$ilCtrl->setParameter($this, "tag", rawurlencode($tag["tag"]));
$tpl->setVariable("HREF_TAG",
$ilCtrl->getLinkTarget($this, "showResourcesForTag"));
$tpl->setVariable("TAG_TITLE", $tag["tag"]);
$tpl->setVariable("FONT_SIZE",
ilTagging::calculateFontSize($tag["cnt"], $max)."%");
$tpl->parseCurrentBlock();
}
$tpl->setVariable("CLOUD_STYLE", ' class="small" ');
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPDTaggingBlockGUI::ilPDTaggingBlockGUI ( )

Constructor.

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

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

{
global $ilCtrl, $lng, $ilUser;
$lng->loadLanguageModule("tagging");
$this->setImage(ilUtil::getImagePath("icon_tag_s.gif"));
$this->setTitle($lng->txt("tagging_my_tags"));
$this->setEnableNumInfo(false);
$this->setLimit(99999);
}

+ Here is the call graph for this function:

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.

{
return false;
}
ilPDTaggingBlockGUI::setFooterLinks ( )

Set footer links.

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

References $ilCtrl, and $lng.

Referenced by fillFooter().

{
global $ilUser, $ilCtrl, $lng;
return;
/*
if ($this->num_bookmarks == 0 && $this->num_folders == 0)
{
return;
}
// flat
if ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
{
$this->addFooterLink( $lng->txt("flatview"),
$ilCtrl->getLinkTarget($this, "setPdFlatMode"),
$ilCtrl->getLinkTarget($this, "setPdFlatMode",
"", true),
"block_".$this->getBlockType()."_".$this->block_id);
}
else
{
$this->addFooterLink($lng->txt("flatview"));
}
// as tree
if ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
{
$this->addFooterLink($lng->txt("treeview"));
}
else
{
$this->addFooterLink($lng->txt("treeview"),
$ilCtrl->getLinkTarget($this,
"setPdTreeMode"),
$ilCtrl->getLinkTarget($this,
"setPdTreeMode", "", true),
"block_".$this->getBlockType()."_".$this->block_id
);
}
*/
}

+ Here is the caller graph for this function:

ilPDTaggingBlockGUI::showResourcesForTag ( )

List resources for tag.

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

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

{
global $lng, $ilCtrl, $ilUser, $objDefinition;
$_GET["tag"] = str_replace("-->","", $_GET["tag"]);
$tpl = new ilTemplate("tpl.resources_for_tag.html", true, true, "Services/Tagging");
include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
$content_block = new ilPDContentBlockGUI();
$content_block->setColSpan(2);
$content_block->setTitle(sprintf($lng->txt("tagging_resources_for_tag"),
"<i>".$_GET["tag"]."</i>"));
$content_block->setImage(ilUtil::getImagePath("icon_tag.gif"));
$content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
$lng->txt("selected_items_back"));
// get resources
include_once("./Services/Tagging/classes/class.ilTagging.php");
$objs = ilTagging::getObjectsForTagAndUser($ilUser->getId(), $_GET["tag"]);
foreach($objs as $key => $obj)
{
$ref_ids = ilObject::_getAllReferences($obj["obj_id"]);
foreach($ref_ids as $ref_id)
{
$type = $obj["obj_type"];
if ($type == "") continue;
// get list gui class for each object type
if (empty($this->item_list_gui[$type]))
{
$class = $objDefinition->getClassName($type);
$location = $objDefinition->getLocation($type);
$full_class = "ilObj".$class."ListGUI";
include_once($location."/class.".$full_class.".php");
$this->item_list_gui[$type] = new $full_class();
$this->item_list_gui[$type]->enableDelete(false);
$this->item_list_gui[$type]->enablePath(true);
$this->item_list_gui[$type]->enableCut(false);
$this->item_list_gui[$type]->enableCopy(false);
$this->item_list_gui[$type]->enableSubscribe(false);
$this->item_list_gui[$type]->enablePayment(false);
$this->item_list_gui[$type]->enableLink(false);
}
$html = $this->item_list_gui[$type]->getListItemHTML(
$ref_id,
$obj["obj_id"],
ilObject::_lookupTitle($obj["obj_id"]),
ilObject::_lookupDescription($obj["obj_id"]));
if ($html != "")
{
$css = ($css != "tblrow1") ? "tblrow1" : "tblrow2";
$tpl->setCurrentBlock("res_row");
$tpl->setVariable("ROWCLASS", $css);
$tpl->setVariable("RESOURCE_HTML", $html);
$tpl->setVariable("ALT_TYPE", $lng->txt("obj_".$type));
$tpl->setVariable("IMG_TYPE",
ilUtil::getImagePath("icon_".$type.".gif"));
$tpl->parseCurrentBlock();
}
}
}
$content_block->setContent($tpl->get());
//$content_block->setContent("test");
return $content_block->getHTML();
}

+ Here is the call graph for this function:

Field Documentation

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: