ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNoteGUI Class Reference

Notes GUI class. More...

+ Collaboration diagram for ilNoteGUI:

Public Member Functions

 ilNoteGUI ($a_rep_obj_id="", $a_obj_id="", $a_obj_type="", $a_include_subobjects=false)
 constructor, specifies notes set
executeCommand ()
 execute command
 enablePrivateNotes ($a_enable=true)
 enable private notes
 enablePublicNotes ($a_enable=true)
 enable public notes
 enableCommentsSettings ($a_enable=true)
 enable private notes
 enablePublicNotesDeletion ($a_enable=true)
 enable public notes
 enableHiding ($a_enable=true)
 enable hiding
 enableTargets ($a_enable=true)
 enable target objects
 enableMultiSelection ($a_enable=true)
 enable multi selection (checkboxes and commands)
 enableAnchorJump ($a_enable=true)
 enable anchor for form jump
 setRepositoryMode ($a_value)
 Set repository mode.
 getOnlyNotesHTML ()
 Get only notes html.
 getOnlyCommentsHTML ()
 Get only comments html.
 getNotesHTML ($a_init_form=true)
 activateComments ()
 Activate Comments.
 deactivateComments ()
 Deactivate Comments.
 getNoteListHTML ($a_type=IL_NOTE_PRIVATE, $a_init_form=true)
 get notes/comments list as html code
 checkDeletion ($a_note)
 Check whether deletion is allowed.
 checkEdit ($a_note)
 Check edit.
 initNoteForm ($a_mode="edit", $a_type, $a_note=null)
 Init note form.
 getPDNoteHTML ($note_id)
 Note display for personal desktop.
 showTargets (&$tpl, $a_rep_obj_id, $a_note_id, $a_obj_type, $a_obj_id)
 show related objects as links
 addNoteForm ($a_init_form=true)
 get notes list including add note area
 cancelAddNote ()
 cancel add note
 cancelUpdateNote ()
 cancel edit note
 addNote ()
 add note
 updateNote ()
 update note
 editNoteForm ($a_init_form=true)
 get notes list including add note area
 deleteNote ()
 delete note confirmation
 deleteNotes ()
 delete notes confirmation
 cancelDelete ()
 cancel deletion of note
 confirmDelete ()
 cancel deletion of note
 exportNotesHTML ()
 export selected notes to html
 printNotes ()
 notes print view screen
 showNotes ()
 show notes
 hideNotes ()
 hide notes
 showAllPublicNotes ()
 show all public notes to user
 showMyPublicNotes ()
 show only public notes of user
 initJavascript ($a_ajax_url)
 Init javascript.
 getListNotesJSCall ($a_hash, $a_update_code=null)
 Get list notes js call.
 getListCommentsJSCall ($a_hash, $a_update_code=null)
 Get list comments js call.
 renderLink ($a_tpl, $a_var, $a_txt, $a_cmd, $a_anchor="")
 Render a link.
 addObserver ($a_callback)
 Add observer.

Data Fields

 $public_deletion_enabled = false
 $repository_mode = false

Protected Member Functions

 getSubObjectTitle ($parent_obj_id, $sub_obj_id)
 Get sub object title if available with callback.
 notifyObserver ($a_action, $a_note)
 Notify observers on update/create.

Static Protected Member Functions

static buildAjaxHash ($a_node_type, $a_node_id, $a_sub_id, $a_sub_type)
 Combine properties to hash.

Detailed Description

Notes GUI class.

An instance of this class handles all notes (and their lists) of an object.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilNoteGUI.php 47027 2014-01-05 15:37:44Z akill

Definition at line 18 of file class.ilNoteGUI.php.

Member Function Documentation

ilNoteGUI::activateComments ( )

Activate Comments.

Definition at line 355 of file class.ilNoteGUI.php.

References $ilCtrl.

Referenced by deactivateComments().

{
global $ilCtrl;
$notes_settings = new ilSetting("notes");
if ($this->comments_settings)
{
$id = $this->rep_obj_id."_".$this->obj_id."_".$this->obj_type;
//$notes_settings->set("activate_".$id, 1);
ilNote::activateComments($this->rep_obj_id, $this->obj_id, $this->obj_type, true);
}
$ilCtrl->redirectByClass("ilnotegui", "showNotes", "", $this->ajax);
// $ilCtrl->redirectByClass("ilnotegui", "getNotesHtml", "", $this->ajax);
}

+ Here is the caller graph for this function:

ilNoteGUI::addNote ( )

add note

Definition at line 1354 of file class.ilNoteGUI.php.

References $_GET, $_POST, $ilCtrl, $ilUser, $lng, initNoteForm(), and notifyObserver().

{
global $ilUser, $lng, $ilCtrl;
$this->initNoteForm("create", $_GET["note_type"]);
//if ($this->form->checkInput())
if ($_POST["note"] != "")
{
$note = new ilNote();
$note->setObject($this->obj_type, $this->rep_obj_id, $this->obj_id);
$note->setInRepository($this->repository_mode);
$note->setType($_GET["note_type"]);
$note->setAuthor($ilUser->getId());
$note->setText(ilUtil::stripslashes($_POST["note"]));
// $note->setSubject($_POST["sub_note"]);
// $note->setLabel($_POST["note_label"]);
$note->create();
$this->notifyObserver("new", $note);
$ilCtrl->setParameter($this, "note_mess", "mod");
// $ilCtrl->redirect($this, "showNotes", "notes_top", $this->ajax);
}
$ilCtrl->redirect($this, "showNotes", "notes_top", $this->ajax);
// $this->note_mess = "frmfld";
// $this->form->setValuesByPost();
// return $this->addNoteForm(false);;
}

+ Here is the call graph for this function:

ilNoteGUI::addNoteForm (   $a_init_form = true)

get notes list including add note area

Definition at line 1322 of file class.ilNoteGUI.php.

References $_GET, $ilUser, getNotesHTML(), and IL_NOTE_PRIVATE.

{
global $ilUser;
$suffix = ($_GET["note_type"] == IL_NOTE_PRIVATE)
? "private"
: "public";
$ilUser->setPref("notes_".$suffix, "y");
$this->add_note_form = true;
return $this->getNotesHTML($a_init_form);
}

+ Here is the call graph for this function:

ilNoteGUI::addObserver (   $a_callback)

Add observer.

Parameters
string | array$a_callback

Definition at line 1681 of file class.ilNoteGUI.php.

{
$this->observer[] = $a_callback;
}
static ilNoteGUI::buildAjaxHash (   $a_node_type,
  $a_node_id,
  $a_sub_id,
  $a_sub_type 
)
staticprotected

Combine properties to hash.

Parameters
string$a_node_type
int$a_node_id
int$a_sub_id
string$a_sub_type
Returns
string

Definition at line 1642 of file class.ilNoteGUI.php.

{
return $a_node_type.";".$a_node_id.";".$a_sub_id.";".$a_sub_type;
}
ilNoteGUI::cancelAddNote ( )

cancel add note

Definition at line 1338 of file class.ilNoteGUI.php.

References getNotesHTML().

