HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: AED Modules

» Return to Contents


An AED module (Add/Edit/Delete module) is a module that inherits from the AED base class, in order to abstract away standard code such that the module can be implemented using less code itself.
For examples, see any module that uses AED - they vary, and there is an adhoc parameterisation scheme that we extend whenever we are implementing a new AED module and find a new parameter is needed.

sources/aed_module.php

standard_aed_module

Function summary

?array info ()
?array get_entry_points ()
tempcode run ()
array choose_feedback_fields_statistically (?BINARY allow_rating, ?SHORT_INTEGER allow_comments, ?BINARY allow_trackbacks)
tempcode get_permission_fields (?ID_TEXT category_id, ?tempcode help, boolean new_category, ?tempcode pinterface_view)
void set_permissions (ID_TEXT id)
tempcode do_next_manager (tempcode title, tempcode description, ?ID_TEXT id)
?tempcode handle_confirmations (tempcode title)
?tempcode choose_catalogue (tempcode title)
tempcode preview_intercept (tempcode title)
boolean has_tied_catalogue ()
tempcode ad ()
tempcode _ad ()
array get_entry_rows (boolean recache, ?ID_TEXT orderer, ?array where, boolean force_site_db, string join)
tempcode nice_get_entries ()
tempcode ed ()
tempcode _ed ()
tempcode __ed ()

?array info()

Standard modular info function.

Parameters…

Returns…

Description Map of module info (NULL: module is disabled).
Type ?array

Return to the function index for this class Expand: View the source code to this function

?array get_entry_points()

Standard modular entry-point finder function.

Parameters…

Returns…

Description A map of entry points (type-code=>language-code) (NULL: disabled).
Type ?array

Return to the function index for this class Expand: View the source code to this function

tempcode run()

Standard modular run function.

Parameters…

Returns…

Description The result of execution.
Type tempcode

Return to the function index for this class Expand: View the source code to this function

array choose_feedback_fields_statistically(?BINARY allow_rating, ?SHORT_INTEGER allow_comments, ?BINARY allow_trackbacks)

Statistically work out defaults for feedback fields, if not currently set.

Parameters…

Name allow_rating
Description Whether rating is allowed (NULL: decide statistically, based on existing choices)
Type ?BINARY

Name allow_comments
Description Whether comments are allowed (0=no, 1=yes, 2=review style) (NULL: decide statistically, based on existing choices)
Type ?SHORT_INTEGER

Name allow_trackbacks
Description Whether trackbacks are allowed (NULL: decide statistically, based on existing choices)
Type ?BINARY

Returns…

Description Array of all input parameters, converted
Type array

Return to the function index for this class Expand: View the source code to this function

tempcode get_permission_fields(?ID_TEXT category_id, ?tempcode help, boolean new_category, ?tempcode pinterface_view)

Standard modular permission chooser.

Parameters…

Name category_id
Description The category ID the permissions are being chosen for (NULL: new category)
Type ?ID_TEXT

Name help
Description Extra help to show in interface (NULL: none)
Default value
Type ?tempcode

Name new_category
Description Whether this is a new category (don't load permissions, default to on)
Default value boolean-false
Type boolean

Name pinterface_view
Description Label for view permissions (NULL: default)
Default value
Type ?tempcode

Returns…

Description The permission fields
Type tempcode

Return to the function index for this class Expand: View the source code to this function

void set_permissions(ID_TEXT id)

Set permissions of the news category from POST parameters.

Parameters…

Name id
Description The category to set permissions for
Type ID_TEXT

(No return value)


Return to the function index for this class Expand: View the source code to this function

tempcode do_next_manager(tempcode title, tempcode description, ?ID_TEXT id)

The do-next manager for after content management.

Parameters…

Name title
Description The title (output of get_page_title)
Type tempcode

Name description
Description Some description to show, saying what happened
Type tempcode

Name id
Description The ID of whatever we are working with (NULL: deleted)
Type ?ID_TEXT

Returns…

Description The UI
Type tempcode

Return to the function index for this class Expand: View the source code to this function

?tempcode handle_confirmations(tempcode title)

If a confirmation is needed, and not been given, ask for one.

Parameters…

Name title
Description The page title for what's being done
Type tempcode

Returns…

Description The confirmation UI (NULL: all is clear - no confirmation needed)
Type ?tempcode

Return to the function index for this class Expand: View the source code to this function

?tempcode choose_catalogue(tempcode title)

Get some XHTML for a form to choose a catalogue out of all the available ones.

Parameters…

Name title
Description The get_page_title converted title for this page
Type tempcode

Returns…

Description The tempcode for the catalogue chooser (NULL: already chosen)
Type ?tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode preview_intercept(tempcode title)

Standard modular UI for a separate preview.

Parameters…

Name title
Description The page title
Type tempcode

Returns…

Description The UI
Type tempcode

Return to the function index for this class Expand: View the source code to this function

boolean has_tied_catalogue()

Find whether this content type has a tied catalogue.

Parameters…

Returns…

Description Whether it has
Type boolean

Return to the function index for this class Expand: View the source code to this function

tempcode ad()

Standard modular UI to add an entry.

Parameters…

Returns…

Description The UI
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode _ad()

Standard modular UI/actualiser to add an entry.

Parameters…

Returns…

Description The UI
Type tempcode

Return to the function index for this class Expand: View the source code to this function

array get_entry_rows(boolean recache, ?ID_TEXT orderer, ?array where, boolean force_site_db, string join)

Standard modular entry function to get rows for selection from.

Parameters…

Name recache
Description Whether to force a recache
Default value boolean-false
Type boolean

Name orderer
Description Order to use (NULL: automatic)
Default value
Type ?ID_TEXT

Name where
Description Extra where clauses (NULL: none)
Default value
Type ?array

Name force_site_db
Description Whether to always access using the site database
Default value boolean-false
Type boolean

Name join
Description Extra join clause for our query (blank: none)
Default value
Type string

Returns…

Description A pair: Rows for selection from, Total results
Type array

Return to the function index for this class Expand: View the source code to this function

tempcode nice_get_entries()

Standard modular entry list fetcher.

Parameters…

Returns…

Description The selection list
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode ed()

Standard modular UI to choose an entry to edit.

Parameters…

Returns…

Description The UI
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode _ed()

Standard modular UI to edit an entry.

Parameters…

Returns…

Description The UI
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode __ed()

Standard modular UI/actualiser to edit an entry.

Parameters…

Returns…

Description The UI
Type tempcode

Return to the function index for this class Expand: View the source code to this function