ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatRecording Class Reference

Class ilChatRecording. More...

+ Collaboration diagram for ilChatRecording:

Public Member Functions

 __construct ($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

Class ilChatRecording.

Author
Jens Conze
Version
Id:
class.ilChatRecording.php 19587 2009-04-09 15:08:42Z jposselt

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

Constructor & Destructor Documentation

ilChatRecording::__construct (   $a_id = 0)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 52 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:

Member Function Documentation

ilChatRecording::delete (   $a_id = 0)

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

References $data, $ilDB, $res, getRecordId(), ilDB\isDbError(), setRecord(), and setRecordId().

{
global $ilDB;
if ($a_id == 0 ||
$a_id == $this->getRecordId())
{
$a_id = $this->getRecordId();
$this->setRecordId(0);
$data = array();
$this->setRecord($data);
}
$res = $ilDB->manipulateF('
DELETE FROM chat_records WHERE record_id = %s',
array('integer'), array($a_id));
if (ilDB::isDbError($res)) die("ilChatRecording::delete(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
$res = $ilDB->manipulateF('
DELETE FROM chat_record_data WHERE record_id = %s',
array('integer'),array($a_id));
if (ilDB::isDbError($res)) die("ilChatRecording::delete(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
}

+ Here is the call graph for this function:

ilChatRecording::exportMessages ( )

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

References $ilDB, $res, $row, DB_FETCHMODE_ASSOC, getRecordId(), and ilDB\isDbError().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT message FROM chat_record_data
WHERE record_id = %s
ORDER BY msg_time ASC',
array('integer'),
array($this->getRecordId()));
if (ilDB::isDbError($res)) die("ilChatRecording::delete(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
$html = "";
//if (($num = $ilDB->numRows($res)) > 0)
if (($num = $res->numRows()) > 0)
{
$html = "";
for ($i = 0; $i < $num; $i++)
{
$html .= $row["message"] . "<br />\n";
}
}
return $html;
}

+ Here is the call graph for this function:

ilChatRecording::getDescription ( )

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

{
return $this->data["description"];
}
ilChatRecording::getEndTime ( )

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

{
return $this->data["end_time"];
}
ilChatRecording::getErrorMessage ( )

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

References $error_msg.

{
}
ilChatRecording::getModerator (   $a_id = 0)

Definition at line 285 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 118 of file class.ilChatRecording.php.

References $moderator_id.

Referenced by getModerator(), and startRecording().

{
}

+ Here is the caller graph for this function:

ilChatRecording::getObjId ( )

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

References $obj_id.

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 128 of file class.ilChatRecording.php.

References $data, $ilDB, $res, $row, DB_FETCHMODE_ASSOC, getRecordId(), ilDB\isDbError(), setRecord(), and setRecordId().

Referenced by isRecording(), and startRecording().

{
global $ilDB;
if ($a_id != 0)
{
$this->setRecordId($a_id);
}
$res = $ilDB->queryf('
SELECT * FROM chat_records WHERE record_id = %s',
array('integer'),array($this->getRecordId()));
die("ilChatRecording::getRecord(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
$row = array();
$status = false;
//if ($ilDB->numRows($res) > 0)
if ($res->numRows() > 0)
{
$status = true;
$row = $data;
}
$this->setRecord($row);
return $status;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRecording::getRecordId ( )

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

References $record_id.

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

{
}

+ Here is the caller graph for this function:

ilChatRecording::getRecordings ( )

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

References $ilDB, $res, $row, DB_FETCHMODE_ASSOC, getObjId(), and ilDB\isDbError().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM chat_records WHERE chat_id = %s',
array('integer'), array($this->getObjId()));
if (ilDB::isDbError($res)) die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
//if (($num = $ilDB->numRows($res)) > 0)
if (($num = $res->numRows()) > 0)
{
for ($i = 0; $i < $num; $i++)
{
$row[] = $res->fetchRow(DB_FETCHMODE_ASSOC);
}
return $row;
}
return false;
}

+ Here is the call graph for this function:

ilChatRecording::getRoomId ( )

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

References $room_id.

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

{
}

+ Here is the caller graph for this function:

ilChatRecording::getStartTime ( )

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

{
return $this->data["start_time"];
}
ilChatRecording::getTitle ( )

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

{
return $this->data["title"];
}
ilChatRecording::isRecording ( )

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

References $ilDB, $res, DB_FETCHMODE_ASSOC, getObjId(), getRecord(), getRoomId(), ilDB\isDbError(), and setRecordId().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT record_id FROM chat_records
WHERE chat_id = %s
AND room_id = %s
AND start_time > %s
AND end_time = %s',
array('integer', 'integer', 'integer', 'integer'),
array($this->getObjId(), $this->getRoomId(), '0', '0'));
if (ilDB::isDbError($res)) die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
//if ($ilDB->numRows($res) > 0)
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 168 of file class.ilChatRecording.php.

{
$this->data["description"] = $a_description;
}
ilChatRecording::setModeratorId (   $a_id)

Definition at line 113 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 __construct().

{
$this->obj_id = $a_id;
}

+ Here is the caller graph for this function:

ilChatRecording::setRecord (   $a_data)

Definition at line 123 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 93 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 73 of file class.ilChatRecording.php.

{
$this->room_id = $a_id;
}
ilChatRecording::setTitle (   $a_title)

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

{
if($a_title == '') $a_title = NULL;
$this->data["title"] = $a_title;
}
ilChatRecording::startRecording (   $a_title = "")

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

References $ilDB, $res, DB_FETCHMODE_ASSOC, getModeratorId(), getObjId(), getRecord(), getRoomId(), ilDB\isDbError(), and setRecordId().

{
global $ilDB;
$next_id = $ilDB->nextId('chat_records');
$res = $ilDB->manipulateF('
INSERT INTO chat_records
( record_id,
moderator_id,
chat_id,
room_id,
title,
start_time
)
VALUES(%s, %s, %s, %s, %s, %s)',
array('integer', 'integer', 'integer', 'integer', 'text', 'integer'),
array($next_id, $this->getModeratorId(), $this->getObjId(), $this->getRoomId(), (($a_title == "") ? "-N/A-" : $a_title), time()));
if (ilDB::isDbError($res)) die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
$res = $ilDB->query('SELECT LAST_INSERT_ID()');
//if (ilDB::isDbError($res)) die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
//if ($ilDB->numRows($res) > 0)
if ($res->numRows() > 0)
{
$lastId = $res->fetchRow(DB_FETCHMODE_ASSOC);
$this->setRecordId($lastId[0]);
$this->getRecord();
}
}

+ Here is the call graph for this function:

ilChatRecording::stopRecording ( )

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

References $data, $ilDB, $res, getObjId(), getRecordId(), getRoomId(), ilDB\isDbError(), setRecord(), and setRecordId().

{
global $ilDB;
$res = $ilDB->manipulateF('
UPDATE chat_records
SET end_time = %s
WHERE chat_id = %s
AND room_id = %s
AND record_id = %s',
array('integer', 'integer', 'integer', 'integer'),
array(time(), $this->getObjId(), $this->getRoomId(), $this->getRecordId()));
if (ilDB::isDbError($res)) die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
$this->setRecordId(0);
$data = array();
$this->setRecord($data);
}

+ Here is the call graph for this function:

Field Documentation

ilChatRecording::$data = array()

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

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

ilChatRecording::$error_msg

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

Referenced by getErrorMessage().

ilChatRecording::$ilias

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

Referenced by __construct().

ilChatRecording::$lng

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

Referenced by __construct().

ilChatRecording::$moderator_id = 0

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

Referenced by getModeratorId().

ilChatRecording::$obj_id = 0

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

Referenced by getObjId().

ilChatRecording::$record_id = 0

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

Referenced by getRecordId().

ilChatRecording::$room_id = 0

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

Referenced by getRoomId().


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