dev.obliquid.com: obliquid
[ class tree: obliquid ] [ index: obliquid ] [ all elements ]

Class: news

Source Location: Program_Root/classes/obliquid/news.php

Class Overview


News class, main class for news module


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 29]
News class, main class for news module





[ Top ]


Class Variables

$dbf =

[line 33]

A db_form object




Type:   mixed


[ Top ]

$id_news =

[line 36]

Category and news id




Type:   mixed


[ Top ]



Class Methods


constructor news [line 42]

void news( [integer $id_cat = 0], [integer $id_news = 0])

Constructor. Stores $id_cat and optional $id_news and creates a new db_form





Parameters:

integer   $id_cat   news category id, optional parameter
integer   $id_news   news id, optional parameter

[ Top ]

method delBlock [line 245]

integer delBlock( mixed $pos)

Deletes a block from a news article. If the block contains attachments, those are deleted too. If the block is the last block of the article, then the article itself is deleted.



Tags:

return:  the number of blocks left


[ Top ]

method delObject [line 299]

void delObject( integer $id_news_object)

Deletes a news object (attachment). Deletes both the news_object record and

the file on disk






Parameters:

integer   $id_news_object   the object id to be deleted

[ Top ]

method delObjects [line 280]

void delObjects( integer $pos)

Deletes all attachments in a given position





Parameters:

integer   $pos   the position, -1 to delete all attachments in any position

[ Top ]

method delTopic [line 215]

void delTopic( integer $id_cat)

Deletes a whole topic, but only if it's empty.





Parameters:

integer   $id_cat   the category to delete

[ Top ]

method enabledLangs [line 54]

array &enabledLangs( )

Gets the list of the enabled languages for this news category



Tags:

return:  the list of enabled languages in an index array


[ Top ]

method getCategory [line 117]

array getCategory( [integer $id_cat = 0], [text $locale = ""])

gets title and description and lastpost for the given news category id in the

current lang as an index array of two elements (0, 1)




Tags:

return:  an index array of four elements: title, body, lastpost, locale


Parameters:

integer   $id_cat   the news category. optional if it was given in the constructor
text   $locale   sets the preferred locale, if not set use the current one -- returns the chosen locale

[ Top ]

method getImages [line 345]

array getImages( integer $id_news_item, text $object_name, text $object_mime, text $how_to_show)

Returns an array of zero, one or two elements with filenames of images to be shown according to the parameters passed. This function may be used as a static method.



Tags:

return:  index array with the name of the image to show in position 0 and how to show the popup in position 1 (I, R, O)


Parameters:

integer   $id_news_item   the news article id
text   $object_name   object base name
text   $object_mime   object mime type (if not an image returns an empty array)
text   $how_to_show   an array of one or two letters I, R, O, N

[ Top ]

method getTitle [line 151]

array getTitle( [$id_news $id_news = 0])

gets title and subtitle for the given news item id in the current lang

as an index array of two elements (0, 1)




Tags:

return:  index array of two elements: title, subtitle


Parameters:

$id_news   $id_news   the news item. optional if it was given in the constructor

[ Top ]

method getTopics [line 183]

array &getTopics( )

Gets the list of news topics. Only the topics allowed to the current user are returned.



Tags:

return:  an indexed array with records containing the following information 0=id_news_cat, 1=ord, 2=ordby, 3=restricted (y/n) (lowercase char, not boolean), 4=page_size, title=topic title, body=topic description, page_size = page size to be displayed (has "No paging" instead of 0), restricted=restricted flag to be displayed (has translated "Yes", "No" instead of y/n)


[ Top ]

method retrieveArticle [line 76]

integer retrieveArticle( array &$tx, array &$object)

Retrieves the article content in all languages and stores it in $tx and $object. It also stores values inside db_form.

$tx is an array of index arrays (0 => lang, 1 => title, 2 => subtitle, 3 => body, 4 => bodytype, 5 => pos, 6 => blocklayout) $object is an array of arrays (0 => id_news_object, 1 => object_name, 2 => object_size, 3 => pos, 4 => object_mime, 5 => lang, "is_image" => is_image)




Tags:

return:  news id of the retrieved news


Parameters:

array   $tx   the body text
array   $object   list of attached files

[ Top ]


Documentation generated on Tue, 29 Mar 2005 09:04:34 -0800 by phpDocumentor 1.2.0rc2