_formBuilt = true; // Here we get all page names in the controller $pages = array(); $myName = $current = $this->getAttribute('id'); while (null !== ($current = $this->controller->getPrevName($current))) { $pages[] = $current; } $pages = array_reverse($pages); $pages[] = $current = $myName; while (null !== ($current = $this->controller->getNextName($current))) { $pages[] = $current; } // Here we display buttons for all pages, the current one's is disabled foreach ($pages as $pageName) { $tabs[] = $this->createElement( 'submit', $this->getButtonName($pageName), ucfirst($pageName), array('class' => 'btn_link') + ($pageName == $myName? array('disabled' => 'disabled'): array()) ); } $this->addGroup($tabs, 'tabs', null, ' ', false); } function addGlobalSubmit() { $this->addElement('submit', $this->getButtonName('submit'), 'Save Changes', array('class' => 'bigred')); $this->setDefaultAction('submit'); } } ?>