Public Member Functions | Data Fields

ilFileDataChat Class Reference

Inheritance diagram for ilFileDataChat:
Collaboration diagram for ilFileDataChat:

Public Member Functions

 ilFileDataChat (&$chat_obj)
 Constructor call base constructors checks if directory is writable and sets the optional obj_id.
 addFile ($filename, $data)
 zip ()
 getChatPath ()
 _ilFileDataChat ()
 __checkPath ()
 __createDirectory ($a_path)
 __deleteOld ()

Data Fields

 $chat_obj
 $chat_path

Detailed Description

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


Member Function Documentation

ilFileDataChat::__checkPath (  ) 

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

References getChatPath().

Referenced by ilFileDataChat().

        {
                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  ) 

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

References ilUtil::makeDir().

Referenced by ilFileDataChat().

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

Here is the call graph for this function:

Here is the caller graph for this function:

ilFileDataChat::__deleteOld (  ) 

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

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

Referenced by ilFileDataChat().

        {
                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))
                                        {
                                                ilUtil::delDir($this->getChatPath()."/".$file);
                                        }
                                }
                        }
                        closedir($dp);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilFileDataChat::_ilFileDataChat (  ) 

Definition at line 98 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 74 of file class.ilFileDataChat.php.

References $_SESSION, and $data.

        {
                $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 92 of file class.ilFileDataChat.php.

Referenced by __checkPath(), and __deleteOld().

        {
                return $this->chat_path;
        }

Here is the caller graph for this function:

ilFileDataChat::ilFileDataChat ( &$  chat_obj  ) 

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

Parameters:
integereger obj_id public

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

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

        {

                parent::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:

ilFileDataChat::zip (  ) 

Definition at line 84 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 37 of file class.ilFileDataChat.php.

Referenced by ilFileDataChat().

ilFileDataChat::$chat_path

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


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