function displayPage($channel, $form) { $pageName = basename($_SERVER['PHP_SELF']); $agencyId = OA_Permission::getAgencyId(); // Obtain the needed data if (!empty($channel['affiliateid'])) { $aEntities = array('agencyid' => $agencyId, 'affiliateid' => $channel['affiliateid'], 'channelid' => $channel['channelid']); // Editing a channel at the publisher level; Only use the // channels at this publisher level for the navigation bar $aOtherChannels = Admin_DA::getChannels(array('publisher_id' => $channel['affiliateid'])); } else { $aEntities = array('agencyid' => $agencyId, 'channelid' => $channel['channelid']); // Editing a channel at the agency level; Only use the // channels at this agency level for the navigation bar $aOtherChannels = Admin_DA::getChannels(array('agency_id' => $agencyId, 'channel_type' => 'agency')); } //show header and breadcrumbs MAX_displayNavigationChannel($pageName, $aOtherChannels, $aEntities); //get template and display form $oTpl = new OA_Admin_Template('channel-edit.html'); $oTpl->assign('form', $form->serialize()); $oTpl->assign('formId', $form->getId()); $oTpl->display(); //show footer phpAds_PageFooter(); }
$translated_message = $translation->translate($GLOBALS['strChannelAclHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "channel-edit.php?" . (!empty($affiliateid) ? "affiliateid={$affiliateid}&" : "") . "channelid={$channelid}"), htmlspecialchars($doChannel->name))); OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0); // Redirect if (!empty($affiliateid)) { header("Location: channel-acl.php?affiliateid={$affiliateid}&channelid={$channelid}"); } else { header("Location: channel-acl.php?channelid={$channelid}"); } exit; } } } /*-------------------------------------------------------*/ /* HTML framework */ /*-------------------------------------------------------*/ MAX_displayNavigationChannel($pageName, $aOtherChannels, $aEntities); $aChannel = Admin_DA::getChannel($channelid); if (!isset($acl)) { $acl = Admin_DA::getChannelLimitations(array('channel_id' => $channelid)); // This array needs to be sorted by executionorder, this should ideally be done in SQL // When we move to DataObject this should be addressed ksort($acl); } if (!empty($affiliateid)) { $aParams = array('affiliateid' => $affiliateid, 'channelid' => $channelid); } else { $aParams = array('agencyid' => $agencyId, 'channelid' => $channelid); } MAX_displayAcls($acl, $aParams); echo "<br /><input type='submit' name='submit' value='{$GLOBALS['strSaveChanges']}' tabindex='" . $tabindex++ . "'></form>"; phpAds_PageFooter();