_name = $name; $this->_type = $type; $this->_back = $back; $this->_next = $next; $this->_stateMachine = &$stateMachine; } /** * Given an CRM Form, jump to the previous page. * * @param CRM_Core_Form $page * * @return mixed * does a jump to the back state */ public function handleBackState(&$page) { if ($this->_type & self::START) { $page->handle('display'); } else { $back = &$page->controller->getPage($this->_back); return $back->handle('jump'); } } /** * Given an CRM Form, jump to the next page. * * @param CRM_Core_Form $page * * @return mixed * Does a jump to the nextstate */ public function handleNextState(&$page) { if ($this->_type & self::FINISH) { $page->handle('process'); } else { $next = &$page->controller->getPage($this->_next); return $next->handle('jump'); } } /** * Mark this page as valid for the QFC framework. * * @param array $data */ public function validate(&$data) { $data['valid'][$this->_name] = TRUE; } /** * Mark this page as invalid for the QFC framework. * * @param array $data */ public function invalidate(&$data) { $data['valid'][$this->_name] = NULL; } /** * Getter for name. * * @return string */ public function getName() { return $this->_name; } /** * Setter for name. * * @param string $name */ public function setName($name) { $this->_name = $name; } /** * Getter for type. * * @return int */ public function getType() { return $this->_type; } }