if (isset($appendtype)) { $aZone['appendtype'] = $appendtype; } else { $aZone['appendtype'] = phpAds_ZoneAppendRaw; } //extract chainzone if (ereg("^zone:([0-9]+)\$", $aZone['chain'], $regs)) { $aZone['chainzone'] = $regs[1]; } else { $aZone['chainzone'] = ''; } /*-------------------------------------------------------*/ /* MAIN REQUEST PROCESSING */ /*-------------------------------------------------------*/ //build zone adv form $zoneForm = buildZoneForm($aZone, $oComponent); if ($zoneForm->validate()) { //process submitted values processForm($aZone, $zoneForm, $oComponent); } else { //either validation failed or form was not submitted, display the form displayPage($aZone, $zoneForm); } /*-------------------------------------------------------*/ /* Build form */ /*-------------------------------------------------------*/ function buildZoneForm($aZone, $oComponent = null) { $form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['SCRIPT_NAME']); $form->forceClientValidation(true); $form->addElement('hidden', 'zoneid', $aZone['zoneid']);
} else { $zone["zonename"] = ''; } $zone['zonename'] .= $GLOBALS['strDefault']; $zone['description'] = ''; $zone['width'] = '468'; $zone['height'] = '60'; $zone['delivery'] = phpAds_ZoneBanner; $zone['comments'] = null; } $zone['affiliateid'] = $affiliateid; /*-------------------------------------------------------*/ /* MAIN REQUEST PROCESSING */ /*-------------------------------------------------------*/ //build form $zoneForm = buildZoneForm($zone); if ($zoneForm->validate()) { //process submitted values $errors = processForm($zoneForm); if (!empty($errors)) { } } //display the page - show any validation errors that may have occured displayPage($zone, $zoneForm, $errors); /*-------------------------------------------------------*/ /* Build form */ /*-------------------------------------------------------*/ function buildZoneForm($zone) { global $conf; // Initialise Ad Networks