function do_edit() { // here we engage in some major evil. // we check for the subevent var // and subdispatch if appropriate. // // saves a little code-duplication (actually, a lot of code-duplication) // FIXME this is essentially a stub for the fieldset-delegation code. if ($this->oFieldset->getIsConditional()) { require_once 'fieldsets/conditional.inc.php'; $oSubDispatcher = new ConditionalFieldsetManagementDispatcher(); } else { require_once 'fieldsets/basic.inc.php'; $oSubDispatcher = new BasicFieldsetManagementDispatcher(); } $subevent_var = 'fieldset_action'; $subevent = KTUtil::arrayGet($_REQUEST, $subevent_var); if (!empty($subevent)) { // do nothing, since this will handle everything $this_url = KTUtil::addQueryStringSelf($this->meldPersistQuery("", "edit")); $oSubDispatcher->redispatch($subevent_var, null, $this, $this_url); exit(0); } else { // what we want is the "additional info" section $additional = $oSubDispatcher->describe_fieldset($this->oFieldset); } $oTemplate =& $this->oValidator->validateTemplate('ktcore/metadata/admin/edit'); $oTemplate->setData(array('context' => $this, 'fieldset_name' => $this->oFieldset->getName(), 'additional' => $additional)); return $oTemplate->render(); }
function predispatch() { // do the other stuff. parent::predispatch(); }