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

Class: ItemAddController

Source Location: /modules/core/ItemAdd.inc

Class ItemAddController

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From GalleryController

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

[ Top ]
Property Summary
array   $_optionInstances   ItemAddOption instances to use when handling this request. Only used by test code.

[ Top ]
Method Summary
void   handleRequest()  
GalleryStatus   handleRequestWithProgressBar()   Handles the add item request and is expected to be called as a progress-bar callback.
array   postprocessItems()   Do post-processing which includes extracting archive-items and letting all ItemAddOption instances handle the added items.
void   setOptionInstances()   Tests can use this method to hardwire a specific set of option instances to use.
array   _extractAndAddFiles()   Extract files from an archive item and add new items to the same album.
GalleryStatus   _recursiveAddDir()   Recursively add files from extracted archive.

[ Top ]
Properties
array   $_optionInstances [line 40]

ItemAddOption instances to use when handling this request. Only used by test code.

API Tags:
Access:  private


[ Top ]
Methods
handleRequest  [line 56]

  void handleRequest( $form  )

Parameters:
   $form: 

API Tags:
See:  GalleryController::handleRequest


Redefinition of:
GalleryController::handleRequest()
Take the appropriate action based on the user input provided.

[ Top ]
handleRequestWithProgressBar  [line 138]

  GalleryStatus handleRequestWithProgressBar( array $form, GalleryItem $item, ItemAddPlugin $addPlugin  )

Handles the add item request and is expected to be called as a progress-bar callback.

Parameters:
array   $form: 
GalleryItem   $item:  The container to which we're adding child-items
ItemAddPlugin   $addPlugin:  The plugin that handles this add item request


[ Top ]
postprocessItems  [line 235]

  array postprocessItems( array $form, &$status, array $status  )

Do post-processing which includes extracting archive-items and letting all ItemAddOption instances handle the added items.

If called from an ItemAddPlugin, the plugin should stop adding items if $error is non-empty.

Parameters:
array   $form: 
array   $status:  An array including the list of all added items
   &$status: 

API Tags:
Return:  GalleryStatus array $error request parameter errors
See:  ItemAddPlugin::handleRequest() for the structure of the $status array


[ Top ]
setOptionInstances  [line 49]

  void setOptionInstances( array $optionInstances  )

Tests can use this method to hardwire a specific set of option instances to use.

This avoids situations where some of the option instances will do unpredictable things and derail the tests.

Parameters:
array   $optionInstances:  (optionId => ItemAddOption, ...)


[ Top ]
_extractAndAddFiles  [line 399]

  array _extractAndAddFiles( GalleryDataItem $archiveItem, GalleryToolkit $toolkit  )

Extract files from an archive item and add new items to the same album.

Parameters:
GalleryDataItem   $archiveItem:  archive
GalleryToolkit   $toolkit:  toolkit that supports extract operation

API Tags:
Return:  GalleryStatus a status code array of array('fileName' => '..', 'id' => ##, 'warnings' => array of string)
Access:  private


[ Top ]
_recursiveAddDir  [line 470]

  GalleryStatus _recursiveAddDir( $dir, $parentId, &$addedFiles, &$archiveItem, $titleMode, $canAddAlbums  )

Recursively add files from extracted archive.

Parameters:
   $dir: 
   $parentId: 
   &$addedFiles: 
   &$archiveItem: 
   $titleMode: 
   $canAddAlbums: 

API Tags:
Return:  a status code
Access:  private


[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:22:00 -0700 by phpDocumentor 1.3.0RC6