[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/wiki/inc/ -> class.sowiki.inc.php (sommaire)

(pas de description)

Poids: 916 lignes (29 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

soWikiPage:: (35 méthodes):
  soWikiPage()
  acl_filter()
  acl_check()
  as_array()
  exists()
  read()
  write()
  rename()
  column2names()
  sowiki()
  page()
  length_sql()
  find()
  history()
  interwiki()
  clear_link()
  clear_interwiki()
  clear_sisterwiki()
  new_link()
  get_links()
  new_interwiki()
  new_sisterwiki()
  twinpages()
  lock()
  unlock()
  allpages()
  _return_pages()
  newpages()
  emptypages()
  givenpages()
  maintain()
  rateCheck()
  rateBlockList()
  rateBlockAdd()
  rateBlockRemove()


Classe: soWikiPage  - X-Ref

Class representing a wiki-page, usualy gets instanciated via sowiki::page()

soWikiPage($db,$PgTbl,$name = '',$lang=False,$wiki_id=0,$debug=0)   X-Ref
Constructor of the soWikiPage class, gets instanciated via the soWiki::page function

param: object $db db-object
param: string $PgTbl name of pages-table
param: string $name name of the wiki-page
param: string/boolean $lang requested language or False
param: int $wiki_id which wiki to use
param: int $debug debug-value

acl_filter($readable = True,$add_wiki_id=True)   X-Ref
filter to and into query to get only readable / writeable page of current user

param: boolean $readable generate SQL for readable or writable filter, default True == readable
param: boolean $add_wiki_id add code to filter only the actual wiki
return: string SQL to AND into the query

acl_check($readable = False)   X-Ref
check if page is readable or writeable by the current user

If we have an anonymous session and the anonymous session-type is NOT editable,
all pages are readonly (even if their own setting is editable by all) !!!

* @paramboolean $readable check if page is readable or writable, default False == writeable
return: boolean true if check was successful, false otherwise

as_array()   X-Ref
Returns the class-vars belonging direct to the wiki-page as an array

return: array

exists()   X-Ref
Check if the page, which name, lang was set in the constructor, exists.

return: boolean true if page exists in database, false otherwise

read()   X-Ref
Read in a page contents, name and lang was set in the constructor

return: array/boolean contents of the page or False.

write()   X-Ref
Write the a page's contents to the db and sets the supercede-time of the prev. version

The caller is responsible for performing locking.

rename($new_name=False,$new_lang=False)   X-Ref
Renames a page to a new name and/or lang

The caller is responsible for performing locking.
param: string/boolean $new_name to rename to or false if only a new language, default false
param: string/boolean $new_lang to rename to or false if only a new name, default false
return: int affected rows, 1=success, 0=not found

column2names()   X-Ref
Returns colNames array, which translates column-names to internal names

return: array with column-names as keys

sowiki($wiki_id=0)   X-Ref
Constructor of the PageStrore class sowiki

param: int $wikid_id which wiki to use, default 0

page($name = '',$lang=False)   X-Ref
Create a page object / instanciate the soWikiPage class.

param: string $name name of the page
param: string/boolean $lang language or false for the users default language-order
return: object soWikiPage class of the page

length_sql($table)   X-Ref
Returns the SQL to retrive the length of the body-column

MaxDB cant calculate the length of the content of a LONG column, we set it to 1,
we could retrive the complete column and use strlen on it, I dont do it as the length is only for sorting
via a macro and that macro retrives all pages(!) - never used that macro ;-)

param: string $table table-name of join alias incl. '.', or '' (default)
return: string the SQL

find($text,$search_in=False)   X-Ref
Find $text in the database, searches title and body.

param: string $text pattern to search
param: string/boolean $search_in comma-separated string with columns to search (name,title,body) or false to search all three for "%text%" (!)
return: array of wiki-pages (array with column-name / value pairs)

history($page,$lang=False)   X-Ref
Retrieve a page's edit history.

param: string/array $page name of the page or array with values for keys 'name' and 'lang'
param: string/boolean $lang language to use or false if given via array in $name, default false
return: an array of the different versions

interwiki($name)   X-Ref
Look up an interwiki prefix

param: string $name name-prefix of an interwiki
return: string/boolean the url of False

clear_link($page)   X-Ref
Clear all the links cached for a particular page.

param: string/array $page page-name or array with values for wiki_id, name and lang keys

clear_interwiki($page)   X-Ref
Clear all the interwiki definitions for a particular page.

param: string/array $page page-name or array with values for wiki_id, name and lang keys

clear_sisterwiki($page)   X-Ref
Clear all the sisterwiki definitions for a particular page.

param: string/array $page page-name or array with values for wiki_id, name and lang keys

new_link($page, $link)   X-Ref
Add a link for a given page to the link table.

param: string/array $page page-name or array with values for wiki_id, name and lang keys
param: string $link the link to add

get_links($link='')   X-Ref
Retrives all links on all pages and all languages

param: string $link if none-empty, only these links are retrived
return: array 2-dim. array with linking pages and languages, eg. $arr[$page][$lang] = $link

new_interwiki($page, $prefix, $url)   X-Ref
Add an interwiki definition for a particular page.

param: string/array $page page-name or array with values for name, lang and evtl. wiki_id (this->wiki_id is used if not)
param: string $prefix Prefix of the new interwiki
param: string $url URL of the new interwiki

new_sisterwiki($page, $prefix, $url)   X-Ref
Add an sisterwiki definition for a particular page.

param: string/array $page page-name or array with values for name, lang and evtl. wiki_id (this->wiki_id is used if not)
param: string $prefix Prefix of the new interwiki
param: string $url URL of the new interwiki

twinpages($page)   X-Ref
Find all twins of a page at sisterwiki sites.

param: string/array $page page-name or array with values for name
return: array list of array(site,page)

lock()   X-Ref
Pas de description

unlock()   X-Ref
Pas de description

allpages()   X-Ref
Pas de description

_return_pages($func)   X-Ref
Create array of page-arrays from the returned rows of a query

param: string $func calling function incl. parameters for debug-message

newpages()   X-Ref
Pas de description

emptypages()   X-Ref
Pas de description

givenpages($names)   X-Ref
Pas de description

maintain()   X-Ref
Expire old versions of pages.


rateCheck($type,$remote_addr)   X-Ref
Perform a lookup on an IP addresses edit-rate.

param: string $type 'view',' search' or 'edit'
param: string $remote_addr eg. $_SERVER['REMOTE_ADDR']

rateBlockList()   X-Ref
Return a list of blocked address ranges.

return: array of blocked address-ranges

rateBlockAdd($address)   X-Ref
Block an address range.

param: string $address ip-addr. or addr-range

rateBlockRemove($address)   X-Ref
Remove an address-range block.

param: string $address ip-addr. or addr-range



Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7