/** * The method to generate a plugin-style report XLS from an already * prepared statistics page OA_Admin_Statistics_Common object. */ function export() { // Prepare the report name // Get system navigation $oMenu = OA_Admin_Menu::singleton(); // Get section by pageId $oCurrentSection = $oMenu->get($this->oStatsController->pageId); if ($oCurrentSection == null) { phpAds_Die($GLOBALS['strErrorOccurred'], 'Menu system error: <strong>' . OA_Permission::getAccountType(true) . '::' . htmlspecialchars($ID) . '</strong> not found for the current user'); } // Get name $reportName = $oCurrentSection->getName(); $this->_name = $reportName; // Prepare the output writer for generation $reportFileName = 'Exported Statistics - ' . $reportName; if (!empty($this->oStatsController->aDates['day_begin'])) { $oStartDate = new Date($this->oStatsController->aDates['day_begin']); $reportFileName .= ' from ' . $oStartDate->format($GLOBALS['date_format']); } if (!empty($this->oStatsController->aDates['day_end'])) { $oEndDate = new Date($this->oStatsController->aDates['day_end']); $reportFileName .= ' to ' . $oEndDate->format($GLOBALS['date_format']); } $reportFileName .= '.xls'; $this->_oReportWriter->openWithFilename($reportFileName); // Get the header and data arrays from the same statistics controllers // that prepare stats for the user interface stats pages list($aHeaders, $aData) = $this->getHeadersAndDataFromStatsController(null, $this->oStatsController); // Add the worksheet $name = ucfirst($this->oStatsController->entity) . ' ' . ucfirst($this->oStatsController->breakdown); $this->createSubReport($reportName, $aHeaders, $aData); // Close the report writer and send the report to the user $this->_oReportWriter->closeAndSend(); }
public function startMVC() { $oRequest = new OX_Admin_UI_Controller_Request(); //setup controller $oController = $this->createController(); ob_start(); $oController->process($oRequest); $actionContent = ob_get_contents(); ob_end_clean(); //create view if ($oController->hasViewScript()) { $view = $this->createView($oController->getAction()); //pass model variables to view $oController->assignModelToView($view); } //LAYOUT // setup dummy installer section display $oMenu = OA_Admin_Menu::singleton(); $oMenu->add(new OA_Admin_Menu_Section('install', '', '')); if ($oController->hasLayout()) { //layout $oPageHeader = $oController->getModelProperty('pageHeader'); phpAds_PageHeader('install', $oPageHeader, $imgPath, false, true, false); } if ($view) { $view->display(); } echo $actionContent; if ($oController->hasLayout()) { phpAds_PageFooter($imgPath); // Do not remove. This is a marker that AJAX response parsers look for to // determine whether the response did not redirect to the installer. echo "<!-- install -->"; } }
function test_cacheMergedMenu() { Mock::generatePartial('OX_Plugin_ComponentGroupManager', $oMockGroupManager = 'OX_Plugin_ComponentGroupManager' . rand(), array('mergeMenu')); $oGroupManager = new $oMockGroupManager($this); $oGroupManager->setReturnValue('mergeMenu', true); Mock::generatePartial('OX_Extension_admin', $oMockExtensionManager = 'OX_Extension_admin' . rand(), array('_getMenuObjectForAccount', '_getGroupManagerObject')); $oMockExtensionManager = new $oMockExtensionManager($this); $oMenu = new OA_Admin_Menu('TEST'); $oMenu->add(new OA_Admin_Menu_Section("test", 'test root', "test-root.php", false, "")); $oMockExtensionManager->setReturnValue('_getMenuObjectForAccount', $oMenu); $oMockExtensionManager->setReturnValue('_getGroupManagerObject', $oGroupManager); OA_Admin_Menu::_clearCache('TEST'); $this->assertTrue($oMockExtensionManager->_cacheMergedMenu('TEST')); $oMenuCache = $oMenu->_loadFromCache('TEST'); $this->assertTrue(is_a($oMenuCache, 'OA_Admin_Menu')); $this->assertEqual(count($oMenuCache->aAllSections), 1); $this->assertTrue(array_key_exists('test', $oMenuCache->aAllSections)); OA_Admin_Menu::_clearCache('TEST'); TestEnv::restoreConfig(); }
/** * Returns the instance of menu. Subsequent calls return the same object. * * @return OA_Admin_Menu */ function &singleton() { $accountType = OA_Permission::getAccountType(); if (isset($GLOBALS['_MAX']['MENU_OBJECT'][$accountType])) { $oMenu =& $GLOBALS['_MAX']['MENU_OBJECT'][$accountType]; } elseif ($GLOBALS['_MAX']['CONF']['debug']['production'] != 0 && ($oMenu = OA_Admin_Menu::_loadFromCache($accountType))) { $GLOBALS['_MAX']['MENU_OBJECT'][$accountType] =& $oMenu; } else { $oMenu = new OA_Admin_Menu(); if (empty($oMenu->aAllSections)) { include_once MAX_PATH . '/lib/OA/Admin/Menu/config.php'; $oMenu = _buildNavigation(OA_Permission::getAccountType()); } require_once LIB_PATH . '/Plugin/ComponentGroupManager.php'; $oPluginManager = new OX_Plugin_ComponentGroupManager(); $oPluginManager->mergeMenu($oMenu, $accountType); $GLOBALS['_MAX']['MENU_OBJECT'][$accountType] =& $oMenu; $oMenu->_saveToCache($accountType); } // Filter against user-account-preferences... return $oMenu; }
// Dashboard Settings $aElements += array('authentication_type' => array('authentication' => 'type')); // Create a new settings object, and save the settings! $oSettings = new OA_Admin_Settings(); $result = $oSettings->processSettingsFromForm($aElements); if ($result) { // Delete all the sessions if the UI is disabled // to force all the users to be logged out if (!$GLOBALS['ui_enabled']) { $doSession = OA_Dal::factoryDO('session'); $doSession->whereAdd('1=1'); $doSession->delete(DB_DATAOBJECT_WHEREADD_ONLY); } // Rebuild the menu because the Enable Dashboard setting could been changed OA_Admin_Menu::_clearCache(OA_ACCOUNT_ADMIN); OA_Admin_Menu::_clearCache(OA_ACCOUNT_MANAGER); // Queue confirmation message $setPref = $oOptions->getSettingsPreferences($prefSection); $title = $setPref[$prefSection]['name']; $translation = new OX_Translation(); $translated_message = $translation->translate($GLOBALS['strXSettingsHaveBeenUpdated'], array(htmlspecialchars($title))); OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0); // The settings configuration file was written correctly, OX_Admin_Redirect::redirect(basename($_SERVER['SCRIPT_NAME'])); } // Could not write the settings configuration file, store this // error message and continue $aErrormessage[0][] = $strUnableToWriteConfig; } // Set the correct section of the settings pages and display the drop-down menu $setPref = $oOptions->getSettingsPreferences($prefSection);
OA_Permission::enforceAccountPermission(OA_ACCOUNT_ADVERTISER, OA_PERM_SUPER_ACCOUNT); OA_Permission::enforceAccessToObject('clients', $clientid); /*-------------------------------------------------------*/ /* Store preferences */ /*-------------------------------------------------------*/ $session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid; phpAds_SessionDataStore(); /*-------------------------------------------------------*/ /* HTML framework */ /*-------------------------------------------------------*/ addPageTools($clientid); addAdvertiserPageToolsAndShortcuts($clientid); if (!empty($clientid)) { $oHeaderModel = buildAdvertiserHeaderModel($clientid); if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) { OA_Admin_Menu::setAdvertiserPageContext($clientid, 'advertiser-access.php'); phpAds_PageHeader("4.1.5", $oHeaderModel); } else { phpAds_PageHeader('2.3', $oHeaderModel); } } $tabindex = 1; /*-------------------------------------------------------*/ /* Main code */ /*-------------------------------------------------------*/ require_once MAX_PATH . '/lib/OA/Admin/Template.php'; $oTpl = new OA_Admin_Template('advertiser-access.html'); // Ensure that any template variables for the authentication plugin are set $oPlugin = OA_Auth::staticGetAuthPlugin(); $oPlugin->setTemplateVariables($oTpl); $oTpl->assign('infomessage', OA_Session::getMessage());
/** * Process input from user and creates/upgrades DB etc.... * * @param OA_Admin_UI_Component_Form $oForm * @param OX_Admin_UI_Install_Wizard $oWizard */ protected function processDatabaseAction($oForm, $oWizard) { $oUpgrader = $this->getUpgrader(); $upgraderSuccess = false; $aDbConfig = $oForm->populateDbConfig(); if ($oUpgrader->canUpgradeOrInstall()) { $installStatus = $oUpgrader->existing_installation_status; define('DISABLE_ALL_EMAILS', 1); OA_Permission::switchToSystemProcessUser('Installer'); if ($installStatus == OA_STATUS_NOT_INSTALLED) { if ($oUpgrader->install($aDbConfig)) { $message = $GLOBALS['strDBInstallSuccess']; $upgraderSuccess = true; } } else { if ($oUpgrader->upgrade($oUpgrader->package_file)) { // Timezone support - hack if ($oUpgrader->versionInitialSchema['tables_core'] < 538 && empty($aDbConfig['noTzAlert'])) { OA_Dal_ApplicationVariables::set('utc_update', OA::getNowUTC()); } // Clear the menu cache to built a new one with the new settings OA_Admin_Menu::_clearCache(OA_ACCOUNT_ADMIN); OA_Admin_Menu::_clearCache(OA_ACCOUNT_MANAGER); OA_Admin_Menu::_clearCache(OA_ACCOUNT_ADVERTISER); OA_Admin_Menu::_clearCache(OA_ACCOUNT_TRAFFICKER); OA_Admin_Menu::singleton(); $message = $GLOBALS['strDBUpgradeSuccess']; $upgraderSuccess = true; } } OA_Permission::switchToSystemProcessUser(); //get back to normal user previously logged in } else { if ($oUpgrader->existing_installation_status == OA_STATUS_CURRENT_VERSION) { $upgraderSuccess = true; //rare but can occur if DB has been installed and user revisits the screen } } $dbSuccess = $upgraderSuccess && !$oUpgrader->oLogger->errorExists; if ($dbSuccess) { //show success status OA_Admin_UI::getInstance()->queueMessage($message, 'global', 'info'); } else { //sth went wrong, display messages from upgrader $aMessages = OX_Admin_UI_Install_InstallUtils::getMessagesWithType($oUpgrader->getMessages()); $this->setModelProperty('aMessages', $aMessages); } return $dbSuccess; }
// Security check OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_TRAFFICKER); OA_Permission::enforceAccountPermission(OA_ACCOUNT_TRAFFICKER, OA_PERM_SUPER_ACCOUNT); OA_Permission::enforceAccessToObject('affiliates', $affiliateid); /*-------------------------------------------------------*/ /* Store preferences */ /*-------------------------------------------------------*/ $session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid; phpAds_SessionDataStore(); /*-------------------------------------------------------*/ /* HTML framework */ /*-------------------------------------------------------*/ $oHeaderModel = MAX_displayWebsiteBreadcrumbs($affiliateid); if (!empty($affiliateid)) { if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) { OA_Admin_Menu::setPublisherPageContext($affiliateid, 'affiliate-access.php'); addPageTools($affiliateid); addWebsitePageTools($affiliateid); phpAds_PageHeader("4.2.7", $oHeaderModel); phpAds_ShowSections(array("4.2.2", "4.2.3", "4.2.4", "4.2.5", "4.2.7")); } else { addPageTools($affiliateid); phpAds_PageHeader('2.3', $oHeaderModel); $sections = array('2.1'); if (OA_Permission::hasPermission(OA_PERM_ZONE_INVOCATION)) { $sections[] = '2.2'; } $sections[] = '2.3'; phpAds_ShowSections($sections); } } else {
function _buildNavigation($accountType) { $oMenu = new OA_Admin_Menu(); $aConf = $GLOBALS['_MAX']['CONF']; switch ($accountType) { case OA_ACCOUNT_ADMIN: if ($GLOBALS['_MAX']['CONF']['ui']['dashboardEnabled']) { $oMenu->add(new OA_Admin_Menu_Section("dashboard", 'Home', "dashboard.php", false, "")); } // Note: The stats screens haven't been updated to use the new menuing names... $oMenu->add(new OA_Admin_Menu_Section("2", 'Stats', "stats.php", false, "statistics")); $oMenu->addTo("2", new OA_Admin_Menu_Section("2.1", 'ClientsAndCampaigns', "stats.php?1=1", false, "statistics/advertisersAndCampaigns")); $oMenu->addTo("2.1", new OA_Admin_Menu_Section("2.1.1", 'ClientHistory', "stats.php?entity=advertiser&breakdown=history&clientid={clientid}", false, "statistics/advertiserHistory")); $oMenu->addTo("2.1.1", new OA_Admin_Menu_Section("2.1.1.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&day={day}", false, "statistics/advertiserHistory/daily")); $oMenu->addTo("2.1", new OA_Admin_Menu_Section("2.1.2", 'Campaigns', "stats.php?entity=advertiser&breakdown=campaigns&clientid={clientid}", false, "statistics/campaignOverview")); $oMenu->addTo("2.1.2", new OA_Admin_Menu_Section("2.1.2.1", 'CampaignHistory', "stats.php?entity=campaign&breakdown=history&clientid={clientid}&campaignid={campaignid}", false, "statistics/campaignHistory")); $oMenu->addTo("2.1.2.1", new OA_Admin_Menu_Section("2.1.2.1.1", 'DailyStats', "stats.php?entity=campaign&breakdown=daily&clientid={clientid}&campaignid={campaignid}&day={day}", false, "statistics/campaignHistory/daily")); $oMenu->addTo("2.1.2", new OA_Admin_Menu_Section("2.1.2.2", 'Banners', "stats.php?entity=campaign&breakdown=banners&clientid={clientid}&campaignid={campaignid}", false, "statistics/bannerOverview")); $oMenu->addTo("2.1.2.2", new OA_Admin_Menu_Section("2.1.2.2.1", 'BannerHistory', "stats.php?entity=banner&breakdown=history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "statistics/bannerHistory")); $oMenu->addTo("2.1.2.2.1", new OA_Admin_Menu_Section("2.1.2.2.1.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&day={day}", false, "statistics/bannerHistory/daily")); $oMenu->addTo("2.1.2.2", new OA_Admin_Menu_Section("2.1.2.2.2", 'PublisherDistribution', "stats.php?entity=banner&breakdown=affiliates&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "statistics/publisherDistribution")); $oMenu->addTo("2.1.2.2.2", new OA_Admin_Menu_Section("2.1.2.2.2.1", 'DistributionHistoryWebsite', "stats.php?entity=banner&breakdown=affiliate-history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/history")); $oMenu->addTo("2.1.2.2.2.1", new OA_Admin_Menu_Section("2.1.2.2.2.1.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("2.1.2.2.2", new OA_Admin_Menu_Section("2.1.2.2.2.2", 'DistributionHistoryZone', "stats.php?entity=banner&breakdown=zone-history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("2.1.2.2.2.2", new OA_Admin_Menu_Section("2.1.2.2.2.2.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("2.1.2", new OA_Admin_Menu_Section("2.1.2.3", 'PublisherDistribution', "stats.php?entity=campaign&breakdown=affiliates&clientid={clientid}&campaignid={campaignid}", false, "statistics/publisherDistribution")); $oMenu->addTo("2.1.2.3", new OA_Admin_Menu_Section("2.1.2.3.1", 'DistributionHistoryWebsite', "stats.php?entity=campaign&breakdown=affiliate-history&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/history")); $oMenu->addTo("2.1.2.3.1", new OA_Admin_Menu_Section("2.1.2.3.1.1", 'DailyStats', "stats.php?entity=campaign&breakdown=daily&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("2.1.2.3", new OA_Admin_Menu_Section("2.1.2.3.2", 'DistributionHistoryZone', "stats.php?entity=campaign&breakdown=zone-history&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("2.1.2.3.2", new OA_Admin_Menu_Section("2.1.2.3.2.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("2.1", new OA_Admin_Menu_Section("2.1.3", 'PublisherDistribution', "stats.php?entity=advertiser&breakdown=affiliates&clientid={clientid}", false, "statistics/publisherDistribution")); $oMenu->addTo("2.1.3", new OA_Admin_Menu_Section("2.1.3.1", 'DistributionHistoryWebsite', "stats.php?entity=advertiser&breakdown=affiliate-history&clientid={clientid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/history")); $oMenu->addTo("2.1.3.1", new OA_Admin_Menu_Section("2.1.3.1.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("2.1.3", new OA_Admin_Menu_Section("2.1.3.2", 'DistributionHistoryZone', "stats.php?entity=advertiser&breakdown=zone-history&clientid={clientid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("2.1.3.2", new OA_Admin_Menu_Section("2.1.3.2.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("2", new OA_Admin_Menu_Section("2.4", 'AffiliatesAndZones', "stats.php?entity=global&breakdown=affiliates", false, "statistics/publishersAndZones")); $oMenu->addTo("2.4", new OA_Admin_Menu_Section("2.4.1", 'AffiliateHistory', "stats.php?entity=affiliate&breakdown=history&affiliateid={affiliateid}", false, "statistics/publisherHistory")); $oMenu->addTo("2.4.1", new OA_Admin_Menu_Section("2.4.1.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&day={day}", false, "statistics/publisherHistory/daily")); $oMenu->addTo("2.4", new OA_Admin_Menu_Section("2.4.2", 'Zones', "stats.php?entity=affiliate&breakdown=zones&affiliateid={affiliateid}", false, "statistics/zoneOverview")); $oMenu->addTo("2.4.2", new OA_Admin_Menu_Section("2.4.2.1", 'ZoneHistory', "stats.php?entity=zone&breakdown=history&affiliateid={affiliateid}&zoneid={zoneid}", false, "statistics/zoneHistory")); $oMenu->addTo("2.4.2.1", new OA_Admin_Menu_Section("2.4.2.1.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&day={day}", false, "statistics/zoneHistory/daily")); $oMenu->addTo("2.4.2", new OA_Admin_Menu_Section("2.4.2.2", 'CampaignDistribution', "stats.php?entity=zone&breakdown=campaigns&affiliateid={affiliateid}&zoneid={zoneid}", false, "statistics/campaignDistribution")); $oMenu->addTo("2.4.2.2", new OA_Admin_Menu_Section("2.4.2.2.1", 'DistributionHistoryCampaign', "stats.php?entity=zone&breakdown=campaign-history&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}", true, "statistics/campaignDistribution/history")); $oMenu->addTo("2.4.2.2.1", new OA_Admin_Menu_Section("2.4.2.2.1.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&day={day}", false, "statistics/campaignDistribution/history/daily")); $oMenu->addTo("2.4.2.2", new OA_Admin_Menu_Section("2.4.2.2.2", 'DistributionHistoryBanner', "stats.php?entity=zone&breakdown=banner-history&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&bannerid={bannerid}", true)); $oMenu->addTo("2.4.2.2.2", new OA_Admin_Menu_Section("2.4.2.2.2.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&bannerid={bannerid}&day={day}")); $oMenu->addTo("2.4", new OA_Admin_Menu_Section("2.4.3", 'CampaignDistribution', "stats.php?entity=affiliate&breakdown=campaigns&affiliateid={affiliateid}", false, "statistics/campaignDistribution")); $oMenu->addTo("2.4.3", new OA_Admin_Menu_Section("2.4.3.1", 'DistributionHistoryCampaign', "stats.php?entity=affiliate&breakdown=campaign-history&affiliateid={affiliateid}&campaignid={campaignid}", true, "statistics/campaignDistribution/history")); $oMenu->addTo("2.4.3.1", new OA_Admin_Menu_Section("2.4.3.1.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&campaignid={campaignid}&day={day}", false, "statistics/campaignDistribution/history/daily")); $oMenu->addTo("2.4.3", new OA_Admin_Menu_Section("2.4.3.2", 'DistributionHistoryBanner', "stats.php?entity=affiliate&breakdown=banner-history&affiliateid={affiliateid}&campaignid={campaignid}&bannerid={bannerid}", true)); $oMenu->addTo("2.4.3.2", new OA_Admin_Menu_Section("2.4.3.2.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&campaignid={campaignid}&bannerid={bannerid}&day={day}")); $oMenu->addTo("2", new OA_Admin_Menu_Section("2.2", 'GlobalHistory', "stats.php?entity=global&breakdown=history", false, "statistics/global")); $oMenu->addTo("2.2", new OA_Admin_Menu_Section("2.2.1", 'DailyStats', "stats.php?entity=global&breakdown=daily&day={day}", false, "statistics/global/daily")); $oMenu->addTo("2", new OA_Admin_Menu_Section("report-index", 'AdvancedReports', "report-index.php", false, "statistics")); $oMenu->add(new OA_Admin_Menu_Section("inventory", 'Adminstration', "agency-index.php", false, "inventory")); $oMenu->addTo("inventory", new OA_Admin_Menu_Section("agency-index", 'AgencyManagement', "agency-index.php", false, "settings/agencyManagement")); $oMenu->addTo("agency-index", new OA_Admin_Menu_Section("agency-edit_new", 'AddAgency', "agency-edit.php", true, "settings/agencyManagement/addagency")); $oMenu->addTo("agency-index", new OA_Admin_Menu_Section("agency-edit", 'AgencyProperties', "agency-edit.php?agencyid={agencyid}", false, "settings/agencyManagement/editagency")); $oMenu->addTo("agency-index", new OA_Admin_Menu_Section("agency-access", 'UserAccess', "agency-access.php?agencyid={agencyid}", false, "inventory/directSelection")); if (empty($aConf['ui']['disableDirectSelection'])) { $oMenu->addTo("inventory", new OA_Admin_Menu_Section("admin-generate", 'GenerateBannercode', "admin-generate.php")); } $oMenu->addTo("inventory", new OA_Admin_Menu_Section("admin-access", 'AdminAccess', "admin-access.php")); $oMenu->addTo("admin-access", new OA_Admin_Menu_Section("admin-user", 'AdminAccess', "admin-user.php?userid={userid}")); $oMenu->add(new OA_Admin_Menu_Section("account-index", 'Preferences', "account-index.php", false, "settings/preferences")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("account-user-index", 'UserPreferences', "account-user-index.php", false, "")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("account-preferences-index", 'AccountPreferences', "account-preferences-index.php", false, "settings/preferences")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("userlog-index", 'UserLog', "userlog-index.php", false, "settings/userLog")); $oMenu->addTo("userlog-index", new OA_Admin_Menu_Section("userlog-details", 'UserLogDetails', "userlog-audit-detailed.php", false, "settings/userLog/details")); $oMenu->add(new OA_Admin_Menu_Section("configuration", 'Configuration', "account-settings-index.php", false, "settings")); $oMenu->addTo("configuration", new OA_Admin_Menu_Section("account-settings-index", 'GlobalSettings', "account-settings-index.php", false, "")); $oMenu->addTo("configuration", new OA_Admin_Menu_Section("maintenance-index", 'Maintenance', "maintenance-index.php", false, "settings/maintenance")); $oMenu->addTo("configuration", new OA_Admin_Menu_Section("updates-index", 'ProductUpdates', "updates-product.php", false, "settings/productUpdates")); $oMenu->add(new OA_Admin_Menu_Section("plugin-index", 'Plugins', "plugin-index.php")); break; case OA_ACCOUNT_MANAGER: if ($GLOBALS['_MAX']['CONF']['ui']['dashboardEnabled'] && $aConf['sync']['checkForUpdates']) { $oMenu->add(new OA_Admin_Menu_Section("dashboard", 'Home', "dashboard.php", false, "dashboard")); } // Note: The stats screens haven't been updated to use the new menuing names... $oMenu->add(new OA_Admin_Menu_Section("2", 'Stats', "stats.php", false, "statistics")); $oMenu->addTo("2", new OA_Admin_Menu_Section("2.1", 'ClientsAndCampaigns', "stats.php?1=1", false, "statistics/advertisersAndCampaigns")); $oMenu->addTo("2.1", new OA_Admin_Menu_Section("2.1.1", 'ClientHistory', "stats.php?entity=advertiser&breakdown=history&clientid={clientid}", false, "statistics/advertiserHistory")); $oMenu->addTo("2.1.1", new OA_Admin_Menu_Section("2.1.1.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&day={day}", false, "statistics/advertiserHistory/daily")); $oMenu->addTo("2.1", new OA_Admin_Menu_Section("2.1.2", 'Campaigns', "stats.php?entity=advertiser&breakdown=campaigns&clientid={clientid}", false, "statistics/campaignOverview")); $oMenu->addTo("2.1.2", new OA_Admin_Menu_Section("2.1.2.1", 'CampaignHistory', "stats.php?entity=campaign&breakdown=history&clientid={clientid}&campaignid={campaignid}", false, "statistics/campaignHistory")); $oMenu->addTo("2.1.2.1", new OA_Admin_Menu_Section("2.1.2.1.1", 'DailyStats', "stats.php?entity=campaign&breakdown=daily&clientid={clientid}&campaignid={campaignid}&day={day}", false, "statistics/campaignHistory/daily")); $oMenu->addTo("2.1.2", new OA_Admin_Menu_Section("2.1.2.2", 'Banners', "stats.php?entity=campaign&breakdown=banners&clientid={clientid}&campaignid={campaignid}", false, "statistics/bannerOverview")); $oMenu->addTo("2.1.2.2", new OA_Admin_Menu_Section("2.1.2.2.1", 'BannerHistory', "stats.php?entity=banner&breakdown=history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "statistics/bannerHistory")); $oMenu->addTo("2.1.2.2.1", new OA_Admin_Menu_Section("2.1.2.2.1.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&day={day}", false, "statistics/bannerHistory/daily")); $oMenu->addTo("2.1.2.2", new OA_Admin_Menu_Section("2.1.2.2.2", 'PublisherDistribution', "stats.php?entity=banner&breakdown=affiliates&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "statistics/publisherDistribution")); $oMenu->addTo("2.1.2.2.2", new OA_Admin_Menu_Section("2.1.2.2.2.1", 'DistributionHistoryWebsite', "stats.php?entity=banner&breakdown=affiliate-history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/history")); $oMenu->addTo("2.1.2.2.2.1", new OA_Admin_Menu_Section("2.1.2.2.2.1.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("2.1.2.2.2", new OA_Admin_Menu_Section("2.1.2.2.2.2", 'DistributionHistoryZone', "stats.php?entity=banner&breakdown=zone-history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("2.1.2.2.2.2", new OA_Admin_Menu_Section("2.1.2.2.2.2.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("2.1.2", new OA_Admin_Menu_Section("2.1.2.3", 'PublisherDistribution', "stats.php?entity=campaign&breakdown=affiliates&clientid={clientid}&campaignid={campaignid}", false, "statistics/publisherDistribution")); $oMenu->addTo("2.1.2.3", new OA_Admin_Menu_Section("2.1.2.3.1", 'DistributionHistoryWebsite', "stats.php?entity=campaign&breakdown=affiliate-history&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/history")); $oMenu->addTo("2.1.2.3.1", new OA_Admin_Menu_Section("2.1.2.3.1.1", 'DailyStats', "stats.php?entity=campaign&breakdown=daily&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("2.1.2.3", new OA_Admin_Menu_Section("2.1.2.3.2", 'DistributionHistoryZone', "stats.php?entity=campaign&breakdown=zone-history&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("2.1.2.3.2", new OA_Admin_Menu_Section("2.1.2.3.2.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("2.1", new OA_Admin_Menu_Section("2.1.3", 'PublisherDistribution', "stats.php?entity=advertiser&breakdown=affiliates&clientid={clientid}", false, "statistics/publisherDistribution")); $oMenu->addTo("2.1.3", new OA_Admin_Menu_Section("2.1.3.1", 'DistributionHistoryWebsite', "stats.php?entity=advertiser&breakdown=affiliate-history&clientid={clientid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/history")); $oMenu->addTo("2.1.3.1", new OA_Admin_Menu_Section("2.1.3.1.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("2.1.3", new OA_Admin_Menu_Section("2.1.3.2", 'DistributionHistoryZone', "stats.php?entity=advertiser&breakdown=zone-history&clientid={clientid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("2.1.3.2", new OA_Admin_Menu_Section("2.1.3.2.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("2", new OA_Admin_Menu_Section("2.2", 'GlobalHistory', "stats.php?entity=global&breakdown=history", false, "statistics/global")); $oMenu->addTo("2.2", new OA_Admin_Menu_Section("2.2.1", 'DailyStats', "stats.php?entity=global&breakdown=daily&day={day}", false, "statistics/global/daily")); $oMenu->addTo("2", new OA_Admin_Menu_Section("2.4", 'AffiliatesAndZones', "stats.php?entity=global&breakdown=affiliates", false, "statistics/publishersAndZones")); $oMenu->addTo("2.4", new OA_Admin_Menu_Section("2.4.1", 'AffiliateHistory', "stats.php?entity=affiliate&breakdown=history&affiliateid={affiliateid}", false, "statistics/publisherHistory")); $oMenu->addTo("2.4.1", new OA_Admin_Menu_Section("2.4.1.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&day={day}", false, "statistics/publisherHistory/daily")); $oMenu->addTo("2.4", new OA_Admin_Menu_Section("2.4.2", 'Zones', "stats.php?entity=affiliate&breakdown=zones&affiliateid={affiliateid}", false, "statistics/zoneOverview")); $oMenu->addTo("2.4.2", new OA_Admin_Menu_Section("2.4.2.1", 'ZoneHistory', "stats.php?entity=zone&breakdown=history&affiliateid={affiliateid}&zoneid={zoneid}", false, "statistics/zoneHistory")); $oMenu->addTo("2.4.2.1", new OA_Admin_Menu_Section("2.4.2.1.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&day={day}", false, "statistics/zoneHistory/daily")); $oMenu->addTo("2.4.2", new OA_Admin_Menu_Section("2.4.2.2", 'CampaignDistribution', "stats.php?entity=zone&breakdown=campaigns&affiliateid={affiliateid}&zoneid={zoneid}", false, "statistics/campaignDistribution")); $oMenu->addTo("2.4.2.2", new OA_Admin_Menu_Section("2.4.2.2.1", 'DistributionHistoryCampaign', "stats.php?entity=zone&breakdown=campaign-history&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}", true, "statistics/campaignDistribution/history")); $oMenu->addTo("2.4.2.2.1", new OA_Admin_Menu_Section("2.4.2.2.1.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&day={day}", false, "statistics/campaignDistribution/history/daily")); $oMenu->addTo("2.4.2.2", new OA_Admin_Menu_Section("2.4.2.2.2", 'DistributionHistoryBanner', "stats.php?entity=zone&breakdown=banner-history&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&bannerid={bannerid}", true)); $oMenu->addTo("2.4.2.2.2", new OA_Admin_Menu_Section("2.4.2.2.2.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&bannerid={bannerid}&day={day}")); $oMenu->addTo("2.4", new OA_Admin_Menu_Section("2.4.3", 'CampaignDistribution', "stats.php?entity=affiliate&breakdown=campaigns&affiliateid={affiliateid}", false, "statistics/campaignDistribution")); $oMenu->addTo("2.4.3", new OA_Admin_Menu_Section("2.4.3.1", 'DistributionHistoryCampaign', "stats.php?entity=affiliate&breakdown=campaign-history&affiliateid={affiliateid}&campaignid={campaignid}", true, "statistics/campaignDistribution/history")); $oMenu->addTo("2.4.3.1", new OA_Admin_Menu_Section("2.4.3.1.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&campaignid={campaignid}&day={day}", false, "statistics/campaignDistribution/history/daily")); $oMenu->addTo("2.4.3", new OA_Admin_Menu_Section("2.4.3.2", 'DistributionHistoryBanner', "stats.php?entity=affiliate&breakdown=banner-history&affiliateid={affiliateid}&campaignid={campaignid}&bannerid={bannerid}", true)); $oMenu->addTo("2.4.3.2", new OA_Admin_Menu_Section("2.4.3.2.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&campaignid={campaignid}&bannerid={bannerid}&day={day}")); $oMenu->addTo("2", new OA_Admin_Menu_Section("report-index", 'AdvancedReports', "report-index.php", false, "statistics")); $oMenu->add(new OA_Admin_Menu_Section("inventory", 'Adminstration', "advertiser-index.php", false, "")); $oMenu->addTo("inventory", new OA_Admin_Menu_Section("advertiser-index", 'Clients', "advertiser-index.php", false, "inventory", null, 1, false, 'g_adv')); $oMenu->addTo("advertiser-index", new OA_Admin_Menu_Section("advertiser-edit_new", 'AddClient', "advertiser-edit.php", true, "inventory/advertiserAndCampaings/addAdvertiser")); $oMenu->addTo("advertiser-index", new OA_Admin_Menu_Section("advertiser-edit", 'ClientProperties', "advertiser-edit.php?clientid={clientid}", false, "inventory/advertiserAndCampaings/editAdvertiser")); if ($aConf['logging']['trackerImpressions']) { $oMenu->addTo("advertiser-index", new OA_Admin_Menu_Section("advertiser-trackers", 'Trackers', "advertiser-trackers.php?clientid={clientid}", false, "inventory/advertisersAndCampaigns/trackers")); $oMenu->addTo("advertiser-trackers", new OA_Admin_Menu_Section("tracker-edit_new", 'AddTracker', "tracker-edit.php?clientid={clientid}", true, "inventory/advertisersAndCampaigns/trackers/addTracker")); $oMenu->addTo("advertiser-trackers", new OA_Admin_Menu_Section("tracker-edit", 'TrackerProperties', "tracker-edit.php?clientid={clientid}&trackerid={trackerid}", false, "inventory/advertisersAndCampaigns/trackers/editTracker")); $oMenu->addTo("advertiser-trackers", new OA_Admin_Menu_Section("tracker-campaigns", 'LinkedCampaigns', "tracker-campaigns.php?clientid={clientid}&trackerid={trackerid}", false, "inventory/advertisersAndCampaigns/trackers/editTracker/linkedCampaigns")); $oMenu->addTo("advertiser-trackers", new OA_Admin_Menu_Section("tracker-variables", 'Variables', "tracker-variables.php?clientid={clientid}&trackerid={trackerid}", false, "inventory/advertisersAndCampaigns/trackers/editTracker/variables")); $oMenu->addTo("advertiser-trackers", new OA_Admin_Menu_Section("tracker-append", 'AppendTrackerCode', "tracker-append.php?clientid={clientid}&trackerid={trackerid}", false, "inventory/advertisersAndCampaigns/trackers/editTracker/appendCode")); $oMenu->addTo("advertiser-trackers", new OA_Admin_Menu_Section("tracker-invocation", 'Invocationcode', "tracker-invocation.php?clientid={clientid}&trackerid={trackerid}", false, "inventory/advertisersAndCampaigns/trackers/editTracker/invocationCode")); } $oMenu->addTo("advertiser-index", new OA_Admin_Menu_Section("advertiser-access", 'UserAccess', "advertiser-access.php?clientid={clientid}", false, "")); $oMenu->addTo("inventory", new OA_Admin_Menu_Section("advertiser-campaigns", 'Campaigns', "advertiser-campaigns.php", false, "inventory/advertiserAndCampaings/campaigns", null, 1, false, 'g_adv')); $oMenu->addTo("advertiser-campaigns", new OA_Admin_Menu_Section("campaign-edit_new", 'AddCampaign', "campaign-edit.php?clientid={clientid}", true, "inventory/advertiserAndCampaings/campaigns/addCampaign")); $oMenu->addTo("advertiser-campaigns", new OA_Admin_Menu_Section("campaign-edit", 'CampaignProperties', "campaign-edit.php?clientid={clientid}&campaignid={campaignid}", false, "inventory/advertisersAndCampaigns/campaigns/editCampaign")); $oMenu->addTo("advertiser-campaigns", new OA_Admin_Menu_Section("campaign-zone", 'LinkedZones', "campaign-zone.php?clientid={clientid}&campaignid={campaignid}", false, "inventory/advertisersAndCampaigns/campaigns/linkedZones")); if ($aConf['logging']['trackerImpressions']) { $oMenu->addTo("advertiser-campaigns", new OA_Admin_Menu_Section("campaign-trackers", 'LinkedTrackers', "campaign-trackers.php?clientid={clientid}&campaignid={campaignid}", false, "inventory/advertisersAndCampaigns/campaigns/linkedTrackers")); } $oMenu->addTo("inventory", new OA_Admin_Menu_Section("campaign-banners", 'Banners', "campaign-banners.php", false, "inventory/advertisersAndCampaigns/campaigns/banners", null, 1, false, 'g_adv')); $oMenu->addTo("campaign-banners", new OA_Admin_Menu_Section("banner-edit_new", 'AddBanner', "banner-edit.php?clientid={clientid}&campaignid={campaignid}", true, "inventory/advertisersAndCampaigns/campaigns/banners/addBanner")); $oMenu->addTo("campaign-banners", new OA_Admin_Menu_Section("banner-edit", 'BannerProperties', "banner-edit.php?clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "inventory/advertisersAndCampaigns/campaigns/banners/editBanner")); $oMenu->addTo("campaign-banners", new OA_Admin_Menu_Section("banner-swf", 'ConvertSWFLinks', "banner-swf.php?clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, null, array(), 1, true)); $oMenu->addTo("campaign-banners", new OA_Admin_Menu_Section("banner-acl", 'ModifyBannerAcl', "banner-acl.php?clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "inventory/advertisersAndCampaigns/campaigns/banners/editBanner/deliveryOptions")); $oMenu->addTo("campaign-banners", new OA_Admin_Menu_Section("banner-zone", 'LinkedZones', "banner-zone.php?clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "inventory/advertisersAndCampaigns/campaigns/banners/editBanner/linkedZones")); $oMenu->addTo("campaign-banners", new OA_Admin_Menu_Section("banner-advanced", 'Advanced', "banner-advanced.php?clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "inventory/advertisersAndCampaigns/campaigns/banners/editBanner/convertFlashLinks")); $oMenu->addTo("inventory", new OA_Admin_Menu_Section("website-index", 'Affiliates', "website-index.php", false, "inventory/publishersAndZones", null, 1, false, 'g_website')); $oMenu->addTo("website-index", new OA_Admin_Menu_Section("affiliate-edit_new", 'AddNewAffiliate', "affiliate-edit.php", true, "inventory/publishersAndZones/addPublisher")); $oMenu->addTo("website-index", new OA_Admin_Menu_Section("affiliate-edit", 'AffiliateProperties', "affiliate-edit.php?affiliateid={affiliateid}", false, "inventory/publishersAndZones/editPublisher")); $oMenu->addTo('website-index', new OA_Admin_Menu_Section('affiliate-invocation', 'Invocationcode', 'affiliate-invocation.php?affiliateid={affiliateid}', false, "inventory/affiliateInvocation")); $oMenu->addTo('affiliate-invocation', new OA_Admin_Menu_Section('affiliate-preview', 'InvocationcodePreview', 'affiliate-preview.php')); $oMenu->addTo('website-index', new OA_Admin_Menu_Section('affiliate-access', 'UserAccess', 'affiliate-access.php?affiliateid={affiliateid}')); $oMenu->addTo('inventory', new OA_Admin_Menu_Section('affiliate-zones', 'Zones', 'affiliate-zones.php', false, "inventory/publishersAndZones/zones", null, 1, false, 'g_website')); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-edit_new', 'AddNewZone', 'zone-edit.php?affiliateid={affiliateid}', true, "inventory/publishersAndZones/zones/addZone")); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-edit', 'ZoneProperties', 'zone-edit.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone")); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-advanced', 'Advanced', 'zone-advanced.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone/advanced")); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-include', 'IncludedBanners', 'zone-include.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone/linkedBanners")); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-probability', 'Probability', 'zone-probability.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone/probability")); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-invocation', 'Invocationcode', 'zone-invocation.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone/invocationCode")); $oMenu->addTo('inventory', new OA_Admin_Menu_Section('affiliate-channels', 'Channels', 'affiliate-channels.php', false, "inventory/publishersAndZones/channels", null, 1, false, 'g_website')); $oMenu->addTo('affiliate-channels', new OA_Admin_Menu_Section('channel-edit-affiliate_new', 'AddNewChannel', 'channel-edit.php?affiliateid={affiliateid}', true, "inventory/publishersAndZones/channels/addChannel")); $oMenu->addTo('affiliate-channels', new OA_Admin_Menu_Section('channel-edit-affiliate', 'ChannelProperties', 'channel-edit.php?affiliateid={affiliateid}&channelid={channelid}', false, "inventory/publishersAndZones/channels/editChannel")); $oMenu->addTo('affiliate-channels', new OA_Admin_Menu_Section('channel-affiliate-acl', 'ChannelLimitations', 'channel-acl.php?affiliateid={affiliateid}&channelid={channelid}', false, "inventory/publishersAndZones/channels/editChannel/deliveryOptions")); if (empty($aConf['ui']['disableDirectSelection'])) { $oMenu->addTo("inventory", new OA_Admin_Menu_Section("admin-generate", 'GenerateBannercode', "admin-generate.php", false, "")); } $oMenu->addTo("inventory", new OA_Admin_Menu_Section("agency-access", 'UserAccess', "agency-access.php?agencyid={agencyid}", false, "", array(array(OA_ACCOUNT_MANAGER => OA_PERM_SUPER_ACCOUNT)))); $oMenu->addTo("agency-access", new OA_Admin_Menu_Section("agency-user", 'UserProperties', "agency-user.php?userid={userid}&agencyid={agencyid}", false, "")); $oMenu->add(new OA_Admin_Menu_Section("account-index", 'Preferences', "account-index.php", false, "settings")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("account-user-index", 'UserPreferences', "account-user-index.php", false, "")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("account-preferences-index", 'AccountPreferences', "account-preferences-index.php", false, "settings/preferences")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("userlog-index", 'UserLog', "userlog-index.php", false, "settings/userLog")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("channel-index", 'ChannelManagement', "channel-index.php", false, "settings/channelManagement")); $oMenu->addTo("channel-index", new OA_Admin_Menu_Section("channel-edit_new", 'AddNewChannel', "channel-edit.php?agencyid={agencyid}", true, "settings/channelManagement/addChannel")); $oMenu->addTo("channel-index", new OA_Admin_Menu_Section("channel-edit", 'ChannelProperties', "channel-edit.php?agencyid={agencyid}&channelid={channelid}", false, "settings/channelManagement/editChannel")); $oMenu->addTo("channel-index", new OA_Admin_Menu_Section("channel-acl", 'ChannelLimitations', "channel-acl.php?agencyid={agencyid}&channelid={channelid}", false, "settings/channelManagement/editChannel/deliveryOptions")); break; case OA_ACCOUNT_TRAFFICKER: // Note: The stats screens haven't been updated to use the new menuing names... $oMenu->add(new OA_Admin_Menu_Section("1", 'Stats', "stats.php?entity=affiliate&breakdown=history&affiliateid={affiliateid}", false, "statistics/publisherHistory")); $oMenu->addTo("1", new OA_Admin_Menu_Section("1.1", 'AffiliateHistory', "stats.php?entity=affiliate&breakdown=history&affiliateid={affiliateid}", false, "statistics/publisherHistory")); $oMenu->addTo("1.1", new OA_Admin_Menu_Section("1.1.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&day={day}", false, "statistics/publisherHistory/daily")); $oMenu->addTo("1", new OA_Admin_Menu_Section("1.2", 'Zones', "stats.php?entity=affiliate&breakdown=zones&affiliateid={affiliateid}", false, "statistics/zoneOverview")); $oMenu->addTo("1.2", new OA_Admin_Menu_Section("1.2.1", 'ZoneHistory', "stats.php?entity=zone&breakdown=history&affiliateid={affiliateid}&zoneid={zoneid}", false, "statistics/zoneHistory")); $oMenu->addTo("1.2.1", new OA_Admin_Menu_Section("1.2.1.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&day={day}", false, "statistics/zoneHistory")); $oMenu->addTo("1.2", new OA_Admin_Menu_Section("1.2.2", 'CampaignDistribution', "stats.php?entity=zone&breakdown=campaigns&affiliateid={affiliateid}&zoneid={zoneid}", false, "statistics/zoneHistory/daily")); $oMenu->addTo("1.2.2", new OA_Admin_Menu_Section("1.2.2.1", 'DistributionHistoryCampaign', "stats.php?entity=zone&breakdown=campaign-history&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}", true, "statistics/campaignDistribution")); $oMenu->addTo("1.2.2.1", new OA_Admin_Menu_Section("1.2.2.1.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&day={day}", false, "statistics/campaignDistribution/history")); $oMenu->addTo("1.2.2", new OA_Admin_Menu_Section("1.2.2.2", 'DistributionHistoryBanner', "stats.php?entity=zone&breakdown=banner-history&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&bannerid={bannerid}", true, "statistics/campaignDistribution/history/daily")); $oMenu->addTo("1.2.2.2", new OA_Admin_Menu_Section("1.2.2.2.1", 'DailyStats', "stats.php?entity=zone&breakdown=daily&affiliateid={affiliateid}&zoneid={zoneid}&campaignid={campaignid}&bannerid={bannerid}&day={day}")); $oMenu->addTo("1", new OA_Admin_Menu_Section("1.3", 'CampaignDistribution', "stats.php?entity=affiliate&breakdown=campaigns&affiliateid={affiliateid}", false, "statistics/campaignDistribution")); $oMenu->addTo("1.3", new OA_Admin_Menu_Section("1.3.1", 'DistributionHistoryCampaign', "stats.php?entity=affiliate&breakdown=campaign-history&affiliateid={affiliateid}&campaignid={campaignid}", true, "statistics/campaignDistribution/history")); $oMenu->addTo("1.3.1", new OA_Admin_Menu_Section("1.3.1.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&campaignid={campaignid}&day={day}", false, "statistics/campaignDistribution/history/daily")); $oMenu->addTo("1.3", new OA_Admin_Menu_Section("1.3.2", 'DistributionHistoryBanner', "stats.php?entity=affiliate&breakdown=banner-history&affiliateid={affiliateid}&campaignid={campaignid}&bannerid={bannerid}", true)); $oMenu->addTo("1.3.2", new OA_Admin_Menu_Section("1.3.2.1", 'DailyStats', "stats.php?entity=affiliate&breakdown=daily&affiliateid={affiliateid}&campaignid={campaignid}&bannerid={bannerid}&day={day}", true)); $oMenu->addTo("1", new OA_Admin_Menu_Section("report-index", 'AdvancedReports', "report-index.php?affiliateid={affiliateid}", false, "reports")); $oMenu->add(new OA_Admin_Menu_Section("inventory", 'Adminstration', "affiliate-zones.php?affiliateid={affiliateid}", false, "inventory/publishersAndZones/zones")); $oMenu->addTo("inventory", new OA_Admin_Menu_Section("affiliate-zones", 'Zones', "affiliate-zones.php?affiliateid={affiliateid}", false, "inventory/publishersAndZones/zones")); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-edit_new', 'AddNewZone', 'zone-edit.php?affiliateid={affiliateid}', true, "inventory/publishersAndZones/zones/addZone", array(array(OA_ACCOUNT_TRAFFICKER => OA_PERM_ZONE_ADD)))); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-edit', 'ZoneProperties', 'zone-edit.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone", array(array(OA_ACCOUNT_TRAFFICKER => OA_PERM_ZONE_EDIT)))); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-include', 'IncludedBanners', 'zone-include.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone/linkedBanners", array(array(OA_ACCOUNT_TRAFFICKER => OA_PERM_ZONE_LINK)))); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-probability', 'Probability', 'zone-probability.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone/linkedBanners/probability")); $oMenu->addTo('affiliate-zones', new OA_Admin_Menu_Section('zone-invocation', 'Invocationcode', 'zone-invocation.php?affiliateid={affiliateid}&zoneid={zoneid}', false, "inventory/publishersAndZones/zones/editZone/linkedBanners/invocationCode", array(array(OA_ACCOUNT_TRAFFICKER => OA_PERM_ZONE_INVOCATION)))); $oMenu->addTo('inventory', new OA_Admin_Menu_Section('affiliate-invocation', 'Invocationcode', 'affiliate-invocation.php?affiliateid={affiliateid}', false, "inventory/affiliateInvocation", array(array(OA_ACCOUNT_TRAFFICKER => OA_PERM_ZONE_INVOCATION)))); $oMenu->addTo('affiliate-invocation', new OA_Admin_Menu_Section('affiliate-preview', 'InvocationcodePreview', 'affiliate-preview.php', false, "", array(array(OA_ACCOUNT_TRAFFICKER => OA_PERM_ZONE_INVOCATION)))); $oMenu->addTo('inventory', new OA_Admin_Menu_Section('affiliate-access', 'UserAccess', 'affiliate-access.php?affiliateid={affiliateid}', false, "", array(array(OA_ACCOUNT_TRAFFICKER => OA_PERM_SUPER_ACCOUNT)))); $oMenu->add(new OA_Admin_Menu_Section("account-index", 'Preferences', "account-index.php", false, "settings")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("account-user-index", 'UserPreferences', "account-user-index.php", false, "settings/preferences")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("account-preferences-index", 'AccountPreferences', "account-preferences-index.php", false, "settings/preferences")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("userlog-index", 'UserLog', "userlog-index.php", false, "settings/userLog", array(array(OA_ACCOUNT_TRAFFICKER => OA_PERM_USER_LOG_ACCESS)))); break; case OA_ACCOUNT_ADVERTISER: // Note: The stats screens haven't been updated to use the new menuing names... $oMenu->add(new OA_Admin_Menu_Section("1", 'Stats', "stats.php?entity=advertiser&breakdown=history&clientid={clientid}", false, "statistics/advertiserHistory")); $oMenu->addTo("1", new OA_Admin_Menu_Section("1.1", 'ClientHistory', "stats.php?entity=advertiser&breakdown=history&clientid={clientid}", false, "statistics/advertiserHistory")); $oMenu->addTo("1.1", new OA_Admin_Menu_Section("1.1.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&day={day}", false, "statistics/advertiserHistory/daily")); $oMenu->addTo("1", new OA_Admin_Menu_Section("1.2", 'Campaigns', "stats.php?entity=advertiser&breakdown=campaigns&clientid={clientid}", false, "statistics/campaignOverview")); $oMenu->addTo("1.2", new OA_Admin_Menu_Section("1.2.1", 'CampaignHistory', "stats.php?entity=campaign&breakdown=history&clientid={clientid}&campaignid={campaignid}", false, "statistics/campaignHistory")); $oMenu->addTo("1.2.1", new OA_Admin_Menu_Section("1.2.1.1", 'DailyStats', "stats.php?entity=campaign&breakdown=daily&clientid={clientid}&campaignid={campaignid}&day={day}", false, "statistics/campaignHistory/daily")); $oMenu->addTo("1.2", new OA_Admin_Menu_Section("1.2.2", 'Banners', "stats.php?entity=campaign&breakdown=banners&clientid={clientid}&campaignid={campaignid}", false, "statistics/bannerOverview")); $oMenu->addTo("1.2.2", new OA_Admin_Menu_Section("1.2.2.1", 'BannerHistory', "stats.php?entity=banner&breakdown=history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "statistics/bannerHistory")); $oMenu->addTo("1.2.2.1", new OA_Admin_Menu_Section("1.2.2.1.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&day={day}", false, "statistics/bannerHistory/daily")); $oMenu->addTo("1.2.2", new OA_Admin_Menu_Section("1.2.2.4", 'PublisherDistribution', "stats.php?entity=banner&breakdown=affiliates&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "statistics/publisherDistribution")); $oMenu->addTo("1.2.2.4", new OA_Admin_Menu_Section("1.2.2.4.1", 'DistributionHistoryWebsite', "stats.php?entity=banner&breakdown=affiliate-history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/history")); $oMenu->addTo("1.2.2.4.1", new OA_Admin_Menu_Section("1.2.2.4.1.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("1.2.2.4", new OA_Admin_Menu_Section("1.2.2.4.2", 'DistributionHistoryZone', "stats.php?entity=banner&breakdown=zone-history&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("1.2.2.4.2", new OA_Admin_Menu_Section("1.2.2.4.2.1", 'DailyStats', "stats.php?entity=banner&breakdown=daily&clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("1.2", new OA_Admin_Menu_Section("1.2.3", 'PublisherDistribution', "stats.php?entity=campaign&breakdown=affiliates&clientid={clientid}&campaignid={campaignid}", false, "statistics/publisherDistribution")); $oMenu->addTo("1.2.3", new OA_Admin_Menu_Section("1.2.3.1", 'DistributionHistoryWebsite', "stats.php?entity=campaign&breakdown=affiliate-history&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/history")); $oMenu->addTo("1.2.3.1", new OA_Admin_Menu_Section("1.2.3.1.1", 'DailyStats', "stats.php?entity=campaign&breakdown=daily&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("1.2.3", new OA_Admin_Menu_Section("1.2.3.2", 'DistributionHistoryZone', "stats.php?entity=campaign&breakdown=zone-history&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("1.2.3.2", new OA_Admin_Menu_Section("1.2.3.2.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&campaignid={campaignid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("1", new OA_Admin_Menu_Section("1.3", 'PublisherDistribution', "stats.php?entity=advertiser&breakdown=affiliates&clientid={clientid}", false, "statistics/publisherDistribution")); $oMenu->addTo("1.3", new OA_Admin_Menu_Section("1.3.1", 'DistributionHistoryWebsite', "stats.php?entity=advertiser&breakdown=affiliate-history&clientid={clientid}&affiliateid={affiliateid}", true, "statistics/publisherDistribution/hisotry")); $oMenu->addTo("1.3.1", new OA_Admin_Menu_Section("1.3.1.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&affiliateid={affiliateid}&day={day}", false, "statistics/publisherDistribution/history/daily")); $oMenu->addTo("1.3", new OA_Admin_Menu_Section("1.3.2", 'DistributionHistoryZone', "stats.php?entity=advertiser&breakdown=zone-history&clientid={clientid}&affiliateid={affiliateid}&zoneid={zoneid}", true)); $oMenu->addTo("1.3.2", new OA_Admin_Menu_Section("1.3.2.1", 'DailyStats', "stats.php?entity=advertiser&breakdown=daily&clientid={clientid}&affiliateid={affiliateid}&zoneid={zoneid}&day={day}")); $oMenu->addTo("1", new OA_Admin_Menu_Section("report-index", 'AdvancedReports', "report-index.php?clientid={clientid}", false, "reports")); $oMenu->add(new OA_Admin_Menu_Section("inventory", 'Adminstration', "advertiser-campaigns.php?clientid={clientid}", false, "inventory/advertisersAndCampaigns/campaigns")); $oMenu->addTo("inventory", new OA_Admin_Menu_Section("advertiser-campaigns", 'Campaigns', "advertiser-campaigns.php?clientid={clientid}", false, "inventory/advertisersAndCampaigns/campaigns")); $oMenu->addTo("advertiser-campaigns", new OA_Admin_Menu_Section("campaign-banners", 'Banners', "campaign-banners.php?clientid={clientid}&campaignid={campaignid}", false, "inventory/advertisersAndCampaigns/campaigns/banners")); $oMenu->addTo("campaign-banners", new OA_Admin_Menu_Section("banner-edit", 'BannerProperties', "banner-edit.php?clientid={clientid}&campaignid={campaignid}&bannerid={bannerid}", false, "inventory/advertisersAndCampaigns/campaigns/editBanner", array(array(OA_ACCOUNT_ADVERTISER => OA_PERM_BANNER_EDIT)))); $oMenu->addTo("inventory", new OA_Admin_Menu_Section("advertiser-access", 'UserAccess', "advertiser-access.php?clientid={clientid}", false, "", array(array(OA_ACCOUNT_ADVERTISER => OA_PERM_SUPER_ACCOUNT)))); $oMenu->addTo("advertiser-access", new OA_Admin_Menu_Section("advertiser-user", 'UserProperties', "advertiser-user.php?userid={userid}&clientid={clientid}", false, "", array(array(OA_ACCOUNT_ADVERTISER => OA_PERM_SUPER_ACCOUNT)))); $oMenu->add(new OA_Admin_Menu_Section("account-index", 'Preferences', "account-index.php", false, "settings")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("account-user-index", 'UserPreferences', "account-user-index.php", false, "")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("account-preferences-index", 'AccountPreferences', "account-preferences-index.php", false, "settings/prefrences")); $oMenu->addTo("account-index", new OA_Admin_Menu_Section("userlog-index", 'UserLog', "userlog-index.php", false, "settings/userLog", array(array(OA_ACCOUNT_ADVERTISER => OA_PERM_USER_LOG_ACCESS)))); break; default: // If the user is not logged in then $accountType will be null } $GLOBALS['_MAX']['MENU_OBJECT'][$accountType] =& $oMenu; return $oMenu; }
function displayPage($aAdvertiser, $form) { //header and breadcrumbs $oHeaderModel = buildAdvertiserHeaderModel($aAdvertiser); if ($aAdvertiser['clientid'] != "") { if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) { OA_Admin_Menu::setAdvertiserPageContext($aAdvertiser['clientid'], 'advertiser-index.php'); addAdvertiserPageToolsAndShortcuts($aAdvertiser['clientid']); phpAds_PageHeader(null, $oHeaderModel); } else { phpAds_PageHeader(null, $oHeaderModel); } } else { //new advertiser phpAds_PageHeader('advertiser-edit_new', $oHeaderModel); } //get template and display form $oTpl = new OA_Admin_Template('advertiser-edit.html'); $oTpl->assign('clientid', $aAdvertiser['clientid']); $oTpl->assign('form', $form->serialize()); $oTpl->display(); //footer phpAds_PageFooter(); }
/** * Method that returns the top level page of the page passed as parameter. * * @param string $sectionId The page that we want to know its parent page. * @return string A string with the parent page, it will be null if the page * doesn't have a parent page. */ function getTopLevelPage($sectionId = null) { $sectionId = OA_Admin_UI::getID($sectionId); $oMenu = OA_Admin_Menu::singleton(); $parentSections = $oMenu->getParentSections($sectionId); return count($parentSections) ? $parentSections[0]->link : ''; }
function displayPage($aAgency, $form) { if ($aAgency['agencyid'] != '') { OA_Admin_Menu::setAgencyPageContext($aAgency['agencyid'], 'agency-edit.php'); MAX_displayInventoryBreadcrumbs(array(array("name" => $aAgency['name'])), "agency"); phpAds_PageHeader(); } else { MAX_displayInventoryBreadcrumbs(array(array("name" => "")), "agency", true); phpAds_PageHeader("agency-edit_new"); } //get template and display form $oTpl = new OA_Admin_Template('agency-edit.html'); $oTpl->assign('form', $form->serialize()); $oTpl->display(); //footer phpAds_PageFooter(); }
function testGetLevel() { $menu = new OA_Admin_Menu(); $sections = $this->generateSections(20, 1); //build hierarchy $menu->add($sections[0]); $parentId = $sections[0]->getId(); for ($i = 1; $i < count($sections); $i++) { $menu->addTo($parentId, $sections[$i]); $parentId = $sections[$i]->getId(); } //get level of a non existent section $level = $menu->getLevel("some-nonexistent-section-id"); $this->assertNotNull($level); $this->assertEqual(-1, $level); //get level of first level section (should be 0) $level = $menu->getLevel($sections[0]->getId()); $this->assertNotNull($level); $this->assertEqual(0, $level); //get other parents for ($i = 0; $i < count($sections); $i++) { $level = $menu->getLevel($sections[$i]->getId()); $this->assertNotNull($level); $this->assertEqual($i, $level); } }
function getHeaderModel() { $builder = new OA_Admin_UI_Model_InventoryPageHeaderModelBuilder(); $oMenu = OA_Admin_Menu::singleton(); $oMenu->_setLinkParams($this->aPageParams); $oCurrentSection = $oMenu->get($this->pageId); $oHeader = new OA_Admin_UI_Model_PageHeaderModel($oCurrentSection->getName()); $oHeader->setIconClass('iconTargetingChannelsLarge'); foreach ($this->aPageBreadcrumbs as $v) { $headerMeta = $builder->getEntityHeaderMeta($v['type']); $oSegment = new OA_Admin_UI_Model_EntityBreadcrumbSegment(); $oSegment->setEntityName($v['name']); $oSegment->setEntityLabel($headerMeta['label']); $oSegment->setCssClass($headerMeta['class']); $oHeader->addSegment($oSegment); } return $oHeader; }
function test_checkMenus() { OA_Admin_Menu::_clearCache(OA_ACCOUNT_ADMIN); $oPluginManager = new OX_Plugin_ComponentGroupManager(); $aMenus[OA_ACCOUNT_ADMIN] = array(0 => array('insertafter' => "999")); $this->assertFalse($oPluginManager->_checkMenus('testPlugin', $aMenus)); $aMenus[OA_ACCOUNT_ADMIN] = array(0 => array('insertbefore' => "999")); $this->assertFalse($oPluginManager->_checkMenus('testPlugin', $aMenus)); $aMenus[OA_ACCOUNT_ADMIN] = array(0 => array('addto' => "999")); $this->assertFalse($oPluginManager->_checkMenus('testPlugin', $aMenus)); $aMenus[OA_ACCOUNT_ADMIN] = array(0 => array('add' => "test-plugin-root", 'link' => "plugins/testPlugin/testPlugin.php", 'data' => 'Test Plugin'), 1 => array('addto' => "test-plugin-root", 'index' => "test-plugin-1", 'link' => "plugins/testPlugin/testPlugin-page.php?action=1", 'data' => 'Test Menu 1'), 2 => array('insertafter' => "test-plugin-1", 'index' => "test-plugin-3", 'link' => "plugins/testPlugin/testPlugin.php?action=3", 'data' => 'Test Menu 3'), 3 => array('insertbefore' => "test-plugin-3", 'index' => "test-plugin-2", 'link' => "plugins/testPlugin/testPlugin.php?action=2", 'data' => 'Test Menu 2')); $oMenu = $oPluginManager->_checkMenus('testPlugin', $aMenus); $this->assertIsA($oMenu, 'OA_Admin_Menu'); $oSection = $oMenu->get('test-plugin-root', false); $this->assertIsA($oSection, 'OA_Admin_Menu_Section'); $this->assertEqual(count($oSection->aSections), 3); $this->assertEqual($oSection->aSections[0]->id, 'test-plugin-1'); $this->assertEqual($oSection->aSections[1]->id, 'test-plugin-2'); $this->assertEqual($oSection->aSections[2]->id, 'test-plugin-3'); $oSection1 = $oMenu->get('test-plugin-1', false); $this->assertIsA($oSection1, 'OA_Admin_Menu_Section'); $this->assertEqual($oSection->aSections[0]->id, $oSection1->id); $oSection2 = $oMenu->get('test-plugin-2', false); $this->assertIsA($oSection2, 'OA_Admin_Menu_Section'); $this->assertEqual($oSection->aSections[1]->id, $oSection2->id); $oSection3 = $oMenu->get('test-plugin-3', false); $this->assertIsA($oSection3, 'OA_Admin_Menu_Section'); $this->assertEqual($oSection->aSections[2]->id, $oSection3->id); $this->assertTrue($oMenu->_saveToCache(OA_ACCOUNT_ADMIN)); $oMenu = $oMenu->_loadFromCache(OA_ACCOUNT_ADMIN); $this->assertIsA($oMenu, 'OA_Admin_Menu'); $oSection = $oMenu->get('test-plugin-root', false); $this->assertIsA($oSection, 'OA_Admin_Menu_Section'); $this->assertEqual(count($oSection->aSections), 3); $this->assertEqual($oSection->aSections[0]->id, 'test-plugin-1'); $this->assertEqual($oSection->aSections[1]->id, 'test-plugin-2'); $this->assertEqual($oSection->aSections[2]->id, 'test-plugin-3'); $oSection1 = $oMenu->get('test-plugin-1', false); $this->assertIsA($oSection1, 'OA_Admin_Menu_Section'); $this->assertEqual($oSection->aSections[0]->id, $oSection1->id); $oSection2 = $oMenu->get('test-plugin-2', false); $this->assertIsA($oSection2, 'OA_Admin_Menu_Section'); $this->assertEqual($oSection->aSections[1]->id, $oSection2->id); $oSection3 = $oMenu->get('test-plugin-3', false); $this->assertIsA($oSection3, 'OA_Admin_Menu_Section'); $this->assertEqual($oSection->aSections[2]->id, $oSection3->id); }
require_once MAX_PATH . '/lib/OA/Session.php'; require_once MAX_PATH . '/lib/OA/Admin/Menu.php'; require_once MAX_PATH . '/lib/max/other/html.php'; require_once MAX_PATH . '/lib/OA/Auth.php'; require_once MAX_PATH . '/lib/OA/Admin/UI/UserAccess.php'; // Security check OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER); OA_Permission::enforceAccountPermission(OA_ACCOUNT_MANAGER, OA_PERM_SUPER_ACCOUNT); OA_Permission::enforceAccessToObject('agency', $agencyid); /*-------------------------------------------------------*/ /* HTML framework */ /*-------------------------------------------------------*/ if ($agencyid != '') { addPageTools($agencyid); if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) { OA_Admin_Menu::setAgencyPageContext($agencyid, 'agency-edit.php'); $doAgency = OA_Dal::staticGetDO('agency', $agencyid); MAX_displayInventoryBreadcrumbs(array(array("name" => $doAgency->name)), "agency"); phpAds_PageHeader("4.1.3"); phpAds_ShowSections(array("4.1.2", "4.1.3")); } else { phpAds_PageHeader('4.4'); phpAds_ShowSections(array("4.1", "4.2", "4.3", "4.4")); } } else { MAX_displayInventoryBreadcrumbs(array(array("name" => phpAds_getClientName($agencyid))), "agency"); phpAds_PageHeader("4.1.1"); phpAds_ShowSections(array("4.1.1")); } $tabindex = 1; /*-------------------------------------------------------*/
function _deleteCacheMenu() { $accountTypes = array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER); foreach ($accountTypes as $accountType) { OA_Admin_Menu::singleton()->_clearCache($accountType); } }
function displayPage($affiliateid, $form, $oPublisherDll = null) { //header and breadcrumbs $oHeaderModel = MAX_displayWebsiteBreadcrumbs($affiliateid); if ($affiliateid != "") { OA_Admin_Menu::setPublisherPageContext($affiliateid, 'affiliate-edit.php'); addWebsitePageTools($affiliateid); phpAds_PageHeader(null, $oHeaderModel); } else { phpAds_PageHeader("affiliate-edit_new", $oHeaderModel); } //get template and display form $oTpl = new OA_Admin_Template('affiliate-edit.html'); $oTpl->assign('affiliateid', $affiliateid); $oTpl->assign('form', $form->serialize()); if (isset($oPublisherDll)) { $oTpl->assign('error', $oPublisherDll->_errorMessage); $oTpl->assign('notice', $oPublisherDll->_noticeMessage); } $oTpl->assign('showAdDirect', defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true ? true : false); $oTpl->assign('keyAddNew', $keyAddNew); $oTpl->display(); //footer phpAds_PageFooter(); }
$activeNav[OA_UPGRADE_LOGIN] = '45'; } ksort($activeNav); // setup the nav to determine whether or not to show a valid link $navLinks = array(); foreach ($activeNav as $key => $val) { if ($val <= $activeNav[$action] && $action <= OA_UPGRADE_DBSETUP) { $navLinks[$key] = 'javascript: changePage(' . $key . ')'; } else { $navLinks[$key] = ''; } } // Setup array for navigation $aInstallerSections = array('10' => new OA_Admin_Menu_Section('10', 'Welcome', $navLinks[OA_UPGRADE_WELCOME], false, "qsg-install"), '20' => new OA_Admin_Menu_Section('20', 'Terms', $navLinks[OA_UPGRADE_TERMS], false, "qsg-install"), '25' => new OA_Admin_Menu_Section('25', 'Policy', $navLinks[OA_UPGRADE_POLICY], false, "qsg-install"), '30' => new OA_Admin_Menu_Section('30', 'System Check', $navLinks[OA_UPGRADE_SYSCHECK], false, "qsg-install"), '40' => new OA_Admin_Menu_Section('40', 'Application Check', $navLinks[OA_UPGRADE_APPCHECK], false, "qsg-install"), '45' => new OA_Admin_Menu_Section('45', 'Login', $navLinks[OA_UPGRADE_LOGIN], false, "qsg-install"), '50' => new OA_Admin_Menu_Section('50', 'Database', $navLinks[OA_UPGRADE_DBSETUP], false, "qsg-install"), '60' => new OA_Admin_Menu_Section('60', 'Configuration', $navLinks[OA_UPGRADE_CONFIGSETUP], false, "qsg-install"), '70' => new OA_Admin_Menu_Section('70', 'Admin', $navLinks[OA_UPGRADE_ADMINSETUP], false, "qsg-install"), '80' => new OA_Admin_Menu_Section('80', 'Plugins', $navLinks[OA_UPGRADE_PLUGINS], false, "qsg-install"), '90' => new OA_Admin_Menu_Section('90', 'Tasks', $navLinks[OA_UPGRADE_POST], false, "qsg-install"), '100' => new OA_Admin_Menu_Section('100', 'Finished', '')); // setup which sections to display $oMenu = OA_Admin_Menu::singleton(); //since we display installer nav as horizontal tabs we need to add two fake levels above $firstLevelNavID = 'l1' . $activeNav[$action]; $secondLevelNavID = 'l2' . $activeNav[$action]; $oMenu->add(new OA_Admin_Menu_Section($firstLevelNavID, '', '')); $oMenu->addTo($firstLevelNavID, new OA_Admin_Menu_Section($secondLevelNavID, '', '')); //$currentSectionID = $firstLevelNavID; $currentSectionID = $secondLevelNavID; foreach ($activeNav as $val) { if (!array_key_exists($val, $oMenu->aAllSections)) { $oMenu->addTo($secondLevelNavID, $aInstallerSections[$val]); // $oMenu->addTo($firstLevelNavID, $aInstallerSections[$val]); } } // display header and navigation, with proper 'active page' marked using $activeNav[$action] phpAds_PageHeader($activeNav[$action], new OA_Admin_UI_Model_PageHeaderModel(), $imgPath, false, true, false);