ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPDNotesBlockGUI Class Reference

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

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

Public Member Functions

 ilPDNotesBlockGUI ()
 Constructor.
executeCommand ()
 execute command
 getHTML ()
 Get HTML.
 fillDataSection ()
 Fill data section.
 getListRowData ()
 Get list data.
 fillRow ($a_set)
 get flat bookmark list for personal desktop
 getOverview ()
 Get overview.
 showNote ()
 show single note
- Public Member Functions inherited from ilBlockGUI
 ilBlockGUI ()
 Constructor.
 addHeaderLink ($a_href, $a_text, $status=true)
 getHeaderLinks ()
 setData ($a_data)
 Set Data.
 getData ()
 Get Data.
 setBigMode ($a_bigmode)
 Set Big Mode.
 getBigMode ()
 Get Big Mode.
 setBlockId ($a_block_id=0)
 Set Block Id.
 getBlockId ()
 Get Block Id.
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels.
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level.
 setGuiObject (&$a_gui_object)
 Set GuiObject.
 getGuiObject ()
 Get GuiObject.
 getCurrentDetailLevel ()
 Get Current Detail Level.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setImage ($a_image)
 Set Image.
 getImage ()
 Get Image.
 setOffset ($a_offset)
 Set Offset.
 getOffset ()
 Get Offset.
 correctOffset ()
 setLimit ($a_limit)
 Set Limit.
 getLimit ()
 Get Limit.
 setEnableEdit ($a_enableedit)
 Set EnableEdit.
 getEnableEdit ()
 Get EnableEdit.
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode.
 getRepositoryMode ()
 Get RepositoryMode.
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info.
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info.
 setSubtitle ($a_subtitle)
 Set Subtitle.
 getSubtitle ()
 Get Subtitle.
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true).
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true).
 setAdminCommands ($a_admincommands)
 Set Administration Commmands.
 getAdminCommands ()
 Get Administration Commmands.
 setColSpan ($a_colspan)
 Set Columns Span.
 getColSpan ()
 Get Columns Span.
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow.
 getEnableDetailRow ()
 Get EnableDetailRow.
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info.
 getEnableNumInfo ()
 Get Enable Item Number Info.
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties.
 getProperty ($a_property)
 setProperty ($a_property, $a_value)
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name.
 getNavParameter ()
 getDetailParameter ()
 getConfigParameter ()
 getMoveParameter ()
 getRowTemplateName ()
 Get Row Template Name.
 getRowTemplateDir ()
 Get Row Template Directory.
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false)
 Add Block Command.
 getBlockCommands ()
 Get Block commands.
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command.
 getHeaderCommands ()
 Get Header Block commands.
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false)
 Add a footer text/link.
 getFooterLinks ()
 Get footer links.
 clearFooterLinks ()
 Clear footer links.
 handleDetailLevel ()
 Handle read/write current detail level.
 setConfigMode ($a_configmode)
 Handle config status.
 getConfigMode ()
 Get Config Mode (move blocks).
 fillHeaderCommands ()
 Fill header commands block.
 fillHeaderTitleBlock ()
 Fill header title block (title and.
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used.
 fillFooter ()
 fillPreviousNext ()
 Fill previous/next row.
 setPreviousNextLinks ()
 Get previous/next linkbar.
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links.
 fillDetailRow ()
 Fill Detail Setting Row.
 fillMoveRow ()
 Fill row for Moving.
 getAllowMove ($a_direction)
 setAllowMove ($a_direction, $a_allow=true)
 fillMoveLink ($a_value, $a_img, $a_txt)

Static Public Member Functions

static getBlockType ()
 Get block type.
static isRepositoryObject ()
 Get block type.
static getScreenMode ()
 Get Screen Mode for current command.

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 = ""

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")

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

& ilPDNotesBlockGUI::executeCommand ( )

execute command

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

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd("getHTML");
return $this->$cmd();
}
ilPDNotesBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

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

{
global $ilUser;
include_once("Services/Notes/classes/class.ilNote.php");
$this->notes = ilNote::_getLastNotesOfUser();
if ($this->getCurrentDetailLevel() > 1 && count($this->notes) > 0)
{
$this->setRowTemplate("tpl.pd_notes_overview.html", "Services/Notes");
$this->getListRowData();
//$this->setColSpan(2);
}
else
{
$this->setEnableNumInfo(false);
if (count($this->notes) == 0)
{
$this->setEnableDetailRow(false);
}
$this->setDataSection($this->getOverview());
}
}

+ Here is the call graph for this function:

ilPDNotesBlockGUI::fillRow (   $a_set)

get flat bookmark list for personal desktop

Reimplemented from ilBlockGUI.

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

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

{
global $ilUser, $ilCtrl, $lng;
include_once("Services/Notes/classes/class.ilNoteGUI.php");
if (!is_object($this->note_gui))
{
$this->note_gui = new ilNoteGUI(0,0,"");
$this->note_gui->enableTargets();
}
//if ($this->getCurrentDetailLevel() > 2)
//{
// $this->tpl->setVariable("VAL_SUBJECT", "<b>".$a_set["subject"]."</b>");
//}
//else
//{
$this->tpl->setVariable("VAL_SUBJECT", $a_set["subject"]);
//}
// link subject to show note function
$ilCtrl->setParameter($this, "rel_obj", $a_set["rep_obj_id"]);
$ilCtrl->setParameter($this, "note_id", $a_set["id"]);
$ilCtrl->setParameter($this, "note_type", IL_NOTE_PRIVATE);
$this->tpl->setVariable("HREF_SHOW_NOTE",
$ilCtrl->getLinkTarget($this, "showNote"));
$this->tpl->setVariable("IMG_NOTE", $a_set["img"]);
$this->tpl->setVariable("ALT_NOTE", $a_set["alt"]);
$ilCtrl->clearParameters($this);
// details
if ($this->getCurrentDetailLevel() > 2)
{
$this->tpl->setCurrentBlock("details");
$this->tpl->setVariable("NOTE_TEXT", $a_set["text"]);
$this->tpl->setVariable("VAL_DATE",
$this->tpl->parseCurrentBlock();
// target objects
$this->note_gui->showTargets($this->tpl, $a_set["rep_obj_id"], $a_set["id"],
$a_set["obj_type"], $a_set["obj_id"]);
// edit button
$this->tpl->setCurrentBlock("edit_note");
$this->tpl->setVariable("TXT_EDIT_NOTE", $lng->txt("edit"));
$ilCtrl->setParameterByClass("ilnotegui", "rel_obj", $a_set["rep_obj_id"]);
$ilCtrl->setParameterByClass("ilnotegui", "note_id", $a_set["id"]);
$ilCtrl->setParameterByClass("ilnotegui", "note_type", IL_NOTE_PRIVATE);
$this->tpl->setVariable("LINK_EDIT_NOTE",
$ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpdnotesgui", "ilnotegui"), "editNoteForm")
."#note_edit");
$this->tpl->parseCurrentBlock();
}
$ilCtrl->clearParametersByClass("ilnotegui");
}

+ Here is the call graph for this function:

static ilPDNotesBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

References $block_type.

{
}
ilPDNotesBlockGUI::getHTML ( )

Get HTML.

Reimplemented from ilBlockGUI.

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

References ilBlockGUI\getCurrentDetailLevel().

{
if ($this->getCurrentDetailLevel() == 0)
{
return "";
}
else
{
return parent::getHTML();
}
}

+ Here is the call graph for this function:

ilPDNotesBlockGUI::getListRowData ( )

Get list data.

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

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

{
global $ilUser, $lng, $ilCtrl;
$data = array();
foreach($this->notes as $note)
{
switch ($note->getLabel())
{
$img = ilUtil::getImagePath("note_unlabeled.gif");
$alt = $lng->txt("note");
break;
$img = ilUtil::getImagePath("note_important.gif");
$alt = $lng->txt("note").", ".$lng->txt("important");
break;
$img = ilUtil::getImagePath("note_question.gif");
$alt = $lng->txt("note").", ".$lng->txt("question");
break;
$img = ilUtil::getImagePath("note_pro.gif");
$alt = $lng->txt("note").", ".$lng->txt("pro");
break;
$img = ilUtil::getImagePath("note_contra.gif");
$alt = $lng->txt("note").", ".$lng->txt("contra");
break;
}
// details
$target = $note->getObject();
$data[] = array(
"subject" => $note->getSubject(),
"img" => $img,
"alt" => $alt,
"text" => ilUtil::shortenText($note->getText(), 150, true, true),
"date" => $note->getCreationDate(),
"id" => $note->getId(),
"obj_type" => $target["obj_type"],
"obj_id" => $target["obj_id"],
"rep_obj_id" => $target["rep_obj_id"]);
}
$this->setData($data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPDNotesBlockGUI::getOverview ( )

Get overview.

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

References $ilCtrl, and $lng.

Referenced by fillDataSection().

{
global $ilUser, $lng, $ilCtrl;
return '<div class="small">'.((int) count($this->notes))." ".$lng->txt("notes")."</div>";
}

+ Here is the caller graph for this function:

static ilPDNotesBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

{
switch($_GET["cmd"])
{
case "showNote":
break;
default:
break;
}
}
ilPDNotesBlockGUI::ilPDNotesBlockGUI ( )

Constructor.

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

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

{
global $ilCtrl, $lng, $ilUser;
$this->setLimit(5);
$this->setImage(ilUtil::getImagePath("icon_note_s.gif"));
$this->setTitle($lng->txt("notes"));
}

+ Here is the call graph for this function:

static ilPDNotesBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

{
return false;
}
ilPDNotesBlockGUI::showNote ( )

show single note

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

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

{
global $lng, $ilCtrl;
include_once("./Services/Notes/classes/class.ilNoteGUI.php");
$note_gui->enableTargets();
include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
$content_block = new ilPDContentBlockGUI();
$content_block->setContent($note_gui->getPDNoteHTML($_GET["note_id"]));
$content_block->setTitle($lng->txt("note"));
$content_block->setColSpan(2);
$content_block->setImage(ilUtil::getImagePath("icon_note.gif"));
$content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"),
$lng->txt("selected_items_back"));
return $content_block->getHTML();
}

+ Here is the call graph for this function:

Field Documentation

ilPDNotesBlockGUI::$block_type = "pdnotes"
static

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

Referenced by getBlockType().

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: