BlockGUI class for Bookmarks block. More...
Inheritance diagram for ilBookmarkBlockGUI:
Collaboration diagram for ilBookmarkBlockGUI:Public Member Functions | |
| ilBookmarkBlockGUI () | |
| Constructor. | |
| & | executeCommand () |
| execute command | |
| getHTML () | |
| Get HTML. | |
| fillDataSection () | |
| Fill data section. | |
| getPDBookmarkListHTMLTree () | |
| get tree bookmark list for personal desktop | |
| fillFooter () | |
| block footer | |
| setFooterLinks () | |
| Set footer links. | |
| getListRowData () | |
| Get list data (for flat list). | |
| fillRow ($a_set) | |
| get flat bookmark list for personal desktop | |
| getOverview () | |
| Get overview. | |
| setPdFlatMode () | |
| set current desktop view mode to flat | |
| setPdTreeMode () | |
| set current desktop view mode to tree | |
| setCurrentBookmarkFolder () | |
| set current bookmarkfolder on personal desktop | |
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 = "pdbookm" |
BlockGUI class for Bookmarks block.
ilBookmarkBlockGUI: ilColumnGUI
Definition at line 34 of file class.ilBookmarkBlockGUI.php.
| & ilBookmarkBlockGUI::executeCommand | ( | ) |
| ilBookmarkBlockGUI::fillDataSection | ( | ) |
Fill data section.
Reimplemented from ilBlockGUI.
Definition at line 123 of file class.ilBookmarkBlockGUI.php.
References ilBookmarkFolder::_getNumberOfObjects(), ilBlockGUI::getCurrentDetailLevel(), getListRowData(), getOverview(), getPDBookmarkListHTMLTree(), ilBlockGUI::setColSpan(), ilBlockGUI::setDataSection(), ilBlockGUI::setEnableDetailRow(), and ilBlockGUI::setRowTemplate().
{
global $ilUser;
include_once("./Services/PersonalDesktop/classes/class.ilBookmarkFolder.php");
$bm_items = ilBookmarkFolder::_getNumberOfObjects();
$this->num_bookmarks = $bm_items["bookmarks"];
$this->num_folders = $bm_items["folders"];
if ($this->getCurrentDetailLevel() > 1 &&
($this->num_bookmarks > 0 || $this->num_folders > 0))
{
if ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
{
$this->setDataSection($this->getPDBookmarkListHTMLTree());
}
else
{
$this->setRowTemplate("tpl.bookmark_pd_list.html", "Services/PersonalDesktop");
$this->getListRowData();
$this->setColSpan(2);
parent::fillDataSection();
}
}
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:| ilBookmarkBlockGUI::fillFooter | ( | ) |
block footer
Reimplemented from ilBlockGUI.
Definition at line 197 of file class.ilBookmarkBlockGUI.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:| ilBookmarkBlockGUI::fillRow | ( | $ | a_set | ) |
get flat bookmark list for personal desktop
Reimplemented from ilBlockGUI.
Definition at line 316 of file class.ilBookmarkBlockGUI.php.
References ilBlockGUI::getCurrentDetailLevel(), and ilUtil::prepareFormOutput().
{
global $ilUser;
$this->tpl->setVariable("IMG_BM", $a_set["img"]);
$this->tpl->setVariable("IMG_ALT", $a_set["alt"]);
$this->tpl->setVariable("BM_TITLE", $a_set["title"]);
$this->tpl->setVariable("BM_LINK", $a_set["link"]);
$this->tpl->setVariable("BM_TARGET", $a_set["target"]);
if ($this->getCurrentDetailLevel() > 2)
{
$this->tpl->setVariable("BM_DESCRIPTION", ilUtil::prepareFormOutput($a_set["desc"]));
}
else
{
$this->tpl->setVariable("BM_TOOLTIP", ilUtil::prepareFormOutput($a_set["desc"]));
}
}
Here is the call graph for this function:| static ilBookmarkBlockGUI::getBlockType | ( | ) | [static] |
Get block type.
Reimplemented from ilBlockGUI.
Definition at line 63 of file class.ilBookmarkBlockGUI.php.
{
return self::$block_type;
}
| ilBookmarkBlockGUI::getHTML | ( | ) |
Get HTML.
Reimplemented from ilBlockGUI.
Definition at line 105 of file class.ilBookmarkBlockGUI.php.
References ilBlockGUI::getCurrentDetailLevel(), and ilBlockGUI::setData().
Referenced by setPdFlatMode(), and setPdTreeMode().
{
// 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:
Here is the caller graph for this function:| ilBookmarkBlockGUI::getListRowData | ( | ) |
Get list data (for flat list).
Definition at line 257 of file class.ilBookmarkBlockGUI.php.
References $_SESSION, ilBlockGUI::$data, $ilCtrl, $lng, ilBookmarkFolder::_getParentId(), ilBookmarkFolder::_lookupTitle(), ilUtil::getImagePath(), ilBookmarkFolder::getObjects(), ilBlockGUI::getTitle(), ilBookmarkFolder::isRootFolder(), ilUtil::prepareFormOutput(), ilBlockGUI::setData(), and ilBlockGUI::setTitle().
Referenced by fillDataSection().
{
global $ilUser, $lng, $ilCtrl;
include_once("./Services/PersonalDesktop/classes/class.ilBookmarkFolder.php");
$data = array();
$bm_items = ilBookmarkFolder::getObjects($_SESSION["ilCurBMFolder"]);
if (!ilBookmarkFolder::isRootFolder($_SESSION["ilCurBMFolder"])
&& !empty($_SESSION["ilCurBMFolder"]))
{
$ilCtrl->setParameter($this, "curBMFolder",
ilBookmarkFolder::_getParentId($_SESSION["ilCurBMFolder"]));
$data[] = array(
"img" => ilUtil::getImagePath("icon_cat_s.gif"),
"alt" => $lng->txt("bmf"),
"title" => "..",
"link" => $ilCtrl->getLinkTarget($this, "setCurrentBookmarkFolder"));
$this->setTitle($this->getTitle().": ".ilBookmarkFolder::_lookupTitle($_SESSION["ilCurBMFolder"]));
}
foreach ($bm_items as $bm_item)
{
switch ($bm_item["type"])
{
case "bmf":
$ilCtrl->setParameter($this, "curBMFolder", $bm_item["obj_id"]);
$data[] = array(
"img" => ilUtil::getImagePath("icon_cat_s.gif"),
"alt" => $lng->txt("bmf"),
"title" => ilUtil::prepareFormOutput($bm_item["title"]),
"desc" => ilUtil::prepareFormOutput($bm_item["desc"]),
"link" => $ilCtrl->getLinkTarget($this,
"setCurrentBookmarkFolder"),
"target" => "");
break;
case "bm":
$data[] = array(
"img" => ilUtil::getImagePath("spacer.gif"),
"alt" => $lng->txt("bm"),
"title" => ilUtil::prepareFormOutput($bm_item["title"]),
"desc" => ilUtil::prepareFormOutput($bm_item["desc"]),
"link" => ilUtil::prepareFormOutput($bm_item["target"]),
"target" => "_blank");
break;
}
}
$this->setData($data);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBookmarkBlockGUI::getOverview | ( | ) |
Get overview.
Definition at line 339 of file class.ilBookmarkBlockGUI.php.
Referenced by fillDataSection().
{
global $ilUser, $lng, $ilCtrl;
return '<div class="small">'.$this->num_bookmarks." ".$lng->txt("bm_num_bookmarks").", ".
$this->num_folders." ".$lng->txt("bm_num_bookmark_folders")."</div>";
}
Here is the caller graph for this function:| ilBookmarkBlockGUI::getPDBookmarkListHTMLTree | ( | ) |
get tree bookmark list for personal desktop
Definition at line 160 of file class.ilBookmarkBlockGUI.php.
References $_GET, $_SESSION, $ilCtrl, $tpl, and ilBlockGUI::getCurrentDetailLevel().
Referenced by fillDataSection().
{
global $ilCtrl, $ilUser;
include_once("./Services/PersonalDesktop/classes/class.ilBookmarkExplorer.php");
$showdetails = ($this->getCurrentDetailLevel() > 2);
$tpl = new ilTemplate("tpl.bookmark_pd_tree.html", true, true,
"Services/PersonalDesktop");
$exp = new ilBookmarkExplorer($ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"),
$_SESSION["AccountId"]);
$exp->setAllowedTypes(array('dum','bmf','bm'));
$exp->setEnableSmallMode(true);
$exp->setTargetGet("bmf_id");
$exp->setSessionExpandVariable('mexpand');
$ilCtrl->setParameter($this, "bmf_id", $this->id);
$exp->setExpandTarget($ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"));
if ($_GET["mexpand"] == "")
{
$expanded = $this->id;
}
else
{
$expanded = $_GET["mexpand"];
}
$exp->setExpand($expanded);
$exp->setShowDetails($showdetails);
// build html-output
$exp->setOutput(0);
return $exp->getOutput();
}
Here is the call graph for this function:
Here is the caller graph for this function:| static ilBookmarkBlockGUI::getScreenMode | ( | ) | [static] |
Get Screen Mode for current command.
Reimplemented from ilBlockGUI.
Definition at line 82 of file class.ilBookmarkBlockGUI.php.
References $_GET.
{
switch($_GET["cmd"])
{
default:
return IL_SCREEN_SIDE;
break;
}
}
| ilBookmarkBlockGUI::ilBookmarkBlockGUI | ( | ) |
Constructor.
Definition at line 41 of file class.ilBookmarkBlockGUI.php.
References $_GET, $ilCtrl, $lng, ilUtil::getImagePath(), ilBlockGUI::ilBlockGUI(), ilBlockGUI::setAvailableDetailLevels(), ilBlockGUI::setEnableNumInfo(), ilBlockGUI::setImage(), ilBlockGUI::setLimit(), and ilBlockGUI::setTitle().
{
global $ilCtrl, $lng, $ilUser;
parent::ilBlockGUI();
$this->setImage(ilUtil::getImagePath("icon_bm_s.gif"));
$this->setTitle($lng->txt("my_bms"));
$this->setEnableNumInfo(false);
$this->setLimit(99999);
$this->setAvailableDetailLevels(3);
$this->id = (empty($_GET["bmf_id"]))
? $bmf_id = 1
: $_GET["bmf_id"];
}
Here is the call graph for this function:| static ilBookmarkBlockGUI::isRepositoryObject | ( | ) | [static] |
Is block used in repository object?
Reimplemented from ilBlockGUI.
Definition at line 73 of file class.ilBookmarkBlockGUI.php.
{
return false;
}
| ilBookmarkBlockGUI::setCurrentBookmarkFolder | ( | ) |
| ilBookmarkBlockGUI::setFooterLinks | ( | ) |
Set footer links.
Definition at line 214 of file class.ilBookmarkBlockGUI.php.
References $ilCtrl, $lng, and ilBlockGUI::addFooterLink().
Referenced by fillFooter().
{
global $ilUser, $ilCtrl, $lng;
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 call graph for this function:
Here is the caller graph for this function:| ilBookmarkBlockGUI::setPdFlatMode | ( | ) |
set current desktop view mode to flat
Definition at line 350 of file class.ilBookmarkBlockGUI.php.
References $ilCtrl, exit, and getHTML().
{
global $ilCtrl, $ilUser;
$ilUser->writePref("il_pd_bkm_mode", 'flat');
if ($ilCtrl->isAsynch())
{
echo $this->getHTML();
exit;
}
else
{
$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
}
}
Here is the call graph for this function:| ilBookmarkBlockGUI::setPdTreeMode | ( | ) |
set current desktop view mode to tree
Definition at line 369 of file class.ilBookmarkBlockGUI.php.
References $ilCtrl, exit, and getHTML().
{
global $ilCtrl, $ilUser;
$ilUser->writePref("il_pd_bkm_mode", 'tree');
if ($ilCtrl->isAsynch())
{
echo $this->getHTML();
exit;
}
else
{
$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
}
}
Here is the call graph for this function:ilBookmarkBlockGUI::$block_type = "pdbookm" [static] |
Definition at line 36 of file class.ilBookmarkBlockGUI.php.
1.7.1