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: Catalogues

» Return to Contents



sources/catalogues.php

Global_functions_catalogues.php

Function summary

void init__catalogues ()
tempcode get_catalogue_category_html (array row, ID_TEXT zone, boolean put_in_box)
void grant_catalogue_full_access (AUTO_LINK category_id)
array count_catalogue_category_children (AUTO_LINK category_id)
array get_catalogue_category_entry_buildup (?AUTO_LINK category_id, ID_TEXT catalogue_name, ?array catalogue, ID_TEXT view_type, ID_TEXT tpl_set, ?integer max, ?integer start, ?mixed select, ?AUTO_LINK root, ?SHORT_INTEGER display_type, boolean do_sorting, ?array entries, string search, ?ID_TEXT _order_by)
array get_catalogue_entry_map (array entry, ?array catalogue, ID_TEXT view_type, ID_TEXT tpl_set, ?AUTO_LINK root, ?array fields, ?array only_fields, boolean feedback_details, boolean tree_details, ?integer order_by)
tempcode nice_get_catalogues (?ID_TEXT it, boolean prefer_ones_with_entries, boolean only_submittable)
array get_catalogue_entry_field_values (?ID_TEXT catalogue_name, mixed entry_id, ?array only_fields, ?array fields, boolean natural_order)
string _get_catalogue_entry_field (AUTO_LINK field_id, mixed entry_id, ID_TEXT type)
tempcode nice_get_catalogue_entries_tree (ID_TEXT catalogue_name, ?AUTO_LINK it, ?AUTO_LINK submitter, boolean editable_filter)
array get_catalogue_entries_tree (ID_TEXT catalogue_name, ?AUTO_LINK submitter, ?AUTO_LINK category_id, ?string tree, ?ID_TEXT title, ?integer levels, boolean editable_filter)
tempcode nice_get_catalogue_category_tree (ID_TEXT catalogue_name, ?AUTO_LINK it, boolean addable_filter, boolean use_compound_list)
array get_catalogue_category_tree (ID_TEXT catalogue_name, ?AUTO_LINK category_id, ?tempcode tree, ?string title, ?integer levels, boolean addable_filter, boolean use_compound_list)
tempcode catalogue_category_breadcrumbs (AUTO_LINK category_id, ?AUTO_LINK root, boolean no_link_for_me_sir)
boolean is_ecommerce_catalogue (SHORT_TEXT catalogue_name)
boolean is_ecommerce_catalogue_entry (AUTO_LINK entry_id)
tempcode render_catalogue_entry_screen (AUTO_LINK id, boolean no_title)

void init__catalogues()

Standard code module initialisation function.

Parameters…

(No return value)


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

tempcode get_catalogue_category_html(array row, ID_TEXT zone, boolean put_in_box)

Get tempcode for a catalogue category 'feature box' for the given row

Parameters…

Name row
Description The database field row of it
Type array

Name zone
Description The zone to use
Default value _SEARCH
Type ID_TEXT

Name put_in_box
Description Whether to put it in a box
Default value boolean-true
Type boolean

Returns…

Description A box for it, linking to the full page
Type tempcode

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

void grant_catalogue_full_access(AUTO_LINK category_id)

Grant all usergroups access to the specified catalogue category.

Parameters…

Name category_id
Description The ID of the category that access is being given to
Type AUTO_LINK

(No return value)


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

array count_catalogue_category_children(AUTO_LINK category_id)

Count the entries and subcategories underneath the specified category, recursively.

Parameters…

Name category_id
Description The ID of the category for which count details are collected
Type AUTO_LINK

Returns…

Description The number of entries is returned in $output['num_entries'], and the number of subcategories is returned in $output['num_children'], the (possibly recursive) number of subcategories in $output['num_children_children'], and the (possibly recursive) number of entries is returned in $output['num_entries_children'].
Type array

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

