/** * execute these statements on object call * * @return void * @author Roland Lehmann <*****@*****.**> * @since 18.10.2010 */ public function init() { parent::init(); $preferences = array(); $urlParams = $this->getURLParams(); if ($urlParams['Action'] == 'addNewAddress') { $preferences['submitAction'] = 'addNewAddress/customHtmlFormSubmit'; } $this->registerCustomHtmlForm('SilvercartAddAddressForm', new SilvercartAddAddressForm($this, null, $preferences)); }
/** * handles the given action. If the action is a numeric value, an address is * requested. This method manipulates the handling for this case. * * @param SS_HTTPRequest $request Request * @param string $action Action * * @return string * * @author Sebastian Diel <*****@*****.**> * @since 04.03.2014 */ public function handleAction($request, $action) { if (!$this->hasMethod($request->param('Action'))) { $secondaryAction = $request->param('OtherID'); if ($this->hasMethod($secondaryAction) && $this->hasAction($secondaryAction)) { $result = $this->{$secondaryAction}($request); if (is_array($result)) { return $this->getViewer($this->action)->process($this->customise($result)); } else { return $result; } } elseif ($request->param('Action') == 'edit' && is_numeric($request->param('ID'))) { return $this->getViewer('index')->process($this); } } return parent::handleAction($request, $action); }
/** * Initialisiert das Formularobjekt. * * @return void * * @author Sascha Koehler <*****@*****.**>, Roland Lehmann <*****@*****.**> * @since 23.10.2010 */ public function init() { $this->registerCustomHtmlForm('SilvercartEditProfileForm', new SilvercartEditProfileForm($this)); parent::init(); }