Content Class Reference

Content class. More...

List of all members.

Public Member Functions

 __construct ($id, $istype=FALSE, $pid=0, $sort=NULL, $page=NULL)
 Constructor.
 getRenderedContent ($id_renderer, $id_container=NULL)
 Get rendered content.

Static Public Member Functions

static add ()
 Add a record in the table content.
static update ()
 Edit a record in the table content.
static delete ($id)
 Delete content.

Public Attributes

const FTYPE_BOOL = 1
 CMSkey field type constants.
const FTYPE_INT = 2
 integer
const FTYPE_UINT = 3
 unsigned integer
const FTYPE_FLOAT = 4
 floating
const FTYPE_DTIME = 5
 date/time
const FTYPE_STEXT = 6
 short text (max 255 chars)
const FTYPE_LTEXT = 7
 long text
const FTYPE_FTEXT = 8
 formatted long text
const FTYPE_IMAGE = 9
 image
 $cnt = array()
 current content

Private Member Functions

 getNextPos ($id_area, $id_type, $id_parent)
 Get specified content field value.

Private Attributes

 $id_area
 area id


Detailed Description

Content class.

Used to describe common properties and methods of derived extended content types.

Definition at line 38 of file content.php.


Constructor & Destructor Documentation

Content::__construct ( id,
istype = FALSE,
pid = 0,
sort = NULL,
page = NULL 
)

Constructor.

Set private array $cnt[].

Parameters:
id content id or type id
istype (optional) if TRUE, id is a type id
pid (optional) parent content id - 0 means top level
sort (optional) sort/order mode - NULL means default (FIXME - explain!) must be two chars XY where X = [A|P|T] (A = alpha, P = position, T = time) Y = [A|D] (A = ascending, D = descending)
page (optional) content page number - NULL means all or max no. of content (according to configuration)

Definition at line 71 of file content.php.

References $auth, $cfg, and $session.


Member Function Documentation

Content::getNextPos ( id_area,
id_type,
id_parent 
) [private]

Get specified content field value.

Parameters:
fieldname (string) field name
Returns:
mixed content field value Get next position id for a new content. Position id is computed in the record group having the same type id and the same parent id.
Min position is 1.

Parameters:
id_area area id
id_type content type id
id_parent content parent id
Returns:
int position id

Definition at line 153 of file content.php.

References $id_area.

Referenced by add().

static Content::add (  )  [static]

Add a record in the table content.

Values to add are supposed to be in the global var $_POST. Here's the complete list:

 id_parent      : (int) parent content id
 id_type        : (int) type id
 visible        : (boolean) content visibility
 readperm       : (int) read permission level
 writeperm      : (int) write permission level
 group_readperm : (string) FIXME check allowed read groups (bitmask)
 group_writeperm: (string) FIXME check allowed write groups (bitmask)
 date_expiration: (int) content expiration date (UNIX time) 

Returns:
(int) new record id or FALSE in case of error

Definition at line 185 of file content.php.

References $cfg, $id_area, $session, and getNextPos().

static Content::update (  )  [static]

Edit a record in the table content.

Values to edit are supposed to be in the global var $_POST. Here's the complete list:

 id             : (int) content id, used to identify record to edit
 visible        : (boolean) content visibility
 readperm       : (int) read permission level
 writeperm      : (int) write permission level
 group_readperm : (string) FIXME check allowed read groups (bitmask)
 group_writeperm: (string) FIXME check allowed write groups (bitmask)
 date_expiration: (int) content expiration date (UNIX time) 

Returns:
(boolean) TRUE if content record successfully modified.

Definition at line 230 of file content.php.

static Content::delete ( id  )  [static]

Delete content.

Recursively delete a content and all its related subcontents,attached files and images.

Parameters:
id (int) content id
Returns:
(boolean) TRUE if deletion was successful

Definition at line 278 of file content.php.

References $cfg, $id_area, and Files::delete().

Content::getRenderedContent ( id_renderer,
id_container = NULL 
)

Get rendered content.

Apply required renderers and get rendered content. Renderer is applied to each of the content items.

Parameters:
id_renderer renderer id
id_container (optional) container id
Returns:
(string) rendered content

Definition at line 341 of file content.php.


Member Data Documentation

const Content::FTYPE_BOOL = 1

CMSkey field type constants.

boolean

Definition at line 43 of file content.php.

const Content::FTYPE_INT = 2

integer

Definition at line 44 of file content.php.

const Content::FTYPE_UINT = 3

unsigned integer

Definition at line 45 of file content.php.

const Content::FTYPE_FLOAT = 4

floating

Definition at line 46 of file content.php.

const Content::FTYPE_DTIME = 5

date/time

Definition at line 47 of file content.php.

const Content::FTYPE_STEXT = 6

short text (max 255 chars)

Definition at line 48 of file content.php.

const Content::FTYPE_LTEXT = 7

long text

Definition at line 49 of file content.php.

const Content::FTYPE_FTEXT = 8

formatted long text

Definition at line 50 of file content.php.

const Content::FTYPE_IMAGE = 9

image

Definition at line 51 of file content.php.

Content::$id_area [private]

area id

Definition at line 53 of file content.php.

Referenced by add(), delete(), and getNextPos().

Content::$cnt = array()

current content

Definition at line 55 of file content.php.


The documentation for this class was generated from the following file:
Generated on Fri Feb 22 11:19:48 2008 for CMSkey by  doxygen 1.5.3