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 | |
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" |
BlockGUI class for Personal Desktop Notes block.
ilPDNotesBlockGUI: ilColumnGUI
Definition at line 34 of file class.ilPDNotesBlockGUI.php.
| & ilPDNotesBlockGUI::executeCommand | ( | ) |
| ilPDNotesBlockGUI::fillDataSection | ( | ) |
Fill data section.
Reimplemented from ilBlockGUI.
Definition at line 118 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);
parent::fillDataSection();
}
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 204 of file class.ilPDNotesBlockGUI.php.
References $ilCtrl, $lng, and ilBlockGUI::getCurrentDetailLevel().
{
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", $a_set["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.
Reimplemented from ilBlockGUI.
Definition at line 58 of file class.ilPDNotesBlockGUI.php.
{
return self::$block_type;
}
| ilPDNotesBlockGUI::getHTML | ( | ) |
Get HTML.
Reimplemented from ilBlockGUI.
Definition at line 103 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 147 of file class.ilPDNotesBlockGUI.php.
References ilBlockGUI::$data, $ilCtrl, $img, $lng, ilUtil::getImagePath(), ilBlockGUI::setData(), and ilUtil::shortenText().
Referenced by fillDataSection().
{
global $ilUser, $lng, $ilCtrl;
$data = array();
foreach($this->notes as $note)
{
switch ($note->getLabel())
{
case IL_NOTE_UNLABELED:
$img = ilUtil::getImagePath("note_unlabeled.gif");
$alt = $lng->txt("note");
break;
case IL_NOTE_IMPORTANT:
$img = ilUtil::getImagePath("note_important.gif");
$alt = $lng->txt("note").", ".$lng->txt("important");
break;
case IL_NOTE_QUESTION:
$img = ilUtil::getImagePath("note_question.gif");
$alt = $lng->txt("note").", ".$lng->txt("question");
break;
case IL_NOTE_PRO:
$img = ilUtil::getImagePath("note_pro.gif");
$alt = $lng->txt("note").", ".$lng->txt("pro");
break;
case IL_NOTE_CONTRA:
$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" => substr($note->getCreationDate(),0,10),
"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 263 of file class.ilPDNotesBlockGUI.php.
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 76 of file class.ilPDNotesBlockGUI.php.
References $_GET.
{
switch($_GET["cmd"])
{
case "showNote":
return IL_SCREEN_CENTER;
break;
default:
return IL_SCREEN_SIDE;
break;
}
}
| ilPDNotesBlockGUI::ilPDNotesBlockGUI | ( | ) |
Constructor.
Definition at line 41 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;
parent::ilBlockGUI();
$this->setLimit(5);
$this->setImage(ilUtil::getImagePath("icon_note_s.gif"));
$this->setTitle($lng->txt("notes"));
$this->setAvailableDetailLevels(3);
}
Here is the call graph for this function:| static ilPDNotesBlockGUI::isRepositoryObject | ( | ) | [static] |
Get block type.
Reimplemented from ilBlockGUI.
Definition at line 68 of file class.ilPDNotesBlockGUI.php.
{
return false;
}
| ilPDNotesBlockGUI::showNote | ( | ) |
show single note
Definition at line 273 of file class.ilPDNotesBlockGUI.php.
References $_GET, $ilCtrl, $lng, and ilUtil::getImagePath().
{
global $lng, $ilCtrl;
include_once("./Services/Notes/classes/class.ilNoteGUI.php");
$note_gui = new ilNoteGUI();
$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:ilPDNotesBlockGUI::$block_type = "pdnotes" [static] |
Definition at line 36 of file class.ilPDNotesBlockGUI.php.
1.7.1