Public Member Functions | Data Fields

ilChatRecording Class Reference

Public Member Functions

 ilChatRecording ($a_id=0)
 Constructor public.
 getErrorMessage ()
 setRoomId ($a_id)
 getRoomId ()
 setObjId ($a_id)
 getObjId ()
 setRecordId ($a_id)
 getRecordId ()
 getStartTime ()
 getEndTime ()
 setModeratorId ($a_id)
 getModeratorId ()
 setRecord ($a_data)
 getRecord ($a_id=0)
 setTitle ($a_title)
 getTitle ()
 setDescription ($a_description)
 getDescription ()
 startRecording ($a_title="")
 stopRecording ()
 isRecording ()
 getRecordings ()
 getModerator ($a_id=0)
 delete ($a_id=0)
 exportMessages ()

Data Fields

 $ilias
 $lng
 $error_msg
 $obj_id = 0
 $moderator_id = 0
 $room_id = 0
 $record_id = 0
 $data = array()

Detailed Description

Definition at line 33 of file class.ilChatRecording.php.


Member Function Documentation

ilChatRecording::delete ( a_id = 0  ) 

Definition at line 257 of file class.ilChatRecording.php.

References $data, $query, $res, getRecordId(), setRecord(), and setRecordId().

        {
                if ($a_id == 0 ||
                        $a_id == $this->getRecordId())
                {
                        $a_id = $this->getRecordId();
                        $this->setRecordId(0);

                        $data = array();
                        $this->setRecord($data);
                }

                $query = "DELETE FROM chat_records WHERE 
                                        record_id = '" . $a_id . "'";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecording::delete(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);

                $query = "DELETE FROM chat_record_data WHERE 
                                        record_id = '" . $a_id . "'";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecording::delete(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);
        }

Here is the call graph for this function:

ilChatRecording::exportMessages (  ) 

Definition at line 280 of file class.ilChatRecording.php.

References $data, $query, $res, and getRecordId().

        {
                $query = "SELECT message FROM chat_record_data WHERE 
                                        record_id = '" . $this->getRecordId() . "' ORDER BY 
                                        msg_time ASC";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecording::exportMessages(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);

                $html = "";
                if (($num = $res->numRows()) > 0)
                {
                        $html = "";
                        for ($i = 0; $i < $num; $i++)
                        {
                                $data = $res->fetchRow(DB_FETCHMODE_ASSOC);
                                $html .= $data["message"] . "<br />\n";
                        }
                }
                
                return $html;
        }

Here is the call graph for this function:

ilChatRecording::getDescription (  ) 

Definition at line 160 of file class.ilChatRecording.php.

        {
                return $this->data["description"];
        }

ilChatRecording::getEndTime (  ) 

Definition at line 105 of file class.ilChatRecording.php.

        {
                return $this->data["end_time"];
        }

ilChatRecording::getErrorMessage (  ) 

Definition at line 69 of file class.ilChatRecording.php.

        {
                return $this->error_msg;
        }

ilChatRecording::getModerator ( a_id = 0  ) 

Definition at line 247 of file class.ilChatRecording.php.

References ilObjUser::_lookupLogin(), and getModeratorId().

        {
                if ($a_id == 0)
                {
                        $a_id = $this->getModeratorId();
                }

                return ilObjUser::_lookupLogin($a_id);
        }

Here is the call graph for this function:

ilChatRecording::getModeratorId (  ) 

Definition at line 114 of file class.ilChatRecording.php.

Referenced by getModerator(), and startRecording().

        {
                return $this->moderator_id;
        }

Here is the caller graph for this function:

ilChatRecording::getObjId (  ) 

Definition at line 87 of file class.ilChatRecording.php.

Referenced by getRecordings(), isRecording(), startRecording(), and stopRecording().

        {
                return $this->obj_id;
        }

Here is the caller graph for this function:

ilChatRecording::getRecord ( a_id = 0  ) 

Definition at line 123 of file class.ilChatRecording.php.

References $data, $query, $res, getRecordId(), setRecord(), and setRecordId().

