CRUD module (Create/Update/Delete), for operations on content types.

package core

 Methods

Standard CRUD-module UI/actualiser to edit an entry.

__edit() : \Tempcode

Returns

\TempcodeThe UI

Standard CRUD-module UI/actualiser to add an entry.

_add() : \Tempcode

Returns

\TempcodeThe UI

Standard CRUD-module UI to edit an entry.

_edit() : \Tempcode

Returns

\TempcodeThe UI

Standard CRUD-module UI to add an entry.

add() : \Tempcode

Returns

\TempcodeThe UI

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

choose_catalogue(\Tempcode $title) : \?Tempcode

Parameters

$title

\Tempcode

The get_screen_title converted title for this page

Returns

\?TempcodeThe Tempcode for the catalogue chooser (null: already chosen)

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

choose_feedback_fields_statistically(\?BINARY $allow_rating, \?SHORT_INTEGER $allow_comments, \?BINARY $allow_trackbacks) : array

Parameters

$allow_rating

\?BINARY

Whether rating is allowed (null: decide statistically, based on existing choices)

$allow_comments

\?SHORT_INTEGER

Whether comments are allowed (0=no, 1=yes, 2=review style) (null: decide statistically, based on existing choices)

$allow_trackbacks

\?BINARY

Whether trackbacks are allowed (null: decide statistically, based on existing choices)

Returns

arrayArray of all input parameters, converted

Standard CRUD-module entry list fetcher.

create_selection_list_entries() : \Tempcode

Returns

\TempcodeThe selection list

The do-next manager for after content management.

do_next_manager(\Tempcode $title, \Tempcode $description, \?ID_TEXT $id) : \Tempcode

Parameters

$title

\Tempcode

The title (output of get_screen_title)

$description

\Tempcode

Some description to show, saying what happened

$id

\?ID_TEXT

The ID of whatever we are working with (null: deleted)

Returns

\TempcodeThe UI

Standard CRUD-module UI to choose an entry to edit.

edit() : \Tempcode

Returns

\TempcodeThe UI

Find entry-points available within this module.

get_entry_points(boolean $check_perms = true, \?MEMBER $member_id = null, boolean $support_crosslinks = true, boolean $be_deferential = false) : \?array

Parameters

$check_perms

boolean

Whether to check permissions.

$member_id

\?MEMBER

The member to check permissions as (null: current user).

$support_crosslinks

boolean

Whether to allow cross links to other modules (identifiable via a full-page-link rather than a screen-name).

$be_deferential

boolean

Whether to avoid any entry-point (or even return NULL to disable the page in the Sitemap) if we know another module, or page_group, is going to link to that entry-point. Note that "!" and "browse" entry points are automatically merged with container page nodes (likely called by page-groupings) as appropriate.

Returns

\?arrayA map of entry points (screen-name=>language-code/string or screen-name=>[language-code/string, icon-theme-image]) (null: disabled).

Standard CRUD-module entry function to get rows for selection from.

get_entry_rows(boolean $recache = false, \?ID_TEXT $orderer = null, \?array $where = null, boolean $force_site_db = false, string $join = '') : array

Parameters

$recache

boolean

Whether to force a recache

$orderer

\?ID_TEXT

Order to use (null: automatic)

$where

\?array

Extra where clauses (null: none)

$force_site_db

boolean

Whether to always access using the site database

$join

string

Extra join clause for our query (blank: none)

Returns

arrayA pair: Rows for selection from, Total results

Standard CRUD-module permission chooser.

get_permission_fields(\?ID_TEXT $category_id, \?Tempcode $help = null, boolean $new_category = false, \?Tempcode $pinterface_view = null) : \Tempcode

Parameters

$category_id

\?ID_TEXT

The category ID the permissions are being chosen for (null: new category)

$help

\?Tempcode

Extra help to show in interface (null: none)

$new_category

boolean

