ILIAS  release_4-4 Revision
ilPDNotesBlockGUI Class Reference

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

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

Public Member Functions

 ilPDNotesBlockGUI ()
 Constructor. More...
 
executeCommand ()
 execute command More...
 
 getHTML ()
 
 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
 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)
 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 ()
 Get block type. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "pdnotes"
 

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
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

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$

ilPDNotesBlockGUI: ilColumnGUI

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

Member Function Documentation

◆ executeCommand()

& ilPDNotesBlockGUI::executeCommand ( )

execute command

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

References $cmd, and $ilCtrl.

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

◆ fillDataSection()

ilPDNotesBlockGUI::fillDataSection ( )

Fill data section.

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

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

101  {
102  global $ilUser;
103 
104  include_once("Services/Notes/classes/class.ilNote.php");
105  $this->notes = ilNote::_getLastNotesOfUser();
106 
107  if ($this->getCurrentDetailLevel() > 1 && count($this->notes) > 0)
108  {
109  $this->setRowTemplate("tpl.pd_notes_overview.html", "Services/Notes");
110  $this->getListRowData();
111  //$this->setColSpan(2);
112  parent::fillDataSection();
113  }
114  else
115  {
116  $this->setEnableNumInfo(false);
117  if (count($this->notes) == 0)
118  {
119  $this->setEnableDetailRow(false);
120  }
121  $this->setDataSection($this->getOverview());
122  }
123  }
getListRowData()
Get list data.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilUser
Definition: imgupload.php:15
_getLastNotesOfUser()
get last notes of current user
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ fillRow()

ilPDNotesBlockGUI::fillRow (   $a_set)

get flat bookmark list for personal desktop

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

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

194  {
195  global $ilUser, $ilCtrl, $lng;
196 
197  include_once("Services/Notes/classes/class.ilNoteGUI.php");
198  if (!is_object($this->note_gui))
199  {
200  $this->note_gui = new ilNoteGUI(0,0,"");
201  $this->note_gui->enableTargets();
202  }
203 
204  //if ($this->getCurrentDetailLevel() > 2)
205  //{
206  // $this->tpl->setVariable("VAL_SUBJECT", "<b>".$a_set["subject"]."</b>");
207  //}
208  //else
209  //{
210  $this->tpl->setVariable("VAL_SUBJECT", $a_set["subject"]);
211  //}
212 
213  // link subject to show note function
214  $ilCtrl->setParameter($this, "rel_obj", $a_set["rep_obj_id"]);
215  $ilCtrl->setParameter($this, "note_id", $a_set["id"]);
216  $ilCtrl->setParameter($this, "note_type", IL_NOTE_PRIVATE);
217  $this->tpl->setVariable("HREF_SHOW_NOTE",
218  $ilCtrl->getLinkTarget($this, "showNote"));
219  $this->tpl->setVariable("IMG_NOTE", $a_set["img"]);
220  $this->tpl->setVariable("ALT_NOTE", $a_set["alt"]);
221  $ilCtrl->clearParameters($this);
222 
223  // details
224  if ($this->getCurrentDetailLevel() > 2)
225  {
226  $this->tpl->setCurrentBlock("details");
227  if (substr($a_set["text"], 0, 40) != substr($a_set["text"], 0, 40))
228  {
229  $this->tpl->setVariable("NOTE_TEXT", $a_set["text"]);
230  }
231  $this->tpl->setVariable("VAL_DATE",
233  $this->tpl->parseCurrentBlock();
234 
235  // target objects
236  $this->note_gui->showTargets($this->tpl, $a_set["rep_obj_id"], $a_set["id"],
237  $a_set["obj_type"], $a_set["obj_id"]);
238 
239  // edit button
240  $this->tpl->setCurrentBlock("edit_note");
241  $this->tpl->setVariable("TXT_EDIT_NOTE", $lng->txt("edit"));
242  $ilCtrl->setParameterByClass("ilnotegui", "rel_obj", $a_set["rep_obj_id"]);
243  $ilCtrl->setParameterByClass("ilnotegui", "note_id", $a_set["id"]);
244  $ilCtrl->setParameterByClass("ilnotegui", "note_type", IL_NOTE_PRIVATE);
245  $this->tpl->setVariable("LINK_EDIT_NOTE",
246  $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpdnotesgui", "ilnotegui"), "editNoteForm")
247  ."#note_edit");
248  $this->tpl->parseCurrentBlock();
249  }
250  $ilCtrl->clearParametersByClass("ilnotegui");
251  }
const IL_NOTE_PRIVATE
Definition: class.ilNote.php:4
const IL_CAL_DATETIME
Notes GUI class.
global $ilCtrl
Definition: ilias.php:18
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getBlockType()

static ilPDNotesBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

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

41  {
42  return self::$block_type;
43  }

◆ getHTML()

ilPDNotesBlockGUI::getHTML ( )

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

References ilBlockGUI\getCurrentDetailLevel().

86  {
87  if ($this->getCurrentDetailLevel() == 0)
88  {
89  return "";
90  }
91  else
92  {
93  return parent::getHTML();
94  }
95  }
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getListRowData()

ilPDNotesBlockGUI::getListRowData ( )

Get list data.

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

References ilBlockGUI\$data, $ilCtrl, $ilUser, $img, $lng, 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().

130  {
131  global $ilUser, $lng, $ilCtrl;
132 
133  $data = array();
134 
135  foreach($this->notes as $note)
136  {
137  switch ($note->getLabel())
138  {
139  case IL_NOTE_UNLABELED:
140  $img = ilUtil::getImagePath("note_unlabeled.png");
141  $alt = $lng->txt("note");
142  break;
143 
144  case IL_NOTE_IMPORTANT:
145  $img = ilUtil::getImagePath("note_important.png");
146  $alt = $lng->txt("note").", ".$lng->txt("important");
147  break;
148 
149  case IL_NOTE_QUESTION:
150  $img = ilUtil::getImagePath("note_question.png");
151  $alt = $lng->txt("note").", ".$lng->txt("question");
152  break;
153 
154  case IL_NOTE_PRO:
155  $img = ilUtil::getImagePath("note_pro.png");
156  $alt = $lng->txt("note").", ".$lng->txt("pro");
157  break;
158 
159  case IL_NOTE_CONTRA:
160  $img = ilUtil::getImagePath("note_contra.png");
161  $alt = $lng->txt("note").", ".$lng->txt("contra");
162  break;
163  }
164 
165  // details
166  $target = $note->getObject();
167 
168  // new notes do not have subject anymore
169  $title = $note->getSubject();
170  if(!$title)
171  {
172  $title = ilUtil::shortenText($note->getText(), 75, true, true);
173  }
174 
175  $data[] = array(
176  "subject" => $title,
177  "img" => $img,
178  "alt" => $alt,
179  "text" => ilUtil::shortenText($note->getText(), 150, true, true),
180  "date" => $note->getCreationDate(),
181  "id" => $note->getId(),
182  "obj_type" => $target["obj_type"],
183  "obj_id" => $target["obj_id"],
184  "rep_obj_id" => $target["rep_obj_id"]);
185  }
186 
187  $this->setData($data);
188  }
const IL_NOTE_CONTRA
const IL_NOTE_PRO
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setData($a_data)
Set Data.
const IL_NOTE_UNLABELED
Definition: class.ilNote.php:7
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
const IL_NOTE_QUESTION
Definition: class.ilNote.php:9
const IL_NOTE_IMPORTANT
Definition: class.ilNote.php:8
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverview()

ilPDNotesBlockGUI::getOverview ( )

Get overview.

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

References $ilCtrl, $ilUser, and $lng.

Referenced by fillDataSection().

257  {
258  global $ilUser, $lng, $ilCtrl;
259 
260  return '<div class="small">'.((int) count($this->notes))." ".$lng->txt("notes")."</div>";
261  }
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDNotesBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

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

◆ ilPDNotesBlockGUI()

ilPDNotesBlockGUI::ilPDNotesBlockGUI ( )

Constructor.

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

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

24  {
25  global $ilCtrl, $lng, $ilUser;
26 
27  parent::ilBlockGUI();
28 
29  $this->setLimit(5);
30  $this->setImage(ilUtil::getImagePath("icon_note_s.png"));
31  $this->setTitle($lng->txt("notes"));
32  $this->setAvailableDetailLevels(3);
33  }
global $ilCtrl
Definition: ilias.php:18
setImage($a_image)
Set Image.
setTitle($a_title)
Set Title.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setLimit($a_limit)
Set Limit.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ isRepositoryObject()

static ilPDNotesBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

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

51  {
52  return false;
53  }

◆ showNote()

ilPDNotesBlockGUI::showNote ( )

show single note

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

References $_GET, $ilCtrl, $lng, $note_gui, and ilUtil\getImagePath().

267  {
268  global $lng, $ilCtrl;
269 
270  include_once("./Services/Notes/classes/class.ilNoteGUI.php");
271  $note_gui = new ilNoteGUI();
272  $note_gui->enableTargets();
273  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
274  $content_block = new ilPDContentBlockGUI();
275  $content_block->setContent($note_gui->getPDNoteHTML($_GET["note_id"]));
276  $content_block->setTitle($lng->txt("note"));
277  $content_block->setColSpan(2);
278  $content_block->setImage(ilUtil::getImagePath("icon_note.png"));
279  $content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"),
280  $lng->txt("selected_items_back"));
281 
282  return $content_block->getHTML();
283  }
$_GET["client_id"]
Notes GUI class.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $lng
Definition: privfeed.php:40
BlockGUI class for (centered) Content on Personal Desktop.
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilPDNotesBlockGUI::$block_type = "pdnotes"
static

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

◆ $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: