Functions

Helper function.

_cedi_show_tree(array $cedi_seen, \?AUTO_LINK $select, \AUTO_LINK $id, string $breadcrumbs, \SHORT_TEXT $title, boolean $use_compound_list, boolean $ins_format) : mixed

Get a nice formatted XHTML list of all the children beneath the specified Wiki+ page. This function is recursive.

Parameters

$cedi_seen

array

A list of pages we've already seen (we don't repeat them in multiple list positions)

$select

\?AUTO_LINK

The Wiki+ page to select by default (NULL: none)

$id

\AUTO_LINK

The Wiki+ page to look beneath

$breadcrumbs

string

Breadcrumbs built up so far, in recursion (blank: starting recursion)

$title

\SHORT_TEXT

The title of the Wiki+ page to look beneath

$use_compound_list

boolean

Whether to create a compound list (gets pairs: tempcode, and comma-separated list of children)

$ins_format

boolean

Whether to use titles in IDs after a ! (used on tree edit page)

Returns

mixedTempcode for the list / pair of tempcode and compound

Add a Wiki+ page

cedi_add_page(\SHORT_TEXT $title, \LONG_TEXT $description, \LONG_TEXT $notes, \BINARY $hide_posts, \?MEMBER $member) : \AUTO_LINK

Parameters

$title

\SHORT_TEXT

The page title

$description

\LONG_TEXT

The page description

$notes

\LONG_TEXT

Hidden notes pertaining to the page

$hide_posts

\BINARY

Whether to hide the posts on the page by default

$member

\?MEMBER

The member doing the action (NULL: current member)

Returns

\AUTO_LINKThe page ID

Edit a CEDI post

cedi_add_post(\AUTO_LINK $page_id, string $message, \BINARY $validated, \?MEMBER $member, boolean $send_notification) : \AUTO_LINK

Parameters

$page_id

\AUTO_LINK

The page ID

$message

string

The new post

$validated

\BINARY

Whether the post will be validated

$member

\?MEMBER

The member doing the action (NULL: current member)

$send_notification

boolean

Whether to send out a notification out

Returns

\AUTO_LINKThe post ID

Convert a Wiki+ chain to a nice breadcrumb trail.

cedi_breadcrumbs(string $chain, \?string $current_title, boolean $final_link, boolean $links, boolean $this_link_virtual_root) : \tempcode

Parameters

$chain

string

The chain to convert (which should include the current page ID)

$current_title

\?string

The title of the current Wiki+ page (if not given, it is looked up) (NULL: work it out)

$final_link

boolean

Whether to show the final breadcrumbs element with a link to it (all others will always have links if $links is true)

$links

boolean

Whether to show links to pages in the breadcrumbs

$this_link_virtual_root

boolean

Whether to make the link as a virtual-root link (only applies if $final_link is true)

Returns

\tempcodeTempcode of the breadcrumb XHTML

Delete a Wiki+ page

cedi_delete_page(\AUTO_LINK $id) 

Parameters

$id

\AUTO_LINK

The page ID

Delete a Wiki+ post

cedi_delete_post(\AUTO_LINK $post_id, \?MEMBER $member) 

Parameters

$post_id

\AUTO_LINK

The post ID

$member

\?MEMBER

The member doing the action (NULL: current member)

Create a Wiki+ chain from the specified page ID

cedi_derive_chain(\AUTO_LINK $id) : string

Parameters

$id

\AUTO_LINK

The ID of the page to derive a chain for

Returns

stringThe Wiki+ chain derived

Edit a Wiki+ page

cedi_edit_page(\AUTO_LINK $id, \SHORT_TEXT $title, \LONG_TEXT $description, \LONG_TEXT $notes, \BINARY $hide_posts, \SHORT_TEXT $meta_keywords, \LONG_TEXT $meta_description, \?MEMBER $member) 

Parameters

$id

\AUTO_LINK

The page ID

$title

\SHORT_TEXT

The page title

$description

\LONG_TEXT

The page description

$notes

\LONG_TEXT

Hidden notes pertaining to the page

$hide_posts

\BINARY

Whether to hide the posts on the page by default

$meta_keywords

\SHORT_TEXT

Meta keywords

$meta_description

\LONG_TEXT

Meta description

$member

\?MEMBER

The member doing the action (NULL: current member)

Edit a Wiki+ post

cedi_edit_post(\AUTO_LINK $id, string $message, \BINARY $validated, \?MEMBER $member) 

