phpDocumentor GalleryCore
Classes
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: GalleryController

Source Location: /modules/core/classes/GalleryController.class

Class GalleryController

Class Overview

The API for module controllers.

This class defines the API for controller classes used by the various modules to perform requested operations.

Located in /modules/core/classes/GalleryController.class [line 41]



		
				Author(s):
		
API Tags:
Abstract:  

Methods

[ Top ]
Direct descendents
Child Class Description
AdminSelfRegistrationController Settings for Registration
ConfirmRegistrationController This controller will handle the confirmation-link that is sent in the confirmation email
UserSelfRegistrationController This controller will handle the registration of a user
AdminNetPbmController Settings for NetPbm
UploadAppletSiteAdminController Settings for Upload Applet
AdminMembersController Settings for Members
ExternalCSSController Generate CSS required if image frames are used with external image block.
ImageBlockSiteAdminController Settings for Image Block
AdminImageMagickController Settings for ImageMagick
UserAlbumSiteAdminController Settings for User Albums
UserAlbumController This controller locates (and creates if needed) a user album and jumps to its view.
AdminSlideshowController Settings for Slideshow
SearchScanController Perform a search
SearchShowAllController Perform a search; show all results from a particular search provider
RedirectController This controller handles rewriting URLs from Gallery1 to the new style Gallery2 locations
PermalinksSiteAdminController Settings for Permalinks
NewDirectoryController This controller implements the Nokia Image Uploader API's 'New Directory' command.
LoginController This controller implements the Nokia Image Uploader API's 'Login' command.
ConfigureController Initial setup for NokiaUpload
DirectoryListingController This controller implements the Nokia Image Uploader API's 'Retrieve Directory Listing' command.
UploadController This controller implements the Nokia Image Uploader API's 'Upload' command.
AdminEcardController Settings for eCards
SendEcardController Send photo as eCard
ItemCreateReplicaSingleController This controller will handle replicating one item from one album to another.
ItemCreateReplicaController This controller will handle replicating one or more items from one album to another.
AdminRewriteController Settings for URL Rewrite
SetupRewriteController Initial setup for URL Rewrite
AdminGdController Settings for GD
NewItemsSiteAdminController Settings for New Items
SwitchDetailModeController Switch the detail mode in the session and return to the previous page.
AdminExifController Settings for Exif
MultiLangSiteAdminController Settings for MultiLang
CantActivateController This controller will redirect back to AdminPlugins
UserWatermarksController Manage user watermarks
ConfirmDeleteController Delete a watermark
WatermarkSiteAdminController Manage watermarks available for all users
UserWatermarkEditController Edit default placement and settings for a watermark image
WatermarkSiteAdminEditController Edit default placement and settings for a watermark image
ConfigureMultirootController Multiroot setup assistant
ConfirmPicasaImportController Perform import
SelectPicasaExportPathController First step of import process
PasswordEntryController Verify password entry
AdminFfmpegController Settings for ffmpeg
EditFeedController Edit RSS feed settings
RssSiteAdminController Settings for RSS
ItemAddSiteAdminController Settings for Item Add
PrintPhotoController This controller handles printing a single photo
IconsSiteAdminController Settings for Icons
ZipCartAdminController Settings for Zip Cart
ThumbnailSiteAdminController Thumbnail manager
RatingSiteAdminController Settings for Ratings
AdminRepositoryDownloadAndInstallController Common base class for Downloaded Plugins and Language Manager controllers.
ConfigViewController Mock GalleryController
FooControllerController
ItemMakeHighlightController This controller will make an item the highlight for its parent
AdminEditGroupController This controller will handle changes made to a group
ItemDeleteController This controller will handle the deletion of items
AdminCoreController This controller will handle the setting of several general Gallery options
UserRecoverPasswordConfirmController This controller will handle the recovery of passwords that have been lost or forgotten by the user.
ItemAddController This controller will handle the addition of new items in the gallery
LogoutController This controller will handle a user logging out of Gallery
AdminDeleteUserController This controller will handle the deletion of an user
ItemReorderController This controller will handle changing the order of items in an album.
ItemMoveController This controller will handle moving one or more items from one album to another.
UserLoginController This controller will handle a user logging in to Gallery
ItemAddAlbumController This controller will handle the addition of an album
ChangeLanguageController This controller handles changing the language in the current session
AdminMaintenanceController This controller will perform the chosen task in AdminMaintenance
AdminEditGroupUsersController This controller will handle changes made to the user-group mapping
UserRecoverPasswordAdminController This controller will handle the recovery of passwords that have been lost or forgotten by the user.
UserPreferencesController This controller will handle changes made to a user
ItemEditController This controller will handle the editing of an item
ItemEditCaptionsController This controller will save many item captions at once.
UserChangePasswordController This controller will handle changing a user password
AdminUsersController This controller will send the user to the chosen subView in the AdminUsers View
ItemDeleteSingleController This controller-like view will handle the deletion of a single item
UserRecoverPasswordController This controller will handle the recovery of passwords that have been lost or forgotten by the user.
AdminCreateGroupController This controller will handle the creation of a group
AdminEditUserController This controller will handle changes made to an user
AdminThemesController This controller will handle an administration request for a theme
ShowItemController Handle the rendering of an album or item.
AdminGroupsController This controller will send the user to the chosen subView in the AdminGroups
AdminCreateUserController This controller will handle the creation of an user
AdminPerformanceController Update performance settings
AdminDeleteGroupController This controller will handle the deletion of a group
ItemMoveSingleController This controller will handle moving an item from one album to another.
ItemPermissionsController This controller will handle the changes in the permission of an item
AdminToolkitPriorityController This controller adjusts relative toolkit priorities
ChooseObjectsController Form to prepare G1 migration
ConfirmImportController Perform G1 migration
SelectGalleryController First step of migration process
AddToCartController This controller will handle adding an item to the cart.
ModifyCartController This controller will handle the changing of item quantities in a cart
AdminDcrawController Settings for dcraw
RearrangeItemsController This controller will handle rearranging the order of all album items at once.
SlideshowAppletSiteAdminController Settings for Slideshow Applet
LinkItemSiteAdminController Settings for Link Items
PrintPhotosController This controller sends data to fotokasten.de
FotokastenSiteAdminController Settings for Fotokasten
NewAlbumController Controller to create a new album for the photos.
OptionsController Controller to set options on how photos are uploaded.
SelectAlbumController Controller to select the album to add photos to.
UploadItemsController Controller to process the uploading of photos from Windows XP.
PublishXpLoginController Controller to initialize the process of publishing photos.
AdminGetid3Controller Settings for getid3
Getid3DetailModeController This controller will switch the ItemDetails mode in the session and return to the previous page
ArchiveUploadSiteAdminController Settings for Archive Upload
MimeAdminController Settings for Mime types
MimeEditController Edit settings for a mime type
RemoteSiteAdminController Settings for Remote
GalleryRemoteController This controller fields requests from Gallery Remote and performs any required changes to the data model.
WebCamSiteAdminController Settings for Webcam images
PanoramaSiteAdminController Settings for Panorama
SquareThumbSiteAdminController Settings for square thumbnails
AlbumSelectSiteAdminController Settings for Album Select
EditCommentController This controller will handle the changes made to a comment
AddCommentController Add a comment to an item
DeleteCommentController This controller will handle the deletion of a comment
CommentSiteAdminController Settings for comments
AdminModerateSpamController Controller for moderating spam
CaptchaConfigAdminController
CaptchaSiteAdminController Settings for Captcha
RandomHighlightSiteAdminController Settings for Random Highlight
KeywordAlbumSiteAdminController Settings for Keyword Albums
AdminDigibugController Digibug4CPG - a plugin for gallery to create photo prints, and print product gift items derived from code written by Bharat Mediratta Copyright (C) 2006 Digibug Express, Inc.
AdminEditUserQuotaController This controller will handle changes made to a user's quotas
AdminDeleteUserQuotaController This controller will handle the deletion of a user quota
AdminQuotasController Options to add/remove/edit User/Group Quotas
AdminEditGroupQuotaController This controller will handle changes made to a group's quotas
AdminCreateUserQuotaController This controller will handle the creation of a user quota
AdminCreateGroupQuotaController This controller will handle the creation of a group quota
AdminDeleteGroupQuotaController This controller will handle the deletion of a group quota
CustomFieldSiteAdminController Settings for custom fields
CustomFieldItemAdminController This controller handles moving between admin modes in the Item Edit plugin, by setting or clearing a session variable. It also handles activation of album-specific settings (copy in global settings) or reverting to global settings for an album (clear album settings, remove field values).
DynamicAlbumSiteAdminController Settings for Dynamic Albums
HttpAuthSiteAdminController Show configuration warnings and settings to site admins.
WebDavController The WebDAV controller handles all WebDAV requests.
AdminJpegtranController Settings for Jpegtran
AdminSnapGalaxyController Settings for SnapGalaxy Copyright (C) 2006 SnapGalaxy Inc.
SnapGalaxyPrintPhotosController This controller handles printing a single photo
NotificationItemAdminController This controller handles event / method preferences for the user on a per-item basis.
NotificationUserAdminController This controller saves changes to settings on a per-user basis.
NotificationSiteAdminController This controller handles event / method settings on a site-wide basis.