array get_catalogue_category_entry_buildup(?AUTO_LINK category_id, ID_TEXT catalogue_name, ?array catalogue, ID_TEXT view_type, ID_TEXT tpl_set, ?integer max, ?integer start, ?mixed select, ?AUTO_LINK root, ?SHORT_INTEGER display_type, boolean do_sorting, ?array entries, string search, ?ID_TEXT _order_by)

Get an ordered array of all the entries in the specified catalogue.

Parameters…

Name category_id
Description The ID of the category for which the entries are being collected (NULL: entries are [and must be] passed instead)
Type ?AUTO_LINK

Name catalogue_name
Description The name of the catalogue
Type ID_TEXT

Name catalogue
Description A database row of the catalogue we are working with (NULL: read it in)
Type ?array

Name view_type
Description The view type we're doing
Type ID_TEXT
Values restricted to PAGE SEARCH CATEGORY

Name tpl_set
Description The template set we are rendering this category using
Type ID_TEXT

Name max
Description The maximum number of entries to show on a single page of this this category (ignored if $select is not NULL) (NULL: all)
Type ?integer

Name start
Description The entry number to start at (ignored if $select is not NULL) (NULL: all)
Type ?integer

Name select
Description The entries to show, may be from other categories. Can either be SQL fragment, or array (NULL: use $start and $max)
Type ?mixed

Name root
Description The virtual root for display of this category (NULL: default)
Type ?AUTO_LINK

Name display_type
Description The display type to use (NULL: lookup from $catalogue)
Default value
Type ?SHORT_INTEGER

Name do_sorting
Description Whether to perform sorting
Default value boolean-true
Type boolean

Name entries
Description A list of entry rows (NULL: select them normally)
Default value
Type ?array

Name search
Description Search filter (blank: no filter)
Default value
Type string

Name _order_by
Description Orderer (NULL: read from environment)
Default value
Type ?ID_TEXT

Returns…

Description An array containing our built up entries (renderable tempcode), our sorting interface, and our entries (entry records from database, with an additional 'map' field), and the max rows
Type array

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

array get_catalogue_entry_map(array entry, ?array catalogue, ID_TEXT view_type, ID_TEXT tpl_set, ?AUTO_LINK root, ?array fields, ?array only_fields, boolean feedback_details, boolean tree_details, ?integer order_by)

Get a map of the fields for the given entry.

Parameters…

Name entry
Description A database row of the entry we are working with
Type array

Name catalogue
Description A database row of the catalogue we are working with (NULL: read it in here)
Type ?array

Name view_type
Description The view type we're doing
Type ID_TEXT
Values restricted to PAGE SEARCH CATEGORY

Name tpl_set
Description The template set we are rendering this category using
Type ID_TEXT

Name root
Description The virtual root for display of this category (NULL: none)
Default value
Type ?AUTO_LINK

Name fields
Description The database rows for the fields for this catalogue (NULL: find them)
Default value
Type ?array

Name only_fields
Description A list of fields that we are limiting ourselves to (NULL: get ALL fields)
Default value
Type ?array

Name feedback_details
Description Whether to grab the feedback details
Default value boolean-false
Type boolean

Name tree_details
Description Whether to grab the tree details
Default value boolean-false
Type boolean

Name order_by
Description Field index to order by (NULL: none)
Default value
Type ?integer

Returns…

Description A map of information relating to the entry. The map contains 'FIELDS' (tempcode for all accumulated fields), 'FIELD_x' (for each field x applying to the entry), STAFF_DETAILS, COMMENT_DETAILS, RATING_DETAILS, VIEW_URL, TREE (tempcode category tree to this entry)
Type array

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

tempcode nice_get_catalogues(?ID_TEXT it, boolean prefer_ones_with_entries, boolean only_submittable)

Get a nice, formatted, XHTML list of all the catalogues.

Parameters…

Name it
Description The name of the currently selected catalogue (NULL: none selected)
Default value
Type ?ID_TEXT

Name prefer_ones_with_entries
Description If there are too many to list prefer to get ones with entries rather than just the newest
Default value boolean-false
Type boolean

