本文整理汇总了PHP中MAX_getPlacementName函数的典型用法代码示例。如果您正苦于以下问题:PHP MAX_getPlacementName函数的具体用法?PHP MAX_getPlacementName怎么用?PHP MAX_getPlacementName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAX_getPlacementName函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
/**
* The final "child" implementation of the parental abstract method.
*
* @see OA_Admin_Statistics_Common::start()
*/
function start()
{
// Get parameters
$publisherId = $this->_getId('publisher');
$placementId = $this->_getId('placement', 0);
$zoneId = $this->_getId('zone');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_TRAFFICKER);
$this->_checkAccess(array('publisher' => $publisherId, 'zone' => $zoneId));
// Cross-entity security check
if (!empty($zoneId)) {
$aPlacements = $this->getZoneCampaigns($zoneId);
if (!isset($aPlacements[$placementId])) {
$this->noStatsAvailable = true;
}
}
// Add standard page parameters
$this->aPageParams = array('affiliateid' => $publisherId, 'campaignid' => $placementId, 'zoneid' => $zoneId);
// Load the period preset and stats breakdown parameters
$this->_loadPeriodPresetParam();
$this->_loadStatsBreakdownParam();
// Load $_GET parameters
$this->_loadParams();
// HTML Framework
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$this->pageId = '2.4.2.2.1';
$this->aPageSections = array($this->pageId);
} elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$this->pageId = '1.2.2.1';
$this->aPageSections = array($this->pageId);
}
// Add breadcrumbs
$this->_addBreadcrumbs('zone', $zoneId);
$this->addCrossBreadcrumbs('campaign', $placementId);
// Add context
$params = $this->aPageParams;
foreach ($aPlacements as $k => $v) {
$params['campaignid'] = $k;
phpAds_PageContext(MAX_buildName($k, MAX_getPlacementName($v)), $this->_addPageParamsToURI($this->pageName, $params, true), $placementId == $k);
}
// Add shortcuts
if (!OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$this->_addShortcut($GLOBALS['strAffiliateProperties'], 'affiliate-edit.php?affiliateid=' . $publisherId, 'images/icon-affiliate.gif');
}
$this->_addShortcut($GLOBALS['strZoneProperties'], 'zone-edit.php?affiliateid=' . $publisherId . '&zoneid=' . $zoneId, 'images/icon-zone.gif');
// Prepare the data for display by output() method
$aParams = array('zone_id' => $zoneId, 'placement_id' => $placementId);
$this->prepare($aParams, 'stats.php');
}
示例2: display
function display()
{
$aParams = array();
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams['agency_id'] = OA_Permission::getEntityId();
} elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$aParams['advertiser_id'] = OA_Permission::getEntityId();
} elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$aParams['publisher_id'] = OA_Permission::getEntityId();
}
$aPlacements = Admin_DA::getPlacements($aParams, true);
$aPlacements = $this->multiSort($aPlacements, "name", true);
echo "\n <select name='{$this->_name}' tabindex='" . $this->_tabIndex++ . "'>";
foreach ($aPlacements as $aPlacement) {
$selected = $aPlacement['placement_id'] == $this->getValue() ? " selected='selected'" : '';
$name = MAX_getPlacementName($aPlacement);
echo "\n <option value='{$aPlacement['placement_id']}'{$selected}>" . htmlspecialchars($name) . "</option>";
}
echo "\n </select>";
}
示例3: getCampaigns
/**
* Get campaign stats
*
* @param array Query parameters
* @param int Tree level
* @param string Expand GET parameter, used only when called from other get methods
* @return Entities array
*/
function getCampaigns($aParams, $level, $expand = '')
{
$aParams['include'] = array('placement_id', 'advertiser_id');
$aParams['exclude'] = array('zone_id');
$this->prepareData($aParams);
$period_preset = MAX_getStoredValue('period_preset', 'today');
$aPlacements = $this->mergeData($aParams, 'placement_id');
MAX_sortArray($aPlacements, $this->listOrderField == 'id' ? 'placement_id' : $this->listOrderField, $this->listOrderDirection == 'up');
$aEntitiesData = array();
foreach ($aPlacements as $campaignId => $campaign) {
$campaign['active'] = $this->_hasActiveStats($campaign);
if ($this->startLevel > $level || !$this->hideInactive || $campaign['active']) {
$this->_summarizeStats($campaign);
// mask anonymous campaigns if advertiser
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
// a) mask campaign name
$campaign['name'] = MAX_getPlacementName($campaign);
// b) mask ad names
if ($campaign['anonymous'] == 't') {
if (isset($campaign['children'])) {
foreach ($campaign['children'] as $ad_id => $ad) {
$campaign['children'][$ad_id]['name'] = MAX_getAdName($ad['name'], null, null, $campaign['anonymous'], $ad_id);
}
}
}
}
$campaign['prefix'] = 'c';
$campaign['id'] = $campaignId;
$campaign['linkparams'] = "clientid={$campaign['advertiser_id']}&campaignid={$campaignId}&";
if (is_array($aParams) && count($aParams) > 0) {
foreach ($aParams as $key => $value) {
if ($key != "include" && $key != "exclude") {
$campaign['linkparams'] .= $key . "=" . $value . "&";
}
}
} else {
$campaign['linkparams'] .= "&";
}
$campaign['linkparams'] .= "period_preset={$period_preset}&period_start=" . MAX_getStoredValue('period_start', date('Y-m-d')) . "&period_end=" . MAX_getStoredValue('period_end', date('Y-m-d'));
$campaign['expanded'] = MAX_isExpanded($campaignId, $expand, $this->aNodes, $campaign['prefix']);
$campaign['icon'] = MAX_getEntityIcon('placement', $campaign['active'], $campaign['type']);
$htmlToAppend = '';
if ($campaign['mtype'] == DataObjects_Campaigns::CAMPAIGN_TYPE_MARKET_CAMPAIGN_OPTIN) {
$htmlToAppend = $this->getHtmlHelpLink('help-market-optin-campaign');
} else {
if ($campaign['mtype'] == DataObjects_Campaigns::CAMPAIGN_TYPE_MARKET_ZONE_OPTIN) {
$htmlToAppend = $this->getHtmlHelpLink('help-market-optin-zone');
}
}
$campaign['html-append'] = $htmlToAppend;
// mask anonymous campaigns
// a) mask campaign name
$campaign['name'] = MAX_getPlacementName($campaign);
if ($campaign['mtype'] == DataObjects_Campaigns::CAMPAIGN_TYPE_MARKET_CAMPAIGN_OPTIN) {
$campaign['name'] = $GLOBALS['strMarketCampaignOptin'];
} else {
if ($campaign['mtype'] == DataObjects_Campaigns::CAMPAIGN_TYPE_MARKET_ZONE_OPTIN) {
$campaign['name'] = $GLOBALS['strMarketZoneOptin'];
}
}
// b) mask ad names
if (isset($campaign['children'])) {
foreach ($campaign['children'] as $ad_id => $ad) {
$campaign['children'][$ad_id]['name'] = MAX_getAdName($ad['name'], null, null, $campaign['anonymous'], $ad_id);
}
}
if ($campaign['expanded'] || $this->startLevel > $level) {
$aParams2 = $aParams + array('placement_id' => $campaignId);
$campaign['subentities'] = $this->getBanners($aParams2, $level + 1, $expand);
}
$aEntitiesData[] = $campaign;
} elseif ($this->startLevel == $level) {
$this->hiddenEntities++;
}
}
return $aEntitiesData;
}
示例4: getCampaignMap
function getCampaignMap($advertiserId)
{
$aCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $advertiserId));
$aCampaignMap = array();
foreach ($aCampaigns as $campaignId => $aCampaign) {
$campaignName = $aCampaign['name'];
// mask campaign name if anonymous campaign
$campaign_details = Admin_DA::getPlacement($campaignId);
$campaignName = MAX_getPlacementName($campaign_details);
$aCampaignMap[$campaignId] = array('name' => $campaignName);
}
return $aCampaignMap;
}
示例5: addCrossBreadCrumbs
function addCrossBreadCrumbs($type, $entityId, $level = 0)
{
$cache = $this->crossEntitiesCache;
switch ($type) {
case 'campaign':
if ($this->noStatsAvailable) {
$this->_addBreadcrumb('', MAX_getEntityIcon('placement'), $type);
} else {
$this->_addBreadcrumb(MAX_buildName($entityId, MAX_getPlacementName($cache[$entityId])), MAX_getEntityIcon('placement'), $type);
}
break;
case 'banner':
if ($this->noStatsAvailable) {
$this->_addBreadcrumb('', MAX_getEntityIcon('ad'), $type);
} else {
$this->_addBreadcrumb(MAX_buildName($entityId, MAX_getAdName($cache[$entityId]['name'], null, null, $cache[$entityId]['anonymous'], $entityId)), MAX_getEntityIcon('ad'), $type);
}
break;
case 'publisher':
if ($this->noStatsAvailable) {
$this->_addBreadcrumb('', MAX_getEntityIcon('publisher'), '');
} else {
$this->_addBreadcrumb(MAX_buildName($entityId, MAX_getPublisherName($cache[$entityId]['name'], null, $cache[$entityId]['anonymous'], $entityId)), MAX_getEntityIcon('publisher'), 'website');
}
break;
case 'zone':
if ($this->noStatsAvailable) {
$this->_addBreadcrumb('', MAX_getEntityIcon('zone'), $type);
} else {
$this->_addBreadcrumb(MAX_buildName($entityId, MAX_getZoneName($cache[$entityId]['name'], null, $cache[$entityId]['anonymous'], $entityId)), MAX_getEntityIcon('zone'), $type);
}
break;
}
}
示例6: maskHiddenEntities
/**
* Mask entities which have the hidden flag set
*
* @param array Entities array
* @param string Name which should be used for hidden entitiies
*/
function maskHiddenEntities(&$aEntitiesData, $entityType)
{
$this->fixLinkParams($aEntitiesData);
foreach (array_keys($aEntitiesData) as $entityId) {
if (isset($aEntitiesData[$entityId]['hidden']) && $aEntitiesData[$entityId]['hidden']) {
switch ($entityType) {
case 'advertiser':
$aEntitiesData[$entityId]['name'] = MAX_getAdvertiserName($aEntitiesData[$entityId]['name'], null, true, $aEntitiesData[$entityId]['id']);
break;
case 'campaign':
$tmp = array('placement_id' => $aEntitiesData[$entityId]['id'], 'name' => $aEntitiesData[$entityId]['name'], 'anonymous' => true);
$aEntitiesData[$entityId]['name'] = MAX_getPlacementName($tmp);
break;
case 'banner':
$aEntitiesData[$entityId]['name'] = MAX_getAdName($aEntitiesData[$entityId]['name'], null, null, true, $aEntitiesData[$entityId]['id']);
break;
case 'publisher':
$aEntitiesData[$entityId]['name'] = MAX_getPublisherName($aEntitiesData[$entityId]['name'], null, true, $aEntitiesData[$entityId]['id']);
break;
case 'zone':
$aEntitiesData[$entityId]['name'] = MAX_getZoneName($aEntitiesData[$entityId]['name'], null, true, $aEntitiesData[$entityId]['id']);
break;
}
//$aEntitiesData[$entityId]['num_children'] = 0;
//unset($aEntitiesData[$entityId]['subentities']);
}
}
if ($this->listOrderField == 'name' || $this->listOrderField == 'id') {
MAX_sortArray($aEntitiesData, $this->listOrderField, $this->listOrderDirection == 'up');
}
}
示例7: OA_Admin_Template
}
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('campaign-index.html');
// Get clients & campaign and build the tree
$doCampaigns = OA_Dal::factoryDO('campaigns');
$doCampaigns->clientid = $clientid;
$doCampaigns->addListOrderBy($listorder, $orderdirection);
$doCampaigns->find();
while ($doCampaigns->fetch() && ($row_campaigns = $doCampaigns->toArray())) {
$campaigns[$row_campaigns['campaignid']]['campaignid'] = $row_campaigns['campaignid'];
// mask campaign name if anonymous campaign
$campaign_details = Admin_DA::getPlacement($row_campaigns['campaignid']);
$row_campaigns['campaignname'] = MAX_getPlacementName($campaign_details);
$campaigns[$row_campaigns['campaignid']]['campaignname'] = $row_campaigns['campaignname'];
$campaigns[$row_campaigns['campaignid']]['impressions'] = phpAds_formatNumber($row_campaigns['views']);
$campaigns[$row_campaigns['campaignid']]['clicks'] = phpAds_formatNumber($row_campaigns['clicks']);
$campaigns[$row_campaigns['campaignid']]['conversions'] = phpAds_formatNumber($row_campaigns['conversions']);
if ($row_campaigns['activate'] && $row_campaigns['activate'] != '0000-00-00') {
$oActivateDate =& new Date($row_campaigns['activate']);
$campaigns[$row_campaigns['campaignid']]['activate'] = $oActivateDate->format($date_format);
} else {
$campaigns[$row_campaigns['campaignid']]['activate'] = '-';
}
if ($row_campaigns['activate'] && $row_campaigns['expire'] != '0000-00-00') {
$oExpireDate =& new Date($row_campaigns['expire']);
$campaigns[$row_campaigns['campaignid']]['expire'] = $oExpireDate->format($date_format);
} else {
$campaigns[$row_campaigns['campaignid']]['expire'] = '-';
示例8: addBannerPageTools
function addBannerPageTools($advertiserId, $campaignId, $bannerId, $aOtherCampaigns, $aOtherBanners, $aEntities)
{
if (empty($bannerId)) {
return;
}
global $phpAds_TextDirection;
//duplicate
addPageLinkTool($GLOBALS["strDuplicate"], MAX::constructUrl(MAX_URL_ADMIN, "banner-modify.php?duplicate=true&clientid={$advertiserId}&campaignid={$campaignId}&bannerid={$bannerId}&returnurl=" . urlencode(basename($_SERVER['SCRIPT_NAME']))), "iconBannerDuplicate");
//move to
$form = "<form action='" . MAX::constructUrl(MAX_URL_ADMIN, 'banner-modify.php') . "'>\n <input type='hidden' name='clientid' value='{$advertiserId}'>\n <input type='hidden' name='campaignid' value='{$campaignId}'>\n <input type='hidden' name='bannerid' value='{$bannerId}'>\n <input type='hidden' name='returnurl' value='" . htmlspecialchars(basename($_SERVER['SCRIPT_NAME'])) . "'>\n <select name='moveto'>";
$aOtherCampaigns = _multiSort($aOtherCampaigns, 'name', 'placement_id');
foreach ($aOtherCampaigns as $otherCampaignId => $aOtherCampaign) {
// mask campaign name if anonymous campaign
$aOtherCampaign['name'] = MAX_getPlacementName($aOtherCampaign);
$otherCampaignName = MAX_buildName($aOtherCampaign['placement_id'], $aOtherCampaign['name']);
if ($aOtherCampaign['placement_id'] != $campaignId) {
$form .= "<option value='" . $aOtherCampaign['placement_id'] . "'>" . htmlspecialchars($otherCampaignName) . "</option>";
} else {
$campaignName = $otherCampaignName;
}
}
$form .= "</select><input name='moveto' class='submit' type='image' src='" . OX::assetPath() . "/images/{$phpAds_TextDirection}/go_blue.gif'></form>";
addPageFormTool($GLOBALS['strMoveTo'], 'iconBannerMove', $form);
//apply to
if (basename($_SERVER['SCRIPT_NAME']) == 'banner-acl.php') {
$form = "<form action='" . MAX::constructUrl(MAX_URL_ADMIN, 'banner-modify.php') . "'>\n <input type='hidden' name='clientid' value='{$advertiserId}'>\n <input type='hidden' name='campaignid' value='{$campaignId}'>\n <input type='hidden' name='bannerid' value='{$bannerId}'>\n <input type='hidden' name='returnurl' value='" . htmlspecialchars(basename($_SERVER['SCRIPT_NAME'])) . "'>\n <select name='applyto'>";
$aOtherBanners = _multiSort($aOtherBanners, 'name', 'ad_id');
foreach ($aOtherBanners as $idx => $aOtherBanner) {
if ($aOtherBanner['ad_id'] != $bannerId) {
$form .= "<option value='{$aOtherBanner['ad_id']}'>" . MAX_buildName($aOtherBanner['ad_id'], $aOtherBanner['name']) . "</option>";
}
}
$form .= "</select><input type='image' class='submit' name='applyto' src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/go_blue.gif'></form>";
addPageFormTool($GLOBALS['strApplyLimitationsTo'], 'iconBannerApplyLimitations', $form);
}
//delete
if (!OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$deleteConfirm = phpAds_DelConfirm($GLOBALS['strConfirmDeleteBanner']);
addPageLinkTool($GLOBALS["strDelete"], MAX::constructUrl(MAX_URL_ADMIN, "banner-delete.php?token=" . urlencode(phpAds_SessionGetToken()) . "&clientid={$advertiserId}&campaignid={$campaignId}&bannerid={$bannerId}&returnurl=campaign-banners.php"), "iconDelete", null, $deleteConfirm);
}
/* Shortcuts */
addPageShortcut($GLOBALS['strBackToBanners'], MAX::constructUrl(MAX_URL_ADMIN, "campaign-banners.php?clientid={$advertiserId}&campaignid={$campaignId}"), "iconBack");
$entityString = _getEntityString($aEntities);
addPageShortcut($GLOBALS['strBannerHistory'], MAX::constructUrl(MAX_URL_ADMIN, "stats.php?entity=banner&breakdown=history&{$entityString}"), 'iconStatistics');
}
示例9: execute
/**
* The local implementation of the execute() method to generate the report.
*
* @param OA_Admin_oDaySpan $oDaySpan The OA_Admin_oDaySpan object for the report.
* @param integer $placementId The ID of the placement the report is for.
* @param array $aSheets An array of sheets that should be in the report.
*/
function execute($oDaySpan, $placementId, $aSheets)
{
$checkResult = $this->_checkParameters($oDaySpan, $placementId, $aSheets);
if ($checkResult !== true) {
return $checkResult;
}
// Save the placement ID for use later
$this->_placementId = $placementId;
// Locate and save the placement's name & owning advertiser
$doCampaigns = OA_Dal::factoryDO('campaigns');
$doCampaigns->campaignid = $this->_placementId;
$doCampaigns->find();
if (!$doCampaigns->fetch()) {
// Could not find the placement, set false
// for the placement name, and the owning
// advertiser ID and advertiser name
$this->_placementName = false;
$this->_advertiserId = false;
$this->_advertiserName = false;
} else {
// Get and store the placement name and the
// owning advertiser ID
$aPlacement = $doCampaigns->toArray();
$aPlacement['name'] = $aPlacement['campaignname'];
$this->_placementName = MAX_getPlacementName($aPlacement);
$this->_advertiserId = $aPlacement['clientid'];
if ($aPlacement['anonymous'] == 't') {
$campaignAnonymous = true;
} else {
$campaignAnonymous = false;
}
// Get the owning advertiser's name
$doClients = OA_Dal::factoryDO('clients');
$doClients->clientid = $this->_advertiserId;
$doClients->find();
if (!$doClients->fetch()) {
// Coule not find the owning advertiser name
$this->_advertiserName = false;
} else {
// Store the owning advertiser name
$aAdvertiser = $doClients->toArray();
$this->_advertiserName = MAX_getAdvertiserName($aAdvertiser['clientname'], null, $campaignAnonymous);
}
}
// Prepare the range information for the report
$this->_prepareReportRange($oDaySpan);
// Prepare the report name
$reportFileName = $this->_getReportFileName();
// Prepare the output writer for generation
$this->_oReportWriter->openWithFilename($reportFileName);
// Add the worksheets to the report, as required
if (isset($aSheets['daily_breakdown'])) {
$this->_addDailyBreakdownWorksheet();
}
if (isset($aSheets['ad_breakdown'])) {
$this->_addAdBreakdownWorksheet();
}
if (isset($aSheets['zone_breakdown'])) {
$this->_addZoneBreakdownWorksheet();
}
// Close the report writer and send the report to the user
$this->_oReportWriter->closeAndSend();
}
示例10: getClientCampaigns
/**
* Get list of campaigns for a given advertiser.
*
* @param int $clientid
* @param string $listorder Column name to use for sorting
* @param string $orderdirection soring direction 'up'/'down'
* @param array $aIncludeSystemTypes an array of system types to be
* included apart from default campaigns
* @return array associative array $campaignId => array of campaign details
*/
public function getClientCampaigns($clientid, $listorder = null, $orderdirection = null, $aIncludeSystemTypes = array())
{
$aIncludeSystemTypes = array_merge(array(DataObjects_Campaigns::CAMPAIGN_TYPE_DEFAULT), $aIncludeSystemTypes);
$doCampaigns = OA_Dal::factoryDO('campaigns');
$doCampaigns->clientid = $clientid;
$doCampaigns->selectAs(array('campaignid'), 'placement_id');
$doCampaigns->selectAs(array('campaignname'), 'name');
$doCampaigns->whereInAdd('type', $aIncludeSystemTypes);
$doCampaigns->orderBy('(type=' . DataObjects_Campaigns::CAMPAIGN_TYPE_DEFAULT . ') ASC');
$doCampaigns->addListOrderBy($listorder, $orderdirection);
$doCampaigns->find();
$aCampaigns = array();
while ($doCampaigns->fetch() && ($row_campaigns = $doCampaigns->toArray())) {
// mask campaign name if anonymous campaign
$row_campaigns['campaignname'] = MAX_getPlacementName($row_campaigns);
$row_campaigns['name'] = $row_campaigns['campaignname'];
$aCampaigns[$row_campaigns['campaignid']] = $row_campaigns;
}
return $aCampaigns;
}
示例11: array
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Dll.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/OA/Permission.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
$aEntityMap = array();
if (!empty($clientid)) {
if (!OA_Permission::hasAccessToObject('clients', $clientid)) {
echo "{ }";
exit;
}
// Retrieve list of campaigns
$aCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $clientid));
foreach ($aCampaigns as $campaignId => $aCampaign) {
$campaignName = $aCampaign['name'];
// mask campaign name if anonymous campaign
$campaign_details = Admin_DA::getPlacement($campaignId);
$campaignName = MAX_getPlacementName($campaign_details);
$aEntityMap[$campaignId] = $campaignName;
}
}
if (count($aEntityMap)) {
while (list($k, $v) = each($aEntityMap)) {
$aEntityMap[$k] = $k . ': { "name": "' . addslashes($v) . '" }';
}
echo "{" . implode(', ', $aEntityMap) . "}";
exit;
}
echo "{ }";
示例12: _showContext
/**
* A private method that can be inherited and used by children classes to
* output the context in the left navigation bar.
*
* {@uses phpAds_PageContext()}
*/
function _showContext($type, $current_id = 0)
{
if ($this->useDailyClass && $type == 'days') {
// Use the helper class contect method instead
$aArray = array('period_start' => MAX_getStoredValue('period_start', date('Y-m-d')), 'period_end' => MAX_getStoredValue('period_end', date('Y-m-d')));
$aDates = array_reverse($this->oHistory->getDatesArray($aArray, 'day', $this->oStartDate));
$this->oDaily->showContext($aDates, $current_id, $this);
} else {
$aParams = array();
switch ($type) {
case 'advertisers':
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams['agency_id'] = OA_Permission::getEntityId();
}
$params = $this->aPageParams;
$advertisers = Admin_DA::getAdvertisers($aParams, false);
foreach ($advertisers as $advertiser) {
$params['clientid'] = $advertiser['advertiser_id'];
phpAds_PageContext(MAX_buildName($advertiser['advertiser_id'], $advertiser['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $advertiser['advertiser_id']);
}
}
break;
case 'campaigns':
$aParams['advertiser_id'] = $this->aPageParams['clientid'];
$params = $this->aPageParams;
$campaigns = Admin_DA::getPlacements($aParams, false);
foreach ($campaigns as $campaign) {
$params['campaignid'] = $campaign['placement_id'];
// mask campaign name if anonymous campaign
$campaign['name'] = MAX_getPlacementName($campaign);
phpAds_PageContext(MAX_buildName($campaign['placement_id'], $campaign['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $campaign['placement_id']);
}
break;
case 'banners':
$aParams['placement_id'] = $this->aPageParams['campaignid'];
$params = $this->aPageParams;
$banners = Admin_DA::getAds($aParams, false);
foreach ($banners as $banner) {
$params['bannerid'] = $banner['ad_id'];
// mask banner name if anonymous campaign
$campaign = Admin_DA::getPlacement($banner['placement_id']);
$campaignAnonymous = $campaign['anonymous'] == 't' ? true : false;
$banner['name'] = MAX_getAdName($banner['name'], null, null, $campaignAnonymous, $banner['ad_id']);
phpAds_PageContext(MAX_buildName($banner['ad_id'], $banner['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $banner['ad_id']);
}
break;
case 'publishers':
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams['agency_id'] = OA_Permission::getEntityId();
}
$params = $this->aPageParams;
$campaigns = Admin_DA::getPublishers($aParams, false);
foreach ($campaigns as $publisher) {
$params['affiliateid'] = $publisher['publisher_id'];
phpAds_PageContext(MAX_buildName($publisher['publisher_id'], $publisher['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $publisher['publisher_id']);
}
}
break;
case 'publisher-campaigns':
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams = array('publisher_id' => $publisherId, 'placement_id' => $placementId, 'include' => array('placement_id'), 'exclude' => array('zone_id'));
$aPlacements = array();
foreach (Admin_DA::fromCache('getEntitiesStats', $aParams + $this->aDates) as $v) {
$aPlacements[$v['placement_id']] = true;
}
$params = $this->aPageParams;
$campaigns = Admin_DA::getPlacements(array(), false);
foreach ($campaigns as $campaign) {
if (isset($aPlacements[$campaign['placement_id']])) {
$params['campaignid'] = $campaign['placement_id'];
phpAds_PageContext(MAX_buildName($campaign['placement_id'], $campaign['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $campaign['placement_id']);
}
}
}
break;
case 'zones':
$aParams['publisher_id'] = $this->aPageParams['affiliateid'];
$params = $this->aPageParams;
$zones = Admin_DA::getZones($aParams, false);
foreach ($zones as $zone) {
$params['zoneid'] = $zone['zone_id'];
phpAds_PageContext(MAX_buildName($zone['zone_id'], $zone['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $zone['zone_id']);
}
break;
}
}
}