isFormBuilt() or $page->buildForm(); $pageName = $page->getAttribute('id'); $data =& $page->controller->container(); $data['values'][$pageName] = array_merge($data['values'][$pageName], $page->exportValues()); $data['valid'][$pageName] = $page->validate(); if (!$data['valid'][$pageName]) { return $page->handle('display'); } // get the element containing the upload $this->_initFile(); foreach ($page->_elements as $elem) { if ('file' == $elem->getType() && $elem->isUploadedFile()) { $data['values'][$pageName][$elem->getName()] = $this->file->handleUpload($elem->getValue()); } } // redirect to next page $next =& $page->controller->getPage($page->controller->getNextName($pageName)); $next->handle('jump'); } function _initFile() { if (!is_object($this->file)) { require_once('class/DB/ImageDB.php'); $this->file = new ImageDB(); } return true; } } ?>