ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBookmarkBlockGUI Class Reference

BlockGUI class for Bookmarks block. More...

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 getBlockType ()
 
Returns
string
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
 getBlockType ()
 
 __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 getScreenMode ()
 Get Screen Mode for current command. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "pdbookm"
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object.
Returns
bool
More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Additional Inherited Members

- 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
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilBookmarkBlockGUI::__construct ( )

Constructor.

Reimplemented from ilBlockGUI.

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

24 {
25 global $DIC;
26
27 $this->ctrl = $DIC->ctrl();
28 $this->lng = $DIC->language();
29 $this->user = $DIC->user();
30 $lng = $DIC->language();
31
32 parent::__construct();
33
34 $this->setImage(ilUtil::getImagePath("icon_bm.svg"));
35 $this->setTitle($lng->txt("my_bms"));
36 $this->setEnableNumInfo(false);
37 $this->setLimit(99999);
39
40 $this->id = (empty($_GET["bmf_id"]))
41 ? $bmf_id = 1
42 : $_GET["bmf_id"];
43 }
user()
Definition: user.php:4
$_GET["client_id"]
setLimit($a_limit)
Set Limit.
setImage($a_image)
Set Image.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: saml.php:7

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

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilBookmarkBlockGUI::executeCommand ( )

execute command

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

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

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ fillDataSection()

ilBookmarkBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

102 {
104
105 include_once("./Services/Bookmarks/classes/class.ilBookmarkFolder.php");
107 $this->num_bookmarks = $bm_items["bookmarks"];
108 $this->num_folders = $bm_items["folders"];
109
110 if ($this->getCurrentDetailLevel() > 1 &&
111 ($this->num_bookmarks > 0 || $this->num_folders > 0)) {
112 if ($ilUser->getPref("il_pd_bkm_mode") == 'tree') {
114 } else {
115 $this->setRowTemplate("tpl.bookmark_pd_list.html", "Services/Bookmarks");
116 $this->getListRowData();
117 $this->setColSpan(2);
118 parent::fillDataSection();
119 }
120 } else {
121 if ($this->num_bookmarks == 0 && $this->num_folders == 0) {
122 $this->setEnableDetailRow(false);
123 }
124 $this->setDataSection($this->getOverview());
125 }
126 }
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
static _getNumberOfObjects()
Get number of folders and bookmarks for current user.
$ilUser
Definition: imgupload.php:18

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

147 {
148 $this->setFooterLinks();
149 $this->fillFooterLinks();
150 $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
151 if ($this->tpl->blockExists("block_footer")) {
152 $this->tpl->setCurrentBlock("block_footer");
153 $this->tpl->parseCurrentBlock();
154 }
155 }
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
getColSpan()
Get Columns Span.
setFooterLinks()
Set footer links.

References 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 273 of file class.ilBookmarkBlockGUI.php.

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

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

+ Here is the call graph for this function:

◆ getBlockType()

ilBookmarkBlockGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

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

48 : string
49 {
50 return self::$block_type;
51 }

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 return "";
93 } else {
94 return parent::getHTML();
95 }
96 }
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 204 of file class.ilBookmarkBlockGUI.php.

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

References $_SESSION, ilBlockGUI\$ctrl, ilBlockGUI\$data, $ilCtrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, 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 296 of file class.ilBookmarkBlockGUI.php.

297 {
301
302 return '<div class="small">' . $this->num_bookmarks . " " . $lng->txt("bm_num_bookmarks") . ", " .
303 $this->num_folders . " " . $lng->txt("bm_num_bookmark_folders") . "</div>";
304 }

References ilBlockGUI\$ctrl, $ilCtrl, $ilUser, ilBlockGUI\$lng, and ilBlockGUI\$user.

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getPDBookmarkListHTMLTree()

ilBookmarkBlockGUI::getPDBookmarkListHTMLTree ( )

get tree bookmark list for personal desktop

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

132 {
135
136 include_once("./Services/Bookmarks/classes/class.ilBookmarkBlockExplorerGUI.php");
137 $exp = new ilBookmarkBlockExplorerGUI($this, "getPDBookmarkListHTMLTree");
138 if (!$exp->handleCommand()) {
139 return "<div id='tree_div'>" . $exp->getHTML() . "</div>";
140 }
141 }
Bookmark block explorer GUI class.

References ilBlockGUI\$ctrl, $ilCtrl, $ilUser, and ilBlockGUI\$user.

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 65 of file class.ilBookmarkBlockGUI.php.

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

References $_GET, and IL_SCREEN_SIDE.

◆ isRepositoryObject()

ilBookmarkBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Returns
bool

Reimplemented from ilBlockGUI.

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

56 : bool
57 {
58 return false;
59 }

◆ setCurrentBookmarkFolder()

ilBookmarkBlockGUI::setCurrentBookmarkFolder ( )

set current bookmarkfolder on personal desktop

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

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

References $_GET, $_SESSION, ilBlockGUI\$ctrl, and $ilCtrl.

◆ setFooterLinks()

ilBookmarkBlockGUI::setFooterLinks ( )

Set footer links.

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

161 {
165
166 if ($this->num_bookmarks == 0 && $this->num_folders == 0) {
167 return;
168 }
169
170 // flat
171 $this->addFooterLink(
172 $lng->txt("list"),
173 $ilCtrl->getLinkTarget($this, "setPdFlatMode"),
174 $ilCtrl->getLinkTarget(
175 $this,
176 "setPdFlatMode",
177 "",
178 true
179 ),
180 "block_" . $this->getBlockType() . "_" . $this->block_id,
181 false,
182 false,
183 ($ilUser->getPref("il_pd_bkm_mode") != 'tree')
184 );
185
186 // as tree
187 $this->addFooterLink(
188 $lng->txt("tree"),
189 $ilCtrl->getLinkTarget(
190 $this,
191 "setPdTreeMode"
192 ),
193 "",
194 "block_" . $this->getBlockType() . "_" . $this->block_id,
195 false,
196 false,
197 ($ilUser->getPref("il_pd_bkm_mode") == 'tree')
198 );
199 }
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 ilBlockGUI\$ctrl, $ilCtrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, 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 309 of file class.ilBookmarkBlockGUI.php.

310 {
313
314 $ilUser->writePref("il_pd_bkm_mode", 'flat');
315 if ($ilCtrl->isAsynch()) {
316 echo $this->getHTML();
317 exit;
318 } else {
319 $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
320 }
321 }
exit
Definition: backend.php:16
getHTML()
Handle config status.

References ilBlockGUI\$ctrl, $ilCtrl, $ilUser, ilBlockGUI\$user, exit, and getHTML().

+ Here is the call graph for this function:

◆ setPdTreeMode()

ilBookmarkBlockGUI::setPdTreeMode ( )

set current desktop view mode to tree

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

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

References ilBlockGUI\$ctrl, $ilCtrl, $ilUser, ilBlockGUI\$user, 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: