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

BlockGUI class for Bookmarks block. More...

+ Inheritance diagram for ilBookmarkBlockGUI:
+ Collaboration diagram for ilBookmarkBlockGUI:

Public Member Functions

 ilBookmarkBlockGUI ()
 Constructor. More...
 
executeCommand ()
 execute command More...
 
 getHTML ()
 Handle config status. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getPDBookmarkListHTMLTree ()
 get tree bookmark list for personal desktop More...
 
 fillFooter ()
 block footer More...
 
 setFooterLinks ()
 Set footer links. More...
 
 getListRowData ()
 Get list data (for flat list). More...
 
 fillRow ($a_set)
 get flat bookmark list for personal desktop More...
 
 getOverview ()
 Get overview. More...
 
 setPdFlatMode ()
 set current desktop view mode to flat More...
 
 setPdTreeMode ()
 set current desktop view mode to tree More...
 
 setCurrentBookmarkFolder ()
 set current bookmarkfolder on personal desktop 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 = "pdbookm"
 

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

BlockGUI class for Bookmarks block.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_IsCalledBy ilBookmarkBlockGUI: ilColumnGUI

Definition at line 16 of file class.ilBookmarkBlockGUI.php.

Member Function Documentation

◆ executeCommand()

& ilBookmarkBlockGUI::executeCommand ( )

execute command

Definition at line 77 of file class.ilBookmarkBlockGUI.php.

78 {
79 global $ilCtrl;
80
81 $next_class = $ilCtrl->getNextClass();
82 $cmd = $ilCtrl->getCmd("getHTML");
83
84 return $this->$cmd();
85 }
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35

References $cmd, and $ilCtrl.

◆ fillDataSection()

ilBookmarkBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

Definition at line 104 of file class.ilBookmarkBlockGUI.php.

105 {
106 global $ilUser;
107
108 include_once("./Services/Bookmarks/classes/class.ilBookmarkFolder.php");
110 $this->num_bookmarks = $bm_items["bookmarks"];
111 $this->num_folders = $bm_items["folders"];
112
113 if ($this->getCurrentDetailLevel() > 1 &&
114 ($this->num_bookmarks > 0 || $this->num_folders > 0))
115 {
116 if ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
117 {
119 }
120 else
121 {
122 $this->setRowTemplate("tpl.bookmark_pd_list.html", "Services/Bookmarks");
123 $this->getListRowData();
124 $this->setColSpan(2);
125 parent::fillDataSection();
126 }
127 }
128 else
129 {
130 if ($this->num_bookmarks == 0 && $this->num_folders == 0)
131 {
132 $this->setEnableDetailRow(false);
133 }
134 $this->setDataSection($this->getOverview());
135 }
136 }
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
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.
setColSpan($a_colspan)
Set Columns Span.
getListRowData()
Get list data (for flat list).
getPDBookmarkListHTMLTree()
get tree bookmark list for personal desktop
_getNumberOfObjects()
Get number of folders and bookmarks for current user.
global $ilUser
Definition: imgupload.php:15

References $ilUser, ilBookmarkFolder\_getNumberOfObjects(), ilBlockGUI\getCurrentDetailLevel(), getListRowData(), getOverview(), getPDBookmarkListHTMLTree(), ilBlockGUI\setColSpan(), ilBlockGUI\setDataSection(), ilBlockGUI\setEnableDetailRow(), and ilBlockGUI\setRowTemplate().

+ Here is the call graph for this function:

◆ fillFooter()

ilBookmarkBlockGUI::fillFooter ( )

block footer

Reimplemented from ilBlockGUI.

Definition at line 156 of file class.ilBookmarkBlockGUI.php.

157 {
158 global $ilCtrl, $lng, $ilUser;
159
160 $this->setFooterLinks();
161 $this->fillFooterLinks();
162 $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
163 if ($this->tpl->blockExists("block_footer"))
164 {
165 $this->tpl->setCurrentBlock("block_footer");
166 $this->tpl->parseCurrentBlock();
167 }
168 }
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:

◆ fillRow()

ilBookmarkBlockGUI::fillRow (   $a_set)

get flat bookmark list for personal desktop

Reimplemented from ilBlockGUI.

Definition at line 269 of file class.ilBookmarkBlockGUI.php.

270 {
271 global $ilUser;
272
273 $this->tpl->setVariable("IMG_BM", $a_set["img"]);
274 $this->tpl->setVariable("IMG_ALT", $a_set["alt"]);
275 $this->tpl->setVariable("BM_TITLE", $a_set["title"]);
276 $this->tpl->setVariable("BM_LINK", $a_set["link"]);
277 $this->tpl->setVariable("BM_TARGET", ilUtil::prepareFormOutput($a_set["target"]));
278 if (isset($a_set['rel'])) {
279 $this->tpl->setVariable("BM_REL", $a_set['rel']);
280 }
281
282 if ($this->getCurrentDetailLevel() > 2)
283 {
284 $this->tpl->setVariable("BM_DESCRIPTION", ilUtil::prepareFormOutput($a_set["desc"]));
285 }
286 else
287 {
288 $this->tpl->setVariable("BM_TOOLTIP", ilUtil::prepareFormOutput($a_set["desc"]));
289 }
290 }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References $ilUser, ilBlockGUI\getCurrentDetailLevel(), and ilUtil\prepareFormOutput().