Name only_submittable
Description Whether to only show catalogues that can be submitted to
Default value boolean-false
Type boolean

Returns…

Description Catalogue selection list
Type tempcode

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

array get_catalogue_entry_field_values(?ID_TEXT catalogue_name, mixed entry_id, ?array only_fields, ?array fields, boolean natural_order)

Get the values for the specified fields, for the stated catalogue entry.

Parameters…

Name catalogue_name
Description The catalogue name we are getting an entry in (NULL: lookup)
Type ?ID_TEXT

Name entry_id
Description The ID of the entry we are getting OR the row
Type mixed

Name only_fields
Description A list of fields that we are limiting ourselves to (NULL: get ALL fields)
Default value
Type ?array

Name fields
Description The database rows for the fields for this catalogue (NULL: find them)
Default value
Type ?array

Name natural_order
Description Whether to order the fields in their natural database order
Default value boolean-false
Type boolean

Returns…

Description A list of maps (each field for the entry gets a map), where each map contains 'effective_value' (the value for the field). Some maps get additional fields (effective_value_nontrans, effective_value_pure), depending on the field type
Type array

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

string _get_catalogue_entry_field(AUTO_LINK field_id, mixed entry_id, ID_TEXT type)

Get the value for the specified field, for the stated catalogue entry.

Parameters…

Name field_id
Description The ID of the field we are getting
Type AUTO_LINK

Name entry_id
Description The ID of the entry we are getting for OR the row
Type mixed

Name type
Description The type of field
Default value short
Type ID_TEXT
Values restricted to short long

Returns…

Description The value
Type string

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

tempcode nice_get_catalogue_entries_tree(ID_TEXT catalogue_name, ?AUTO_LINK it, ?AUTO_LINK submitter, boolean editable_filter)

Get a nice, formatted XHTML list of entries, in catalogue category tree structure

Parameters…

Name catalogue_name
Description The catalogue name
Type ID_TEXT

Name it
Description The currently selected entry (NULL: none selected)
Default value
Type ?AUTO_LINK

Name submitter
Description Only show entries submitted by this member (NULL: no filter)
Default value
Type ?AUTO_LINK

Name editable_filter
Description Whether to only show for what may be edited by the current member
Default value boolean-false
Type boolean

Returns…

Description The list of entries
Type tempcode

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

array get_catalogue_entries_tree(ID_TEXT catalogue_name, ?AUTO_LINK submitter, ?AUTO_LINK category_id, ?string tree, ?ID_TEXT title, ?integer levels, boolean editable_filter)

Get a list of maps containing all the catalogue entries, and path information, under the specified category - and those beneath it, recursively.

Parameters…

Name catalogue_name
Description The catalogue name
Type ID_TEXT

Name submitter
Description Only show entries submitted by this member (NULL: no filter)
Default value
Type ?AUTO_LINK

Name category_id
Description The category being at the root of our recursion (NULL: true root)
Default value
Type ?AUTO_LINK

Name tree
Description The tree up to this point in the recursion (NULL: blank, as we are starting the recursion)
Default value
Type ?string

Name title
Description The name of the $category_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
Default value
Type ?ID_TEXT

Name levels
Description The number of recursive levels to search (NULL: all)
Default value
Type ?integer

Name editable_filter
Description Whether to only show for what may be edited by the current member
Default value boolean-false
Type boolean

Returns…

Description A list of maps for all categories. Each map entry containins the fields 'id' (category ID) and 'tree' (tree path to the category, including the categories own title), and more.
Type array

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

tempcode nice_get_catalogue_category_tree(ID_TEXT catalogue_name, ?AUTO_LINK it, boolean addable_filter, boolean use_compound_list)

Get a nice, formatted XHTML list extending from the root, and showing all subcategories, and their subcategories (ad infinitum). The tree bit is because each entry in the list is shown to include the path through the tree that gets to it

Parameters…

