ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPDNotesGUI Class Reference

Private Notes on PD. More...

+ Collaboration diagram for ilPDNotesGUI:

Public Member Functions

 ilPDNotesGUI ()
 Constructor.
executeCommand ()
 execute command
 displayHeader ()
 display header and locator
 view ()
 changeRelatedObject ()
 change related object
 setTabs ()
 Show subtabs.
 showPrivateNotes ()
 Show private notes.
 showPublicComments ()
 Show public comments.
 getMode ()
 Get current mode.

Data Fields

 $ilias
 $tpl
 $lng
const PUBLIC_COMMENTS = "publiccomments"
const PRIVATE_NOTES = "privatenotes"

Detailed Description

Private Notes on PD.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilPDNotesGUI.php 38177 2012-11-14 09:21:03Z akill

ilPDNotesGUI: ilNoteGUI, ilFeedbackGUI

Definition at line 38 of file class.ilPDNotesGUI.php.

Member Function Documentation

ilPDNotesGUI::changeRelatedObject ( )

change related object

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

References $_POST, and getMode().

{
global $ilUser;
$ilUser->writePref("pd_notes_rel_obj".$this->getMode(), $_POST["rel_obj"]);
$this->ctrl->redirect($this);
}

+ Here is the call graph for this function:

ilPDNotesGUI::displayHeader ( )

display header and locator

Definition at line 119 of file class.ilPDNotesGUI.php.

References ilUtil\infoPanel().

Referenced by executeCommand().