+ Here is the call graph for this function:

◆ getBlockType()

static ilBookmarkBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Definition at line 45 of file class.ilBookmarkBlockGUI.php.

46 {
47 return self::$block_type;
48 }

References $block_type.

◆ getHTML()

ilBookmarkBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

Definition at line 87 of file class.ilBookmarkBlockGUI.php.

88 {
89 // workaround to show details row
90 $this->setData(array("dummy"));
91 if ($this->getCurrentDetailLevel() == 0)
92 {
93 return "";
94 }
95 else
96 {
97 return parent::getHTML();
98 }
99 }
setData($a_data)
Set Data.

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

Referenced by setPdFlatMode(), and setPdTreeMode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListRowData()

ilBookmarkBlockGUI::getListRowData ( )

Get list data (for flat list).

Definition at line 203 of file class.ilBookmarkBlockGUI.php.

204 {
205 global $ilUser, $lng, $ilCtrl;
206
207 include_once("./Services/Bookmarks/classes/class.ilBookmarkFolder.php");
208
209 $data = array();
210
211 $sess_cur_bm_folder = "";
212 if (isset($_SESSION["ilCurBMFolder"]))
213 {
214 $sess_cur_bm_folder = $_SESSION["ilCurBMFolder"];
215 }
216
217 $bm_items = ilBookmarkFolder::getObjects($sess_cur_bm_folder);
218
219 if (!ilBookmarkFolder::isRootFolder($sess_cur_bm_folder)
220 && !empty($_SESSION["ilCurBMFolder"]))
221 {
222 $ilCtrl->setParameter($this, "curBMFolder",
223 ilBookmarkFolder::_getParentId($sess_cur_bm_folder));
224
225 $data[] = array(
226 "img" => ilUtil::getImagePath("icon_bmf.svg"),
227 "alt" => $lng->txt("bmf"),
228 "title" => "..",
229 "link" => $ilCtrl->getLinkTarget($this, "setCurrentBookmarkFolder"));
230
231 $this->setTitle($this->getTitle().": ".ilBookmarkFolder::_lookupTitle($sess_cur_bm_folder));
232 }
233
234 foreach ($bm_items as $bm_item)
235 {
236 switch ($bm_item["type"])
237 {
238 case "bmf":
239 $ilCtrl->setParameter($this, "curBMFolder", $bm_item["obj_id"]);
240 $data[] = array(
241 "img" => ilUtil::getImagePath("icon_bmf.svg"),
242 "alt" => $lng->txt("bmf"),
243 "title" => ilUtil::prepareFormOutput($bm_item["title"]),
244 "desc" => ilUtil::prepareFormOutput($bm_item["desc"]),
245 "link" => $ilCtrl->getLinkTarget($this,
246 "setCurrentBookmarkFolder"),
247 "target" => "");
248 break;
249
250 case "bm":
251 $data[] = array(
252 "img" => ilUtil::getImagePath("spacer.png"),
253 "alt" => $lng->txt("bm"),
254 "title" => ilUtil::prepareFormOutput($bm_item["title"]),
255 "desc" => ilUtil::prepareFormOutput($bm_item["desc"]),
256 "link" => ilUtil::prepareFormOutput($bm_item["target"]),
257 "rel" => "noopener",
258 "target" => "_blank");
259 break;
260 }
261 }
262
263 $this->setData($data);
264 }
$_SESSION["AccountId"]
getTitle()
Get Title.
setTitle($a_title)
Set Title.
_lookupTitle($a_bmf_id)
lookup bookmark folder title
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $_SESSION, ilBlockGUI\$data, $ilCtrl, $ilUser, $lng, ilBookmarkFolder\_getParentId(), ilBookmarkFolder\_lookupTitle(), ilUtil\getImagePath(), ilBookmarkFolder\getObjects(), ilBlockGUI\getTitle(), ilBookmarkFolder\isRootFolder(), ilUtil\prepareFormOutput(), ilBlockGUI\setData(), and ilBlockGUI\setTitle().

Referenced by fillDataSection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverview()

ilBookmarkBlockGUI::getOverview ( )

Get overview.

Definition at line 295 of file class.ilBookmarkBlockGUI.php.

296 {
297 global $ilUser, $lng, $ilCtrl;
298
299 return '<div class="small">'.$this->num_bookmarks." ".$lng->txt("bm_num_bookmarks").", ".
300 $this->num_folders." ".$lng->txt("bm_num_bookmark_folders")."</div>";
301 }

References $ilCtrl, $ilUser, and $lng.

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getPDBookmarkListHTMLTree()

ilBookmarkBlockGUI::getPDBookmarkListHTMLTree ( )

get tree bookmark list for personal desktop

Definition at line 141 of file class.ilBookmarkBlockGUI.php.

