Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

tx_commerce_pi4 Class Reference

List of all members.

Public Member Functions

 main ($content, $conf)
 init ($conf, $getAddresses=true)
 noUser ()
 getListing ($addressType=0, $createHiddenFields=false, $hiddenFieldPrefix= '')
 getAddressForm ($action= 'new', $addressUid=NULL, $config)
 deleteAddressQuestion ()
 deleteAddress ()
 getInputField ($fieldName, $fieldConfig, $fieldValue= '')
 getSingleInputField ($fieldName, $fieldConfig, $fieldValue= '')
 getSelectInputField ($fieldName, $fieldConfig, $fieldValue= '')
 getCheckboxInputField ($fieldName, $fieldConfig, $fieldValue= '')
 checkAddressForm ()
 saveAddressData ($new=false, $addressType=0)
 parseFieldList ($dataArray)
 getAddresses ($userId, $addressType=0)

Public Attributes

 $prefixId = 'tx_commerce_pi4'
 $scriptRelPath = 'pi4/class.tx_commerce_pi4.php'
 $extKey = 'commerce'
 $imgFolder = ''
 $user = NULL
 $addresses = array()
 $formError = array()
 $fieldList = array()
 $sysMessage = ''
 $staticInfo

Member Function Documentation

tx_commerce_pi4::checkAddressForm  ) 
 

Reads in the complete configuration for a form, and parses the data that come from the piVars and checks if this values fit the configuration for the field. If errors occur, it writes it into a class var called formError. The key will be the name of the field and the value will be the error message.

Returns:
void

tx_commerce_pi4::deleteAddress  ) 
 

Deletes an address from the database. It doesn't deletes the dataset in real, but it set's the deleted flag like it's done inside TYPO3. This method has no params, because it get's his data from the piVars currently.

Returns:
void
Hook for deleting an address
Since:
03.08.2006
Author:
Volker Graubaum

tx_commerce_pi4::deleteAddressQuestion  ) 
 

Returns the html code for a confirmation if the user wants to delete one of his addresses.

Returns:
The html source with the delete confirmation form

tx_commerce_pi4::getAddresses userId,
addressType = 0
 

Get all addresses from the database that are assigned to the current user.

Parameters:
integer $userId: The UID of the user you want to have the addresses from
integer $addressType: The type of addresses you which to have (0 (default) means get all types)
Returns:
An array with addresses where the keys are the UIDs and the values are the complete addresses data

tx_commerce_pi4::getAddressForm action = 'new',
addressUid = NULL,
config
 

Returns the HTML form for a single address. The fields are fetched from tt_address and are configured in TS.

Parameters:
string $action: The action that should be performed (can be "new" or "edit")
integer $addressUid: The uid of the page where the addresses are stored
array $config: The configuration array for all fields
Returns:
The HTML code with the form for editing an address

tx_commerce_pi4::getCheckboxInputField fieldName,
fieldConfig,
fieldValue = ''
 

Returns a checkbox

Parameters:
string $fieldname: The name of the field
array $fieldConf: The configuration for this field (normally from TypoScript)
string $fieldValue: The current value of this field (Normally fetched from piVars)
Returns:
a single checkbox

tx_commerce_pi4::getInputField fieldName,
fieldConfig,
fieldValue = ''
 

Returns a single input form field. In fact this is just a switch between the specific methods.

Parameters:
string $fieldname: The name of the field
array $fieldConf: The configuration for this field (normally from TypoScript)
string $fieldValue: The current value of this field (Normally fetched from piVars)
Returns:
The result of the specific field methods (Normally an html string)

tx_commerce_pi4::getListing addressType = 0,
createHiddenFields = false,
hiddenFieldPrefix = ''
 

Returns the listing html of addresses.

Parameters:
integer $addressType: The type of addresses that should be returned. If this is 0 all types will be returned
Returns:
HTML with addresses

tx_commerce_pi4::getSelectInputField fieldName,
fieldConfig,
fieldValue = ''
 

Returns a selectbox

Parameters:
string $fieldname: The name of the field
array $fieldConf: The configuration for this field (normally from TypoScript)
string $fieldValue: The current value of this field (Normally fetched from piVars)
Returns:
Returns the html code for a select box with a set of options

tx_commerce_pi4::getSingleInputField fieldName,
fieldConfig,
fieldValue = ''
 

Returns a single textfield

Parameters:
string $fieldname: The name of the field
array $fieldConf: The configuration for this field (normally from TypoScript)
string $fieldValue: The current value of this field (Normally fetched from piVars)
Returns:
A single field with type = text

tx_commerce_pi4::init conf,
getAddresses = true
 

The initialization. This method has to be called before the magic can start... ;-)

Parameters:
array $conf: The TS configuration for this template
boolean 
getAddresses
If this is set to true, this method will fetch all addresses into
this->addresses (Default is true)
Returns:
void

tx_commerce_pi4::main content,
conf
 

Main method. Starts the magic...

Parameters:
string $content: The content of this plugin
array $conf: The TS configuration for this plugin
Returns:
The compiled content

tx_commerce_pi4::noUser  ) 
 

Is called whenever the address handling is called without a logged in fe_user. Currently this is just a dummy with no function.

TODO: Here we could return a template and / or call a hook

tx_commerce_pi4::parseFieldList dataArray  ) 
 

Creates a list of array keys where the last character is removed from it.

Parameters:
array $dataArray: The array where the keys should be cleaned
Returns:
An array with the cleaned arraykeys or the orginal data if it was no array

tx_commerce_pi4::saveAddressData new = false,
addressType = 0
 

Saves some data from the piVars as address into the database.

Parameters:
boolean $new: If this is true, a new address will be created, otherwise it searches for an existing dataset and updates it
integer $addressType: The type of the address that comes from the piVars
Returns:
void
Hook for processing the new/changed address
Since:
03.08.2006
Author:
Volker Graubaum


Member Data Documentation

tx_commerce_pi4::$addresses = array()
 

tx_commerce_pi4::$extKey = 'commerce'
 

tx_commerce_pi4::$fieldList = array()
 

tx_commerce_pi4::$formError = array()
 

tx_commerce_pi4::$imgFolder = ''
 

tx_commerce_pi4::$prefixId = 'tx_commerce_pi4'
 

tx_commerce_pi4::$scriptRelPath = 'pi4/class.tx_commerce_pi4.php'
 

tx_commerce_pi4::$staticInfo
 

tx_commerce_pi4::$sysMessage = ''
 

tx_commerce_pi4::$user = NULL
 


The documentation for this class was generated from the following file:
Generated on Sun Jan 13 23:12:24 2008 for tx_commerce by  doxygen 1.4.4