[ Top ]
Method Summary
static GalleryStatus   assertIsGenuineRequest()   Verifies the genuineness of the request
static array   loadController()   Load a controller
array   getItem()   Return the current item, as specified in the itemId request variable.
array   handleRequest()   Take the appropriate action based on the user input provided.
boolean   isAllowedInEmbedOnly()   Does this controller allow direct access even in embed-only mode?
boolean   isAllowedInMaintenance()   Does this controller allow access to non-admins when site is in maintenance mode?
boolean   omitAuthTokenCheck()   Whether the controller opts-out from the framework's auth token check.
void   permissionCheck()  
boolean   shouldSaveSession()   Should session be saved and session cookie sent when this controller is used?

[ Top ]
Methods
static method assertIsGenuineRequest  [line 228]

  static GalleryStatus assertIsGenuineRequest( )

Verifies the genuineness of the request

All requests that modify data must be signed, except the request is by a guest.


API Tags:
Return:  a status code null on success, ERROR_REQUEST_FORGED on failure


[ Top ]
static method loadController  [line 128]

  static array loadController( string $controllerName  )

Load a controller

Be very security conscious about checking the inputs for possible misuse

Parameters:
string   $controllerName:  a controller name (eg. 'core.Logout')

API Tags:
Return:  GalleryStatus a status code GalleryController a controller