Parameters

$id

\AUTO_LINK

The post ID

$message

string

The new post

$validated

\BINARY

Whether the post will be validated

$member

\?MEMBER

The member doing the action (NULL: current member)

Get a nice formatted XHTML list of all the children beneath the specified Wiki+ page.

cedi_show_tree(\?AUTO_LINK $select, \?AUTO_LINK $id, string $breadcrumbs, boolean $include_orphans, boolean $use_compound_list, boolean $ins_format) : mixed

This function is recursive.

Parameters

$select

\?AUTO_LINK

The Wiki+ page to select by default (NULL: none)

$id

\?AUTO_LINK

The Wiki+ page to look beneath (NULL: the root)

$breadcrumbs

string

Breadcrumbs built up so far, in recursion (blank: starting recursion)

$include_orphans

boolean

Whether to include orphaned pages in the breadcrumbs

$use_compound_list

boolean

Whether to create a compound list (gets pairs: tempcode, and comma-separated list of children)

$ins_format

boolean

Whether to use titles in IDs after a ! (used on tree edit page)

Returns

mixedTempcode for the list / pair of tempcode and compound

Dispatch a notification about a Wiki+ page

dispatch_cedi_page_notification(\AUTO_LINK $page_id, \ID_TEXT $type) 

set ADD EDIT

Parameters

$page_id

\AUTO_LINK

The page ID

$type

\ID_TEXT

The action type

Dispatch a notification about a Wiki+ post

dispatch_cedi_post_notification(\AUTO_LINK $post_id, \ID_TEXT $type) 

set ADD EDIT

Parameters

$post_id

\AUTO_LINK

The post ID

$type

\ID_TEXT

The action type

Get a list of maps containing all the subpages, and path information, of the specified page - and those beneath it, recursively.

get_cedi_page_tree(array $cedi_seen, \?AUTO_LINK $page_id, \?string $breadcrumbs, \?ID_TEXT $title, boolean $do_stats, boolean $use_compound_list, \?integer $levels) : array

Parameters

$cedi_seen

array

A list of pages we've already seen (we don't repeat them in multiple list positions)

$page_id

\?AUTO_LINK

The page being at the root of our recursion (NULL: true root page)

$breadcrumbs

\?string

The breadcrumbs up to this point in the recursion (NULL: blank, as we are starting the recursion)

$title

\?ID_TEXT

The name of the $page_id we are currently going through (NULL: look it up). This is here for efficiency reasons, as finding children IDs to recurse to also reveals the childs title

$do_stats

boolean

Whether to collect post counts with our breadcrumbs information

$use_compound_list

boolean

Whether to make a compound list (a pair of a comma-separated list of children, and the child array)

$levels

\?integer

The number of recursive levels to search (NULL: all)

Returns

arrayA list of maps for all subcategories. Each map entry containins the fields 'id' (category ID) and 'breadcrumbs' (path to the category, including the categories own title). There is also an additional 'downloadcount' entry if stats were requested

Get the number of CEDI pages currently in the database.

get_num_cedi_pages() : integer

Returns

integerThe number of pages in the CEDI database

Get the number of CEDI posts currently in the database.

get_num_cedi_posts() : integer

Returns

integerThe number of posts in the CEDI database

Get a chain script parameter or just an ID, in which case it does more work), and converts it into a id/chain pair

get_param_cedi_chain(\ID_TEXT $parameter_name, \?string $default_value) : array

Parameters

$parameter_name

\ID_TEXT

The name of the GET parameter that stores the chain

$default_value

\?string

The default value for the chain (NULL: no default)

Returns

arrayAn array of two elements: an ID and a chain

Get tempcode for a CEDI post 'feature box' for the given row

render_cedi_page_box(array $row, \ID_TEXT $zone, boolean $put_in_box) : \tempcode

Parameters

$row

array

The database field row of it

$zone

\ID_TEXT

The zone to use

$put_in_box

boolean

Whether to put it in a box with a title

Returns

\tempcodeA box for it, linking to the full page

Get tempcode for a Wiki+ post 'feature box' for the given row

render_cedi_post_box(array $row, \ID_TEXT $zone, boolean $put_in_box) : \tempcode

Parameters

$row

array

The database field row of it

$zone

\ID_TEXT

The zone to use

$put_in_box

boolean

Whether to put it in a box

Returns

\tempcodeA box for it, linking to the full page