142 {
143 global $ilCtrl, $ilUser;
144
145 include_once("./Services/Bookmarks/classes/class.ilBookmarkBlockExplorerGUI.php");
146 $exp = new ilBookmarkBlockExplorerGUI($this, "getPDBookmarkListHTMLTree");
147 if (!$exp->handleCommand())
148 {
149 return "<div id='tree_div'>".$exp->getHTML()."</div>";
150 }
151 }
Bookmark block explorer GUI class.

References $ilCtrl, and $ilUser.

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilBookmarkBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 64 of file class.ilBookmarkBlockGUI.php.

65 {
66 switch($_GET["cmd"])
67 {
68 default:
69 return IL_SCREEN_SIDE;
70 break;
71 }
72 }
$_GET["client_id"]
const IL_SCREEN_SIDE

References $_GET, and IL_SCREEN_SIDE.

◆ ilBookmarkBlockGUI()

ilBookmarkBlockGUI::ilBookmarkBlockGUI ( )

Constructor.

Definition at line 23 of file class.ilBookmarkBlockGUI.php.

24 {
25 global $ilCtrl, $lng, $ilUser;
26
27 parent::ilBlockGUI();
28
29 $this->setImage(ilUtil::getImagePath("icon_bm.svg"));
30 $this->setTitle($lng->txt("my_bms"));
31 $this->setEnableNumInfo(false);
32 $this->setLimit(99999);
34
35 $this->id = (empty($_GET["bmf_id"]))
36 ? $bmf_id = 1
37 : $_GET["bmf_id"];
38 }
setLimit($a_limit)
Set Limit.
setImage($a_image)
Set Image.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.

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

+ Here is the call graph for this function:

◆ isRepositoryObject()

static ilBookmarkBlockGUI::isRepositoryObject ( )
static

Is block used in repository object?

Returns
string Block type.

Reimplemented from ilBlockGUI.

Definition at line 55 of file class.ilBookmarkBlockGUI.php.

56 {
57 return false;
58 }

◆ setCurrentBookmarkFolder()

ilBookmarkBlockGUI::setCurrentBookmarkFolder ( )

set current bookmarkfolder on personal desktop

Definition at line 344 of file class.ilBookmarkBlockGUI.php.

345 {
346 global $ilCtrl;
347
348 $_SESSION["ilCurBMFolder"] = $_GET["curBMFolder"];
349 $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
350 }

References $_GET, $_SESSION, and $ilCtrl.

◆ setFooterLinks()

ilBookmarkBlockGUI::setFooterLinks ( )

Set footer links.

Definition at line 173 of file class.ilBookmarkBlockGUI.php.

174 {
175 global $ilUser, $ilCtrl, $lng;
176
177 if ($this->num_bookmarks == 0 && $this->num_folders == 0)
178 {
179 return;
180 }
181
182 // flat
183 $this->addFooterLink( $lng->txt("list"),
184 $ilCtrl->getLinkTarget($this, "setPdFlatMode"),
185 $ilCtrl->getLinkTarget($this, "setPdFlatMode",
186 "", true),
187 "block_".$this->getBlockType()."_".$this->block_id,
188 false, false, ($ilUser->getPref("il_pd_bkm_mode") != 'tree'));
189
190 // as tree
191 $this->addFooterLink($lng->txt("tree"),
192 $ilCtrl->getLinkTarget($this,
193 "setPdTreeMode"),
194 "",
195 "block_".$this->getBlockType()."_".$this->block_id,
196 false, false, ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
197 );
198 }
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.

References $ilCtrl, $ilUser, $lng, and ilBlockGUI\addFooterLink().

Referenced by fillFooter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPdFlatMode()

ilBookmarkBlockGUI::setPdFlatMode ( )

set current desktop view mode to flat

Definition at line 306 of file class.ilBookmarkBlockGUI.php.

307 {
308 global $ilCtrl, $ilUser;
309
310 $ilUser->writePref("il_pd_bkm_mode", 'flat');
311 if ($ilCtrl->isAsynch())
312 {
313 echo $this->getHTML();
314 exit;
315 }
316 else
317 {
318 $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
319 }
320 }
getHTML()
Handle config status.
exit
Definition: login.php:54

References $ilCtrl, $ilUser, exit, and getHTML().

+ Here is the call graph for this function:

◆ setPdTreeMode()

ilBookmarkBlockGUI::setPdTreeMode ( )

set current desktop view mode to tree

Definition at line 325 of file class.ilBookmarkBlockGUI.php.

326 {
327 global $ilCtrl, $ilUser;
328
329 $ilUser->writePref("il_pd_bkm_mode", 'tree');
330 if ($ilCtrl->isAsynch())
331 {
332 echo $this->getHTML();
333 exit;
334 }
335 else
336 {
337 $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
338 }
339 }

References $ilCtrl, $ilUser, exit, and getHTML().

+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilBookmarkBlockGUI::$block_type = "pdbookm"
static

Definition at line 18 of file class.ilBookmarkBlockGUI.php.

Referenced by getBlockType().


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