Referenced by isRecording(), and startRecording().

        {
                if ($a_id != 0)
                {
                        $this->setRecordId($a_id);
                }

                $query = "SELECT * FROM chat_records WHERE 
                                        record_id = '" . addslashes($this->getRecordId()) . "'";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecording::getRecord(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);

                $data = array();
                $status = false;
                if ($res->numRows() > 0)
                {
                        $data = $res->fetchRow(DB_FETCHMODE_ASSOC);
                        $status = true;
                }

                $this->setRecord($data);
                return $status;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilChatRecording::getRecordId (  ) 

Definition at line 96 of file class.ilChatRecording.php.

Referenced by delete(), exportMessages(), and getRecord().

        {
                return $this->record_id;
        }

Here is the caller graph for this function:

ilChatRecording::getRecordings (  ) 

Definition at line 228 of file class.ilChatRecording.php.

References $data, $query, $res, and getObjId().

        {
                $query = "SELECT * FROM chat_records WHERE 
                                        chat_id = '" . $this->getObjId() . "'";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecording::getRecordings(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);

                if (($num = $res->numRows()) > 0)
                {
                        for ($i = 0; $i < $num; $i++)
                        {
                                $data[] = $res->fetchRow(DB_FETCHMODE_ASSOC);
                        }
                        return $data;
                }
                
                return false;
        }

Here is the call graph for this function:

ilChatRecording::getRoomId (  ) 

Definition at line 78 of file class.ilChatRecording.php.

Referenced by isRecording(), startRecording(), and stopRecording().

        {
                return $this->room_id;
        }

Here is the caller graph for this function:

ilChatRecording::getStartTime (  ) 

Definition at line 101 of file class.ilChatRecording.php.

        {
                return $this->data["start_time"];
        }

ilChatRecording::getTitle (  ) 

Definition at line 151 of file class.ilChatRecording.php.

        {
                return $this->data["title"];
        }

ilChatRecording::ilChatRecording ( a_id = 0  ) 

Constructor public.

Parameters:
integer reference_id or object_id
boolean treat the id as reference_id (true) or object_id (false)

Definition at line 53 of file class.ilChatRecording.php.

References $ilias, $lng, and setObjId().

        {
                global $ilias,$lng;

                define(MAX_TIME,60*60*24);

                $this->ilias =& $ilias;
                $this->lng =& $lng;

                if ($a_id > 0)
                {
                        $this->setObjId($a_id);
                }
        }

Here is the call graph for this function:

ilChatRecording::isRecording (  ) 

Definition at line 206 of file class.ilChatRecording.php.

References $id, $query, $res, getObjId(), getRecord(), getRoomId(), and setRecordId().

        {
                $query = "SELECT record_id FROM chat_records WHERE 
                                        chat_id = '" . $this->getObjId() . "' AND 
                                        room_id = '" . $this->getRoomId() . "' AND 
                                        start_time > 0 AND 
                                        end_time = 0";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecording::isRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);

                if ($res->numRows() > 0)
                {
                        $id = $res->fetchRow(DB_FETCHMODE_ASSOC);
                        $this->setRecordId($id["record_id"]);

                        $this->getRecord();
                        return true;
                }
                
                return false;
        }

Here is the call graph for this function:

ilChatRecording::setDescription ( a_description  ) 

Definition at line 156 of file class.ilChatRecording.php.

        {
                $this->data["description"] = $a_description;
        }

ilChatRecording::setModeratorId ( a_id  ) 

Definition at line 110 of file class.ilChatRecording.php.

        {
                $this->moderator_id = $a_id;
        }

ilChatRecording::setObjId ( a_id  ) 

Definition at line 83 of file class.ilChatRecording.php.

Referenced by ilChatRecording().

        {
                $this->obj_id = $a_id;
        }

Here is the caller graph for this function:

ilChatRecording::setRecord ( a_data  ) 

Definition at line 119 of file class.ilChatRecording.php.

Referenced by delete(), getRecord(), and stopRecording().

        {
                $this->data = $a_data;
        }

Here is the caller graph for this function:

ilChatRecording::setRecordId ( a_id  ) 

Definition at line 92 of file class.ilChatRecording.php.

Referenced by delete(), getRecord(), isRecording(), startRecording(), and stopRecording().

        {
                $this->record_id = $a_id;
        }

Here is the caller graph for this function:

ilChatRecording::setRoomId ( a_id  ) 

Definition at line 74 of file class.ilChatRecording.php.

        {
                $this->room_id = $a_id;
        }

ilChatRecording::setTitle ( a_title  ) 

Definition at line 147 of file class.ilChatRecording.php.

        {
                $this->data["title"] = $a_title;
        }

ilChatRecording::startRecording ( a_title = ""  ) 

Definition at line 165 of file class.ilChatRecording.php.

References $query, $res, getModeratorId(), getObjId(), getRecord(), getRoomId(), and setRecordId().

        {
                $query = "INSERT INTO chat_records SET 
                                        moderator_id = '" . $this->getModeratorId() . "', 
                                        chat_id = '" . $this->getObjId() . "', 
                                        room_id = '" . $this->getRoomId() . "', 
                                        title = '" . (($a_title == "") ? "-N/A-" : addslashes($a_title)) . "', 
                                        start_time = '" . time() . "'";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) 
                        die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);

                $query = "SELECT LAST_INSERT_ID()";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) 
                        die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);

                if ($res->numRows() > 0)
                {
                        $lastId = $res->fetchRow();
                        $this->setRecordId($lastId[0]);

                        $this->getRecord();
                }
        }

Here is the call graph for this function:

ilChatRecording::stopRecording (  ) 

Definition at line 191 of file class.ilChatRecording.php.

References $data, $query, $res, getObjId(), getRoomId(), setRecord(), and setRecordId().

        {
                $query = "UPDATE chat_records SET 
                                        end_time = '" . time() . "' WHERE 
                                        chat_id = '" . $this->getObjId() . "' AND 
                                        room_id = '" . $this->getRoomId() . "'";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecording::stopRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$q);

                $this->setRecordId(0);

                $data = array();
                $this->setRecord($data);
        }

Here is the call graph for this function:


Field Documentation

ilChatRecording::$data = array()
ilChatRecording::$error_msg

Definition at line 38 of file class.ilChatRecording.php.

ilChatRecording::$ilias

Definition at line 35 of file class.ilChatRecording.php.

Referenced by ilChatRecording().

ilChatRecording::$lng

Definition at line 36 of file class.ilChatRecording.php.

Referenced by ilChatRecording().

ilChatRecording::$moderator_id = 0

Definition at line 41 of file class.ilChatRecording.php.

ilChatRecording::$obj_id = 0

Definition at line 40 of file class.ilChatRecording.php.

ilChatRecording::$record_id = 0

Definition at line 43 of file class.ilChatRecording.php.

ilChatRecording::$room_id = 0

Definition at line 42 of file class.ilChatRecording.php.


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