[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/inc/ -> class.article.php (sommaire)

(pas de description)

Poids: 714 lignes (26 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Article:: (19 méthodes):
  Article()
  load()
  loadPages()
  getAsString()
  setDefaults()
  set()
  setPage()
  check()
  goToPage()
  getPathToPage()
  getArrayPageList()
  checkPage()
  action()
  hookOnInitTemplate()
  parseQueryString()
  commit()
  remove()
  commitPage()
  removePage()


Classe: Article  - X-Ref

Article class. This is the data storage of an article.

Article($data='')   X-Ref
Constructor.


load($id='')   X-Ref
Load the article.

param: mixed Identifier or resource id ('')
return: bool Success

loadPages()   X-Ref
Load the pages of an articles.
The pages are stored in $this->pages for later reuse.

return: bool Success or error

getAsString($format='html')   X-Ref
Return the content of the article as a string ready for indexation.

param: string Format of the string (html, wiki, text)
return: string The content of the news as a string

setDefaults($user)   X-Ref
Set the default values for the article.

param: object User object to have the preferences
return: bool True

set($title, $subject, $content, $format, $status, $path,$datestart, $dateend, $useenddate, $comment_support, $subtype)   X-Ref
Set the basic data of an article.
The basic data are the one saved in the table `resources`.
There is only a check of the data, use the commit() method
to save in the database.

param: string Title of the article
param: string Subject or keywords
param: string Description of the article
param: string Format of the description
param: int Status
param: string Path
param: timestamp Date of publication
param: timestamp Date of end of publication
param: bool Use a date of end of publication
param: int Comment support
param: int Subtype of the article

setPage($id, $title, $content, $format, $number)   X-Ref
Set a page.
If the page id is empty, a new page is added.

param: int Id of the page
param: string Title of the page
param: string Content
param: string Format
param: int Number
return: bool Success

check()   X-Ref
Check the consistency of the data of the article.

Simply goes through the object and check that the values are not
possibly conflicting. The check is only with respect to the type
of the data, no integrity check like existence of a matching
author in the base is done.

return: bool Success, if false the error is set.

goToPage($id)   X-Ref
Go to the page with a specific id.
In case of success the $this->pages recordset is set to the page.

param: int id of the page
return: bool success to go to the page

getPathToPage()   X-Ref
Get path to the current article page.
It uses the current page in $this->pages

return: string The path to the current page

getArrayPageList($auto=true)   X-Ref
Get an array with the list of the pages.

param: bool Auto 'at the end' (true)
return: array Ready to use in combo box

checkPage()   X-Ref
Check that the data for the page to be added or updated are
correct.

return: bool Success

action($query)   X-Ref
Action to display a category.

param: string Server query string
return: int Success code

hookOnInitTemplate($hook, $param)   X-Ref
Hook on the initialization of the templates.

param: string Name of the calling hook
param: array Default parameters (not used)
return: bool Success

parseQueryString($query)   X-Ref
Parse query string.

param: string Query string
return: array (article path, page number, category path)

commit()   X-Ref
Save the article in the database.

Only the basic data of the article are saved. The pages are not
saved. See commitPage() to commit a page into the database.

return: bool Success

remove()   X-Ref
Remove the article from the database.

return: bool Success

commitPage()   X-Ref
Save the current page in the database.

The page currently pointed in $this->pages is saved in the
database. It means that you need to be carefull between the
call to setPage() and commitPage() not to "move" the cursor.

return: mixed Id of the page if success, false if error

removePage()   X-Ref
Remove a page of the article.
Remove the current page.

return: bool Success



Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics