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

This class handles all operations on files for the exercise object. More...

+ Inheritance diagram for ilFileDataChat:
+ Collaboration diagram for ilFileDataChat:

Public Member Functions

 __construct (&$chat_obj)
 Constructor call base constructors checks if directory is writable and sets the optional obj_id.
 addFile ($filename, $data)
 zip ()
 getChatPath ()
 _ilFileDataChat ()
- Public Member Functions inherited from ilFileData
 ilFileData ()
 Constructor class bas constructor and read path of directory from ilias.ini setup an mail object public.
 checkPath ($a_path)
 check if path exists and is writable
 getPath ()
 get Path public
- Public Member Functions inherited from ilFile
 ilFile ()
 Constructor get ilias object public.
 deleteTrailingSlash ($a_path)
 delete trailing slash of path variables

Data Fields

 $chat_obj
 $chat_path

Private Member Functions

 __checkPath ()
 __createDirectory ($a_path)
 __deleteOld ()

Detailed Description

This class handles all operations on files for the exercise object.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilFileDataChat.php 23143 2010-03-09 12:15:33Z smeyer

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

Constructor & Destructor Documentation

ilFileDataChat::__construct ( $chat_obj)

Constructor call base constructors checks if directory is writable and sets the optional obj_id.

Parameters
integeregerobj_id public

Definition at line 52 of file class.ilFileDataChat.php.

References $_SESSION, $chat_obj, __checkPath(), __createDirectory(), __deleteOld(), ilUtil\delDir(), ilFileData\getPath(), and ilFileData\ilFileData().

{
$this->chat_obj =& $chat_obj;
$this->chat_path = parent::getPath()."/chat";
if(!$this->__checkPath())
{
$this->__createDirectory($this->chat_path);
}
$this->__deleteOld();
if(@is_dir($this->chat_path."/chatrooms_".$_SESSION["AccountId"]))
{
ilUtil::delDir($this->chat_path."/chatrooms_".$_SESSION["AccountId"]);
}
$this->__createDirectory($this->chat_path."/chatrooms_".$_SESSION["AccountId"]);
}

+ Here is the call graph for this function:

Member Function Documentation

ilFileDataChat::__checkPath ( )
private

Definition at line 102 of file class.ilFileDataChat.php.

References getChatPath().

Referenced by __construct().

{
if(!file_exists($this->getChatPath()))
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilFileDataChat::__createDirectory (   $a_path)
private

Definition at line 111 of file class.ilFileDataChat.php.

References ilUtil\makeDir().

Referenced by __construct().

{
return ilUtil::makeDir($a_path);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilFileDataChat::__deleteOld ( )
private

Definition at line 116 of file class.ilFileDataChat.php.

References $file, ilUtil\delDir(), and getChatPath().

Referenced by __construct().

{
if(is_dir($this->getChatPath()))
{
$dp = opendir($this->getChatPath());
while(($file = readdir($dp)) !== false)
{
if($file != '.' and $file != '..')
{
if(filectime($this->getChatPath()."/".$file) < (time() - 60*60*24))
{
}
}
}
closedir($dp);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilFileDataChat::_ilFileDataChat ( )

Definition at line 97 of file class.ilFileDataChat.php.

References ilUtil\delDir().

{
ilUtil::delDir($this->chat_path);
}

+ Here is the call graph for this function:

ilFileDataChat::addFile (   $filename,
  $data 
)

Definition at line 73 of file class.ilFileDataChat.php.

References $_SESSION, $data, and $filename.

{
$fp = @fopen($this->chat_path."/chatrooms_".$_SESSION["AccountId"]."/".$filename,"w+");
fwrite($fp,$data);
fclose($fp);
return $this->chat_path."/chatrooms_".$_SESSION["AccountId"];
}
ilFileDataChat::getChatPath ( )

Definition at line 91 of file class.ilFileDataChat.php.

References $chat_path.

Referenced by __checkPath(), and __deleteOld().

{
}

+ Here is the caller graph for this function:

ilFileDataChat::zip ( )

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

References $_SESSION.

{
ilUtil::zip($this->chat_path."/chatrooms_".$_SESSION["AccountId"],
$this->chat_path."/ilias_chat.zip");
return $this->chat_path."/ilias_chat.zip";
}

Field Documentation

ilFileDataChat::$chat_obj

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

Referenced by __construct().

ilFileDataChat::$chat_path

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

Referenced by getChatPath().


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