• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

notes.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
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 //zeige gruppenmitglieder an
00042 $users = $rbacreview->assignedUsers(247);
00043 $roles = $rbacreview->assignedRoles(305);
00044 //print_r($users);
00045 /*
00046 foreach($users as $user)
00047 {
00048         //$user_details = getObject($user);     
00049         print_r($user_details);
00050 }
00051 
00052 */
00053 
00054 //form has been submitted
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                         //create new note
00070                         $obj_id = $myNote->createObject($_POST["lo_title"], $_POST["note_text"]);
00071                         //save to database
00072                         $myNote->saveNote($obj_id, $_POST["lo_id"], $_POST["lo_title"], $_POST ["note_text"], $_POST["rate"]);
00073                         //save in table tree
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"]);           //perhaps lo's title is display here
00110         $tpl->setVariable("TITLE", $row["title"]);              //perhaps lo's title is display here
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&amp;id=".$row["obj_id"]);
00115         $tpl->setVariable("LINK_EDIT", "note_new.php?cmd=edit&amp;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 ?>

Generated on Fri Dec 13 2013 09:06:37 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1