{
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::cancelDelete ( )

cancel deletion of note

Definition at line 1462 of file class.ilNoteGUI.php.

References getNotesHTML().

{
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::cancelUpdateNote ( )

cancel edit note

Definition at line 1346 of file class.ilNoteGUI.php.

References getNotesHTML().

{
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::checkDeletion (   $a_note)

Check whether deletion is allowed.

Definition at line 910 of file class.ilNoteGUI.php.

References $ilUser, $public_deletion_enabled, IL_NOTE_PRIVATE, and IL_NOTE_PUBLIC.

Referenced by confirmDelete(), and getNoteListHTML().

{
global $ilUser;
if ($ilUser->getId() == ANONYMOUS_USER_ID)
{
return false;
}
// delete note stuff for all private notes
if (($a_note->getType() == IL_NOTE_PRIVATE && $a_note->getAuthor() == $ilUser->getId()) ||
($a_note->getType() == IL_NOTE_PUBLIC &&
)
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilNoteGUI::checkEdit (   $a_note)

Check edit.

Definition at line 934 of file class.ilNoteGUI.php.

References $ilUser.

Referenced by getNoteListHTML(), and updateNote().

{
global $ilUser;
if ($a_note->getAuthor() == $ilUser->getId()
&& ($ilUser->getId() != ANONYMOUS_USER_ID))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilNoteGUI::confirmDelete ( )

cancel deletion of note

Definition at line 1470 of file class.ilNoteGUI.php.

References $_POST, $ilCtrl, $ilUser, $lng, and checkDeletion().

{
global $ilCtrl, $lng, $ilUser;
$cnt = 0;
foreach($_POST["note"] as $id)
{
$note = new ilNote($id);
if ($this->checkDeletion($note))
{
$note->delete();
$cnt++;
}
}
if ($cnt > 1)
{
$ilCtrl->setParameter($this, "note_mess", "ntsdel");
}
else
{
$ilCtrl->setParameter($this, "note_mess", "ntdel");
}
$ilCtrl->redirect($this, "showNotes", "notes_top", $this->ajax);
}

+ Here is the call graph for this function:

ilNoteGUI::deactivateComments ( )

Deactivate Comments.

Definition at line 375 of file class.ilNoteGUI.php.

References $ilCtrl, and activateComments().

{
global $ilCtrl;
$notes_settings = new ilSetting("notes");
if ($this->comments_settings)
{
$id = $this->rep_obj_id."_".$this->obj_id."_".$this->obj_type;
//$notes_settings->set("activate_".$id, 0);
ilNote::activateComments($this->rep_obj_id, $this->obj_id, $this->obj_type, false);
}
$ilCtrl->redirectByClass("ilnotegui", "showNotes", "", $this->ajax);
//$ilCtrl->redirectByClass("ilnotegui", "getNotesHtml", "", $this->ajax);
}

+ Here is the call graph for this function:

ilNoteGUI::deleteNote ( )

delete note confirmation

Definition at line 1432 of file class.ilNoteGUI.php.

References getNotesHTML().

{
$this->delete_note = true;
$this->note_mess = "qdel";
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::deleteNotes ( )

delete notes confirmation

Definition at line 1442 of file class.ilNoteGUI.php.

References $_POST, $lng, and getNotesHTML().

{
global $lng;
if (!$_POST["note"])
{
$this->note_mess = "noc";
}
else
{
$this->delete_note = true;
$this->note_mess = "qdel";
}
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::editNoteForm (   $a_init_form = true)

get notes list including add note area

Definition at line 1422 of file class.ilNoteGUI.php.

References getNotesHTML().

Referenced by updateNote().

{
$this->edit_note_form = true;
return $this->getNotesHTML($a_init_form);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNoteGUI::enableAnchorJump (   $a_enable = true)

enable anchor for form jump

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

{
$this->anchor_jump = $a_enable;
}
ilNoteGUI::enableCommentsSettings (   $a_enable = true)

enable private notes

Definition at line 153 of file class.ilNoteGUI.php.

{
$this->comments_settings = $a_enable;
}
ilNoteGUI::enableHiding (   $a_enable = true)

enable hiding

Definition at line 169 of file class.ilNoteGUI.php.

{
$this->enable_hiding = $a_enable;
}
ilNoteGUI::enableMultiSelection (   $a_enable = true)

enable multi selection (checkboxes and commands)

Definition at line 185 of file class.ilNoteGUI.php.

{
$this->multi_selection = $a_enable;
}
ilNoteGUI::enablePrivateNotes (   $a_enable = true)

enable private notes

Definition at line 137 of file class.ilNoteGUI.php.

Referenced by ilPageObjectGUI\getNotesHTML(), and ilPDNotesGUI\view().

{
$this->private_enabled = $a_enable;
}

+ Here is the caller graph for this function:

ilNoteGUI::enablePublicNotes (   $a_enable = true)

enable public notes

Definition at line 145 of file class.ilNoteGUI.php.

Referenced by ilInfoScreenGUI\showNotesSection().

{
$this->public_enabled = $a_enable;
}

+ Here is the caller graph for this function:

ilNoteGUI::enablePublicNotesDeletion (   $a_enable = true)

enable public notes

Definition at line 161 of file class.ilNoteGUI.php.

Referenced by ilLMPresentationGUI\ilLMNotes().

{
$this->public_deletion_enabled = $a_enable;
}

+ Here is the caller graph for this function:

ilNoteGUI::enableTargets (   $a_enable = true)

enable target objects

Definition at line 177 of file class.ilNoteGUI.php.

{
$this->targets_enabled = $a_enable;
}
& ilNoteGUI::executeCommand ( )

execute command

Definition at line 121 of file class.ilNoteGUI.php.

References $cmd.

{
$cmd = $this->ctrl->getCmd("getNotesHTML");
$next_class = $this->ctrl->getNextClass($this);
switch($next_class)
{
default:
return $this->$cmd();
break;
}
}
ilNoteGUI::exportNotesHTML ( )

export selected notes to html

Definition at line 1498 of file class.ilNoteGUI.php.

References $tpl, ilUtil\deliverData(), and getNotesHTML().

{
$tpl = new ilTemplate("tpl.main.html", true, true);
$this->export_html = true;
$this->multi_selection = false;
$tpl->setVariable("CONTENT", $this->getNotesHTML());
ilUtil::deliverData($tpl->get(), "notes.html");
}

+ Here is the call graph for this function:

ilNoteGUI::getListCommentsJSCall (   $a_hash,
  $a_update_code = null 
)

Get list comments js call.

Parameters
string$a_hash
string$a_update_code
Returns
string

Definition at line 1619 of file class.ilNoteGUI.php.

Referenced by ilObjectListGUI\getHeaderAction(), ilObjectListGUI\insertCommonSocialCommands(), and ilObjectListGUI\insertProperties().

{
if ($a_update_code === null)
{
$a_update_code = "null";
}
else
{
$a_update_code = "'".$a_update_code."'";
}
return "ilNotes.listComments(event, '".$a_hash."', ".$a_update_code.");";
}

+ Here is the caller graph for this function:

ilNoteGUI::getListNotesJSCall (   $a_hash,
  $a_update_code = null 
)

Get list notes js call.

Parameters
string$a_hash
string$a_update_code
Returns
string

Definition at line 1598 of file class.ilNoteGUI.php.

Referenced by ilObjectListGUI\getHeaderAction(), ilObjectListGUI\insertCommonSocialCommands(), and ilObjectListGUI\insertProperties().

{
if ($a_update_code === null)
{
$a_update_code = "null";
}
else
{
$a_update_code = "'".$a_update_code."'";
}
return "ilNotes.listNotes(event, '".$a_hash."', ".$a_update_code.");";
}

+ Here is the caller graph for this function:

ilNoteGUI::getNoteListHTML (   $a_type = IL_NOTE_PRIVATE,
  $a_init_form = true 
)

get notes/comments list as html code

Definition at line 395 of file class.ilNoteGUI.php.

References $_GET, $_POST, $ilCtrl, $ilUser, $img, $lng, $tpl, ilObject\_exists(), ilObject\_getIcon(), ilNote\_getNotesOfObject(), ilObjUser\_getPersonalPicturePath(), ilObjUser\_lookupLogin(), ilContainerReference\_lookupTitle(), ilObject\_lookupTitle(), checkDeletion(), checkEdit(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilUserUtil\getNamePresentation(), getSubObjectTitle(), IL_CAL_DATETIME, IL_NOTE_CONTRA, IL_NOTE_IMPORTANT, IL_NOTE_PRIVATE, IL_NOTE_PRO, IL_NOTE_PUBLIC, IL_NOTE_QUESTION, IL_NOTE_UNLABELED, ilUtil\img(), initNoteForm(), renderLink(), ilDatePresentation\setUseRelativeDates(), showTargets(), and ilDatePresentation\useRelativeDates().

Referenced by getNotesHTML().

{
global $lng, $ilCtrl, $ilUser;
include_once("./Services/User/classes/class.ilUserUtil.php");
$suffix = ($a_type == IL_NOTE_PRIVATE)
? "private"
: "public";
/* user settings are deprecated
$user_setting_notes_public_all = $ilUser->getPref("notes_pub_all");
$user_setting_notes_by_type = $ilUser->getPref("notes_".$suffix);
*/
$user_setting_notes_public_all = "y";
$user_setting_notes_by_type = "y";
if ($this->delete_note || $this->export_html || $this->print)
{
if ($_GET["note_id"] != "")
{
$filter = $_GET["note_id"];
}
else
{
$filter = $_POST["note"];
}
}
$notes = ilNote::_getNotesOfObject($this->rep_obj_id, $this->obj_id,
$this->obj_type, $a_type, $this->inc_sub, $filter,
$user_setting_notes_public_all, $this->repository_mode);
$all_notes = ilNote::_getNotesOfObject($this->rep_obj_id, $this->obj_id,
$this->obj_type, $a_type, $this->inc_sub, $filter,
"", $this->repository_mode);
$tpl = new ilTemplate("tpl.notes_list.html", true, true, "Services/Notes");
// show counter if notes are hidden
$cnt_str = (count($all_notes) > 0)
? " (".count($all_notes).")"
: "";
if (!$this->export_html)
{
$tpl->setCurrentBlock("notes_img");
if ($a_type == IL_NOTE_PUBLIC)
{
$tpl->setVariable("IMG_NOTES", ilUtil::getImagePath("icon_comment.png"));
$tpl->setVariable("ALT_NOTES", $lng->txt("icon")." ".$lng->txt("notes_public_comments"));
}
else
{
$tpl->setVariable("IMG_NOTES", ilUtil::getImagePath("icon_note.png"));
$tpl->setVariable("ALT_NOTES", $lng->txt("icon")." ".$lng->txt("private_notes"));
}
$tpl->parseCurrentBlock();
}
// title
if ($this->ajax)
{
switch($this->obj_type)
{
case "catr":
case "crsr":
include_once "Services/ContainerReference/classes/class.ilContainerReference.php";
$title = ilContainerReference::_lookupTitle($this->rep_obj_id);
break;
default:
$title = ilObject::_lookupTitle($this->rep_obj_id);
break;
}
$img = ilUtil::img(ilObject::_getIcon($this->rep_obj_id, "tiny"));
// add sub-object if given
if($this->obj_id)
{
$sub_title = $this->getSubObjectTitle($this->rep_obj_id, $this->obj_id);
if($sub_title)
{
$title .= " - ".$sub_title;
}
}
$tpl->setCurrentBlock("title");
$tpl->setVariable("TITLE", $img." ".$title);
$tpl->parseCurrentBlock();
}
if ($this->delete_note)
{
$cnt_str = "";
}
if ($a_type == IL_NOTE_PRIVATE)
{
$tpl->setVariable("TXT_NOTES", $lng->txt("private_notes").$cnt_str);
$ilCtrl->setParameterByClass("ilnotegui", "note_type", IL_NOTE_PRIVATE);
}
else
{
$tpl->setVariable("TXT_NOTES", $lng->txt("notes_public_comments").$cnt_str);
$ilCtrl->setParameterByClass("ilnotegui", "note_type", IL_NOTE_PUBLIC);
}
$anch = $this->anchor_jump
? "notes_top"
: "";
$tpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this, "getNotesHTML", $anch));
if ($this->ajax)
{
$os = "onsubmit = \"ilNotes.cmdAjaxForm(event, '".
$ilCtrl->getFormActionByClass("ilnotegui", "", "", true).
"'); return false;\"";
$tpl->setVariable("ON_SUBMIT_FORM", $os);
$tpl->setVariable("FORM_ID", "Ajax");
}
if ($this->export_html || $this->print)
{
$tpl->touchBlock("print_style");
}
// show add new note button
if (!$this->add_note_form && !$this->edit_note_form && !$this->delete_note &&
!$this->export_html && !$this->print && $ilUser->getId() != ANONYMOUS_USER_ID)
{
if (!$this->inc_sub) // we cannot offer add button if aggregated notes
{ // are displayed
if ($this->rep_obj_id > 0 || $a_type != IL_NOTE_PUBLIC)
{
$tpl->setCurrentBlock("add_note_btn");
if ($a_type == IL_NOTE_PUBLIC)
{
$tpl->setVariable("TXT_ADD_NOTE", $lng->txt("notes_add_comment"));
}
else
{
$tpl->setVariable("TXT_ADD_NOTE", $lng->txt("add_note"));
}
$tpl->setVariable("LINK_ADD_NOTE", $ilCtrl->getLinkTargetByClass("ilnotegui", "addNoteForm").
"#note_edit");
$tpl->parseCurrentBlock();
}
}
}
// show show/hide button for note list
if (count($all_notes) > 0 && $this->enable_hiding && !$this->delete_note
&& !$this->export_html && !$this->print && !$this->edit_note_form
&& !$this->add_note_form)
{
if ($user_setting_notes_by_type == "n")
{
if ($a_type == IL_NOTE_PUBLIC)
{
$txt = $lng->txt("notes_show_comments");
}
else
{
$txt = $lng->txt("show_".$suffix."_notes");
}
$this->renderLink($tpl, "show_notes", $txt, "showNotes", "notes_top");
}
else
{
// never individually hide for anonymous users
if (($ilUser->getId() != ANONYMOUS_USER_ID))
{
if ($a_type == IL_NOTE_PUBLIC)
{
$txt = $lng->txt("notes_hide_comments");
}
else
{
$txt = $lng->txt("hide_".$suffix."_notes");
}
$this->renderLink($tpl, "hide_notes", $txt, "hideNotes", "notes_top");
// show all public notes / my notes only switch
if ($a_type == IL_NOTE_PUBLIC)
{
if ($user_setting_notes_public_all == "n")
{
$this->renderLink($tpl, "all_pub_notes", $lng->txt("notes_all_comments"),
"showAllPublicNotes", "notes_top");
}
else
{
$this->renderLink($tpl, "my_pub_notes", $lng->txt("notes_my_comments"),
"showMyPublicNotes", "notes_top");
}
}
}
}
}
// show add new note text area
if (!$this->edit_note_form && $user_setting_notes_by_type != "n" &&
!$this->delete_note && $ilUser->getId() != ANONYMOUS_USER_ID)
{
if ($a_init_form)
{
$this->initNoteForm("create", $a_type);
}
$tpl->setCurrentBlock("edit_note_form");
// $tpl->setVariable("EDIT_FORM", $this->form->getHTML());
$tpl->setVariable("EDIT_FORM", $this->form_tpl->get());
$tpl->parseCurrentBlock();
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("note_row");
$tpl->parseCurrentBlock();
}
// list all notes
if ($user_setting_notes_by_type != "n" || !$this->enable_hiding)
{
$notes_given = false;
foreach($notes as $note)
{
if ($this->edit_note_form && ($note->getId() == $_GET["note_id"])
&& $a_type == $_GET["note_type"])
{
if ($a_init_form)
{
$this->initNoteForm("edit", $a_type, $note);
}
$tpl->setCurrentBlock("edit_note_form");
// $tpl->setVariable("EDIT_FORM", $this->form->getHTML());
$tpl->setVariable("EDIT_FORM", $this->form_tpl->get());
$tpl->parseCurrentBlock();
}
else
{
$cnt_col = 2;
// delete note stuff for all private notes
if ($this->checkDeletion($note)
&& !$this->delete_note
&& !$this->export_html && !$this->print
&& !$this->edit_note_form && !$this->add_note_form)
{
$ilCtrl->setParameterByClass("ilnotegui", "note_id", $note->getId());
$this->renderLink($tpl, "delete_note", $lng->txt("delete"),
"deleteNote", "note_".$note->getId());
}
// checkboxes in multiselection mode
if ($this->multi_selection && !$this->delete_note)
{
$tpl->setCurrentBlock("checkbox_col");
$tpl->setVariable("CHK_NOTE", "note[]");
$tpl->setVariable("CHK_NOTE_ID", $note->getId());
$tpl->parseCurrentBlock();
$cnt_col = 1;
}
// edit note stuff for all private notes
if ($this->checkEdit($note))
{
if (!$this->delete_note && !$this->export_html && !$this->print
&& !$this->edit_note_form && !$this->add_note_form)
{
$ilCtrl->setParameterByClass("ilnotegui", "note_id", $note->getId());
$this->renderLink($tpl, "edit_note", $lng->txt("edit"),
"editNoteForm", "note_edit");
}
}
$tpl->setVariable("CNT_COL", $cnt_col);
// output author account
if ($a_type == IL_NOTE_PUBLIC && ilObject::_exists($note->getAuthor()))
{
//$tpl->setCurrentBlock("author");
//$tpl->setVariable("VAL_AUTHOR", ilObjUser::_lookupLogin($note->getAuthor()));
//$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("user_img");
$tpl->setVariable("USR_IMG",
ilObjUser::_getPersonalPicturePath($note->getAuthor(), "xxsmall"));
$tpl->setVariable("USR_ALT", $lng->txt("user_image").": ".
ilObjUser::_lookupLogin($note->getAuthor()));
$tpl->parseCurrentBlock();
$tpl->setVariable("TXT_USR",
ilUserUtil::getNamePresentation($note->getAuthor(), false, false)." - ");
}
// last edited
if ($note->getUpdateDate() != null)
{
$tpl->setVariable("TXT_LAST_EDIT", $lng->txt("last_edited_on"));
$tpl->setVariable("DATE_LAST_EDIT",
ilDatePresentation::formatDate(new ilDate($note->getUpdateDate(), IL_CAL_DATETIME)));
}
else
{
$tpl->setVariable("VAL_DATE",
ilDatePresentation::formatDate(new ilDate($note->getCreationDate(), IL_CAL_DATETIME)));
}
// hidden note ids for deletion
if ($this->delete_note)
{
$tpl->setCurrentBlock("delete_ids");
$tpl->setVariable("HID_NOTE", "note[]");
$tpl->setVariable("HID_NOTE_ID", $note->getId());
$tpl->parseCurrentBlock();
}
$target = $note->getObject();
// target objects
$this->showTargets($tpl, $this->rep_obj_id, $note->getId(),
$target["obj_type"], $target["obj_id"]);
$rowclass = ($rowclass != "tblrow1")
? "tblrow1"
: "tblrow2";
if (!$this->export_html && !$this->print)
{
$tpl->setCurrentBlock("note_img");
if ($a_type == IL_NOTE_PUBLIC)
{
$tpl->setVariable("IMG_NOTE", $this->comment_img[$note->getLabel()]["img"]);
$tpl->setVariable("ALT_NOTE", $this->comment_img[$note->getLabel()]["alt"]);
}
else
{
$tpl->setVariable("IMG_NOTE", $this->note_img[$note->getLabel()]["img"]);
$tpl->setVariable("ALT_NOTE", $this->note_img[$note->getLabel()]["alt"]);
}
$tpl->parseCurrentBlock();
}
else
{
switch ($note->getLabel())
{
$tpl->setVariable("EXP_ICON", "[ ]");
break;
$tpl->setVariable("EXP_ICON", "[!]");
break;
$tpl->setVariable("EXP_ICON", "[?]");
break;
$tpl->setVariable("EXP_ICON", "[+]");
break;
$tpl->setVariable("EXP_ICON", "[-]");
break;
}
}
$tpl->setCurrentBlock("note");
$tpl->setVariable("ROWCLASS", $rowclass);
$text = (trim($note->getText()) != "")
? nl2br($note->getText())
: "<p class='subtitle'>".$lng->txt("note_content_removed")."</p>";
$tpl->setVariable("NOTE_TEXT", $text);
$tpl->setVariable("VAL_SUBJECT", $note->getSubject());
$tpl->setVariable("NOTE_ID", $note->getId());
$tpl->setVariable("CLASS", $a_type == IL_NOTE_PUBLIC
? "ilComment"
: "ilNote");
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("note_row");
$tpl->parseCurrentBlock();
$notes_given = true;
}
if (!$notes_given)
{
$tpl->setCurrentBlock("no_notes");
if ($a_type == IL_NOTE_PUBLIC)
{
$tpl->setVariable("NO_NOTES", $lng->txt("notes_no_comments"));
}
/* else
{
$tpl->setVariable("NO_NOTES", $lng->txt("notes_no_notes"));
}*/
$tpl->parseCurrentBlock();
}
// multiple items commands
if ($this->multi_selection && !$this->delete_note && !$this->edit_note_form
&& count($notes) > 0)
{
if ($a_type == IL_NOTE_PRIVATE)
{
$tpl->setCurrentBlock("delete_cmd");
$tpl->setVariable("TXT_DELETE_NOTES", $this->lng->txt("delete"));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("multiple_commands");
$tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
$tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.png"));
$tpl->setVariable("ALT_ARROW", $this->lng->txt("actions"));
$tpl->setVariable("TXT_PRINT_NOTES", $this->lng->txt("print"));
$tpl->setVariable("TXT_EXPORT_NOTES", $this->lng->txt("exp_html"));
$tpl->parseCurrentBlock();
}
// delete / cancel row
if ($this->delete_note)
{
$tpl->setCurrentBlock("delete_cancel");
$tpl->setVariable("TXT_DEL_NOTES", $this->lng->txt("delete"));
$tpl->setVariable("TXT_CANCEL_DEL_NOTES", $this->lng->txt("cancel"));
$tpl->parseCurrentBlock();
}
// print
if ($this->print)
{
$tpl->touchBlock("print_js");
$tpl->setCurrentBlock("print_back");
$tpl->setVariable("LINK_BACK", $this->ctrl->getLinkTarget($this, "showNotes"));
$tpl->setVariable("TXT_BACK", $this->lng->txt("back"));
$tpl->parseCurrentBlock();
}
}
// message
switch($_GET["note_mess"] != "" ? $_GET["note_mess"] : $this->note_mess)
{
case "mod":
$mtype = "success";
$mtxt = $lng->txt("msg_obj_modified");
break;
case "ntsdel":
$mtype = "success";
$mtxt = $lng->txt("notes_notes_deleted");
break;
case "ntdel":
$mtype = "success";
$mtxt = $lng->txt("notes_note_deleted");
break;
case "frmfld":
$mtype = "failure";
$mtxt = $lng->txt("form_input_not_valid");
break;
case "qdel":
$mtype = "question";
$mtxt = $lng->txt("info_delete_sure");
break;
case "noc":
$mtype = "failure";
$mtxt = $lng->txt("no_checkbox");
break;
}
if ($mtxt != "")
{
$tpl->setVariable("MESS", $tpl->getMessageHTML($mtxt, $mtype));
}
else
{
$tpl->setVariable("MESS", "");
}
if ($this->delete_note && count($notes) == 0)
{
return "";
}
else
{
return $tpl->get();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNoteGUI::getNotesHTML (   $a_init_form = true)

Definition at line 241 of file class.ilNoteGUI.php.

References $_GET, $ilCtrl, $ilUser, $lng, ilNote\commentsActivated(), exit, getNoteListHTML(), IL_NOTE_PRIVATE, IL_NOTE_PUBLIC, and renderLink().

Referenced by addNoteForm(), cancelAddNote(), cancelDelete(), cancelUpdateNote(), deleteNote(), deleteNotes(), editNoteForm(), exportNotesHTML(), getOnlyCommentsHTML(), getOnlyNotesHTML(), hideNotes(), printNotes(), showAllPublicNotes(), showMyPublicNotes(), and showNotes().

{
global $ilUser, $lng, $ilCtrl;
$lng->loadLanguageModule("notes");
$ntpl = new ilTemplate("tpl.notes_and_comments.html", true, true,
"Services/Notes");
// check, whether column is hidden due to processing in other column
$hide_comments = ($this->only == "notes");
$hide_notes = ($this->only == "comments");
switch($ilCtrl->getCmd())
{
case "addNoteForm":
case "editNoteForm":
case "addNote":
case "updateNote":
if ($_GET["note_type"] == IL_NOTE_PRIVATE)
{
$hide_comments = true;
}
if ($_GET["note_type"] == IL_NOTE_PUBLIC)
{
$hide_notes = true;
}
break;
}
// temp workaround: only show comments (if both have been activated)
if ($this->private_enabled && $this->public_enabled
&& $this->only != "notes")
{
$this->private_enabled = false;
}
$nodes_col = false;
if ($this->private_enabled && ($ilUser->getId() != ANONYMOUS_USER_ID)
&& !$hide_notes)
{
$ntpl->setCurrentBlock("notes_col");
$ntpl->setVariable("NOTES", $this->getNoteListHTML(IL_NOTE_PRIVATE, $a_init_form));
$ntpl->parseCurrentBlock();
$nodes_col = true;
}
$comments_col = false;
if ($this->public_enabled && (!$this->delete_note || $this->public_deletion_enabled)
&& !$hide_comments /* && $ilUser->getId() != ANONYMOUS_USER_ID */)
{
$ntpl->setVariable("COMMENTS", $this->getNoteListHTML(IL_NOTE_PUBLIC, $a_init_form));
$comments_col = true;
}
// Comments Settings
if ($this->comments_settings && !$hide_comments && !$this->delete_note
&& !$this->edit_note_form && !$this->add_note_form && $ilUser->getId() != ANONYMOUS_USER_ID)
{
$notes_settings = new ilSetting("notes");
$id = $this->rep_obj_id."_".$this->obj_id."_".$this->obj_type;
//$active = $notes_settings->get("activate_".$id);
$active = ilNote::commentsActivated($this->rep_obj_id, $this->obj_id, $this->obj_type);
if ($active)
{
$this->renderLink($ntpl, "comments_settings", $lng->txt("notes_deactivate_comments"),
"deactivateComments", "notes_top");
$ntpl->setCurrentBlock("comments_settings2");
}
else
{
$this->renderLink($ntpl, "comments_settings", $lng->txt("notes_activate_comments"),
"activateComments", "notes_top");
$ntpl->setCurrentBlock("comments_settings2");
if ($this->ajax && !$comments_col)
{
$ntpl->setVariable("COMMENTS_MESS",
$ntpl->getMessageHTML($lng->txt("comments_feature_currently_not_activated_for_object"), "info"));
}
}
$ntpl->parseCurrentBlock();
if (!$comments_col)
{
$ntpl->setVariable("COMMENTS", "");
}
$comments_col = true;
}
if ($comments_col)
{
$ntpl->setCurrentBlock("comments_col");
if ($nodes_col)
{
// $ntpl->touchBlock("comments_style");
}
$ntpl->parseCurrentBlock();
}
if ($this->ajax)
{
echo $ntpl->get();
}
return $ntpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNoteGUI::getOnlyCommentsHTML ( )

Get only comments html.

Parameters
@return

Definition at line 229 of file class.ilNoteGUI.php.

References $ilCtrl, and getNotesHTML().

{
global $ilCtrl;
$ilCtrl->setParameter($this, "notes_only", "comments");
$this->only = "comments";
return $this->getNotesHTML($a_init_form = true);
}

+ Here is the call graph for this function:

ilNoteGUI::getOnlyNotesHTML ( )

Get only notes html.

Parameters
@return

Definition at line 215 of file class.ilNoteGUI.php.

References $ilCtrl, and getNotesHTML().

{
global $ilCtrl;
$ilCtrl->setParameter($this, "notes_only", "notes");
$this->only = "notes";
return $this->getNotesHTML($a_init_form = true);
}

+ Here is the call graph for this function:

ilNoteGUI::getPDNoteHTML (   $note_id)

Note display for personal desktop.

Definition at line 1059 of file class.ilNoteGUI.php.

References $ilCtrl, $ilUser, $img, $lng, $tpl, ilDatePresentation\formatDate(), ilUtil\getImagePath(), IL_CAL_DATETIME, and showTargets().

{
global $lng, $ilCtrl, $ilUser;
$tpl = new ilTemplate("tpl.pd_note.html", true, true, "Services/Notes");
$note = new ilNote($note_id);
$target = $note->getObject();
if ($note->getAuthor() != $ilUser->getId())
{
return;
}
$img = ilUtil::getImagePath("note_".$note->getLabel().".png");
$alt = $lng->txt("note");
$tpl->setCurrentBlock("edit_note");
$ilCtrl->setParameterByClass("ilnotegui", "rel_obj", $target["rep_obj_id"]);
$ilCtrl->setParameterByClass("ilnotegui", "note_id", $note_id);
$ilCtrl->setParameterByClass("ilnotegui", "note_type", $note->getType());
$tpl->setVariable("LINK_EDIT_NOTE",
$ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpdnotesgui", "ilnotegui"),
"editNoteForm"));
$tpl->setVariable("TXT_EDIT_NOTE", $lng->txt("edit"));
$tpl->parseCurrentBlock();
$ilCtrl->clearParametersByClass("ilnotegui");
$tpl->setCurrentBlock("note_img");
$tpl->setVariable("IMG_NOTE", $this->note_img[$note->getLabel()]["img"]);
$tpl->setVariable("ALT_NOTE", $this->note_img[$note->getLabel()]["alt"]);
$tpl->parseCurrentBlock();
// last edited
if ($note->getUpdateDate() != null)
{
$tpl->setVariable("TXT_LAST_EDIT", $lng->txt("last_edited_on"));
$tpl->setVariable("DATE_LAST_EDIT",
ilDatePresentation::formatDate(new ilDate($note->getUpdateDate(), IL_CAL_DATETIME)));
}
else
{
//$tpl->setVariable("TXT_CREATED", $lng->txt("create_date"));
$tpl->setVariable("VAL_DATE",
ilDatePresentation::formatDate(new ilDate($note->getCreationDate(), IL_CAL_DATETIME)));
}
$tpl->setVariable("VAL_SUBJECT", $note->getSubject());
$text = (trim($note->getText()) != "")
? nl2br($note->getText())
: "<p class='subtitle'>".$lng->txt("note_content_removed")."</p>";
$tpl->setVariable("NOTE_TEXT", $text);
$this->showTargets($tpl, $target["rep_obj_id"], $note_id, $target["obj_type"], $target["obj_id"]);
return $tpl->get();
}

+ Here is the call graph for this function:

ilNoteGUI::getSubObjectTitle (   $parent_obj_id,
  $sub_obj_id 
)
protected

Get sub object title if available with callback.

Parameters
int$parent_obj_id
int$sub_obj_id
Returns
string

Definition at line 893 of file class.ilNoteGUI.php.

References $ilCtrl, and ilObject\_lookupType().

Referenced by getNoteListHTML(), and showTargets().

{
global $objDefinition, $ilCtrl;
$parent_type = ilObject::_lookupType($parent_obj_id);
$parent_class = "ilObj".$objDefinition->getClassName($parent_type)."GUI";
$parent_path = $ilCtrl->lookupClassPath($parent_class);
include_once $parent_path;
if(method_exists($parent_class, "lookupSubObjectTitle"))
{
return call_user_func_array(array($parent_class, "lookupSubObjectTitle"), array($parent_obj_id, $sub_obj_id));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNoteGUI::hideNotes ( )

hide notes

Definition at line 1539 of file class.ilNoteGUI.php.

References $_GET, $ilUser, getNotesHTML(), and IL_NOTE_PRIVATE.

{
global $ilUser;
$suffix = ($_GET["note_type"] == IL_NOTE_PRIVATE)
? "private"
: "public";
$ilUser->writePref("notes_".$suffix, "n");
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::ilNoteGUI (   $a_rep_obj_id = "",
  $a_obj_id = "",
  $a_obj_type = "",
  $a_include_subobjects = false 
)

constructor, specifies notes set

Parameters
$a_rep_obj_idint object id of repository object (0 for personal desktop)
$a_obj_idint subobject id (0 for repository items, user id for personal desktop)
$a_obj_typestring "pd" for personal desktop
$a_include_subobjectsstring include all subobjects of rep object (e.g. pages)

Definition at line 31 of file class.ilNoteGUI.php.

References $_GET, $ilCtrl, $lng, ilObject\_lookupType(), ilNote\commentsActivated(), ilUtil\getImagePath(), IL_NOTE_CONTRA, IL_NOTE_IMPORTANT, IL_NOTE_PRO, IL_NOTE_QUESTION, IL_NOTE_UNLABELED, and setRepositoryMode().

{
global $ilCtrl, $lng;
$lng->loadLanguageModule("notes");
$ilCtrl->saveParameter($this, "notes_only");
$this->only = $_GET["notes_only"];
$this->rep_obj_id = $a_rep_obj_id;
$this->obj_id = $a_obj_id;
$this->obj_type = $a_obj_type;
$this->inc_sub = $a_include_subobjects;
// auto-detect object type
if(!$this->obj_type && $a_rep_obj_id)
{
$this->obj_type = ilObject::_lookupType($a_rep_obj_id);
}
$this->ajax = $ilCtrl->isAsynch();
$this->ctrl =& $ilCtrl;
$this->lng =& $lng;
$this->anchor_jump = true;
$this->add_note_form = false;
$this->edit_note_form = false;
$this->private_enabled = false;
$notes_settings = new ilSetting("notes");
$id = $this->rep_obj_id."_".$this->obj_id."_".$this->obj_type;
//if ($notes_settings->get("activate_".$id))
if (ilNote::commentsActivated($this->rep_obj_id, $this->obj_id, $this->obj_type))
{
$this->public_enabled = true;
}
else
{
$this->public_enabled = false;
}
$this->enable_hiding = false;
$this->targets_enabled = false;
$this->multi_selection = false;
$this->export_html = false;
$this->print = false;
$this->comments_settings = false;
$this->note_img = array(
"img" => ilUtil::getImagePath("note_unlabeled.png"),
"alt" => $lng->txt("note")),
"img" => ilUtil::getImagePath("note_important.png"),
"alt" => $lng->txt("note").", ".$lng->txt("important")),
IL_NOTE_QUESTION => array(
"img" => ilUtil::getImagePath("note_question.png"),
"alt" => $lng->txt("note").", ".$lng->txt("question")),
IL_NOTE_PRO => array(
"img" => ilUtil::getImagePath("note_pro.png"),
"alt" => $lng->txt("note").", ".$lng->txt("pro")),
IL_NOTE_CONTRA => array(
"img" => ilUtil::getImagePath("note_contra.png"),
"alt" => $lng->txt("note").", ".$lng->txt("contra"))
);
$this->comment_img = array(
"img" => ilUtil::getImagePath("comment_unlabeled.png"),
"alt" => $lng->txt("notes_comment")),
"img" => ilUtil::getImagePath("comment_important.png"),
"alt" => $lng->txt("notes_comment").", ".$lng->txt("important")),
IL_NOTE_QUESTION => array(
"img" => ilUtil::getImagePath("comment_question.png"),
"alt" => $lng->txt("notes_comment").", ".$lng->txt("question")),
IL_NOTE_PRO => array(
"img" => ilUtil::getImagePath("comment_pro.png"),
"alt" => $lng->txt("notes_comment").", ".$lng->txt("pro")),
IL_NOTE_CONTRA => array(
"img" => ilUtil::getImagePath("comment_contra.png"),
"alt" => $lng->txt("notes_comment").", ".$lng->txt("contra"))
);
// default: notes for repository objects
$this->setRepositoryMode(true);
}

+ Here is the call graph for this function:

ilNoteGUI::initJavascript (   $a_ajax_url)

Init javascript.

Definition at line 1578 of file class.ilNoteGUI.php.

References $tpl, iljQueryUtil\initjQuery(), and ilYuiUtil\initPanel().

Referenced by ilObjectListGUI\prepareJsLinks().

{
global $tpl;
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
$tpl->addJavascript("./Services/Notes/js/ilNotes.js");
$tpl->addOnLoadCode("ilNotes.setAjaxUrl('".$a_ajax_url."');");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNoteGUI::initNoteForm (   $a_mode = "edit",
  $a_type,
  $a_note = null 
)

Init note form.

Parameters
int$a_modeEdit Mode

Definition at line 952 of file class.ilNoteGUI.php.

References $_GET, $ilCtrl, $lng, IL_NOTE_PUBLIC, and ilUtil\prepareFormOutput().

Referenced by addNote(), getNoteListHTML(), and updateNote().

{
global $lng, $ilCtrl;
$this->form_tpl = new ilTemplate("tpl.notes_edit.html", true, true, "Services/Notes");
if ($a_note)
{
$this->form_tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput($a_note->getText()));
$this->form_tpl->setVariable("NOTE_ID", $a_note->getId());
}
if ($a_mode == "create")
{
$this->form_tpl->setVariable("TXT_CMD", ($a_type == IL_NOTE_PUBLIC)
? $lng->txt("note_add_comment")
: $lng->txt("note_add_note"));
$this->form_tpl->setVariable("CMD", "addNote");
}
else
{
$this->form_tpl->setVariable("TXT_CMD", ($a_type == IL_NOTE_PUBLIC)
? $lng->txt("note_update_comment")
: $lng->txt("note_update_note"));
$this->form_tpl->setVariable("CMD", "updateNote");
}
return;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setOpenTag(false);
$this->form->setCloseTag(false);
$this->form->setDisableStandardMessage(true);
// subject
/* $ti = new ilTextInputGUI($this->lng->txt("subject"), "sub_note");
$ti->setRequired(true);
$ti->setMaxLength(200);
$ti->setSize(40);
if ($a_note)
{
$ti->setValue($a_note->getSubject());
}
$this->form->addItem($ti);*/
// text
// $ta = new ilTextAreaInputGUI(($a_type == IL_NOTE_PUBLIC)
// ? $lng->txt("notes_comment")
// : $lng->txt("note"), "note");
$ta = new ilTextAreaInputGUI("", "note");
$ta->setCols(40);
$ta->setRows(4);
if ($a_note)
{
$ta->setValue($a_note->getText());
}
$this->form->addItem($ta);
// label
/* $options = array(
IL_NOTE_UNLABELED => $lng->txt("unlabeled"),
IL_NOTE_QUESTION => $lng->txt("question"),
IL_NOTE_IMPORTANT => $lng->txt("important"),
IL_NOTE_PRO => $lng->txt("pro"),
IL_NOTE_CONTRA => $lng->txt("contra"),
);
$si = new ilSelectInputGUI($this->lng->txt("notes_label"), "note_label");
$si->setOptions($options);
if ($a_note)
{
$si->setValue($a_note->getLabel());
}
$this->form->addItem($si); */
// hidden note id
if ($a_note)
{
$hi = new ilHiddenInputGUI("note_id");
$hi->setValue($_GET["note_id"]);
$this->form->addItem($hi);
}
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("addNote", $lng->txt("save"));
/* $this->form->addCommandButton("cancelAddNote", $lng->txt("cancel"));
$this->form->setTitle($a_type == IL_NOTE_PUBLIC
? $lng->txt("notes_add_comment")
: $lng->txt("notes_add_note"));*/
}
else
{
$this->form->addCommandButton("updateNote", $lng->txt("save"));
/* $this->form->addCommandButton("cancelUpdateNote", $lng->txt("cancel"));
$this->form->setTitle($a_type == IL_NOTE_PUBLIC
? $lng->txt("notes_edit_comment")
: $lng->txt("notes_edit_note"));*/
}
$ilCtrl->setParameter($this, "note_type", $a_type);
$this->form->setFormAction($this->ctrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNoteGUI::notifyObserver (   $a_action,
  $a_note 
)
protected

Notify observers on update/create.

Parameters
string$a_action
ilNote$a_note

Definition at line 1692 of file class.ilNoteGUI.php.

Referenced by addNote(), and updateNote().

{
if(sizeof($this->observer))
{
foreach($this->observer as $item)
{
$param = $a_note->getObject();
$param["action"] = $a_action;
$param["note_id"] = $a_note->getId();
call_user_func_array($item, $param);
}
}
}

+ Here is the caller graph for this function:

ilNoteGUI::printNotes ( )

notes print view screen

Definition at line 1511 of file class.ilNoteGUI.php.

References $tpl, exit, and getNotesHTML().

{
$tpl = new ilTemplate("tpl.main.html", true, true);
$this->print = true;
$this->multi_selection = false;
$tpl->setVariable("CONTENT", $this->getNotesHTML());
echo $tpl->get(); exit;
}

+ Here is the call graph for this function:

ilNoteGUI::renderLink (   $a_tpl,
  $a_var,
  $a_txt,
  $a_cmd,
  $a_anchor = "" 
)

Render a link.

Definition at line 1650 of file class.ilNoteGUI.php.

References $ilCtrl.

Referenced by getNoteListHTML(), and getNotesHTML().

{
global $ilCtrl;
$low_var = strtolower($a_var);
$up_var = strtoupper($a_var);
if ($this->ajax)
{
$a_tpl->setVariable("LINK_".$up_var, "#");
$oc = "onclick = \"ilNotes.cmdAjaxLink(event, '".
$ilCtrl->getLinkTargetByClass("ilnotegui", $a_cmd, "", true).
"');\"";
$a_tpl->setVariable("ON_CLICK_".$up_var, $oc);
}
else
{
$a_tpl->setVariable("LINK_".$up_var,
$ilCtrl->getLinkTargetByClass("ilnotegui", $a_cmd, $a_anchor));
}
$a_tpl->setCurrentBlock($low_var);
$a_tpl->setVariable("TXT_".$up_var, $a_txt);
$a_tpl->parseCurrentBlock();
}

+ Here is the caller graph for this function:

ilNoteGUI::setRepositoryMode (   $a_value)

Set repository mode.

Parameters
bool$a_value

Definition at line 203 of file class.ilNoteGUI.php.

Referenced by ilNoteGUI().

{
$this->repository_mode = (bool)$a_value;
}

+ Here is the caller graph for this function:

ilNoteGUI::showAllPublicNotes ( )

show all public notes to user

Definition at line 1554 of file class.ilNoteGUI.php.

References $ilUser, and getNotesHTML().

{
global $ilUser;
$ilUser->writePref("notes_pub_all", "y");
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::showMyPublicNotes ( )

show only public notes of user

Definition at line 1566 of file class.ilNoteGUI.php.

References $ilUser, and getNotesHTML().

{
global $ilUser;
$ilUser->writePref("notes_pub_all", "n");
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::showNotes ( )

show notes

Definition at line 1524 of file class.ilNoteGUI.php.

References $_GET, $ilUser, getNotesHTML(), and IL_NOTE_PRIVATE.

{
global $ilUser;
$suffix = ($_GET["note_type"] == IL_NOTE_PRIVATE)
? "private"
: "public";
$ilUser->writePref("notes_".$suffix, "y");
return $this->getNotesHTML();
}

+ Here is the call graph for this function:

ilNoteGUI::showTargets ( $tpl,
  $a_rep_obj_id,
  $a_note_id,
  $a_obj_type,
  $a_obj_id 
)

show related objects as links

Definition at line 1117 of file class.ilNoteGUI.php.

References $additional, $ilUser, $location, $path, $ref_id, $tpl, ilObject\_getAllReferences(), ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupOwner(), ilContainerReference\_lookupTargetId(), ilSCORM2004Node\_lookupTitle(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilUtil\appendUrlParameterString(), ilWorkspaceAccessHandler\getGotoLink(), ilUtil\getImagePath(), and getSubObjectTitle().

Referenced by getNoteListHTML(), and getPDNoteHTML().

{
global $tree, $ilAccess, $objDefinition, $ilUser;
if ($this->targets_enabled)
{
if ($a_rep_obj_id > 0)
{
// get all visible references of target object
// repository
$ref_ids = ilObject::_getAllReferences($a_rep_obj_id);
if($ref_ids)
{
$vis_ref_ids = array();
foreach($ref_ids as $ref_id)
{
if ($ilAccess->checkAccess("visible", "", $ref_id))
{
$vis_ref_ids[] = $ref_id;
}
}
// output links to targets
if (count($vis_ref_ids) > 0)
{
foreach($vis_ref_ids as $vis_ref_id)
{
$type = ilObject::_lookupType($vis_ref_id, true);
$sub_link = $sub_title = "";
if ($type == "sahs") // bad hack, needs general procedure
{
$link = "goto.php?target=sahs_".$vis_ref_id;
$title = ilObject::_lookupTitle($a_rep_obj_id);
if ($a_obj_type == "sco" || $a_obj_type == "seqc" || $a_obj_type == "chap" || $a_obj_type == "pg")
{
$sub_link = "goto.php?target=sahs_".$vis_ref_id."_".$a_obj_id;
include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
$sub_title = ilSCORM2004Node::_lookupTitle($a_obj_id);
$sub_icon = ilUtil::getImagePath("icon_".$a_obj_type."_s.png");
}
}
else if ($a_obj_type != "pg")
{
if (!is_object($this->item_list_gui[$type]))
{
$class = $objDefinition->getClassName($type);
$location = $objDefinition->getLocation($type);
$full_class = "ilObj".$class."ListGUI";
include_once($location."/class.".$full_class.".php");
$this->item_list_gui[$type] = new $full_class();
}
// for references, get original title
// (link will lead to orignal, which basically is wrong though)
if($a_obj_type == "crsr" || $a_obj_type == "catr")
{
include_once "Services/ContainerReference/classes/class.ilContainerReference.php";
$tgt_obj_id = ilContainerReference::_lookupTargetId($a_rep_obj_id);
$title = ilObject::_lookupTitle($tgt_obj_id);
}
else
{
$title = ilObject::_lookupTitle($a_rep_obj_id);
}
$this->item_list_gui[$type]->initItem($vis_ref_id, $a_rep_obj_id, $title);
$link = $this->item_list_gui[$type]->getCommandLink("infoScreen");
// workaround, because # anchor can't be passed through frameset
$link = ilUtil::appendUrlParameterString($link, "anchor=note_".$a_note_id);
$link = $this->item_list_gui[$type]->appendRepositoryFrameParameter($link)."#note_".$a_note_id;
}
else
{
$title = ilObject::_lookupTitle($a_rep_obj_id);
$link = "goto.php?target=pg_".$a_obj_id."_".$vis_ref_id;
}
$par_id = $tree->getParentId($vis_ref_id);
// sub object link
if ($sub_link != "")
{
if ($this->export_html || $this->print)
{
$tpl->setCurrentBlock("exp_target_sub_object");
}
else
{
$tpl->setCurrentBlock("target_sub_object");
$tpl->setVariable("LINK_SUB_TARGET", $sub_link);
}
$tpl->setVariable("TXT_SUB_TARGET", $sub_title);
$tpl->setVariable("IMG_SUB_TARGET", $sub_icon);
$tpl->parseCurrentBlock();
}
// container and object link
if ($this->export_html || $this->print)
{
$tpl->setCurrentBlock("exp_target_object");
}
else
{
$tpl->setCurrentBlock("target_object");
$tpl->setVariable("LINK_TARGET", $link);
}
$tpl->setVariable("TXT_CONTAINER",
$tpl->setVariable("IMG_CONTAINER",
ilObject::_lookupObjId($par_id), "tiny"));
$tpl->setVariable("TXT_TARGET", $title);
$tpl->setVariable("IMG_TARGET",
ilObject::_getIcon($a_rep_obj_id, "tiny"));
$tpl->parseCurrentBlock();
}
$tpl->touchBlock("target_objects");
}
}
// personal workspace
else
{
// we only need 1 instance
if(!$this->wsp_tree)
{
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
$this->wsp_tree = new ilWorkspaceTree($ilUser->getId());
$this->wsp_access_handler = new ilWorkspaceAccessHandler($this->wsp_tree);
}
$node_id = $this->wsp_tree->lookupNodeId($a_rep_obj_id);
if($this->wsp_access_handler->checkAccess("visible", "", $node_id))
{
$path = $this->wsp_tree->getPathFull($node_id);
if($path)
{
$item = array_pop($path);
$parent = array_pop($path);
if(!$parent["title"])
{
$parent["title"] = $this->lng->txt("wsp_personal_workspace");
}
// sub-objects
$additional = null;
if($a_obj_id)
{
$sub_title = $this->getSubObjectTitle($a_rep_obj_id, $a_obj_id);
if($sub_title)
{
$item["title"] .= " (".$sub_title.")";
$additional = "_".$a_obj_id;
}
}
$link = ilWorkspaceAccessHandler::getGotoLink($node_id, $a_rep_obj_id, $additional);
}
// shared resource
else
{
$owner = ilObject::_lookupOwner($a_rep_obj_id);
$parent["title"] = $this->lng->txt("wsp_tab_shared").
" (".ilObject::_lookupOwnerName($owner).")";
$item["title"] = ilObject::_lookupTitle($a_rep_obj_id);
$link = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".
$owner;
}
// container and object link
if ($this->export_html || $this->print)
{
$tpl->setCurrentBlock("exp_target_object");
}
else
{
$tpl->setCurrentBlock("target_object");
$tpl->setVariable("LINK_TARGET", $link);
}
// :TODO: no images in template ?
$tpl->setVariable("TXT_CONTAINER", $parent["title"]);
$tpl->setVariable("IMG_CONTAINER",
ilObject::_getIcon($parent["obj_id"], "tiny"));
$tpl->setVariable("TXT_TARGET", $item["title"]);
$tpl->setVariable("IMG_TARGET",
ilObject::_getIcon($a_rep_obj_id, "tiny"));
$tpl->parseCurrentBlock();
}
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNoteGUI::updateNote ( )

update note

Definition at line 1387 of file class.ilNoteGUI.php.

References $_GET, $_POST, $ilCtrl, $ilUser, $lng, checkEdit(), editNoteForm(), initNoteForm(), notifyObserver(), and ilUtil\stripSlashes().

{
global $ilUser, $lng, $ilCtrl;
$note = new ilNote(ilUtil::stripSlashes($_POST["note_id"]));
$this->initNoteForm("edit", $note->getType(),
$note);
// if ($this->form->checkInput())
// if ($_POST["note"] != "")
// {
$note->setText(ilUtil::stripSlashes($_POST["note"]));
$note->setSubject(ilUtil::stripSlashes($_POST["sub_note"]));
$note->setLabel(ilUtil::stripSlashes($_POST["note_label"]));
if ($this->checkEdit($note))
{
$note->update();
$this->notifyObserver("update", $note);
$ilCtrl->setParameter($this, "note_mess", "mod");
}
$ilCtrl->redirect($this, "showNotes", "notes_top", $this->ajax);
// }
$ilCtrl->redirect($this, "showNotes", "notes_top", $this->ajax);
$this->note_mess = "frmfld";
$this->form->setValuesByPost();
$_GET["note_id"] = $note->getId();
$_GET["note_type"] = $note->getType();
return $this->editNoteForm(false);
}

+ Here is the call graph for this function:

Field Documentation

ilNoteGUI::$public_deletion_enabled = false

Definition at line 20 of file class.ilNoteGUI.php.

Referenced by checkDeletion().

ilNoteGUI::$repository_mode = false

Definition at line 21 of file class.ilNoteGUI.php.


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