$entityIds += array('day' => $day, 'hour' => $hour, 'howLong' => $howLong);
    $addUrl .= "&day={$day}&hour={$hour}&howLong={$howLong}";
} else {
    $entityIds += array('period_preset' => $period_preset, 'period_start' => $period_start, 'period_end' => $period_end);
    $addUrl .= "&period_preset={$period_preset}&period_start={$period_start}&period_end={$period_end}";
}
// Adjust which nodes are opened closed...
MAX_adjustNodes($aNodes, $expand, $collapse);
if (!OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
    // editing statuses is allowed only for admin and agency
    $editStatuses = false;
} else {
    if ($editStatuses) {
        addPageShortcut($strShortcutShowStatuses, 'stats.php?entity=conversions&editStatuses=0&' . $addUrl, 'iconZoom');
    } else {
        addPageShortcut($strShortcutEditStatuses, 'stats.php?entity=conversions&editStatuses=1&' . $addUrl, 'iconEdit');
    }
}
// @todo: hack - get edit status working when expading/collapsing
if ($editStatuses) {
    $entityIds['editStatuses'] = 1;
    $addUrl .= '&editStatuses=1';
}
// Display navigation
if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
    // Navigation for publisher
    $conf =& $GLOBALS['_MAX']['CONF'];
    $conf['logging']['adRequests'] = false;
    $affiliateid = OA_Permission::getEntityId();
    phpAds_PageHeader("1.1");
    echo '<br><br>';