{
//$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.gif"),
// $this->lng->txt("personal_desktop"));
// $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.gif"),
// "");
$this->tpl->setTitle($this->lng->txt("notes"));
// catch feedback message
// display infopanel if something happened
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilPDNotesGUI::executeCommand ( )

execute command

Definition at line 89 of file class.ilPDNotesGUI.php.

References $cmd, displayHeader(), setTabs(), and view().

{
$next_class = $this->ctrl->getNextClass();
switch($next_class)
{
case "ilnotegui":
// scorm2004-start
$this->setTabs();
// scorm2004-end
$this->displayHeader();
$this->view(); // forwardCommand is invoked in view() method
break;
default:
// scorm2004-start
$this->setTabs();
// scorm2004-end
$cmd = $this->ctrl->getCmd("view");
$this->displayHeader();
$this->$cmd();
break;
}
$this->tpl->show(true);
return true;
}

+ Here is the call graph for this function:

ilPDNotesGUI::getMode ( )

Get current mode.

Definition at line 317 of file class.ilPDNotesGUI.php.

References $ilSetting, PRIVATE_NOTES, and PUBLIC_COMMENTS.

Referenced by changeRelatedObject(), setTabs(), and view().

{
global $ilUser, $ilSetting;
if ($ilUser->getPref("pd_notes_mode") == ilPDNotesGUI::PUBLIC_COMMENTS &&
!$ilSetting->get("disable_comments"))
{
}
else
{
}
}

+ Here is the caller graph for this function:

ilPDNotesGUI::ilPDNotesGUI ( )

Constructor.

public

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

References $_GET, $_REQUEST, $ilCtrl, $ilias, $lng, $tpl, and IL_NOTE_PRIVATE.

{
global $ilias, $tpl, $lng, $ilCtrl, $ilUser, $ilTabs;
// initiate variables
$this->ilias =& $ilias;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->ctrl =& $ilCtrl;
// link from ilPDNotesBlockGUI
if($_GET["rel_obj"])
{
$mode = ($_GET["note_type"] == IL_NOTE_PRIVATE) ? self::PRIVATE_NOTES : self::PUBLIC_COMMENTS;
$ilUser->writePref("pd_notes_mode", $mode);
$ilUser->writePref("pd_notes_rel_obj".$mode, $_GET["rel_obj"]);
}
// edit link
else if($_REQUEST["note_id"])
{
$note = new ilNote($_REQUEST["note_id"]);
$mode = ($note->getType() == IL_NOTE_PRIVATE) ? self::PRIVATE_NOTES : self::PUBLIC_COMMENTS;
$obj = $note->getObject();
$ilUser->writePref("pd_notes_mode", $mode);
$ilUser->writePref("pd_notes_rel_obj".$mode, $obj["rep_obj_id"]);
}
}
ilPDNotesGUI::setTabs ( )

Show subtabs.

Definition at line 272 of file class.ilPDNotesGUI.php.

References $ilCtrl, $ilSetting, getMode(), PRIVATE_NOTES, and PUBLIC_COMMENTS.

Referenced by executeCommand().

{
global $ilTabs, $ilSetting, $ilCtrl;
$ilTabs->addTarget("private_notes",
$ilCtrl->getLinkTarget($this, "showPrivateNotes"), "", "", "",
if(!$ilSetting->get("disable_comments"))
{
$ilTabs->addTarget("notes_public_comments",
$ilCtrl->getLinkTarget($this, "showPublicComments"), "", "", "",
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPDNotesGUI::showPrivateNotes ( )

Show private notes.

Definition at line 290 of file class.ilPDNotesGUI.php.

References $ilCtrl, and PRIVATE_NOTES.

{
global $ilUser, $ilCtrl;
$ilUser->writePref("pd_notes_mode", ilPDNotesGUI::PRIVATE_NOTES);
$ilCtrl->redirect($this, "");
}
ilPDNotesGUI::showPublicComments ( )

Show public comments.

Definition at line 301 of file class.ilPDNotesGUI.php.

References $ilCtrl, $ilSetting, and PUBLIC_COMMENTS.

{
global $ilUser, $ilCtrl, $ilSetting;
if($ilSetting->get("disable_comments"))
{
$ilCtrl->redirect($this, "showPrivateNotes");
}
$ilUser->writePref("pd_notes_mode", ilPDNotesGUI::PUBLIC_COMMENTS);
$ilCtrl->redirect($this, "");
}
ilPDNotesGUI::view ( )

Definition at line 136 of file class.ilPDNotesGUI.php.

References $lng, ilNote\_getRelatedObjectsOfUser(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilNoteGUI\enablePrivateNotes(), getMode(), PRIVATE_NOTES, PUBLIC_COMMENTS, and ilUtil\sendInfo().

Referenced by executeCommand().

{
global $ilUser, $lng;
//$this->tpl->addBlockFile("ADM_CONTENT", "objects", "tpl.table.html")
include_once("Services/Notes/classes/class.ilNoteGUI.php");
// output related item selection (if more than one)
include_once("Services/Notes/classes/class.ilNote.php");
// prepend personal dektop, if first object
if ($rel_objs[0]["rep_obj_id"] > 0 && $this->getMode() == ilPDNotesGUI::PRIVATE_NOTES)
{
$rel_objs = array_merge(array(0), $rel_objs);
}
// #9410
if(!$rel_objs && $this->getMode() == ilPDNotesGUI::PUBLIC_COMMENTS)
{
$lng->loadLanguageModule("notes");
ilUtil::sendInfo($lng->txt("msg_no_search_result"));
return;
}
$first = true;
foreach ($rel_objs as $r)
{
if ($first) // take first one as default
{
$this->current_rel_obj = $r["rep_obj_id"];
}
if ($r["rep_obj_id"] == $ilUser->getPref("pd_notes_rel_obj".$this->getMode()))
{
$this->current_rel_obj = $r["rep_obj_id"];
}
$first = false;
}
if ($this->current_rel_obj > 0)
{
$notes_gui = new ilNoteGUI($this->current_rel_obj, 0,
ilObject::_lookupType($this->current_rel_obj),true);
}
else
{
$notes_gui = new ilNoteGUI(0, $ilUser->getId(), "pd");
}
{
$notes_gui->enablePrivateNotes(true);
$notes_gui->enablePublicNotes(false);
}
else
{
$notes_gui->enablePrivateNotes(false);
$notes_gui->enablePublicNotes(true);
}
$notes_gui->enableHiding(false);
$notes_gui->enableTargets(true);
$notes_gui->enableMultiSelection(true);
$notes_gui->enableAnchorJump(false);
$next_class = $this->ctrl->getNextClass($this);
if ($next_class == "ilnotegui")
{
$html = $this->ctrl->forwardCommand($notes_gui);
}
else
{
$html = $notes_gui->getNotesHTML();
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.pd_notes.html", "Services/Notes");
if (count($rel_objs) > 1 ||
($rel_objs[0]["rep_obj_id"] > 0))
{
foreach($rel_objs as $obj)
{
$this->tpl->setCurrentBlock("related_option");
$this->tpl->setVariable("VAL_RELATED",
$obj["rep_obj_id"]);
//echo "-".$obj["rep_obj_id"]."-".$obj["obj_type"]."-";
if ($obj["rep_obj_id"] > 0)
{
$type = ilObject::_lookupType($obj["rep_obj_id"]);
$type_str = (in_array($type, array("lm", "htlm", "sahs", "dbk")))
? $lng->txt("learning_resource")
: $lng->txt("obj_".$type);
$this->tpl->setVariable("TXT_RELATED", $type_str.": ".
ilObject::_lookupTitle($obj["rep_obj_id"]));
}
else
{
$this->tpl->setVariable("TXT_RELATED",
$lng->txt("personal_desktop"));
}
if ($obj["rep_obj_id"] == $this->current_rel_obj)
{
$this->tpl->setVariable("SEL", 'selected="selected"');
}
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("related_selection");
$this->tpl->setVariable("TXT_CHANGE", $lng->txt("change"));
$this->tpl->setVariable("TXT_RELATED_TO", $lng->txt("related_to"));
$this->tpl->setVariable("TXT_FILTER", $lng->txt("filter"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("adm_content");
// output notes
$this->tpl->setVariable("NOTES", $html);
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilPDNotesGUI::$ilias

Definition at line 46 of file class.ilPDNotesGUI.php.

Referenced by ilPDNotesGUI().

ilPDNotesGUI::$lng

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

Referenced by ilPDNotesGUI(), and view().

ilPDNotesGUI::$tpl

Definition at line 47 of file class.ilPDNotesGUI.php.

Referenced by ilPDNotesGUI().

const ilPDNotesGUI::PRIVATE_NOTES = "privatenotes"
const ilPDNotesGUI::PUBLIC_COMMENTS = "publiccomments"

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

Referenced by getMode(), setTabs(), showPublicComments(), and view().


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