SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class AdminController

Main class to handle admin processing.
This delegates processing to controllers registered with Register::adminControllers

Functions

NameVisibilityDescription
__constructpublicDoes some general admin loading
addpublicShows an add form for the specified item
addSavepublicExecutes the save action for a specific item
ajaxUnlockpublicUnlock a record.
callpublicDirectly calls a method provided by an admin controller
checkAccessprivateCheck access for a given controller/access flag combo
checkRecordAccesspublicChecks that an admin user has access to an individual record
cleanupCommonPostDataprivateEnsure 'active' flag and 'tags' POST fields have values set, if they are nonexistant
closeFirstrunpublicCloses the 'first run' box, which is shown on the admin dashboard
contentspublicShows an edit form for the specified item
cronGenericActivatepublicActivates AutoLaunch revisions
dashboardpublicDashboard shown when a user first logs in to the admin
deletepublicShows a delete form for the specified item
deleteSavepublicExecutes the delete action for a specific item
duplicatepublicShows a duplication form for the specified item
duplicateSavepublicExecutes the save action for a record duplication
editpublicShows an edit form for the specified item
editSavepublicExecutes the save action for a specific item
errorprivateShows an error message in the admin skin
exportpublicShows an edit form for the specified item
exportActionpublicExecutes the save action for a specific item
extrapublicCalls any 'extra' commands that might be provided by the controller
getControllerprivateReturns an instance of a controller class for a given type
heartbeatpublic 
importActionpublicExecutes the import action
importOptionspublicShows the import form for the specified item
importUploadpublicFile upload box for importing, options are the next step
importUploadActionpublicCopies the file to a temporary directory
indexpublicHome page of admin area
intropublicShows an introduction for a specified type.
lockprivateDoes lock checking, locking, or lock messages.
loginpublicShows a login form
loginActionpublicProcesses a user login
loginCompleteprivateSet up various login params and redirect into admin
loginTwoFactorpublicShow the two-factor-auth ui for a half-logged-in operator
loginTwoFactorActionpublicProcess the result of a two-factor-auth for a half-logged-in operator
logoutpublicProcesses a user logout
moderatepublicModeration
moderateActionpublicProcesses the moderation form
perRecordPermissionsFieldsprotectedGenerates HTML for fields relating to per-record permissions in the 'save changes' box
renderSubActionsprivateRender a list of sub-actions into HTML as links
restorepublicRestore a deleted record from log data
searchpublicShows a search form for the specified item
setActiveSubsitepublicSets the active subsite, and then redirects back to the admin area.
setDefaultMainviewParamsprivateSets the a bunch of parameters for a the main view.
setNavigationprivateSets up the sidebar navigation for a view to show the navigation for a specific controller.
styleGuidepublicView the various styles available in the admin area
unlockprivateUnlocks lock for a given record/controller, all records for a controller, or all locks
userAgentpublicBrowser information

public __construct

void $AdminController->__construct ( );

Does some general admin loading

public add

void $AdminController->add ( string $type );

Shows an add form for the specified item

public addSave

void $AdminController->addSave ( string $type );

Executes the save action for a specific item

public ajaxUnlock

void $AdminController->ajaxUnlock ( );

Unlock a record.
Called via ajax in the beforeunload javascript event

public call

void $AdminController->call ( string $class , string $method );

Directly calls a method provided by an admin controller
Suports varargs - additional args are passed to the underlying function

private checkAccess

True $AdminController->checkAccess ( ManagedAdminController $ctlr , string $access_flag , bool $action );

Check access for a given controller/access flag combo
If this returns false, it will echo out an error message; the calling code should just return.

public checkRecordAccess

bool $AdminController->checkRecordAccess ( ManagedAdminController $ctlr , int $item_id );

Checks that an admin user has access to an individual record

private cleanupCommonPostData

void $AdminController->cleanupCommonPostData ( ManagedAdminController $ctlr );

Ensure 'active' flag and 'tags' POST fields have values set, if they are nonexistant

public closeFirstrun

void $AdminController->closeFirstrun ( );

Closes the 'first run' box, which is shown on the admin dashboard

public contents

void $AdminController->contents ( string $type );

Shows an edit form for the specified item

public cronGenericActivate

unknown $AdminController->cronGenericActivate ( );

Activates AutoLaunch revisions

public dashboard

void $AdminController->dashboard ( );

Dashboard shown when a user first logs in to the admin