[ Top ]
getItem  [line 262]

  array getItem( [bool $checkPermissions = true]  )

Return the current item, as specified in the itemId request variable.

Parameters:
bool   $checkPermissions:  (optional) Default true. Whether to enfore the required (view) permission.

API Tags:
Return:  GalleryStatus a status code, GalleryItem an item

Information Tags:
Throws:  ERROR_MISSING_VALUE if there is no itemId in the request parameters.

[ Top ]
handleRequest  [line 114]

  array handleRequest( array $form  )

Take the appropriate action based on the user input provided.

When done, we return a data structure with results from the controller's actions and information about where we should send the user next. We can either delegate the user to a view in the same request, or we can redirect the user to a different url. Whenever a controller makes a change to the data model, it should pass back a redirect so that the browser is sent to a fresh page. Otherwise if you hit reload on the browser it will want to re-post the form data and it will attempt to change the model again, which may not be what the user wants.

To redirect, return:

     array('redirect' => [url params],
           'status' => [status data])

To delegate, return:

     array('delegate' => [url params],
           'return' => [boolean],   optional
           'error' => [error],
           'status' => [status data])

If you delegate, your form and request variables will persist to the view, since it is being handled inside the same request. However, if you redirect you'll have to put any form variables that you want to pass to the subsequent view into the redirect url, since it will be processed in a new request. The browser will receive a redirect and then post the new url. So for example, if you want to redirect to a confirmation view and specify a username to that view, you'd return:

    array('redirect' => array('view' => 'module.Confirmation',
                              'username' => 'johndoe'),
          'status' => array('success' => 'true'),
          'error' => array())

Status data is passed to the view and can be in any form that you want. Typically it's simple key value pairs, like this:

    array('myAction' => 'wasSuccessful')

If you pass status data back on a redirect, it will be automatically stored in the session and the url will be modified to contain a marker to this status information. After the redirect, we'll retrieve it back from the database and pass it to the view. Status data sent back upon delegation is passed directly to the view.

Error data is an array of values, like this:

    array('form[widget][missing]')

This data is only processed on delegation. It gets put into the request and is accessible when the delegated view is called. Since we only redirect on success, you never pass back error data when you redirect.

Return is a special parameter. If you set this to a non-false value, it will look for a special request variable called "return" in the request scope. This variable is expected to contain a URL, and we'll return a redirect to that URL. This is useful in the case where we want to use this controller in the middle of a workflow. A good example of this is when we click the "Login" link on the main page. We pass control to the UserLogin controller, and when its done, it uses the "return" flag to indicate that we should return to the URL where the login link was clicked.

Parameters:
array   $form:  the form values

API Tags:
Return:  GalleryStatus a status code return-array


Redefined in descendants as:

[ Top ]
isAllowedInEmbedOnly  [line 195]

  boolean isAllowedInEmbedOnly( )

Does this controller allow direct access even in embed-only mode?


API Tags:
Return:  true if access always allowed


Redefined in descendants as:

[ Top ]
isAllowedInMaintenance  [line 186]

  boolean isAllowedInMaintenance( )

Does this controller allow access to non-admins when site is in maintenance mode?


API Tags:
Return:  true if access always allowed


Redefined in descendants as:

[ Top ]
omitAuthTokenCheck  [line 207]

  boolean omitAuthTokenCheck( )

Whether the controller opts-out from the framework's auth token check.

Some protocols don't allow to add authentication tokens to controller requests, but all normal Gallery controllers should not override this method.


API Tags:
Return:  true if the controller opts-out from the auth token check


Redefined in descendants as:

[ Top ]
permissionCheck  [line 292]

  void permissionCheck( $ret  )

Parameters:
   $ret: 

API Tags:
See:  GalleryView::_permissionCheck()


Redefined in descendants as:
  • WebDavController::permissionCheck() : Overriding permissionCheck() since the WebDAV protocol needs to handle authentication differently (redirects to a HTML based login view don't work here).

[ Top ]
shouldSaveSession  [line 216]

  boolean shouldSaveSession( )

Should session be saved and session cookie sent when this controller is used?


API Tags:
Return:  true to enable session


Redefined in descendants as:

[ Top ]

Documentation generated on Fri, 08 Oct 2010 04:54:28 -0700 by phpDocumentor 1.3.0RC6