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

BlockGUI class for Personal Desktop Notes block. More...

+ Inheritance diagram for ilPDNotesBlockGUI:
+ Collaboration diagram for ilPDNotesBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getBlockType ()
 
Returns
string
More...
 
 executeCommand ()
 execute command More...
 
 getHTML ()
 Handle config status. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getListRowData ()
 Get list data. More...
 
 fillRow ($a_set)
 get flat bookmark list for personal desktop More...
 
 getOverview ()
 Get overview. More...
 
 showNote ()
 show single note 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 = "pdnotes"
 

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...
 

Protected Attributes

 $note_gui = null
 
- 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 Personal Desktop Notes block.

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

@ilCtrl_IsCalledBy ilPDNotesBlockGUI: ilColumnGUI

Definition at line 15 of file class.ilPDNotesBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPDNotesBlockGUI::__construct ( )

Constructor.

Reimplemented from ilBlockGUI.

Definition at line 23 of file class.ilPDNotesBlockGUI.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->setLimit(5);
35 $this->setTitle($lng->txt("notes"));
37 }
user()
Definition: user.php:4
setLimit($a_limit)
Set Limit.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setTitle($a_title)
Set Title.
global $DIC
Definition: saml.php:7

References $DIC, ilBlockGUI\$lng, ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setLimit(), ilBlockGUI\setTitle(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilPDNotesBlockGUI::executeCommand ( )

execute command

Definition at line 74 of file class.ilPDNotesBlockGUI.php.

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

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ fillDataSection()

ilPDNotesBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

97 {
99
100 include_once("Services/Notes/classes/class.ilNote.php");
101 $this->notes = ilNote::_getLastNotesOfUser();
102
103 if ($this->getCurrentDetailLevel() > 1 && count($this->notes) > 0) {
104 $this->setRowTemplate("tpl.pd_notes_overview.html", "Services/Notes");
105 $this->getListRowData();
106 //$this->setColSpan(2);
107 parent::fillDataSection();
108 } else {
109 $this->setEnableNumInfo(false);
110 if (count($this->notes) == 0) {
111 $this->setEnableDetailRow(false);
112 }
113 $this->setDataSection($this->getOverview());
114 }
115 }
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.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static _getLastNotesOfUser()
get last notes of current user
getListRowData()
Get list data.
$ilUser
Definition: imgupload.php:18

References $ilUser, ilBlockGUI\$user, ilNote\_getLastNotesOfUser(), ilBlockGUI\getCurrentDetailLevel(), getListRowData(), getOverview(), ilBlockGUI\setDataSection(), ilBlockGUI\setEnableDetailRow(), ilBlockGUI\setEnableNumInfo(), and ilBlockGUI\setRowTemplate().

+ Here is the call graph for this function:

◆ fillRow()

ilPDNotesBlockGUI::fillRow (   $a_set)

get flat bookmark list for personal desktop

Reimplemented from ilBlockGUI.

Definition at line 184 of file class.ilPDNotesBlockGUI.php.

185 {
189
190 include_once("Services/Notes/classes/class.ilNoteGUI.php");
191 if (!is_object($this->note_gui)) {
192 $this->note_gui = new ilNoteGUI(0, 0, "");
193 $this->note_gui->enableTargets();
194 }
195
196 $this->tpl->setVariable("VAL_SUBJECT", $a_set["subject"]);
197
198 // link subject to show note function
199 $ilCtrl->setParameter($this, "rel_obj", $a_set["rep_obj_id"]);
200 $ilCtrl->setParameter($this, "note_id", $a_set["id"]);
201 $ilCtrl->setParameter($this, "note_type", IL_NOTE_PRIVATE);
202 $this->tpl->setVariable(
203 "HREF_SHOW_NOTE",
204 $ilCtrl->getLinkTarget($this, "showNote")
205 );
206 $this->tpl->setVariable("IMG_NOTE", $a_set["img"]);
207 $this->tpl->setVariable("ALT_NOTE", $a_set["alt"]);
208 $ilCtrl->clearParameters($this);
209
210 // details
211 if ($this->getCurrentDetailLevel() > 2) {
212 $this->tpl->setCurrentBlock("details");
213 if (substr($a_set["text"], 0, 40) != substr($a_set["text"], 0, 40)) {
214 $this->tpl->setVariable("NOTE_TEXT", $a_set["text"]);
215 }
216 $this->tpl->setVariable(
217 "VAL_DATE",
219 );
220 $this->tpl->parseCurrentBlock();
221
222 // target objects
223 $note = new ilNote($a_set["id"]);
224 $this->tpl->setVariable(
225 "TARGET_OBJECTS",
226 $this->note_gui->renderTargets($note)
227 );
228
229 // edit button
230 $this->tpl->setCurrentBlock("edit_note");
231 $this->tpl->setVariable("TXT_EDIT_NOTE", $lng->txt("edit"));
232 $ilCtrl->setParameterByClass("ilnotegui", "rel_obj", $a_set["rep_obj_id"]);
233 $ilCtrl->setParameterByClass("ilnotegui", "note_id", $a_set["id"]);
234 $ilCtrl->setParameterByClass("ilnotegui", "note_type", IL_NOTE_PRIVATE);
235 $this->tpl->setVariable(
236 "LINK_EDIT_NOTE",
237 $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpdnotesgui", "ilnotegui"), "editNoteForm")
238 . "#note_edit"
239 );
240 $this->tpl->parseCurrentBlock();
241 }
242 $ilCtrl->clearParametersByClass("ilnotegui");
243 }
const IL_CAL_DATETIME
const IL_NOTE_PRIVATE
Definition: class.ilNote.php:5
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Notes GUI class.
Note class.

References ilBlockGUI\$ctrl, $ilCtrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, ilDatePresentation\formatDate(), ilBlockGUI\getCurrentDetailLevel(), IL_CAL_DATETIME, and IL_NOTE_PRIVATE.

+ Here is the call graph for this function:

◆ getBlockType()

ilPDNotesBlockGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

Definition at line 42 of file class.ilPDNotesBlockGUI.php.

42 : string
43 {
44 return self::$block_type;
45 }

References $block_type.

◆ getHTML()

ilPDNotesBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

Definition at line 84 of file class.ilPDNotesBlockGUI.php.

85 {
86 if ($this->getCurrentDetailLevel() == 0) {
87 return "";
88 } else {
89 return parent::getHTML();
90 }
91 }

References ilBlockGUI\getCurrentDetailLevel().

+ Here is the call graph for this function:

◆ getListRowData()

ilPDNotesBlockGUI::getListRowData ( )

Get list data.

Definition at line 121 of file class.ilPDNotesBlockGUI.php.

122 {
126
127 $data = array();
128
129 foreach ($this->notes as $note) {
130 switch ($note->getLabel()) {
132 $img = ilUtil::getImagePath("note_unlabeled.svg");
133 $alt = $lng->txt("note");
134 break;
135
137 $img = ilUtil::getImagePath("note_unlabeled.svg");
138 $alt = $lng->txt("note") . ", " . $lng->txt("important");
139 break;
140
141 case IL_NOTE_QUESTION:
142 $img = ilUtil::getImagePath("note_unlabeled.svg");
143 $alt = $lng->txt("note") . ", " . $lng->txt("question");
144 break;
145
146 case IL_NOTE_PRO:
147 $img = ilUtil::getImagePath("note_unlabeled.svg");
148 $alt = $lng->txt("note") . ", " . $lng->txt("pro");
149 break;
150
151 case IL_NOTE_CONTRA:
152 $img = ilUtil::getImagePath("note_unlabeled.svg");
153 $alt = $lng->txt("note") . ", " . $lng->txt("contra");
154 break;
155 }
156
157 // details
158 $target = $note->getObject();
159
160 // new notes do not have subject anymore
161 $title = $note->getSubject();
162 if (!$title) {
163 $title = ilUtil::shortenText($note->getText(), 75, true, true);
164 }
165
166 $data[] = array(
167 "subject" => $title,
168 "img" => $img,
169 "alt" => $alt,
170 "text" => ilUtil::shortenText($note->getText(), 150, true, true),
171 "date" => $note->getCreationDate(),
172 "id" => $note->getId(),
173 "obj_type" => $target["obj_type"],
174 "obj_id" => $target["obj_id"],
175 "rep_obj_id" => $target["rep_obj_id"]);
176 }
177
178 $this->setData($data);
179 }
const IL_NOTE_PRO
const IL_NOTE_UNLABELED
Definition: class.ilNote.php:8
const IL_NOTE_CONTRA
const IL_NOTE_QUESTION
const IL_NOTE_IMPORTANT
Definition: class.ilNote.php:9
setData($a_data)
Set Data.
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$target
Definition: test.php:19

References ilBlockGUI\$ctrl, ilBlockGUI\$data, $ilCtrl, $ilUser, $img, ilBlockGUI\$lng, $target, $title, ilBlockGUI\$user, ilUtil\getImagePath(), IL_NOTE_CONTRA, IL_NOTE_IMPORTANT, IL_NOTE_PRO, IL_NOTE_QUESTION, IL_NOTE_UNLABELED, ilBlockGUI\setData(), and ilUtil\shortenText().

Referenced by fillDataSection().

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

◆ getOverview()

ilPDNotesBlockGUI::getOverview ( )

Get overview.

Definition at line 248 of file class.ilPDNotesBlockGUI.php.

249 {
253
254 return '<div class="small">' . ((int) count($this->notes)) . " " . $lng->txt("notes") . "</div>";
255 }

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

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDNotesBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 58 of file class.ilPDNotesBlockGUI.php.

59 {
60 switch ($_GET["cmd"]) {
61 case "showNote":
62 return IL_SCREEN_CENTER;
63 break;
64
65 default:
66 return IL_SCREEN_SIDE;
67 break;
68 }
69 }
$_GET["client_id"]
const IL_SCREEN_SIDE
const IL_SCREEN_CENTER

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

◆ isRepositoryObject()

ilPDNotesBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Returns
bool

Reimplemented from ilBlockGUI.

Definition at line 50 of file class.ilPDNotesBlockGUI.php.

50 : bool
51 {
52 return false;
53 }

◆ showNote()

ilPDNotesBlockGUI::showNote ( )

show single note

Definition at line 260 of file class.ilPDNotesBlockGUI.php.

261 {
264
265 include_once("./Services/Notes/classes/class.ilNoteGUI.php");
266 $note_gui = new ilNoteGUI();
267 $note_gui->enableTargets();
268 include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
269 $content_block = new ilPDContentBlockGUI();
270 $content_block->setContent($note_gui->getPDNoteHTML($_GET["note_id"]));
271 $content_block->setTitle($lng->txt("note"));
272 $content_block->setColSpan(2);
273 $content_block->addHeaderCommand(
274 $ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"),
275 $lng->txt("selected_items_back")
276 );
277
278 return $content_block->getHTML();
279 }
BlockGUI class for (centered) Content on Personal Desktop.

References $_GET, ilBlockGUI\$ctrl, $ilCtrl, ilBlockGUI\$lng, and $note_gui.

Field Documentation

◆ $block_type

ilPDNotesBlockGUI::$block_type = "pdnotes"
static

Definition at line 17 of file class.ilPDNotesBlockGUI.php.

Referenced by getBlockType().

◆ $note_gui

ilPDNotesBlockGUI::$note_gui = null
protected

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

Referenced by showNote().


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