ILIAS  Release_5_0_x_branch Revision 61816
 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 56798 2015-01-06 16:03:05Z akill

ilPDNotesGUI: ilNoteGUI

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

Member Function Documentation

ilPDNotesGUI::changeRelatedObject ( )

change related object

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

References $_POST, $ilUser, 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 100 of file class.ilPDNotesGUI.php.

References ilUtil\infoPanel().

Referenced by executeCommand().

{
$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 70 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 308 of file class.ilPDNotesGUI.php.

References $ilSetting, $ilUser, PRIVATE_NOTES, and PUBLIC_COMMENTS.

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

{
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 37 of file class.ilPDNotesGUI.php.

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

{
global $ilias, $tpl, $lng, $ilCtrl, $ilUser, $ilTabs, $ilHelp;
$ilHelp->setScreenIdComponent("note");
// 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 263 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 281 of file class.ilPDNotesGUI.php.

References $ilCtrl, $ilUser, 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 292 of file class.ilPDNotesGUI.php.

References $ilCtrl, $ilSetting, $ilUser, and PUBLIC_COMMENTS.

{
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 113 of file class.ilPDNotesGUI.php.

References $ilSetting, $ilUser, $lng, $options, $ref_id, ilNote\_getRelatedObjectsOfUser(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilNoteGUI\enablePrivateNotes(), getMode(), PRIVATE_NOTES, PUBLIC_COMMENTS, ilUtil\sendInfo(), and ilSelectInputGUI\setOptions().

Referenced by executeCommand().

{
global $ilUser, $lng, $ilSetting, $ilAccess, $ilToolbar;
//$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");
//var_dump($rel_objs);
// 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"];
$current_ref_ids = $r["ref_ids"];
}
if ($r["rep_obj_id"] == $ilUser->getPref("pd_notes_rel_obj".$this->getMode()))
{
$this->current_rel_obj = $r["rep_obj_id"];
$current_ref_ids = $r["ref_ids"];
}
$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);
// #13707
if ($this->current_rel_obj > 0 &&
sizeof($current_ref_ids) &&
$ilSetting->get("comments_del_tutor", 1))
{
foreach($current_ref_ids as $ref_id)
{
if($ilAccess->checkAccess("write", "", $ref_id))
{
$notes_gui->enablePublicNotesDeletion(true);
break;
}
}
}
}
$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->getOnlyNotesHTML();
}
else
{
$html = $notes_gui->getOnlyCommentsHTML();
}
}
if (count($rel_objs) > 1 ||
($rel_objs[0]["rep_obj_id"] > 0))
{
$ilToolbar->setFormAction($this->ctrl->getFormAction($this));
foreach($rel_objs as $obj)
{
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);
$caption = $type_str.": ".ilObject::_lookupTitle($obj["rep_obj_id"]);
}
else
{
$caption = $lng->txt("personal_desktop");
}
$options[$obj["rep_obj_id"]] = $caption;
}
include_once "Services/Form/classes/class.ilSelectInputGUI.php";
$rel = new ilSelectInputGUI($lng->txt("related_to"), "rel_obj");
$rel->setValue($this->current_rel_obj);
$ilToolbar->addInputItem($rel);
$ilToolbar->addFormButton($lng->txt("change"), "changeRelatedObject");
}
$this->tpl->setContent($html);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilPDNotesGUI::$ilias

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

Referenced by ilPDNotesGUI().

ilPDNotesGUI::$lng

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

Referenced by ilPDNotesGUI(), and view().

ilPDNotesGUI::$tpl

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

Referenced by ilPDNotesGUI().

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

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

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


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