Name catalogue_name
Description The catalogue name
Type ID_TEXT

Name it
Description The currently selected entry (NULL: none)
Default value
Type ?AUTO_LINK

Name addable_filter
Description Whether to only show for what may be added to by the current member
Default value boolean-false
Type boolean

Name use_compound_list
Description Whether to make the list elements store comma-separated child lists instead of IDs
Default value boolean-false
Type boolean

Returns…

Description The list of categories
Type tempcode

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

array get_catalogue_category_tree(ID_TEXT catalogue_name, ?AUTO_LINK category_id, ?tempcode tree, ?string title, ?integer levels, boolean addable_filter, boolean use_compound_list)

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

Parameters…

Name catalogue_name
Description The catalogue name
Type ID_TEXT

Name category_id
Description The category being at the root of our recursion (NULL: true root category)
Type ?AUTO_LINK

Name tree
Description The tree up to this point in the recursion (NULL: blank, as we are starting the recursion)
Default value
Type ?tempcode

Name title
Description The category name of the $category_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
Default value
Type ?string

Name levels
Description The number of recursive levels to search (NULL: all)
Default value
Type ?integer

Name addable_filter
Description Whether to only show for what may be added to by the current member
Default value boolean-false
Type boolean

Name use_compound_list
Description Whether to make the list elements store comma-separated child lists instead of IDs
Default value boolean-false
Type boolean

Returns…

Description A list of maps for all subcategories. Each map entry containins the fields 'id' (category ID) and 'tree' (tree path to the category, including the categories own title), and 'count' (the number of entries in the category).
Type array

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

tempcode catalogue_category_breadcrumbs(AUTO_LINK category_id, ?AUTO_LINK root, boolean no_link_for_me_sir)

Get a formatted XHTML string of the route back to the specified root, from the specified category.

Parameters…

Name category_id
Description The category we are finding for
Type AUTO_LINK

Name root
Description The root of the tree (NULL: the true root)
Default value
Type ?AUTO_LINK

Name no_link_for_me_sir
Description Whether to include category links at this level (the recursed levels will always contain links - the top level is optional, hence this parameter)
Default value boolean-true
Type boolean

Returns…

Description The tree route
Type tempcode

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

boolean is_ecommerce_catalogue(SHORT_TEXT catalogue_name)

Check the current catalogue is an ecommerce catalogue

Parameters…

Name catalogue_name
Description Catalogue name
Type SHORT_TEXT

Returns…

Description Status of ecommerce catalogue check
Type boolean

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

boolean is_ecommerce_catalogue_entry(AUTO_LINK entry_id)

Check selected entry is an ecommerce catalogue entry

Parameters…

Name entry_id
Description Entry ID
Type AUTO_LINK

Returns…

Description Status of entry type check
Type boolean

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

tempcode render_catalogue_entry_screen(AUTO_LINK id, boolean no_title)

Display a catalogue entry

Parameters…

Name id
Description Entry ID
Type AUTO_LINK

Name no_title
Description Whether to skip rendering a title
Default value boolean-false
Type boolean

Returns…

Description Tempcode interface to display an entry
Type tempcode

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

sources/catalogues2.php

Global_functions_catalogues2.php

Function summary