Whether this is a new category (don't load permissions, default to on)

$pinterface_view

\?Tempcode

Label for view permissions (null: default)

Returns

\TempcodeThe permission fields

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

handle_confirmations(\Tempcode $title) : \?Tempcode

Parameters

$title

\Tempcode

The page title for what's being done

Returns

\?TempcodeThe confirmation UI (null: all is clear - no confirmation needed)

Find whether this content type has a tied catalogue.

has_tied_catalogue() : boolean

Returns

booleanWhether it has

Find details of the module.

info() : \?array

Returns

\?arrayMap of module info (null: module is disabled).

Mass delete some entries/categories.

mass_delete(boolean $top_level = true) : \?Tempcode

Parameters

$top_level

boolean

Whether this is a top level mass delete op (i.e. not a recursion)

Returns

\?TempcodeThe UI (null: not top level)

Module pre-run function. Allows us to know metadata for <head> before we start streaming output.

pre_run(boolean $top_level = true, \?ID_TEXT $type = null) : \?Tempcode

Parameters

$top_level

boolean

Whether this is running at the top level, prior to having sub-objects called.

$type

\?ID_TEXT

The screen type to consider for metadata purposes (null: read from environment).

Returns

\?TempcodeTempcode indicating some kind of exceptional output (null: none).

Standard CRUD-module UI for a separate preview.

preview_intercept(\Tempcode $title) : \Tempcode

Parameters

$title

\Tempcode

The page title

Returns

\TempcodeThe UI

Execute the module.

run() : \Tempcode

Returns

\TempcodeThe result of execution.

Set permissions of the news category from POST parameters.

set_permissions(\ID_TEXT $id) 

Parameters

$id

\ID_TEXT

The category to set permissions for

Work out a screen type code.

get_screen_type_for(string $type_code, string $stub) : string

Parameters

$type_code

string

General-purpose screen type code (e.g. 'add')

$stub

string

Type code for current flow (e.g. '' or 'category')

Returns

stringComplete screen type code

 Properties

 

$add_one_cat_label

$add_one_cat_label 

Default

null
 

$add_one_label

$add_one_label 

Default

null
 

$add_submit_name

$add_submit_name 

Default

null
 

$add_text

$add_text 

Default

''
 

$alt_crud_module

$alt_crud_module 

Default

null
 

$appended_actions_already

$appended_actions_already 

Default

false
 

$archive_entry_point

$archive_entry_point 

Default

null
 

$archive_label

$archive_label 

Default

null
 

$array_key

$array_key 

Default

'id'
 

$author

$author 

Default

'Chris Graham'
 

$cached_entry_rows

$cached_entry_rows 

Default

null
 

$cached_max_rows

$cached_max_rows 

Default

null
 

$care_please

$care_please 

Default

true
 

$cat_crud_module

$cat_crud_module 

Default

null
 

$catalogue

$catalogue 

Default

false
 

$categories_title

$categories_title 

Default

null
 

$check_validation

$check_validation 

Default

true
 

$code_require

$code_require 

Default

null
 

$content_type

$content_type 

Default

null
 

$default_type

$default_type 

Default

null
 

$do_next_description

$do_next_description 

Default

null
 

$do_next_editing_categories

$do_next_editing_categories 

Default

false
 

$do_preview

$do_preview 

Default

true
 

$doing

$doing 

Default

 

$donext_category_id

$donext_category_id 

Default

null
 

$donext_type

$donext_type 

Default

null
 

$edit_keep_validation

$edit_keep_validation 

Default

false
 

$edit_one_cat_label

$edit_one_cat_label 

Default

null
 

$edit_one_label

$edit_one_label 

Default

null
 

$edit_submit_name

$edit_submit_name 

Default

null
 

$edit_text

$edit_text 

Default

''
 

$edit_this_cat_label

$edit_this_cat_label 

Default

null
 

$edit_this_label

$edit_this_label 

Default

null
 

$entries_title

$entries_title 

Default

null
 

$extra_donext_categories

$extra_donext_categories 

Default

null
 

$extra_donext_entries

$extra_donext_entries 

Default

null
 

$extra_donext_whatever

$extra_donext_whatever 

Default

null
 

$extra_donext_whatever_title

$extra_donext_whatever_title 

Default

null
 

$form_id

$form_id 

Default

'selection_table'
 

$javascript

$javascript 

Default

null
 

$javascript_for_choose

$javascript_for_choose 

Default

null
 

$javascript_require

$javascript_require 

Default

null
 

$lang_type

$lang_type 

Default

null
 

$menu_label

$menu_label 

Default

null
 

$module_type

$module_type 

Default

 

$new_id

$new_id 

Default

null
 

$no_blank_ids

$no_blank_ids 

Default

true
 

$non_integer_id

$non_integer_id 

Default

false
 

$orderer

$orderer 

Default

null
 

$orderer_is_multi_lang

$orderer_is_multi_lang 

Default

null
 

$organisation

$organisation 

Default

'ocProducts'
 

$output_of_action_is_confirmation

$output_of_action_is_confirmation 

Default

false
 

$permission_module

$permission_module 

Default

null
 

$permissions_cat_name

$permissions_cat_name 

Default

null
 

$permissions_cat_name_b

$permissions_cat_name_b 

Default

null
 

$permissions_cat_require

$permissions_cat_require 

Default

null
 

$permissions_cat_require_b

$permissions_cat_require_b 

Default

null
 

$permissions_require

$permissions_require 

Default

null
 

$possibly_some_kind_of_upload

$possibly_some_kind_of_upload 

Default

false
 

$posting_field_required

$posting_field_required 

Default

true
 

$posting_form_tabindex

$posting_form_tabindex 

Default

null
 

$posting_form_text

$posting_form_text 

Default

''
 

$posting_form_text_parsed

$posting_form_text_parsed 

Default

null
 

$posting_form_title

$posting_form_title 

Default

null
 

$privilege_page

$privilege_page 

Default

null
 

$privilege_page_name

$privilege_page_name 

Default

null
 

$protect_first

$protect_first 

Default

0
 

$redirect_type

$redirect_type 

Default

null
 

$second_stage_preview

$second_stage_preview 

Default

false
 

$select_name

$select_name 

Default

null
 

$select_name_description

$select_name_description 

Default

null
 

$send_validation_request

$send_validation_request 

Default

true
 

$skip_webstandards

$skip_webstandards 

Default

false
 

$special_edit_frontend

$special_edit_frontend 

Default

false
 

$success_message_str

$success_message_str 

Default

 

$supports_mass_delete

$supports_mass_delete 

Default

false
 

$table

$table 

Default

null
 

$table_prefix

$table_prefix 

Default

''
 

$title

$title 

Default

 

$title_is_multi_lang

$title_is_multi_lang 

Default

true
 

$type_code

$type_code 

Default

''
 

$upload

$upload 

Default

null
 

$user_facing

$user_facing 

Default

false
 

$view_entry_point

$view_entry_point 

Default

null
 

$view_label

$view_label 

Default

null