SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Admin

Useful functions for the admin

Variables

NameVisibilityDescription
$cat_singlecat (static) 
$cat_tablename (static) 
$error_msgs (static) 

Functions

NameVisibilityDescription
attrEditorpublic (static)Renders an interface for editing attributes
categorySelectionpublic (static)Outputs an interface for selecting multiple categories
checkboxListpublic (static)Outputs a list of checkboxes.
clearFieldErrorspublic (static)Clears all pre-field error messages
clearOldLockspublic (static)Remove all locks which are older than the allowed lock time.
createLockKeypublic (static)Return a unique key for identifying a session.
ensureUrlAbsolutepublic (static)For a given URL, ensure it's absolute.
fieldErrorpublic (static)Shows a per-field error message
forceUnlockpublic (static)Nuke a lock
getControllerpublic (static)Gets an instance of a managed admin controller
getControllerSlugpublic (static)When in the admin, return the slug of the controller being used, e.g. 'page' or 'blog_post'
getLockpublic (static)Gets the lock details for a given record
getRecordIdpublic (static)When in the admin, return the record id being added or edited.
isTourCompletedpublic (static)Has a given JavaScript tour been completed?
lockpublic (static)Locks the given record for the current user
locksEnabledpublic (static)Is admin locks enabled?
lookupErrMsgpublic (static)Finds an appropriate error message for the specified error code
multieditBuildpublic (static)For a set of multi-edit fields, loads the data into a much more usable array
navigationTreeNodepublic (static)Render a tree of nodes for the navigation area of the admin
pageDropdownpublic (static)Deprecated wrapper around Fb::pageDropdown
pingLockpublic (static)Updates the timestamp for a given lock record to prevent it from timing out
radioListpublic (static)Outputs a list of radiobuttons, which will all use the same field name
setCategorySinglecatpublic (static) 
setCategoryTablenamepublic (static) 
setTourCompletedpublic (static)Set a given JavaScript tour as being "completed", preventing it from being shown again.
topNavpublic (static)Return HTML for the top nav tabs
unlockpublic (static)Removes locks for the current user
widgetListpublic (static)Shows a UI for the list of widgets, for editing

public attrEditor

void Admin::attrEditor ( mixed $current_attrs );

Renders an interface for editing attributes
Uses a multiedit

public categorySelection

void Admin::categorySelection ( The $field , An $data , An $selected );

Outputs an interface for selecting multiple categories

public checkboxList

void Admin::checkboxList ( mixed $field , mixed $data , mixed $selected );

Outputs a list of checkboxes.

If the $field parameter is provided, multiple checkboxes with the same field name will be rendered.
   $data should be a key-value pair, with the keys being the value of the checkbox, and the value being the label.
   $selected should be an array of selected checkbox ids.

If the $field parameter is omitted (null), multiple checkboxes widh different field names will be rendered.
The checkboxes will be binary checkboxes with a value of 1.
   $data should be a key-value pair, with the keys being the field name, and the value being the label.
   $selected should be a key-value pair, with the keys being the field name, and the value being 1 or 0.

public clearFieldErrors

void Admin::clearFieldErrors ( [ mixed $scope ] );

Clears all pre-field error messages

public clearOldLocks

void Admin::clearOldLocks ( );

Remove all locks which are older than the allowed lock time.

public createLockKey

unknown Admin::createLockKey ( );

Return a unique key for identifying a session.
This will be constant even if the session id changes, although it's nuked if you log out.

public ensureUrlAbsolute

string Admin::ensureUrlAbsolute ( string $url );

For a given URL, ensure it's absolute.
If it's not absolute, the current admin abs-root is prepended

public fieldError

unknown Admin::fieldError ( string $field_name [, mixed $scope ] );

Shows a per-field error message

public forceUnlock

void Admin::forceUnlock ( mixed $lock_id );

Nuke a lock

public getController

ManagedAdminController Admin::getController ( string $class_name );

Gets an instance of a managed admin controller

public getControllerSlug

string Admin::getControllerSlug ( );

When in the admin, return the slug of the controller being used, e.g. 'page' or 'blog_post'

public getLock

null|array Admin::getLock ( string $ctlr , int $record_id );

Gets the lock details for a given record

public getRecordId

unknown Admin::getRecordId ( );

When in the admin, return the record id being added or edited.
If it's not an add or an edit, returns null.
If used outside of the admin, behaviour is undefined

public isTourCompleted

bool Admin::isTourCompleted ( string $tour_name );

Has a given JavaScript tour been completed?

public lock

int Admin::lock ( string $ctlr , int $record_id );

Locks the given record for the current user

public locksEnabled

boolean Admin::locksEnabled ( );

Is admin locks enabled?

public lookupErrMsg

unknown Admin::lookupErrMsg ( mixed $err );

Finds an appropriate error message for the specified error code

public multieditBuild

unknown Admin::multieditBuild ( array $dataset , array $field_names );

For a set of multi-edit fields, loads the data into a much more usable array

Input:
  [phone] = ('1234 1234', '4321 4321')
  [type] = ('Mobile', 'Home')

Output:
  [1] = ('phone' => '1234 1234', 'type' => 'Mobile')
  [2] = ('phone' => '4321 4321', 'type' => 'Home')

public navigationTreeNode

void Admin::navigationTreeNode ( Treenode $node , array $actions [, int $depth ] );

Render a tree of nodes for the navigation area of the admin
Used by the pages module

public pageDropdown

void Admin::pageDropdown ( string $field_name [, int $selected [, int $exclude [, int $subsite_id [, string $top_text ]]]] );

Deprecated wrapper around Fb::pageDropdown

public pingLock

void Admin::pingLock ( int $lock_id );

Updates the timestamp for a given lock record to prevent it from timing out

public radioList

void Admin::radioList ( string $field , array $data , array $selected );

Outputs a list of radiobuttons, which will all use the same field name

public setCategorySinglecat

void Admin::setCategorySinglecat ( mixed $value );

This function does not have a description

public setCategoryTablename

void Admin::setCategoryTablename ( mixed $name );

This function does not have a description

public setTourCompleted

void Admin::setTourCompleted ( string $tour_name );

Set a given JavaScript tour as being "completed", preventing it from being shown again.

public topNav

string Admin::topNav ( string $selected_controller );

Return HTML for the top nav tabs

public unlock

void Admin::unlock ( [ string $ctlr [, int $record_id ]] );

Removes locks for the current user

public widgetList

void Admin::widgetList ( string $field_name , WidgetArea $area , array $curr_widgets [, boolean $enable_all ] );

Shows a UI for the list of widgets, for editing