void catalogue_to_tree (ID_TEXT catalogue_name)
void catalogue_from_tree (ID_TEXT catalogue_name)
void catalogue_file_script ()
?AUTO_LINK actual_add_catalogue (ID_TEXT name, mixed title, mixed description, SHORT_INTEGER display_type, BINARY is_tree, LONG_TEXT notes, integer submit_points, BINARY ecommerce, ID_TEXT send_view_reports)
AUTO_LINK actual_add_catalogue_field (ID_TEXT c_name, mixed name, mixed description, ID_TEXT type, integer order, BINARY defines_order, BINARY visible, BINARY searchable, LONG_TEXT default, BINARY required, BINARY put_in_category, BINARY put_in_search, ?AUTO_LINK id)
void actual_edit_catalogue (ID_TEXT old_name, ID_TEXT name, SHORT_TEXT title, LONG_TEXT description, SHORT_INTEGER display_type, LONG_TEXT notes, integer submit_points, BINARY ecommerce, ID_TEXT send_view_reports)
void actual_delete_catalogue (ID_TEXT name)
void actual_edit_catalogue_field (AUTO_LINK id, ID_TEXT c_name, SHORT_TEXT name, LONG_TEXT description, integer order, BINARY defines_order, BINARY visible, BINARY searchable, LONG_TEXT default, BINARY required, BINARY put_in_category, BINARY put_in_search, ?ID_TEXT type)
void actual_delete_catalogue_field (AUTO_LINK id)
AUTO_LINK actual_add_catalogue_category (ID_TEXT catalogue_name, mixed title, mixed description, LONG_TEXT notes, ?AUTO_LINK parent_id, URLPATH rep_image, integer move_days_lower, integer move_days_higher, ?AUTO_LINK move_target, ?TIME add_date, ?AUTO_LINK id)
void rebuild_catalogue_cat_treecache ()
void store_in_catalogue_cat_treecache (AUTO_LINK id, ?AUTO_LINK parent_id, boolean cleanup_first)
void calculate_category_child_count_cache (?AUTO_LINK cat_id, boolean recursive_updates)
void actual_edit_catalogue_category (AUTO_LINK id, SHORT_TEXT title, LONG_TEXT description, LONG_TEXT notes, ?AUTO_LINK parent_id, SHORT_TEXT meta_keywords, LONG_TEXT meta_description, URLPATH rep_image, integer move_days_lower, integer move_days_higher, ?AUTO_LINK move_target)
void actual_delete_catalogue_category (AUTO_LINK id, boolean deleting_all)
AUTO_LINK actual_add_catalogue_entry (AUTO_LINK category_id, BINARY validated, LONG_TEXT notes, BINARY allow_rating, SHORT_INTEGER allow_comments, BINARY allow_trackbacks, array map, ?TIME time, ?MEMBER submitter, ?TIME edit_date, integer views, ?AUTO_LINK id)
void actual_edit_catalogue_entry (AUTO_LINK id, AUTO_LINK category_id, BINARY validated, LONG_TEXT notes, BINARY allow_rating, SHORT_INTEGER allow_comments, BINARY allow_trackbacks, array map, ?SHORT_TEXT meta_keywords, ?LONG_TEXT meta_description)
void actual_delete_catalogue_entry (AUTO_LINK id)

void catalogue_to_tree(ID_TEXT catalogue_name)

Converts a non-tree catalogue to a tree catalogue.

Parameters…

Name catalogue_name
Description Catalogue name
Type ID_TEXT

(No return value)


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

void catalogue_from_tree(ID_TEXT catalogue_name)

Converts a non-tree catalogue from a tree catalogue.

Parameters…

Name catalogue_name
Description Catalogue name
Type ID_TEXT

(No return value)


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

void catalogue_file_script()

Farm out the files for catalogue entry fields.

Parameters…

(No return value)


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

?AUTO_LINK actual_add_catalogue(ID_TEXT name, mixed title, mixed description, SHORT_INTEGER display_type, BINARY is_tree, LONG_TEXT notes, integer submit_points, BINARY ecommerce, ID_TEXT send_view_reports)

Add a catalogue using all the specified values.

Parameters…

Name name
Description The codename of the catalogue
Type ID_TEXT

Name title
Description The title of the catalogue (either language code or string)
Type mixed

Name description
Description A description (either language code or string)
Type mixed

Name display_type
Description The display type
Type SHORT_INTEGER

Name is_tree
Description Whether the catalogue uses a tree system (as opposed to mere categories in an index)
Type BINARY

Name notes
Description Hidden notes pertaining to this catalogue
Type LONG_TEXT

Name submit_points
Description How many points a member gets by submitting to this catalogue
Type integer

