Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Comments Class Reference

Inheritance diagram for Comments:

Comments_gallery Comments_XML List of all members.

Public Member Functions

 Comments ($source=null)
 loadComments ($for)
 addComment ($data)
 canAdd ($for)
 hasComments ()
 getComments ()
 mergeVars ()

Public Attributes

 comments
 prefix
 _init
 _source
 _modulesrc
 _module

Detailed Description

Comments class holds all comments of selected Album.

Definition at line 30 of file Comments.php.


Constructor & Destructor Documentation

Comments::Comments source = null  ) 
 

This constructor creates a new inmstance of Comments class and also performs source check. Constructor is responsible about selecting and loading a correct data loader module.

Parameters:
string $source Source where comments are saved.

Definition at line 55 of file Comments.php.

References generateModule(), and module.


Member Function Documentation

Comments::addComment data  ) 
 

If module is loaded propeply, this method adds a new comments into data file using selected module. And after adding a new comment, variables will be merged.

Parameters:
array $data A new comment data block, named array containing sender name, sender IP, message, etc.
Returns:
integer Status

Definition at line 103 of file Comments.php.

References mergeVars().

Comments::canAdd for  ) 
 

Checks if adding comment on current album is allowed or possible. For example Gallery module doesnät support adding comments by album-level, but XML comments supports this.

Parameters:
string $for For what? For album or image?
Returns:
boolean True if can add comments, false otherwise

Definition at line 120 of file Comments.php.

Comments::getComments  ) 
 

Get all comments as array

Returns:
array Returns array of comments, format is as below: Array ( [0] => Array ( "from" => "xxx", "sender" => "xxx"))

Definition at line 147 of file Comments.php.

Comments::hasComments  ) 
 

Detects if we have any comments (currently loaded)

Returns:
boolean false if there are no comments, otherwise true

Definition at line 133 of file Comments.php.

Comments::loadComments for  ) 
 

If data loader modue was succesfully loaded at Constructor, this method loads data using module's loadData()-method. After loading data to module's parameters, loadData() calls mergeVars-method to merge comments data from module to current object.

Parameters:
string $for For which object are we loading comments? If photo, this is a filename of photo. If album, this is -album-
See also:
mergeVars()

Definition at line 87 of file Comments.php.

References mergeVars().

Comments::mergeVars  ) 
 

After comments data is loaded by module's loadData(), this method is called to merge data from module to this object.

Definition at line 156 of file Comments.php.

Referenced by addComment(), and loadComments().


Member Data Documentation

Comments::_init
 

Definition at line 39 of file Comments.php.

Comments::_module
 

Definition at line 47 of file Comments.php.

Comments::_modulesrc
 

Definition at line 41 of file Comments.php.

Comments::_source
 

Definition at line 40 of file Comments.php.

Comments::comments
 

Reimplemented in Comments_gallery, and Comments_XML.

Definition at line 36 of file Comments.php.

Comments::prefix
 

Definition at line 37 of file Comments.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 19 11:08:05 2003 for ImaComm by doxygen1.3