Class WFYAHOO_widget_Uploader

Description

Implements interfaces:

This widget allows easy bulk uploading from the desktop to the web server with the YUI Uploader Flash widget. Requires Flash 9.

To use, simply add a WFYAHOO_widget_Uploader instance, as a child of a WFForm, to your page. Then, place the widget on your page {WFView id="myUploaderId"}. There is no need to wrap the widget inside the form in the HTML template.

All you need to do to receive the uploaded files is create a single function to handle the uploaded file. When someone uploads file(s) through the bulk uploader, your module's hasUploadCallback will be called, once for each file uploaded. From this function you can do as you please with each uploaded file.

NOTE: If you want to bulid a full ajax uploader with no page refreshes, this widget will fire a 'WFYAHOO_widget_Uploader:allUploadsComplete' event when all uploads have completed. You can register handlers with document.observe('WFYAHOO_widget_Uploader:allUploadsComplete').

PHOCOA Builder Setup:

Required:

Optional:
allowMultiple addButtonLabel uploadButtonLabel continueURL

Located in /framework/widgets/yahoo/WFYAHOO_widget_Uploader.php (line 31)

WFObject
   |
   --WFView
      |
      --WFWidget
         |
         --WFYAHOO
            |
            --WFYAHOO_widget_Uploader
Variable Summary
Method Summary
WFYAHOO_widget_Uploader __construct ( $id,  $page)
void getForm ()
void hasUpload ()
void initJS ( $blockContent)
void mimeType ()
void render ([ $blockContent = NULL])
void restoreState ()
void setContinueURL ( $url)
void setHasUploadCallback (mixed $callback)
void tmpFileName ()
Variables
string $addButtonLabel (line 40)
  • var: The label used on the "Add Files" button.
  • access: protected
boolean $allowMultiple (line 36)
  • var: Allow multiple uploads? Default: FALSE
  • access: protected
string $continueURL (line 48)
  • var: The URL to redirect the user to once the upload has completed. Default: NULL (no redirect).
  • access: protected
mixed $hasUploadCallback (line 69)
  • var: A valid php callback object that will be called on each uploaded file. The prototype is: void handleUploadedFile($page, $params, object WFYAHOO_widget_Uploader).
  • access: protected
int $maxUploadBytes (line 73)
  • var: The maximum file size in bytes to allow. A warning will be displayed for any file over that size and no upload will be attempted on that file. Default NULL (no limit).
  • access: protected
string $mimeType (line 57)
  • var: The mime type of the uploaded file. This is the mime-type reported by the browser, so remember that it can be faked!
  • access: protected
string $originalFileName (line 61)
  • var: The name of the actual file.
  • access: protected
string $tmpFileName (line 53)
  • var: The temp file name of the uploaded file.
  • access: protected
string $uploadButtonLabel (line 44)
  • var: The label used on the "Start Upload" button.
  • access: protected

Inherited Variables

Inherited from WFYAHOO

WFYAHOO::$initializeWaitsForID

Inherited from WFWidget

WFWidget::$bindings
WFWidget::$class
WFWidget::$errors
WFWidget::$formatter
WFWidget::$hasRestoredState
WFWidget::$hidden
WFWidget::$name
WFWidget::$value
WFWidget::$widgetLabel

Inherited from WFView

WFView::$children
WFView::$cssImports
WFView::$enabled
WFView::$id
WFView::$importInHead
WFView::$jsActions
WFView::$jsEvents
WFView::$jsImports
WFView::$originalOnEvent
WFView::$page
WFView::$parent
Methods
Constructor __construct (line 79)

Constructor.

WFYAHOO_widget_Uploader __construct ( $id,  $page)
  • $id
  • $page

Redefinition of:
WFYAHOO::__construct()
Constructor.
getForm (line 92)
void getForm ()

Redefinition of:
WFView::getForm()
Get the form associated with this element, if there is one.
handleUploadedFile (line 140)
void handleUploadedFile ()
hasUpload (line 135)
void hasUpload ()
initJS (line 218)
void initJS ( $blockContent)
  • $blockContent

Redefinition of:
WFYAHOO::initJS()
The initJS function is where YUI widgets perform their bootstrap/initialization.
mimeType (line 130)
void mimeType ()

Implementation of:
WFUploadedFile::mimeType()
originalFileName (line 125)
void originalFileName ()

Implementation of:
WFUploadedFile::originalFileName()
render (line 189)
void render ([ $blockContent = NULL])
  • $blockContent

Redefinition of:
WFYAHOO::render()
IMPORTANT: The subclasses should get the base class's html, then add the needed code.
restoreState (line 156)
void restoreState ()

Redefinition of:
WFWidget::restoreState()
Restore the UI state of this widget from the $_REQUEST data.
setContinueURL (line 99)
void setContinueURL ( $url)
  • $url
setHasUploadCallback (line 110)

Set the callback function to be used to process the uploaded file.

  • throws: object Exception
void setHasUploadCallback (mixed $callback)
  • mixed $callback: String: the method of the current page delegate to call. Array: a php callback.
tmpFileName (line 120)
void tmpFileName ()

Implementation of:
WFUploadedFile::tmpFileName()

Inherited Methods

Inherited From WFYAHOO

WFYAHOO::__construct()
WFYAHOO::canPushValueBinding()
WFYAHOO::initJS()
WFYAHOO::jsForSimplePropertyConfig()
WFYAHOO::jsValueForValue()
WFYAHOO::render()
WFYAHOO::yuiloader()

Inherited From WFWidget

WFWidget::__construct()
WFWidget::addError()
WFWidget::addErrors()
WFWidget::bind()
WFWidget::bindingByName()
WFWidget::bindings()
WFWidget::canPushValueBinding()
WFWidget::errors()
WFWidget::exposedBindings()
WFWidget::exposedProperties()
WFWidget::formattedValue()
WFWidget::formatter()
WFWidget::hasRestoredState()
WFWidget::hidden()
WFWidget::name()
WFWidget::processBindingOptions()
WFWidget::propagateValueToBinding()
WFWidget::pullBindings()
WFWidget::pushBindings()
WFWidget::restoreState()
WFWidget::setFormatter()
WFWidget::setHidden()
WFWidget::setName()
WFWidget::setupExposedBindings()
WFWidget::setValue()
WFWidget::setWidgetLabel()
WFWidget::unbind()
WFWidget::value()
WFWidget::valueForBinding()
WFWidget::widgetLabel()

Inherited From WFView

WFView::__construct()
WFView::addChild()
WFView::allConfigFinishedLoading()
WFView::children()
WFView::cloneWithID()
WFView::enabled()
WFView::exposedProperties()
WFView::getForm()
WFView::getJSActions()
WFView::getListenerJS()
WFView::getListenerJSInScriptTag()
WFView::getOnEvent()
WFView::getWidgetDir()
WFView::getWidgetWWWDir()
WFView::id()
WFView::importCSS()
WFView::importJS()
WFView::jsEndHTML()
WFView::jsStartHTML()
WFView::page()
WFView::parent()
WFView::removeChild()
WFView::render()
WFView::setEnabled()
WFView::setId()
WFView::setJSonBlur()
WFView::setJSonClick()
WFView::setListener()
WFView::setOnEvent()
WFView::setParent()
WFView::yuiPath()

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()

Documentation generated on Thu, 14 May 2009 16:20:57 -0400 by phpDocumentor 1.4.2