Name ecommerce
Description Whether the catalogue is an eCommerce catalogue
Default value 0
Type BINARY

Name send_view_reports
Description How to send view reports
Default value never
Type ID_TEXT
Values restricted to never daily weekly monthly quarterly

Returns…

Description The ID of the first new catalogues root category (NULL: no root, as it's not a tree catalogue)
Type ?AUTO_LINK

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

AUTO_LINK actual_add_catalogue_field(ID_TEXT c_name, mixed name, mixed description, ID_TEXT type, integer order, BINARY defines_order, BINARY visible, BINARY searchable, LONG_TEXT default, BINARY required, BINARY put_in_category, BINARY put_in_search, ?AUTO_LINK id)

Add a field to the specified catalogue, without disturbing any other data in that catalogue.

Parameters…

Name c_name
Description The codename of the catalogue the field is for
Type ID_TEXT

Name name
Description The name of the field (either language code or string)
Type mixed

Name description
Description A description (either language code or string)
Type mixed

Name type
Description The type of the field
Type ID_TEXT

Name order
Description The field order (the field order determines what order the fields are displayed within an entry)
Type integer

Name defines_order
Description Whether this field defines the catalogue order
Type BINARY

Name visible
Description Whether this is a visible field
Type BINARY

Name searchable
Description Whether the field is usable as a search key
Type BINARY

Name default
Description The default value for the field
Type LONG_TEXT

Name required
Description Whether this field is required
Type BINARY

Name put_in_category
Description Whether the field is to be shown in category views (not applicable for the list display type)
Default value 1
Type BINARY

Name put_in_search
Description Whether the field is to be shown in search views (not applicable for the list display type)
Default value 1
Type BINARY

Name id
Description Force this ID (NULL: auto-increment as normal)
Default value
Type ?AUTO_LINK

Returns…

Description Field ID
Type AUTO_LINK

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

void actual_edit_catalogue(ID_TEXT old_name, ID_TEXT name, SHORT_TEXT title, LONG_TEXT description, SHORT_INTEGER display_type, LONG_TEXT notes, integer submit_points, BINARY ecommerce, ID_TEXT send_view_reports)

Edit a catalogue.

Parameters…

Name old_name
Description The current name of the catalogue
Type ID_TEXT

Name name
Description The new name of the catalogue
Type ID_TEXT

Name title
Description The human readable name/title of the catalogue
Type SHORT_TEXT

Name description
Description The description
Type LONG_TEXT

Name display_type
Description The display type
Type SHORT_INTEGER

Name notes
Description Admin notes
Type LONG_TEXT

Name submit_points
Description How many points are given to a member that submits to the catalogue
Type integer

Name ecommerce
Description Whether the catalogue is an eCommerce catalogue
Type BINARY

Name send_view_reports
Description How to send view reports
Type ID_TEXT
Values restricted to never daily weekly monthly quarterly

(No return value)


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

void actual_delete_catalogue(ID_TEXT name)

Delete a catalogue.

Parameters…

Name name
Description The name of the catalogue
Type ID_TEXT

(No return value)


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

void actual_edit_catalogue_field(AUTO_LINK id, ID_TEXT c_name, SHORT_TEXT name, LONG_TEXT description, integer order, BINARY defines_order, BINARY visible, BINARY searchable, LONG_TEXT default, BINARY required, BINARY put_in_category, BINARY put_in_search, ?ID_TEXT type)

Edit a catalogue field.

Parameters…

Name id
Description The ID of the field
Type AUTO_LINK

Name c_name
Description The name of the catalogue
Type ID_TEXT

Name name
Description The name of the field
Type SHORT_TEXT

Name description
Description Description for the field
Type LONG_TEXT

Name order
Description The field order (the field order determines what order the fields are displayed within an entry)
Type integer

Name defines_order
Description Whether the field defines entry ordering
Type BINARY

Name visible
Description Whether the field is visible when an entry is viewed
Type BINARY

Name searchable
Description Whether the field is usable as a search key
Type BINARY

Name default
Description The default value for the field
Type LONG_TEXT

Name required
Description Whether the field is required
Type BINARY

Name put_in_category
Description Whether the field is to be shown in category views (not applicable for the list display type)
Default value 1
Type BINARY

Name put_in_search
Description Whether the field is to be shown in search views (not applicable for the list display type)
Default value 1
Type BINARY

Name type
Description The field type (NULL: do not change)
Default value
Type ?ID_TEXT

(No return value)


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

void actual_delete_catalogue_field(AUTO_LINK id)

Delete a catalogue field.

Parameters…

Name id
Description The ID of the field
Type AUTO_LINK

(No return value)


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

AUTO_LINK actual_add_catalogue_category(ID_TEXT catalogue_name, mixed title, mixed description, LONG_TEXT notes, ?AUTO_LINK parent_id, URLPATH rep_image, integer move_days_lower, integer move_days_higher, ?AUTO_LINK move_target, ?TIME add_date, ?AUTO_LINK id)

Add a catalogue category

Parameters…

Name catalogue_name
Description The codename of the catalogue the category is in
Type ID_TEXT

Name title
Description The title of this category (either language code or string)
Type mixed

Name description
Description A description (either language code or string)
Type mixed

Name notes
Description Hidden notes pertaining to this category
Type LONG_TEXT

Name parent_id
Description The ID of this categories parent (NULL: a root category, or not a tree catalogue)
Type ?AUTO_LINK

Name rep_image
Description The representative image for the category (blank: none)
Default value
Type URLPATH

Name move_days_lower
Description The number of days before expiry (lower limit)
Default value 30
Type integer

Name move_days_higher
Description The number of days before expiry (higher limit)
Default value 60
Type integer

Name move_target
Description The expiry category (NULL: do not expire)
Default value
Type ?AUTO_LINK

Name add_date
Description The add time (NULL: now)
Default value
Type ?TIME

Name id
Description Force an ID (NULL: don't force an ID)
Default value
Type ?AUTO_LINK

Returns…

Description The ID of the new category
Type AUTO_LINK

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

void rebuild_catalogue_cat_treecache()

Re-build the efficient catalogue category tree structure ancestry cache.

Parameters…

(No return value)


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

void store_in_catalogue_cat_treecache(AUTO_LINK id, ?AUTO_LINK parent_id, boolean cleanup_first)

Update the treecache for a catalogue category node.

Parameters…

Name id
Description The ID of the category
Type AUTO_LINK

Name parent_id
Description The ID of the parent category (NULL: no parent)
Type ?AUTO_LINK

Name cleanup_first
Description Whether to delete any possible pre-existing records for the category first
Default value boolean-true
Type boolean

(No return value)


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

void calculate_category_child_count_cache(?AUTO_LINK cat_id, boolean recursive_updates)

Update cache for a categories child counts.

Parameters…

Name cat_id
Description The ID of the category (NULL: skip, called by some code that didn't realise it didn't impact a tree parent)
Type ?AUTO_LINK

Name recursive_updates
Description Whether to recurse up the tree to force recalculations on other categories (recommended, unless you are doing a complete rebuild)
Default value boolean-true
Type boolean

(No return value)


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

void actual_edit_catalogue_category(AUTO_LINK id, SHORT_TEXT title, LONG_TEXT description, LONG_TEXT notes, ?AUTO_LINK parent_id, SHORT_TEXT meta_keywords, LONG_TEXT meta_description, URLPATH rep_image, integer move_days_lower, integer move_days_higher, ?AUTO_LINK move_target)

Edit a catalogue category.

Parameters…

Name id
Description The ID of the category
Type AUTO_LINK

Name title
Description The title of the category
Type SHORT_TEXT

Name description
Description Description for the category
Type LONG_TEXT

Name notes
Description Admin notes
Type LONG_TEXT

Name parent_id
Description The ID of the parent category (NULL: no parent)
Type ?AUTO_LINK

Name meta_keywords
Description Meta keywords for the category
Type SHORT_TEXT

Name meta_description
Description Meta description for the category
Type LONG_TEXT

Name rep_image
Description The representative image for the category (blank: none)
Type URLPATH

Name move_days_lower
Description The number of days before expiry (lower limit)
Type integer

Name move_days_higher
Description The number of days before expiry (higher limit)
Type integer

Name move_target
Description The expiry category (NULL: do not expire)
Type ?AUTO_LINK

(No return value)


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

void actual_delete_catalogue_category(AUTO_LINK id, boolean deleting_all)

Delete a catalogue category.

Parameters…

Name id
Description The ID of the category
Type AUTO_LINK

Name deleting_all
Description Whether we're deleting everything under the category; if FALSE we will actively reassign child categories to be directly under the root
Default value boolean-false
Type boolean

(No return value)


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

AUTO_LINK actual_add_catalogue_entry(AUTO_LINK category_id, BINARY validated, LONG_TEXT notes, BINARY allow_rating, SHORT_INTEGER allow_comments, BINARY allow_trackbacks, array map, ?TIME time, ?MEMBER submitter, ?TIME edit_date, integer views, ?AUTO_LINK id)

Adds an entry to the specified catalogue.

Parameters…

Name category_id
Description The ID of the category that the entry is in
Type AUTO_LINK

Name validated
Description Whether the entry has been validated
Type BINARY

Name notes
Description Hidden notes pertaining to the entry
Type LONG_TEXT

Name allow_rating
Description Whether the entry may be rated
Type BINARY

Name allow_comments
Description Whether comments are allowed (0=no, 1=yes, 2=review style)
Type SHORT_INTEGER

Name allow_trackbacks
Description Whether the entry may be trackbacked
Type BINARY

Name map
Description A map of field IDs, to values, that defines the entries settings
Type array

Name time
Description The time the entry was added (NULL: now)
Default value
Type ?TIME

Name submitter
Description The entries submitter (NULL: current user)
Default value
Type ?MEMBER

Name edit_date
Description The edit time (NULL: never)
Default value
Type ?TIME

Name views
Description The number of views
Default value 0
Type integer

Name id
Description Force an ID (NULL: don't force an ID)
Default value
Type ?AUTO_LINK

Returns…

Description The ID of the newly added entry
Type AUTO_LINK

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

void actual_edit_catalogue_entry(AUTO_LINK id, AUTO_LINK category_id, BINARY validated, LONG_TEXT notes, BINARY allow_rating, SHORT_INTEGER allow_comments, BINARY allow_trackbacks, array map, ?SHORT_TEXT meta_keywords, ?LONG_TEXT meta_description)

Edit the specified catalogue entry

Parameters…

Name id
Description The ID of the entry being edited
Type AUTO_LINK

Name category_id
Description The ID of the category that the entry is in
Type AUTO_LINK

Name validated
Description Whether the entry has been validated
Type BINARY

Name notes
Description Hidden notes pertaining to the entry
Type LONG_TEXT

Name allow_rating
Description Whether the entry may be rated
Type BINARY

Name allow_comments
Description Whether comments are allowed (0=no, 1=yes, 2=review style)
Type SHORT_INTEGER

Name allow_trackbacks
Description Whether the entry may be trackbacked
Type BINARY

Name map
Description A map of field IDs, to values, that defines the entries settings
Type array

Name meta_keywords
Description Meta keywords for this resource (NULL: do not edit)
Default value
Type ?SHORT_TEXT

Name meta_description
Description Meta description for this resource (NULL: do not edit)
Default value
Type ?LONG_TEXT

(No return value)


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

void actual_delete_catalogue_entry(AUTO_LINK id)

Delete a catalogue entry.

Parameters…

Name id
Description The ID of the entry to delete
Type AUTO_LINK

(No return value)


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