public delete

void $AdminController->delete ( string $type , int $id );

Shows a delete form for the specified item

public deleteSave

void $AdminController->deleteSave ( string $type , int $id );

Executes the delete action for a specific item

public duplicate

void $AdminController->duplicate ( string $type , int $id );

Shows a duplication form for the specified item
This uses the edit form with some string replacements

public duplicateSave

void $AdminController->duplicateSave ( string $type , int $orig_id );

Executes the save action for a record duplication

public edit

void $AdminController->edit ( string $type , int $id );

Shows an edit form for the specified item

public editSave

void $AdminController->editSave ( string $type , int $id );

Executes the save action for a specific item

private error

void $AdminController->error ( string $message [, ManagedAdminController $ctlr ] );

Shows an error message in the admin skin

public export

void $AdminController->export ( string $type );

Shows an edit form for the specified item

public exportAction

void $AdminController->exportAction ( string $type );

Executes the save action for a specific item

public extra

void $AdminController->extra ( string $class , string $method );

Calls any 'extra' commands that might be provided by the controller

Method names will be prefixed with '_extra' and must be public
Names which are lower_cased will be converted to camelCase

Supports varargs - additional args are passed to the underlying function
Called method should return an array, with two keys:
    title     string    Main title
    content   string    HTML for the main content area

private getController

Controller $AdminController->getController ( string $type );

Returns an instance of a controller class for a given type

public heartbeat

void $AdminController->heartbeat ( );

This function does not have a description

public importAction

void $AdminController->importAction ( string $type );

Executes the import action

public importOptions

void $AdminController->importOptions ( string $type );

Shows the import form for the specified item

public importUpload

void $AdminController->importUpload ( string $type );

File upload box for importing, options are the next step

public importUploadAction

void $AdminController->importUploadAction ( mixed $type );

Copies the file to a temporary directory

public index

void $AdminController->index ( );

Home page of admin area

public intro

void $AdminController->intro ( string $type );

Shows an introduction for a specified type.

private lock

void $AdminController->lock ( string $type , int $id , View $view );

Does lock checking, locking, or lock messages.

public login

void $AdminController->login ( );

Shows a login form

public loginAction

void $AdminController->loginAction ( );

Processes a user login

private loginComplete

void $AdminController->loginComplete ( );

Set up various login params and redirect into admin

Called after a successful login (either one-factor or two-factor)

public loginTwoFactor

void $AdminController->loginTwoFactor ( );

Show the two-factor-auth ui for a half-logged-in operator

public loginTwoFactorAction

void $AdminController->loginTwoFactorAction ( );

Process the result of a two-factor-auth for a half-logged-in operator

public logout

void $AdminController->logout ( );

Processes a user logout

public moderate

void $AdminController->moderate ( );

Moderation

public moderateAction

void $AdminController->moderateAction ( );

Processes the moderation form

protected perRecordPermissionsFields

string $AdminController->perRecordPermissionsFields ( ManagedAdminController $ctlr , int $item_id );

Generates HTML for fields relating to per-record permissions in the 'save changes' box

private renderSubActions

HTML $AdminController->renderSubActions ( array $list );

Render a list of sub-actions into HTML as links

Each sub-action should be an array, with the following keys:
   url     Link URL
   name    Link text
   class   Optional class
   new_tab Optional bool to show in new window/tab

Use a special entry with a key of "_preview" and a value of the
preview URL to set up a preview button

public restore

void $AdminController->restore ( int $log_id );

Restore a deleted record from log data

public search

void $AdminController->search ( string $type );

Shows a search form for the specified item

public setActiveSubsite

void $AdminController->setActiveSubsite ( );

Sets the active subsite, and then redirects back to the admin area.
Uses the post variable "subsite".

private setDefaultMainviewParams

void $AdminController->setDefaultMainviewParams ( View $view );

Sets the a bunch of parameters for a the main view.

private setNavigation

void $AdminController->setNavigation ( View $view , Controller $ctlr );

Sets up the sidebar navigation for a view to show the navigation for a specific controller.

public styleGuide

void $AdminController->styleGuide ( mixed $section );

View the various styles available in the admin area

private unlock

void $AdminController->unlock ( [ mixed $type [, mixed $id ]] );

Unlocks lock for a given record/controller, all records for a controller, or all locks

public userAgent

void $AdminController->userAgent ( );

Browser information