Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00033 require_once "./include/inc.header.php";
00034 require_once "./classes/class.ilObjNote.php";
00035 require_once "./classes/class.ilObjNoteFolder.php";
00036
00037 $myNote = new ilObjNote();
00038 $myNoteFolder = new ilObjNoteFolder($ilias->account->getId());
00039 $testNoteFolder = new ilObjNoteFolder(320);
00040
00041
00042 $users = $rbacreview->assignedUsers(247);
00043 $roles = $rbacreview->assignedRoles(305);
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 if ($_POST["submit"] = "delete")
00056 {
00057
00058 if ($_POST["id"] != "")
00059 {
00060 $myNoteFolder->deleteNotes($id);
00061 }
00062 }
00063
00064 if ($_GET["cmd"] != "")
00065 {
00066 switch ($_GET["cmd"])
00067 {
00068 case "save":
00069
00070 $obj_id = $myNote->createObject($_POST["lo_title"], $_POST["note_text"]);
00071
00072 $myNote->saveNote($obj_id, $_POST["lo_id"], $_POST["lo_title"], $_POST ["note_text"], $_POST["rate"]);
00073
00074 $myNoteFolder->addNote($obj_id, 247);
00075 $testNoteFolder->addNote($obj_id);
00076 break;
00077
00078 case "update":
00079 $myNote->updateNote($_GET["id"], $_POST["note_text"], $_POST["rate"]);
00080 break;
00081
00082 case "edit":
00083 break;
00084 }
00085
00086 header("location: notes.php");
00087 exit;
00088 }
00089
00090 $tpl->addBlockFile("CONTENT", "content", "tpl.notes.html");
00091 $tpl->addBlockFile("BUTTONS", "buttons", "tpl.buttons.html");
00092
00093 sendInfo("Attention: Functions to handle bookmarks is not implemented yet.");
00094
00095 $tpl->setCurrentBlock("btn_cell");
00096 $tpl->setVariable("BTN_LINK","note_new.php");
00097 $tpl->setVariable("BTN_TXT", $lng->txt("new_note"));
00098 $tpl->parseCurrentBlock();
00099 $tpl->setCurrentBlock("btn_row");
00100 $tpl->parseCurrentBlock();
00101
00102 $myNotes = $myNoteFolder->getNotes();
00103
00104 foreach ($myNotes as $row)
00105 {
00106 $i++;
00107 $tpl->setCurrentBlock("noterow");
00108 $tpl->setVariable("ROWCOL","tblrow".(($i%2)+1));
00109 $tpl->setVariable("NOTE_ID", $row["obj_id"]);
00110 $tpl->setVariable("TITLE", $row["title"]);
00111 $tpl->setVariable("DESC", $row["desc"]);
00112 $tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
00113 $tpl->setVariable("TXT_VIEW", $lng->txt("view"));
00114 $tpl->setVariable("LINK_VIEW", "note_view.php?cmd=view&id=".$row["obj_id"]);
00115 $tpl->setVariable("LINK_EDIT", "note_new.php?cmd=edit&id=".$row["obj_id"]);
00116 $tpl->parseCurrentBlock();
00117 }
00118
00119 $tpl->setVariable("TXT_NOTES", $lng->txt("notes"));
00120 $tpl->setVariable("TXT_TITLE", $lng->txt("title"));
00121 $tpl->setVariable("TXT_DESCRIPTION", $lng->txt("description"));
00122 $tpl->setVariable("TXT_SAVE", $lng->txt("save"));
00123 $tpl->parseCurrentBlock();
00124
00125 $tpl->show();
00126 ?>