SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class HasCategoriesAdminController

An abstract class for controllers of things which have categories.

Variables

NameVisibilityDescription
$add_defaults 
$category_archive
Do we have the 'archive' feature for categories?
You will need a "show_admin TINYINT UNSIGNED DEFAULT 1" column on the category table.
$category_reorder
Enables re-ordering for categories.
You will need a "record_order" column on the category table.
$category_single
Enables single-cat mode.
This uses radiobuttons instead of checkboxes in the category selection UI.
$controller_name 
$db 
$friendly_name 
$main_columns 

Functions

NameVisibilityDescription
__constructpublicConstructor
_deleteSavepublicDeletes an item and logs the deleted data
_extraMultiCategorisepublicForm to change the categories for a number of records
_getAddFormpublicReturns a page title and HTML for a form to add a record
_getContentspublicReturns the main list of records for this controller
_getContentsViewpublicReturn HTML for a resultset of items
_getContentsViewListpublicFormats a resultset of items into an Itemlist
_getDuplicateFormpublicReturns the edit form for duplicating a record
_getEditFormpublicReturns the edit form for adding a record
_getNavigationpublicReturns the contents of the navigation pane
_getRefineClauseprotectedReturn the WHERE clause to use for a given key which is provided by the RefineBar
_getToolspublicAdditional categry tools
_importExtraOptionsprotectedCalled when the import form is being built.
_importPostRecordprotectedCalled after a record has been inserted or updated.
catAllowAddpublicReturn true if categories are allowed to be added.
catAllowDeletepublicReturn true if categories are allowed to be deleted.
catAllowEditpublicReturn true if categories are allowed to be edited.
getCategoryArchivepublicReturns TRUE if category archive is enabled, FALSE otherwise
postMultiCategorisepublicChange the categories for a number of records
updateCategoriesprotectedUpdates the category table for this controller (so for articles, the updated table will be articles_cat_join)

public __construct

void $HasCategoriesAdminController->__construct ( );

Constructor

public _deleteSave

bool $HasCategoriesAdminController->_deleteSave ( int $item_id );

Deletes an item and logs the deleted data

This method should not be overridden unless absolutely necessary.

public _extraMultiCategorise

unknown $HasCategoriesAdminController->_extraMultiCategorise ( );

Form to change the categories for a number of records

public _getAddForm

array $HasCategoriesAdminController->_getAddForm ( );

Returns a page title and HTML for a form to add a record

public _getContents

unknown $HasCategoriesAdminController->_getContents ( );

Returns the main list of records for this controller

public _getContentsView

unknown $HasCategoriesAdminController->_getContentsView ( Traversable $items , string $mode , StdClass $category );

Return HTML for a resultset of items
The returned HTML will be sandwiched between the refinebar and the pagination bar.

public _getContentsViewList

unknown $HasCategoriesAdminController->_getContentsViewList ( Traversable $items , StdClass $category );

Formats a resultset of items into an Itemlist

public _getDuplicateForm

unknown $HasCategoriesAdminController->_getDuplicateForm ( int $id );

Returns the edit form for duplicating a record

public _getEditForm

unknown $HasCategoriesAdminController->_getEditForm ( int $id );

Returns the edit form for adding a record

public _getNavigation

unknown $HasCategoriesAdminController->_getNavigation ( );

Returns the contents of the navigation pane

protected _getRefineClause

string $HasCategoriesAdminController->_getRefineClause ( string $key , string $val , array &$query_params );

Return the WHERE clause to use for a given key which is provided by the RefineBar

Allows custom non-table clauses to be added.
Is only called for key names which begin with an underscore.
The base table is aliased to 'item'.

public _getTools

unknown $HasCategoriesAdminController->_getTools ( );

Additional categry tools

protected _importExtraOptions

unknown $HasCategoriesAdminController->_importExtraOptions ( );

Called when the import form is being built.

Returns HTML of extra options to display, or null if no extra options.

protected _importPostRecord

unknown $HasCategoriesAdminController->_importPostRecord ( int $record_id , array $new_data , array $existing_record , string $type , boolean $raw_data );

Called after a record has been inserted or updated.

public catAllowAdd

unknown $HasCategoriesAdminController->catAllowAdd ( );

Return true if categories are allowed to be added.

public catAllowDelete

unknown $HasCategoriesAdminController->catAllowDelete ( mixed $category_id );

Return true if categories are allowed to be deleted.

public catAllowEdit

unknown $HasCategoriesAdminController->catAllowEdit ( mixed $category_id );

Return true if categories are allowed to be edited.

public getCategoryArchive

unknown $HasCategoriesAdminController->getCategoryArchive ( );

Returns TRUE if category archive is enabled, FALSE otherwise

public postMultiCategorise

void $HasCategoriesAdminController->postMultiCategorise ( );

Change the categories for a number of records

protected updateCategories

boolean $HasCategoriesAdminController->updateCategories ( mixed $item_id , array $categories );

Updates the category table for this controller (so for articles, the updated table will be articles_cat_join)
so that the records for the specified item match the category ids provided.