6 include_once(
"Services/Notes/classes/class.ilNote.php");
41 $ilHelp->setScreenIdComponent(
"note");
43 $lng->loadLanguageModule(
"notes");
55 $ilUser->writePref(
"pd_notes_mode", $mode);
56 $ilUser->writePref(
"pd_notes_rel_obj".$mode,
$_GET[
"rel_obj"]);
59 else if($_REQUEST[
"note_id"])
61 $note =
new ilNote($_REQUEST[
"note_id"]);
62 $mode = ($note->getType() ==
IL_NOTE_PRIVATE) ? self::PRIVATE_NOTES : self::PUBLIC_COMMENTS;
63 $obj = $note->getObject();
64 $ilUser->writePref(
"pd_notes_mode", $mode);
65 $ilUser->writePref(
"pd_notes_rel_obj".$mode, $obj[
"rep_obj_id"]);
74 $next_class = $this->ctrl->getNextClass();
89 $cmd = $this->ctrl->getCmd(
"view");
94 $this->tpl->show(
true);
105 $t = $this->lng->txt(
"notes");
106 if (!$this->
ilias->getSetting(
"disable_notes") && !$ilSetting->get(
"disable_comments"))
108 $t = $this->lng->txt(
"notes_and_comments");
110 if ($this->
ilias->getSetting(
"disable_notes"))
112 $t = $this->lng->txt(
"notes_comments");
115 $this->tpl->setTitle(
$t);
131 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
134 include_once(
"Services/Notes/classes/class.ilNote.php");
142 $rel_objs = array_merge(
array(0), $rel_objs);
148 $lng->loadLanguageModule(
"notes");
154 foreach ($rel_objs as
$r)
158 $this->current_rel_obj = $r[
"rep_obj_id"];
159 $current_ref_ids = $r[
"ref_ids"];
161 if ($r[
"rep_obj_id"] == $ilUser->getPref(
"pd_notes_rel_obj".$this->getMode()))
163 $this->current_rel_obj = $r[
"rep_obj_id"];
164 $current_ref_ids = $r[
"ref_ids"];
168 if ($this->current_rel_obj > 0)
170 $notes_gui =
new ilNoteGUI($this->current_rel_obj, 0,
175 $notes_gui =
new ilNoteGUI(0, $ilUser->getId(),
"pd");
181 $notes_gui->enablePublicNotes(
false);
185 $notes_gui->enablePrivateNotes(
false);
186 $notes_gui->enablePublicNotes(
true);
189 if ($this->current_rel_obj > 0 &&
190 sizeof($current_ref_ids) &&
191 $ilSetting->get(
"comments_del_tutor", 1))
193 foreach($current_ref_ids as
$ref_id)
195 if($ilAccess->checkAccess(
"write",
"", $ref_id))
197 $notes_gui->enablePublicNotesDeletion(
true);
203 $notes_gui->enableHiding(
false);
204 $notes_gui->enableTargets(
true);
205 $notes_gui->enableMultiSelection(
true);
206 $notes_gui->enableAnchorJump(
false);
208 $next_class = $this->ctrl->getNextClass($this);
210 if ($next_class ==
"ilnotegui")
212 $html = $this->ctrl->forwardCommand($notes_gui);
218 $html = $notes_gui->getOnlyNotesHTML();
222 $html = $notes_gui->getOnlyCommentsHTML();
226 if (count($rel_objs) > 1 ||
227 ($rel_objs[0][
"rep_obj_id"] > 0))
229 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
231 foreach($rel_objs as $obj)
233 if ($obj[
"rep_obj_id"] > 0)
236 $type_str = (in_array($type,
array(
"lm",
"htlm",
"sahs")))
237 ? $lng->txt(
"learning_resource")
238 : $lng->txt(
"obj_".$type);
243 $caption = $lng->txt(
"personal_desktop");
246 $options[$obj[
"rep_obj_id"]] = $caption;
249 include_once
"Services/Form/classes/class.ilSelectInputGUI.php";
252 $rel->setValue($this->current_rel_obj);
253 $ilToolbar->addInputItem($rel);
255 $ilToolbar->addFormButton($lng->txt(
"change"),
"changeRelatedObject");
258 $this->tpl->setContent(
$html);
268 $ilUser->writePref(
"pd_notes_rel_obj".$this->
getMode(),
$_POST[
"rel_obj"]);
269 $this->ctrl->redirect($this);
280 if(!$ilSetting->get(
"disable_notes"))
282 $ilTabs->addTarget(
"private_notes",
283 $ilCtrl->getLinkTarget($this,
"showPrivateNotes"),
"",
"",
"",
287 if(!$ilSetting->get(
"disable_comments"))
289 $ilTabs->addTarget(
"notes_public_comments",
290 $ilCtrl->getLinkTarget($this,
"showPublicComments"),
"",
"",
"",
303 $ilCtrl->redirect($this,
"");
313 if($ilSetting->get(
"disable_comments"))
315 $ilCtrl->redirect($this,
"showPrivateNotes");
319 $ilCtrl->redirect($this,
"");
330 !$ilSetting->get(
"disable_comments"))
executeCommand()
execute command
showPublicComments()
Show public comments.
static _lookupTitle($a_id)
lookup object title
changeRelatedObject()
change related object
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct()
Constructor.
if(!is_array($argv)) $options
static infoPanel($a_keep=true)
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getRelatedObjectsOfUser($a_mode)
get all related objects for user
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
displayHeader()
display header and locator
getMode()
Get current mode.
enablePrivateNotes($a_enable=true)
enable private notes
showPrivateNotes()
Show private notes.