function displayPage($bannerid, $campaignid, $clientid, $bannerTypes, $aBanner, $type, $form, $ext_bannertype, $formDisabled = false)
{
    $pageName = 'advertiser-campaigns';
    $aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid);
    $entityId = OA_Permission::getEntityId();
    $entityType = 'advertiser_id';
    $aOtherCampaigns = Admin_DA::getPlacements(array($entityType => $entityId));
    $aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignid), false);
    $advertiserId = $aEntities['clientid'];
    $campaignId = $aEntities['campaignid'];
    $bannerId = $aEntities['bannerid'];
    $entityString = _getEntityString($aEntities);
    $aOtherEntities = $aEntities;
    unset($aOtherEntities['bannerid']);
    $otherEntityString = _getEntityString($aOtherEntities);
    if ($pageName == 'banner-edit.php' && empty($bannerId)) {
        $tabValue = 'banner-edit_new';
        $pageType = 'edit-new';
    } else {
        $pageType = 'edit';
    }
    $advertiserEditUrl = '';
    $campaignEditUrl = '';
    if (OA_Permission::hasAccessToObject('clients', $advertiserId)) {
        $advertiserEditUrl = "advertiser-edit.php?clientid={$advertiserId}";
    }
    if (!OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
        $campaignEditUrl = "campaign-edit.php?clientid={$advertiserId}&campaignid={$campaignId}";
    }
    if ($bannerId && !empty($GLOBALS['_MAX']['PREF']['ui_show_banner_preview']) && empty($_GET['nopreview'])) {
        require_once MAX_PATH . '/lib/max/Delivery/adRender.php';
        $aBanner = Admin_DA::getAd($bannerId);
        $aBanner['storagetype'] = $aBanner['type'];
        $aBanner['bannerid'] = $aBanner['ad_id'];
        $bannerCode = MAX_adRender($aBanner, 0, '', '', '', true, '', false, false);
    } else {
        $bannerCode = '';
    }
    $advertiserDetails = phpAds_getClientDetails($advertiserId);
    $advertiserName = $advertiserDetails['clientname'];
    $campaignDetails = Admin_DA::getPlacement($campaignId);
    $campaignName = $campaignDetails['name'];
    $bannerName = $aOtherBanners[$bannerId]['name'];
    $builder = new OA_Admin_UI_Model_InventoryPageHeaderModelBuilder();
    $oHeaderModel = $builder->buildEntityHeader(array(array("name" => $advertiserName, "url" => $advertiserEditUrl), array("name" => $campaignName, "url" => $campaignEditUrl), array("name" => $bannerName)), "banner", $pageType);
    global $phpAds_breadcrumbs_extra;
    $phpAds_breadcrumbs_extra .= "<div class='bannercode'>{$bannerCode}</div>";
    if ($bannerCode != '') {
        $phpAds_breadcrumbs_extra .= "<br />";
    }
    addPageLinkTool($GLOBALS["strDuplicate"], MAX::constructUrl(MAX_URL_ADMIN, "plugins/oxMarkedTextAdvertiser/banner-modify.php?duplicate=true&clientid={$advertiserId}&campaignid={$campaignId}&bannerid={$bannerId}&returnurl=" . urlencode(basename($_SERVER['SCRIPT_NAME']))), "iconBannerDuplicate");
    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');
    phpAds_PageHeader('advertiser-campaigns', $oHeaderModel);
    $oTpl = new OA_Admin_Template('banner-edit.html');
    $oTpl->assign('clientId', $clientid);
    $oTpl->assign('campaignId', $campaignid);
    $oTpl->assign('bannerId', $bannerid);
    $oTpl->assign('bannerTypes', $bannerTypes);
    $oTpl->assign('bannerType', 'bannerTypeText:oxMarkedText:oxMarkedTextComponent');
    $oTpl->assign('bannerHeight', $aBanner["height"]);
    $oTpl->assign('bannerWidth', $aBanner["width"]);
    $oTpl->assign('disabled', $formDisabled);
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    phpAds_PageFooter();
}
Ejemplo n.º 3
0
function addZonePageTools($affiliateid, $zoneid, $aOtherPublishers, $aEntities)
{
    global $phpAds_TextDirection;
    //duplicate
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER) || OA_Permission::hasPermission(OA_PERM_ZONE_ADD)) {
        addPageLinkTool($GLOBALS["strDuplicate"], MAX::constructUrl(MAX_URL_ADMIN, "zone-modify.php?duplicate=true&affiliateid={$affiliateid}&zoneid={$zoneid}&returnurl=" . urlencode(basename($_SERVER['SCRIPT_NAME']))), "iconZoneDuplicate");
    }
    //move to
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
        $form = "<form action='" . MAX::constructUrl(MAX_URL_ADMIN, 'zone-modify.php') . "'>\n        <input type='hidden' name='affiliateid' value='{$affiliateid}'>\n        <input type='hidden' name='zoneid' value='{$zoneid}'>\n        <input type='hidden' name='returnurl' value='" . htmlspecialchars(basename($_SERVER['SCRIPT_NAME'])) . "'>\n        <select name='newaffiliateid'>";
        $aOtherPublishers = _multiSort($aOtherPublishers, 'name', 'publisher_id');
        foreach ($aOtherPublishers as $otherPublisherId => $aOtherPublisher) {
            $otherPublisherName = MAX_buildName($aOtherPublisher['publisher_id'], $aOtherPublisher['name']);
            if ($aOtherPublisher['publisher_id'] != $affiliateid) {
                $form .= "<option value='" . $aOtherPublisher['publisher_id'] . "'>" . htmlspecialchars($otherPublisherName) . "</option>";
            }
        }
        $form .= "</select><input type='image' class='submit' src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/go_blue.gif'></form>";
        addPageFormTool($GLOBALS['strMoveTo'], 'iconZoneMove', $form);
    }
    //delete
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER) || OA_Permission::hasPermission(OA_PERM_ZONE_DELETE)) {
        $deleteConfirm = phpAds_DelConfirm($GLOBALS['strConfirmDeleteZone']);
        addPageLinkTool($GLOBALS["strDelete"], MAX::constructUrl(MAX_URL_ADMIN, "zone-delete.php?token=" . urlencode(phpAds_SessionGetToken()) . "&affiliateid={$affiliateid}&zoneid={$zoneid}&returnurl=affiliate-zones.php"), "iconDelete", null, $deleteConfirm);
    }
    //shortcut
    addPageShortcut($GLOBALS['strBackToZones'], MAX::constructUrl(MAX_URL_ADMIN, "affiliate-zones.php?affiliateid={$affiliateid}"), "iconBack");
    $entityString = _getEntityString($aEntities);
    addPageShortcut($GLOBALS['strZoneHistory'], MAX::constructUrl(MAX_URL_ADMIN, "stats.php?entity=zone&breakdown=history&{$entityString}"), 'iconStatistics');
}
Ejemplo n.º 4
0
 /**
  * A private method to output the shortcuts in the left navigation bar.
  *
  * @access private
  * {@uses addPageShortcut()}
  */
 function _showShortcuts()
 {
     foreach ($this->aPageShortcuts as $shortcut) {
         addPageShortcut($shortcut['name'], $shortcut['link'], $shortcut['iconClass']);
     }
 }