Class ilChatRecording. More...
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() | |
Class ilChatRecording.
Definition at line 32 of file class.ilChatRecording.php.
| ilChatRecording::delete | ( | $ | a_id = 0 |
) |
Definition at line 266 of file class.ilChatRecording.php.
References $data, $res, getRecordId(), 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);
}
$query = "DELETE FROM chat_records WHERE
record_id = ".$ilDB->quote($a_id)."";
$res = $this->ilias->db->query($query);
if (DB::isError($res)) die("ilChatRecording::delete(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
$query = "DELETE FROM chat_record_data WHERE
record_id = ".$ilDB->quote($a_id)."";
$res = $this->ilias->db->query($query);
if (DB::isError($res)) die("ilChatRecording::delete(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
}
Here is the call graph for this function:| ilChatRecording::exportMessages | ( | ) |
Definition at line 291 of file class.ilChatRecording.php.
References $data, $res, and getRecordId().
{
global $ilDB;
$query = "SELECT message FROM chat_record_data WHERE
record_id = ".$ilDB->quote($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: ".$query);
$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 161 of file class.ilChatRecording.php.
{
return $this->data["description"];
}
| ilChatRecording::getEndTime | ( | ) |
Definition at line 104 of file class.ilChatRecording.php.
{
return $this->data["end_time"];
}
| ilChatRecording::getErrorMessage | ( | ) |
Definition at line 68 of file class.ilChatRecording.php.
{
return $this->error_msg;
}
| ilChatRecording::getModerator | ( | $ | a_id = 0 |
) |
Definition at line 256 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 113 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 86 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 122 of file class.ilChatRecording.php.
References $data, $res, getRecordId(), setRecord(), and setRecordId().
Referenced by isRecording(), and startRecording().
{
global $ilDB;
if ($a_id != 0)
{
$this->setRecordId($a_id);
}
$query = "SELECT * FROM chat_records WHERE
record_id = " . $ilDB->quote( $this->getRecordId() ) . "";
$res = $this->ilias->db->query($query);
if (DB::isError($res)) die("ilChatRecording::getRecord(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
$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 95 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 235 of file class.ilChatRecording.php.
References $data, $res, and getObjId().
{
global $ilDB;
$query = "SELECT * FROM chat_records WHERE
chat_id = ".$ilDB->quote($this->getObjId())."";
$res = $this->ilias->db->query($query);
if (DB::isError($res)) die("ilChatRecording::getRecordings(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
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 77 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 100 of file class.ilChatRecording.php.
{
return $this->data["start_time"];
}
| ilChatRecording::getTitle | ( | ) |
Definition at line 152 of file class.ilChatRecording.php.
{
return $this->data["title"];
}
| ilChatRecording::ilChatRecording | ( | $ | a_id = 0 |
) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat 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:| ilChatRecording::isRecording | ( | ) |
Definition at line 211 of file class.ilChatRecording.php.
References $res, getObjId(), getRecord(), getRoomId(), and setRecordId().
{
global $ilDB;
$query = "SELECT record_id FROM chat_records WHERE
chat_id = ".$ilDB->quote($this->getObjId())." AND
room_id = ".$ilDB->quote($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: ".$query);
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 157 of file class.ilChatRecording.php.
{
$this->data["description"] = $a_description;
}
| ilChatRecording::setModeratorId | ( | $ | a_id | ) |
Definition at line 109 of file class.ilChatRecording.php.
{
$this->moderator_id = $a_id;
}
| ilChatRecording::setObjId | ( | $ | a_id | ) |
Definition at line 82 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 118 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 91 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 148 of file class.ilChatRecording.php.
{
$this->data["title"] = $a_title;
}
| ilChatRecording::startRecording | ( | $ | a_title = "" |
) |
Definition at line 166 of file class.ilChatRecording.php.
References $res, getModeratorId(), getObjId(), getRecord(), getRoomId(), and setRecordId().
{
global $ilDB;
$query = "INSERT INTO chat_records SET
moderator_id = ".$ilDB->quote($this->getModeratorId()).",
chat_id = ".$ilDB->quote($this->getObjId()).",
room_id = ".$ilDB->quote($this->getRoomId()).",
title = ".$ilDB->quote((($a_title == "") ? "-N/A-" : $a_title)).",
start_time = '" . time() . "'";
$res = $this->ilias->db->query($query);
if (DB::isError($res))
die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
$query = "SELECT LAST_INSERT_ID()";
$res = $this->ilias->db->query($query);
if (DB::isError($res))
die("ilChatRecording::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
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 194 of file class.ilChatRecording.php.
References $data, $res, getObjId(), getRoomId(), setRecord(), and setRecordId().
{
global $ilDB;
$query = "UPDATE chat_records SET
end_time = '" . time() . "' WHERE
chat_id = ".$ilDB->quote($this->getObjId())." AND
room_id = ".$ilDB->quote($this->getRoomId())."";
$res = $this->ilias->db->query($query);
if (DB::isError($res)) die("ilChatRecording::stopRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
$this->setRecordId(0);
$data = array();
$this->setRecord($data);
}
Here is the call graph for this function:| ilChatRecording::$data = array() |
Definition at line 44 of file class.ilChatRecording.php.
Referenced by delete(), exportMessages(), getRecord(), getRecordings(), and stopRecording().
| ilChatRecording::$error_msg |
Definition at line 37 of file class.ilChatRecording.php.
| ilChatRecording::$ilias |
Definition at line 34 of file class.ilChatRecording.php.
Referenced by ilChatRecording().
| ilChatRecording::$lng |
Definition at line 35 of file class.ilChatRecording.php.
Referenced by ilChatRecording().
| ilChatRecording::$moderator_id = 0 |
Definition at line 40 of file class.ilChatRecording.php.
| ilChatRecording::$obj_id = 0 |
Definition at line 39 of file class.ilChatRecording.php.
| ilChatRecording::$record_id = 0 |
Definition at line 42 of file class.ilChatRecording.php.
| ilChatRecording::$room_id = 0 |
Definition at line 41 of file class.ilChatRecording.php.
1.7.1