fileName = $fileName; if (!BSApp::$input instanceof BSInput) { throw new Exception('BSApp::$input is not an instance of BSInput'); } $methods = get_class_methods($this); foreach ($methods as $name) { if (preg_match('/step([0-9]+)/', $name)) { $this->steps[] = $name; } } natsort($this->steps); $this->_runStep(BSApp::$input->inputClean('step', TYPE_UINT)); } /** * An abstract method that needs to be overridden by a subclass that * populates the page title * * @return string Returns the page title */ protected abstract function _pageTitle(); /** * Abstract method that will return link to the page after all the * steps are completed. This needs to provide it's own * * @return string Final page link */ protected abstract function _finalLink(); /** * Abstract method that prints out the first welcome screen that the * user sees when no step has been selected */ protected abstract function _welcomePage(); /** * Prints out the page header... you really don't do this more than * once */ protected function _setUp() { ?> <?= $this->_pageTitle() ?> _setUp(); $this->_welcomePage(); $this->_setDown(0); } else if (in_array("step$step", $this->steps)) { $this->_setUp(); $this->{"step$step"}(); $this->_setDown($step); } else { throw new Exception("step$step() does not exist in this module"); } } /** * Prints out the footer part of the page, and the appropriate forwarding * action button * * @param integer Step number */ protected function _setDown($step) { // this is the last step, print the final button if ($step == sizeof($this->steps)) { echo ''; } // just another step else { echo ''; } echo ' '; } } ?>