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
00035 require_once "class.ilObject.php";
00036
00037 require_once "classes/class.ilObject.php";
00038
00039 class ilObjNote extends ilObject
00040 {
00041 var $ilias;
00042
00049 function ilObjNote($a_id = 0,$a_call_by_reference = false)
00050 {
00051 global $ilias;
00052 $this->ilias =& $ilias;
00053
00054 $this->type = "note";
00055 $this->ilObject($a_id,$a_call_by_reference);
00056 }
00057
00065 function viewObject($a_note_id)
00066 {
00067 $query = "SELECT * FROM note_data WHERE note_id = '".$a_note_id."'";
00068 $res = $this->ilias->db->query($query);
00069 $note_data = $res->fetchRow(DB_FETCHMODE_OBJECT);
00070 return $note_data;
00071 }
00072
00081 function createObject($lo_title, $note_text)
00082 {
00083 global $rbacadmin, $rbacsystem;
00084
00085 $this->setType("note");
00086 $this->setTitle($lo_title);
00087 $this->setDescription($note_text);
00088 parent::create();
00089 $note_id = $this->getId();
00090
00091 return $note_id;
00092 }
00093
00102 function saveNote($obj_id, $ref_lo, $lo_title, $text, $rate)
00103 {
00104 $create_date = date("Y-m-d G:i:s");
00105
00106 $query = "INSERT INTO note_data (note_id, lo_id, text, create_date, important, good, question, bad)".
00107 " VALUES ('".$obj_id."','".$ref_lo."','".$text."','".$create_date."','".$rate["important"]."','".$rate["good"]."','".$rate["question"]."','".$rate["bad"]."')";
00108
00109 $res = $this->ilias->db->query($query);
00110 }
00111
00112 function updateNote($obj_id, $note_text, $rate)
00113 {
00114 $create_date = date("Y-m-d G:i:s");
00115
00116
00117 $q = "UPDATE note_data SET text='".$note_text."', question='".$rate["question"]."', ".
00118 "important='".$rate["important"]."', good='".$rate["good"]."', ".
00119 "bad='".$rate["bad"]."' WHERE note_id='".$obj_id."'";
00120 $this->ilias->db->query($q);
00121
00122
00123 $this->setTitle($note_text);
00124 $this->setDescription($note_text);
00125 $this->update();
00126 }
00127 function edit()
00128 {
00129 }
00130
00131 function owner()
00132 {
00133 }
00134 }
00135 ?>