Useful functions for the admin
This is the code documentation for the SproutCMS project
Search documentation |
class AdminUseful functions for the admin
Variables
Functions
public attrEditorvoid Admin::attrEditor ( mixed $current_attrs ); Renders an interface for editing attributes Uses a multiedit public categorySelectionvoid Admin::categorySelection ( The $field , An $data , An $selected ); Outputs an interface for selecting multiple categories public checkboxListvoid 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 clearFieldErrorsvoid Admin::clearFieldErrors ( [ mixed $scope ] ); Clears all pre-field error messages public clearOldLocksvoid Admin::clearOldLocks ( ); Remove all locks which are older than the allowed lock time. public createLockKeyunknown 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 ensureUrlAbsolutestring 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 fieldErrorunknown Admin::fieldError ( string $field_name [, mixed $scope ] ); Shows a per-field error message public forceUnlockvoid Admin::forceUnlock ( mixed $lock_id ); Nuke a lock public getControllerManagedAdminController Admin::getController ( string $class_name ); Gets an instance of a managed admin controller public getControllerSlugstring Admin::getControllerSlug ( ); When in the admin, return the slug of the controller being used, e.g. 'page' or 'blog_post' public getLocknull|array Admin::getLock ( string $ctlr , int $record_id ); Gets the lock details for a given record public getRecordIdunknown 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 isTourCompletedbool Admin::isTourCompleted ( string $tour_name ); Has a given JavaScript tour been completed? public lockint Admin::lock ( string $ctlr , int $record_id ); Locks the given record for the current user public locksEnabledboolean Admin::locksEnabled ( ); Is admin locks enabled? public lookupErrMsgunknown Admin::lookupErrMsg ( mixed $err ); Finds an appropriate error message for the specified error code public multieditBuildunknown 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 navigationTreeNodevoid 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 pageDropdownvoid Admin::pageDropdown ( string $field_name [, int $selected [, int $exclude [, int $subsite_id [, string $top_text ]]]] ); Deprecated wrapper around Fb::pageDropdown public pingLockvoid Admin::pingLock ( int $lock_id ); Updates the timestamp for a given lock record to prevent it from timing out public radioListvoid Admin::radioList ( string $field , array $data , array $selected ); Outputs a list of radiobuttons, which will all use the same field name public setCategorySinglecatvoid Admin::setCategorySinglecat ( mixed $value ); This function does not have a description public setCategoryTablenamevoid Admin::setCategoryTablename ( mixed $name ); This function does not have a description public setTourCompletedvoid Admin::setTourCompleted ( string $tour_name ); Set a given JavaScript tour as being "completed", preventing it from being shown again. public topNavstring Admin::topNav ( string $selected_controller ); Return HTML for the top nav tabs public unlockvoid Admin::unlock ( [ string $ctlr [, int $record_id ]] ); Removes locks for the current user public widgetListvoid Admin::widgetList ( string $field_name , WidgetArea $area , array $curr_widgets [, boolean $enable_all ] ); Shows a UI for the list of widgets, for editing |
Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Monday, 3rd April, 2023 at 02:59 pm |