Main class to handle admin processing. This delegates processing to controllers registered with Register::adminControllers
This is the code documentation for the SproutCMS project
Search documentation |
class AdminControllerMain class to handle admin processing. This delegates processing to controllers registered with Register::adminControllers
Variables
Functions
public __call (from BaseController)void $BaseController->__call ( string $method , array $args ); Handles methods that do not exist. public __constructvoid $AdminController->__construct ( ); Does some general admin loading public _run (from BaseController)void $BaseController->_run ( mixed $method , mixed $args ); The router/kohana will invoke this method to invoke an action. If you please, you may wrap this method to create before/after hooks. public addvoid $AdminController->add ( string $type ); Shows an add form for the specified item public addSavevoid $AdminController->addSave ( string $type ); Executes the save action for a specific item public ajaxUnlockvoid $AdminController->ajaxUnlock ( ); Unlock a record. Called via ajax in the beforeunload javascript event protected autoSetEmptyParam (from Controller)null $Controller->autoSetEmptyParam ( array &$conf ); Auto-set the "empty" param for fields with foreign keys to be NULL This greatly reduces the number of foreign-key constraints hit in day-to-day use, especially with file fields. public callvoid $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 checkAccessTrue $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 checkRecordAccessbool $AdminController->checkRecordAccess ( ManagedAdminController $ctlr , int $item_id ); Checks that an admin user has access to an individual record private cleanupCommonPostDatavoid $AdminController->cleanupCommonPostData ( ManagedAdminController $ctlr ); Ensure 'active' flag and 'tags' POST fields have values set, if they are nonexistant public closeFirstrunvoid $AdminController->closeFirstrun ( ); Closes the 'first run' box, which is shown on the admin dashboard public contentsvoid $AdminController->contents ( string $type ); Shows an edit form for the specified item public cronGenericActivateunknown $AdminController->cronGenericActivate ( ); Activates AutoLaunch revisions public dashboardvoid $AdminController->dashboard ( ); Dashboard shown when a user first logs in to the admin public deletevoid $AdminController->delete ( string $type , int $id ); Shows a delete form for the specified item protected deleteRecord (from Controller)int $Controller->deleteRecord ( string $table , int $record_id [, int $parent_log_id ] ); Deletes a record, and logs the deletion This should be used by all _deleteSave methods Starts a transaction and commits it if not already in a transaction when called public deleteSavevoid $AdminController->deleteSave ( string $type , int $id ); Executes the delete action for a specific item public duplicatevoid $AdminController->duplicate ( string $type , int $id ); Shows a duplication form for the specified item This uses the edit form with some string replacements public duplicateSavevoid $AdminController->duplicateSave ( string $type , int $orig_id ); Executes the save action for a record duplication public editvoid $AdminController->edit ( string $type , int $id ); Shows an edit form for the specified item public editSavevoid $AdminController->editSave ( string $type , int $id ); Executes the save action for a specific item private errorvoid $AdminController->error ( string $message [, ManagedAdminController $ctlr ] ); Shows an error message in the admin skin public exportvoid $AdminController->export ( string $type ); Shows an edit form for the specified item public exportActionvoid $AdminController->exportAction ( string $type ); Executes the save action for a specific item public extravoid $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 areaprotected generateFormView (from Controller)array $Controller->generateFormView ( mixed $file_name ); Generates a form view from a JSON config file private getControllerController $AdminController->getController ( string $type ); Returns an instance of a controller class for a given type public getCssClassName (from BaseController)string $BaseController->getCssClassName ( ); Return the class name for this controller, expressed in CSS style, i.e. with dashes Example: When called from BlogPostController --> 'blog-post-controller' public getModulePath (from BaseController)string $BaseController->getModulePath ( ); Gets the relative path to the module the controller lives in, or sprout itself public heartbeatvoid $AdminController->heartbeat ( ); This function does not have a description public importActionvoid $AdminController->importAction ( string $type ); Executes the import action public importOptionsvoid $AdminController->importOptions ( string $type ); Shows the import form for the specified item public importUploadvoid $AdminController->importUpload ( string $type ); File upload box for importing, options are the next step public importUploadActionvoid $AdminController->importUploadAction ( mixed $type ); Copies the file to a temporary directory public indexvoid $AdminController->index ( ); Home page of admin area public introvoid $AdminController->intro ( string $type ); Shows an introduction for a specified type. protected jsonExtraValidate (from Controller)void $Controller->jsonExtraValidate ( int $id , Validator $validator ); Do any additional validation prior to saving the record protected loadEditJson (from Controller)array $Controller->loadEditJson ( ); Loads a JSON config file for an automated edit-type form for this controller protected loadFormJson (from Controller)array $Controller->loadFormJson ( string $file_name ); Loads a config file for a JsonForm associated with this controller protected loadRecord (from Controller)bool|array $Controller->loadRecord ( string $table , int $record_id ); Fetches the pre-update record from the database. Used by the action log system, and disabled if the action log system has been turned off private lockvoid $AdminController->lock ( string $type , int $id , View $view ); Does lock checking, locking, or lock messages. protected logAction (from Controller)int $Controller->logAction ( string $table , int $record_id , int $type , array $data [, int $parent_log_id ] ); Stores a history item in the database, recording an add (i.e. insert), edit, or delete. Should be called AFTER the action has been made. N.B. This is a low-level method; the friendlier wrapper methods are preferred; e.g. Controller::logAdd, Controller::logEdit protected logAdd (from Controller)int $Controller->logAdd ( string $table , int $record_id ); Logs an add action. This is a wrapper for Controller::logAction protected logAddCategory (from Controller)int $Controller->logAddCategory ( string $table , int $record_id , int $cat_id ); Logs the adding of a record to a category. This is a wrapper for Controller::logAction protected logDelete (from Controller)int $Controller->logDelete ( string $table , int $record_id , array $data [, int $parent_log_id ] ); Logs a delete action. This is a wrapper for Controller::logAction protected logDeleteCategory (from Controller)int $Controller->logDeleteCategory ( string $table , int $record_id , int $cat_id ); Logs the removal of a record from a category. This is a wrapper for Controller::logAction protected logEdit (from Controller)int $Controller->logEdit ( string $table , int $record_id , array $data ); Logs an edit action. This is a wrapper for Controller::logAction public loginvoid $AdminController->login ( ); Shows a login form public loginActionvoid $AdminController->loginAction ( ); Processes a user login private loginCompletevoid $AdminController->loginComplete ( ); Set up various login params and redirect into admin Called after a successful login (either one-factor or two-factor) public loginTwoFactorvoid $AdminController->loginTwoFactor ( ); Show the two-factor-auth ui for a half-logged-in operator public loginTwoFactorActionvoid $AdminController->loginTwoFactorAction ( ); Process the result of a two-factor-auth for a half-logged-in operator public logoutvoid $AdminController->logout ( ); Processes a user logout public moderatevoid $AdminController->moderate ( ); Moderation public moderateActionvoid $AdminController->moderateAction ( ); Processes the moderation form protected perRecordPermissionsFieldsstring $AdminController->perRecordPermissionsFields ( ManagedAdminController $ctlr , int $item_id ); Generates HTML for fields relating to per-record permissions in the 'save changes' box private renderSubActionsHTML $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 protected replaceSet (from Controller)void $Controller->replaceSet ( string $table , array $new_records , array $conditions ); Inserts records which are in $new_records, but are not in the specified table Deletes records which are in the specified table, but not in $new_records Updates records which are in both Matching is done on the 'id' field, as a result the $new_records arrays MUST contain an id field. public restorevoid $AdminController->restore ( int $log_id ); Restore a deleted record from log data protected saveJsonData (from Controller)bool $Controller->saveJsonData ( array $conf , int &$item_id [, string $mode ] ); Automatically saves the data associated with a submission on a JSON-generated form public searchvoid $AdminController->search ( string $type ); Shows a search form for the specified item public setActiveSubsitevoid $AdminController->setActiveSubsite ( ); Sets the active subsite, and then redirects back to the admin area. Uses the post variable "subsite". private setDefaultMainviewParamsvoid $AdminController->setDefaultMainviewParams ( View $view ); Sets the a bunch of parameters for a the main view. private setNavigationvoid $AdminController->setNavigation ( View $view , Controller $ctlr ); Sets up the sidebar navigation for a view to show the navigation for a specific controller. public styleGuidevoid $AdminController->styleGuide ( mixed $section ); View the various styles available in the admin area private unlockvoid $AdminController->unlock ( [ mixed $type [, mixed $id ]] ); Unlocks lock for a given record/controller, all records for a controller, or all locks public userAgentvoid $AdminController->userAgent ( ); Browser information |
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Tuesday, 15th September, 2026 at 10:26 am |
|