Пример #1
0
 /**
  * A method to launch and display the widget
  *
  * @param array $aParams The parameters array, usually $_REQUEST
  */
 function display()
 {
     if (!$this->oTpl->is_cached()) {
         RV::disableErrorHandling();
         $oRss = new XML_RSS($this->url);
         $result = $oRss->parse();
         RV::enableErrorHandling();
         // ignore bad character error which could appear if rss is using invalid characters
         if (PEAR::isError($result)) {
             if (!strstr($result->getMessage(), 'Invalid character')) {
                 PEAR::raiseError($result);
                 // rethrow
                 $this->oTpl->caching = false;
             }
         }
         $aPost = array_slice($oRss->getItems(), 0, $this->posts);
         foreach ($aPost as $key => $aValue) {
             $aPost[$key]['origTitle'] = $aValue['title'];
             if (strlen($aValue['title']) > 38) {
                 $aPost[$key]['title'] = substr($aValue['title'], 0, 38) . '...';
             }
         }
         $this->oTpl->assign('title', $this->title);
         $this->oTpl->assign('feed', $aPost);
         $this->oTpl->assign('siteTitle', $this->siteTitle);
         $this->oTpl->assign('siteUrl', $this->siteUrl);
     }
     $this->oTpl->display();
 }
Пример #2
0
 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $oTpl = new OA_Admin_Template('dashboard/grid.html');
     $oTpl->assign('dashboardURL', MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php'));
     $oTpl->assign('cssURL', OX::assetPath() . "/css");
     $oTpl->assign('imageURL', OX::assetPath() . "/images");
     $oTpl->assign('jsURL', OX::assetPath() . "/js");
     $oTpl->display();
 }
Пример #3
0
 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     $oTpl = new OA_Admin_Template('dashboard/disabled.html');
     $oDashboard = new OA_Central_Dashboard();
     $oTpl->assign('isAdmin', OA_Permission::isAccount(OA_ACCOUNT_ADMIN));
     $oTpl->display();
 }
Пример #4
0
 protected function createView($actionName)
 {
     $view = new OA_Admin_Template($actionName . '-step.html');
     $installTemplatesPath = MAX_PATH . '/www/admin/templates/install/';
     $view->template_dir = $installTemplatesPath;
     $view->assign("oxInstallerTemplateDir", $installTemplatesPath);
     $view->register_function('ox_wizard_steps', array(new OX_UI_WizardSteps(), 'wizardSteps'));
     return $view;
 }
 public static function createTemplateWithModel($panel, $single = true)
 {
     $agencyId = OA_Permission::getAgencyId();
     $oDalZones = OA_Dal::factoryDAL('zones');
     $infix = $single ? '' : '-' . $panel;
     phpAds_registerGlobalUnslashed('action', 'campaignid', 'clientid', "text{$infix}", "page{$infix}");
     $campaignId = $GLOBALS['campaignid'];
     $text = $GLOBALS["text{$infix}"];
     $linked = $panel == 'linked';
     $showStats = empty($GLOBALS['_MAX']['CONF']['ui']['zoneLinkingStatistics']) ? false : true;
     $websites = $oDalZones->getWebsitesAndZonesList($agencyId, $campaignId, $linked, $text);
     $matchingZones = 0;
     foreach ($websites as $aWebsite) {
         $matchingZones += count($aWebsite['zones']);
     }
     $aZonesCounts = array('all' => $oDalZones->countZones($agencyId, null, $campaignId, $linked), 'matching' => $matchingZones);
     $pagerFileName = 'campaign-zone-zones.php';
     $pagerParams = array('clientid' => $GLOBALS['clientid'], 'campaignid' => $GLOBALS['campaignid'], 'status' => $panel, 'text' => $text);
     $currentPage = null;
     if (!$single) {
         $currentPage = $GLOBALS["page{$infix}"];
     }
     $oTpl = new OA_Admin_Template('campaign-zone-zones.html');
     $oPager = OX_buildPager($websites, self::WEBSITES_PER_PAGE, true, 'websites', 2, $currentPage, $pagerFileName, $pagerParams);
     $oTopPager = OX_buildPager($websites, self::WEBSITES_PER_PAGE, false, 'websites', 2, $currentPage, $pagerFileName, $pagerParams);
     list($itemsFrom, $itemsTo) = $oPager->getOffsetByPageId();
     $websites = array_slice($websites, $itemsFrom - 1, self::WEBSITES_PER_PAGE, true);
     // Add statistics for the displayed zones if required
     if ($showStats) {
         $oDalZones->mergeStatistics($websites, $campaignId);
     }
     // Count how many zone are displayed
     $showingCount = 0;
     foreach ($websites as $website) {
         $showingCount += count($website['zones']);
     }
     $aZonesCounts['showing'] = $showingCount;
     $oTpl->assign('pager', $oPager);
     $oTpl->assign('topPager', $oTopPager);
     $oTpl->assign('websites', $websites);
     $oTpl->assign('zonescounts', $aZonesCounts);
     $oTpl->assign('text', $text);
     $oTpl->assign('status', $panel);
     $oTpl->assign('page', $oTopPager->getCurrentPageID());
     $oTpl->assign('showStats', $showStats);
     $oTpl->assign('colspan', $showStats ? 6 : 3);
     return $oTpl;
 }
Пример #6
0
 public static function assignModel(OA_Admin_Template $template, $query = '')
 {
     $accounts = OA_Permission::getLinkedAccounts(true, true);
     $remainingCounts = array();
     // Prepare recently used accountName
     $recentlyUsed = array();
     global $session;
     if (empty($query) && !empty($session['recentlyUsedAccounts'])) {
         $allAcountsNoGroups = array();
         foreach ($accounts as $k => $v) {
             foreach ($accounts[$k] as $accountId => $accountName) {
                 $allAcountsNoGroups[$accountId] = $accountName;
             }
         }
         $recentlyUsedAccountIds = $session['recentlyUsedAccounts'];
         $added = 0;
         foreach ($recentlyUsedAccountIds as $k => $recentlyUserAccountId) {
             if (++$added > self::MAX_ACCOUNTS_IN_GROUP) {
                 break;
             }
             $recentlyUsed[$recentlyUserAccountId] = $allAcountsNoGroups[$recentlyUserAccountId];
         }
     }
     // Prepare admin accounts
     if (isset($accounts[OA_ACCOUNT_ADMIN])) {
         $adminAccounts = self::filterByNameAndLimit($accounts[OA_ACCOUNT_ADMIN], $query, $remainingCounts, OA_ACCOUNT_ADMIN);
         unset($accounts[OA_ACCOUNT_ADMIN]);
     } else {
         $adminAccounts = array();
     }
     $showSearchAndRecent = false;
     foreach ($accounts as $k => $v) {
         $workingFor = sprintf($GLOBALS['strWorkingFor'], ucfirst(strtolower($k)));
         $accounts[$workingFor] = self::filterByNameAndLimit($v, $query, $remainingCounts, $workingFor);
         $count = count($accounts[$workingFor]);
         if ($count == 0) {
             unset($accounts[$workingFor]);
         }
         $showSearchAndRecent |= isset($remainingCounts[$workingFor]);
         unset($accounts[$k]);
     }
     // Prepend recently used to the results
     if (!empty($recentlyUsed) && $showSearchAndRecent) {
         $accounts = array_merge(array($GLOBALS['strRecentlyUsed'] => $recentlyUsed), $accounts);
     }
     $template->assign('adminAccounts', $adminAccounts);
     $template->assign('otherAccounts', $accounts);
     $template->assign('remainingCounts', $remainingCounts);
     $template->assign('query', $query);
     $template->assign('noAccountsMessage', sprintf($GLOBALS['strNoAccountWithXInNameFound'], $query));
     $template->assign('currentAccountId', OA_Permission::getAccountId());
     $template->assign('showSearchAndRecent', $showSearchAndRecent);
 }
Пример #7
0
 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     phpAds_PageHeader(null, new OA_Admin_UI_Model_PageHeaderModel(), '', false, false);
     $oTpl = new OA_Admin_Template('dashboard/main.html');
     if (!$aConf['ui']['dashboardEnabled'] || !$aConf['sync']['checkForUpdates']) {
         $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Disabled');
     } else {
         $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Grid');
     }
     $oTpl->assign('dashboardURL', $dashboardUrl);
     $oTpl->display();
     phpAds_PageFooter('', true);
 }
Пример #8
0
 public static function createTemplateWithModel($panel, $single = true)
 {
     $agencyId = OA_Permission::getAgencyId();
     $oDalZones = OA_Dal::factoryDAL('zones');
     $infix = $single ? '' : '-' . $panel;
     phpAds_registerGlobalUnslashed('action', 'campaignid', 'clientid', "category{$infix}", "category{$infix}-text", "text{$infix}", "page{$infix}");
     $campaignId = $GLOBALS['campaignid'];
     $category = $GLOBALS["category{$infix}"];
     $categoryText = $GLOBALS["category{$infix}-text"];
     $text = $GLOBALS["text{$infix}"];
     $linked = $panel == 'linked';
     $websites = $oDalZones->getWebsitesAndZonesListByCategory($agencyId, $category, $campaignId, $linked, $text);
     $pagerFileName = 'campaign-zone-zones.php';
     $pagerParams = array('clientid' => $GLOBALS['clientid'], 'campaignid' => $GLOBALS['campaignid'], 'status' => $panel, 'category' => $category, 'category-text' => $categoryText, 'text' => $text);
     $currentPage = null;
     if (!$single) {
         $currentPage = $GLOBALS["page{$infix}"];
     }
     $oTpl = new OA_Admin_Template('campaign-zone-zones.html');
     $oPager = OX_buildPager($websites, self::WEBSITES_PER_PAGE, true, 'websites', 2, $currentPage, $pagerFileName, $pagerParams);
     $oTopPager = OX_buildPager($websites, self::WEBSITES_PER_PAGE, false, 'websites', 2, $currentPage, $pagerFileName, $pagerParams);
     list($itemsFrom, $itemsTo) = $oPager->getOffsetByPageId();
     $websites = array_slice($websites, $itemsFrom - 1, self::WEBSITES_PER_PAGE, true);
     $aZonesCounts = array('all' => $oDalZones->countZones($agencyId, null, $campaignId, $linked), 'matching' => $oDalZones->countZones($agencyId, $category, $campaignId, $linked, $text));
     $showingCount = 0;
     // TODO: currently we're calculating the number in PHP code. Once
     // MAX_Dal_Admin_Zones::countZones() supports the limit parameter, we can remove
     // the code below and use the dal.
     foreach ($websites as $website) {
         $showingCount += count($website['zones']);
     }
     $aZonesCounts['showing'] = $showingCount;
     $oTpl->assign('pager', $oPager);
     $oTpl->assign('topPager', $oTopPager);
     $oTpl->assign('websites', $websites);
     $oTpl->assign('zonescounts', $aZonesCounts);
     $oTpl->assign('category', $categoryText);
     $oTpl->assign('text', $text);
     $oTpl->assign('status', $panel);
     $oTpl->assign('page', $oTopPager->getCurrentPageID());
     return $oTpl;
 }
Пример #9
0
 function showFooter()
 {
     global $session;
     $aConf = $GLOBALS['_MAX']['CONF'];
     $this->oTpl->assign('uiPart', 'footer');
     $this->oTpl->display();
     // Clean up MPE session variable
     if (!empty($session['RUN_MPE']) && $session['RUN_MPE'] === true) {
         unset($session['RUN_MPE']);
         phpAds_SessionDataStore();
     }
     if (isset($aConf['ui']['gzipCompression']) && $aConf['ui']['gzipCompression']) {
         //flush if we have used ob_gzhandler
         $zlibCompression = ini_get('zlib.output_compression');
         if (!$zlibCompression && function_exists('ob_gzhandler')) {
             ob_end_flush();
         }
     }
 }
Пример #10
0
 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     phpAds_PageHeader(null, new OA_Admin_UI_Model_PageHeaderModel(), '', false, false);
     $oTpl = new OA_Admin_Template('dashboard/main.html');
     if (!$aConf['ui']['dashboardEnabled'] || !$aConf['sync']['checkForUpdates']) {
         $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Disabled');
     } else {
         $m2mTicket = OA_Dal_Central_M2M::getM2MTicket(OA_Permission::getAccountId());
         if (empty($m2mTicket)) {
             $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Reload');
         } else {
             $dashboardUrl = $this->buildDashboardUrl($m2mTicket, null, '&');
         }
     }
     $oTpl->assign('dashboardURL', $dashboardUrl);
     $oTpl->display();
     phpAds_PageFooter('', true);
 }
Пример #11
0
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();
}
Пример #12
0
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
// Register input variables
// TODO: This variable has been added to demonstrate that clicking on
// links from error messages could bring the already entered e-mail address
// to the new form. Feel free to keep it or remove, depending on the
// implementation strategy.
phpAds_registerGlobalUnslashed('email');
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("4.1.3.4.7.2");
// TODO: The path here should probably start with the advertiser's data
// Not sure if we need to include the campaign and banner in the path though.
// We'll need to clarify this with the Product team.
echo "<img src='" . OX::assetPath() . "/images/icon-affiliate.gif' align='absmiddle'>&nbsp;<b>Create AdSense Account</b><br /><br /><br />";
phpAds_ShowSections(array("4.1.3.4.7.2"));
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('adsense-create.html');
$oTpl->assign('fields', array(array('title' => 'Email address for AdSense Account', 'fields' => array(array('name' => 'email', 'label' => 'Email', 'value' => '', 'id' => 'adsenseemail', 'title' => 'Provide valid email', 'clientValid' => 'required:true,email:true'))), array('title' => 'Name for the AdSense Account in Openads', 'fields' => array(array('name' => 'name', 'label' => 'Name for the AdSense Account in Openads', 'value' => '', 'id' => 'accountname', 'title' => 'Provide name in Openads', 'clientValid' => 'required:true')))));
//var_dump($oTpl);
//die();
$oTpl->display();
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageFooter();
    if (!empty(${$key})) {
        $aUrlParam[$key] = "{$key}=" . ${$key};
    }
}
$aUrlParam['listorder'] = "listorder={$listorder}";
$aUrlParam['$orderdirection'] = $orderdirection == 'down' ? "orderdirection=up" : "orderdirection=down";
$urlParam = implode('&', $aUrlParam);
// Replace context with translation
foreach ($aAuditData as $key => $aValue) {
    $k = 'str' . str_replace(' ', '', $aValue['context']);
    if (!empty($GLOBALS[$k])) {
        $aAuditData[$key]['context'] = $GLOBALS[$k];
    }
}
// Assign vars to template
$oTpl->assign('showAdvertisers', $showAdvertisers);
$oTpl->assign('showPublishers', $showPublishers);
if ($showAdvertisers) {
    $oTpl->assign('aAdvertiser', $aAdvertiser);
    $oTpl->assign('aCampaign', $aCampaign);
}
if ($showPublishers) {
    $oTpl->assign('aPublisher', $aPublisher);
    $oTpl->assign('aZone', $aZone);
}
$oTpl->assign('aAuditEnabled', OA::getConfigOption('audit', 'enabled', false));
$oTpl->assign('aAuditData', $aAuditData);
$oTpl->assign('aPeriodPreset', $aPeriodPreset);
$oTpl->assign('context', $context);
$oTpl->assign('advertiserId', $advertiserId);
$oTpl->assign('campaignId', $campaignId);
 /**
  * A method to set the required template variables, if any
  *
  * @param OA_Admin_Template $oTpl
  */
 function setTemplateVariables(&$oTpl)
 {
     if (preg_match('/-user-start\\.html$/', $oTpl->templateName)) {
         $oTpl->assign('fields', array(array('fields' => array(array('name' => 'login', 'label' => $GLOBALS['strUsernameToLink'], 'value' => '', 'id' => 'user-key')))));
     }
 }
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
/**
 * OpenX jQuery ajax functions
 */
require_once '../../../../init.php';
require_once MAX_PATH . '/lib/OA/Admin/UI.php';
/**
 since we are loading a page inside of a frame we do not have access to
 scripts defined in top frame. Thus we need to load them on our own if we want to
 use jQuery.
 Please note that scripts.html is an admin template not a plugin template
 **/
$oUI = OA_Admin_UI::getInstance();
$aScripts = $oUI->genericJavascript();
$oTpl = new OA_Admin_Template('layout/scripts.html');
$oTpl->assign('aGenericJavascript', $aScripts);
$oTpl->display();
//now display the page content
include "templates/content.html";
Пример #16
0
 case 'exp':
     $oTpl = new OA_Admin_Template('plugin-export.html');
     require_once LIB_PATH . '/Plugin/PluginExport.php';
     $oExporter = new OX_PluginExport();
     $aErrors = array();
     foreach ($GLOBALS['_MAX']['CONF']['plugins'] as $name => $enabled) {
         $aPlugins[$name]['file'] = '';
         $aPlugins[$name]['error'] = false;
         if ($file = $oExporter->exportPlugin($name)) {
             $aPlugins[$name]['file'] = $file;
         } else {
             $aPlugins[$name]['error'] = true;
             $aErrors[] = $oExporter->aErrors;
         }
     }
     $oTpl->assign('aPlugins', $aPlugins);
     $oTpl->assign('aErrors', $aErrors);
     break;
     /*case 'dep':
       require_once LIB_PATH . '/Plugin/PluginManager.php';
       $oPluginManager = & new OX_PluginManager();
       $oPluginManager->_cacheDependencies();
       if (empty($oPluginManager->aErrors))
       {
           $oPluginManager->aMessages[] = 'No dependency problems detected';
       }
       break;*/
 /*case 'dep':
   require_once LIB_PATH . '/Plugin/PluginManager.php';
   $oPluginManager = & new OX_PluginManager();
   $oPluginManager->_cacheDependencies();
Пример #17
0
 /**
  * A method to launch and display the widget
  *
  * @param array $aParams The parameters array, usually $_REQUEST
  */
 function display()
 {
     $conf = $GLOBALS['_MAX']['CONF'];
     if (!$conf['audit']['enabled']) {
         $this->oTpl->assign('screen', 'disabled');
         $this->oTpl->assign('siteTitle', $GLOBALS['strCampaignAuditTrailSetup']);
         $this->oTpl->assign('siteUrl', MAX::constructUrl(MAX_URL_ADMIN, 'account-settings-debug.php'));
     } else {
         $oCache = new OA_Cache('campaignOverview', 'Widgets');
         $aCache = $oCache->load(true);
         $aCampaign = array();
         if (isset($aCache['maxItems'])) {
             if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
                 foreach ($aCache['aAccounts'] as $aActions) {
                     foreach ($aActions as $aAction) {
                         $aCampaign[$aAction['auditid']] = $aAction;
                     }
                 }
             } else {
                 $aAccountsId = OA_Permission::getOwnedAccounts(OA_Permission::getAccountId());
                 foreach ($aAccountsId as $accountId) {
                     if (isset($aCache['aAccounts'][$accountId])) {
                         foreach ($aCache['aAccounts'][$accountId] as $aAction) {
                             $aCampaign[$aAction['auditid']] = $aAction;
                         }
                     }
                 }
             }
             krsort($aCampaign);
             $aCampaign = array_slice($aCampaign, 0, $aCache['maxItems']);
         }
         if (count($aCampaign)) {
             $aActionMap = array('added' => $GLOBALS['strCampaignStatusAdded'], 'started' => $GLOBALS['strCampaignStatusStarted'], 'restarted' => $GLOBALS['strCampaignStatusRestarted'], 'completed' => $GLOBALS['strCampaignStatusExpired'], 'paused' => $GLOBALS['strCampaignStatusPaused'], 'deleted' => $GLOBALS['strCampaignStatusDeleted']);
             foreach ($aCampaign as $k => $v) {
                 if (isset($aActionMap[$v['action']])) {
                     $aCampaign[$k]['actionDesc'] = $aActionMap[$v['action']];
                 }
             }
         } else {
             // Check if the account has any campaign in its realm
             $doCampaigns = OA_Dal::factoryDO('campaigns');
             if (!empty($aParam['account_id'])) {
                 $doClients = OA_Dal::factoryDO('clients');
                 $doAgency = OA_Dal::factoryDO('agency');
                 $doAgency->account_id = $aParam['account_id'];
                 $doClients->joinAdd($doAgency);
                 $doCampaigns->joinAdd($doClients);
             }
             $doCampaigns->limit(1);
             $this->oTpl->assign('hasCampaigns', $doCampaigns->count());
             if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
                 $this->oTpl->assign('isAdmin', true);
             }
         }
         $this->oTpl->assign('screen', 'enabled');
         $this->oTpl->assign('aCampaign', $aCampaign);
         $this->oTpl->assign('siteUrl', MAX::constructURL(MAX_URL_ADMIN, 'advertiser-campaigns.php'));
         $this->oTpl->assign('baseUrl', MAX::constructURL(MAX_URL_ADMIN, 'campaign-edit.php'));
     }
     $this->oTpl->display();
 }
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER);
OA_Permission::enforceAccountPermission(OA_ACCOUNT_ADVERTISER, OA_PERM_USER_LOG_ACCESS);
OA_Permission::enforceAccountPermission(OA_ACCOUNT_TRAFFICKER, OA_PERM_USER_LOG_ACCESS);
OA_Permission::enforceAccessToObject('audit', $auditId);
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader('userlog-index');
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
    // Show all "My Account" sections
    phpAds_ShowSections(array("5.1", "5.2", "5.3", "5.5", "5.6", "5.4"));
    phpAds_UserlogSelection("index");
} else {
    if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
        // Show the "Preferences", "User Log" and "Channel Management" sections of the "My Account" sections
        phpAds_ShowSections(array("5.1", "5.2", "5.4", "5.7"));
    } else {
        if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER) || OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
            phpAds_ShowSections(array("5.1", "5.2", "5.4"));
        }
    }
}
//  initialize parameters
$pageName = basename($_SERVER['SCRIPT_NAME']);
$oTpl = new OA_Admin_Template('userlog-audit-detailed.html');
$oAudit = new OA_Dll_Audit();
$aAuditDetail = $oAudit->getAuditDetail($auditId);
$oTpl->assign('aAuditDetail', $aAuditDetail);
$oTpl->display();
phpAds_PageFooter();
// Figure out which banners are inactive and prepare trimmed URLs for display
$bannersHidden = 0;
if (isset($banners) && is_array($banners) && count($banners) > 0) {
    reset($banners);
    while (list($key, $banner) = each($banners)) {
        $aCount['banners']++;
        if ($hideinactive == true && $banner['status'] != OA_ENTITY_STATUS_RUNNING) {
            $bannersHidden++;
            $aCount['banners_hidden']++;
            unset($banners[$key]);
        } elseif (strlen($banner['url']) > 40) {
            $banners[$key]['url_trimmed'] = substr_replace($banner['url'], ' ...', 40);
        }
    }
}
$oTpl->assign('clientId', $clientid);
$oTpl->assign('campaignId', $campaignid);
$oTpl->assign('aBanners', $banners);
$oTpl->assign('aCount', $aCount);
$oTpl->assign('hideinactive', $hideinactive);
$oTpl->assign('listorder', $listorder);
$oTpl->assign('orderdirection', $orderdirection);
$oTpl->assign('isManager', OA_Permission::isAccount(OA_ACCOUNT_MANAGER));
$oTpl->assign('canACL', !OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER));
$oTpl->assign('canEdit', !OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER) || OA_Permission::hasPermission(OA_PERM_BANNER_EDIT));
$oTpl->assign('canActivate', !OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER) || OA_Permission::hasPermission(OA_PERM_BANNER_ACTIVATE));
$oTpl->assign('canDeactivate', !OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER) || OA_Permission::hasPermission(OA_PERM_BANNER_DEACTIVATE));
$oTpl->assign('canDelete', !OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER));
/*-------------------------------------------------------*/
/* Store preferences                                     */
/*-------------------------------------------------------*/
function displayPage($campaign, $campaignForm, $statusForm, $campaignErrors = null)
{
    global $conf;
    //header and breadcrumbs
    if ($campaign['campaignid'] != "") {
        //edit campaign
        // Initialise some parameters
        $tabindex = 1;
        $agencyId = OA_Permission::getAgencyId();
        $aEntities = array('clientid' => $campaign['clientid'], 'campaignid' => $campaign['campaignid']);
        // Display navigation
        $aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
        $aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $campaign['clientid']));
        MAX_displayNavigationCampaign($campaign['campaignid'], $aOtherAdvertisers, $aOtherCampaigns, $aEntities);
    } else {
        //new campaign
        $advertiser = phpAds_getClientDetails($campaign['clientid']);
        $advertiserName = $advertiser['clientname'];
        $advertiserEditUrl = "advertiser-edit.php?clientid=" . $campaign['clientid'];
        // New campaign
        $builder = new OA_Admin_UI_Model_InventoryPageHeaderModelBuilder();
        $oHeaderModel = $builder->buildEntityHeader(array(array("name" => $advertiserName, "url" => $advertiserEditUrl), array("name" => "")), "campaign", "edit-new");
        phpAds_PageHeader("campaign-edit_new", $oHeaderModel);
    }
    //get template and display form
    $oTpl = new OA_Admin_Template('campaign-edit.html');
    $oTpl->assign('clientid', $campaign['clientid']);
    $oTpl->assign('campaignid', $campaign['campaignid']);
    $oTpl->assign('calendarBeginOfWeek', $GLOBALS['pref']['begin_of_week'] ? 1 : 0);
    $oTpl->assign('language', $GLOBALS['_MAX']['PREF']['language']);
    $oTpl->assign('conversionsEnabled', $conf['logging']['trackerImpressions']);
    $oTpl->assign('adDirectEnabled', defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true);
    $oTpl->assign('impressionsDelivered', isset($campaign['impressions_delivered']) ? $campaign['impressions_delivered'] : 0);
    $oTpl->assign('clicksDelivered', isset($campaign['clicks_delivered']) ? $campaign['clicks_delivered'] : 0);
    $oTpl->assign('conversionsDelivered', isset($campaign['conversions_delivered']) ? $campaign['conversions_delivered'] : 0);
    $oTpl->assign('strCampaignWarningNoTargetMessage', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningNoTarget'])));
    $oTpl->assign('strCampaignWarningRemnantNoWeight', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningRemnantNoWeight'])));
    $oTpl->assign('strCampaignWarningEcpmNoRevenue', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningEcpmNoRevenue'])));
    $oTpl->assign('strCampaignWarningExclusiveNoWeight', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningExclusiveNoWeight'])));
    $oTpl->assign('campaignErrors', $campaignErrors);
    $oTpl->assign('CAMPAIGN_TYPE_REMNANT', OX_CAMPAIGN_TYPE_REMNANT);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_NORMAL', OX_CAMPAIGN_TYPE_CONTRACT_NORMAL);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_EXCLUSIVE', OX_CAMPAIGN_TYPE_CONTRACT_EXCLUSIVE);
    $oTpl->assign('CAMPAIGN_TYPE_ECPM', OX_CAMPAIGN_TYPE_ECPM);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_ECPM', OX_CAMPAIGN_TYPE_CONTRACT_ECPM);
    $oTpl->assign('PRIORITY_ECPM_FROM', DataObjects_Campaigns::PRIORITY_ECPM_FROM);
    $oTpl->assign('PRIORITY_ECPM_TO', DataObjects_Campaigns::PRIORITY_ECPM_TO);
    $oTpl->assign('MODEL_CPM', MAX_FINANCE_CPM);
    $oTpl->assign('MODEL_CPC', MAX_FINANCE_CPC);
    $oTpl->assign('MODEL_CPA', MAX_FINANCE_CPA);
    if ($conf['logging']['trackerImpressions']) {
        $oTpl->assign('MODEL_MT', MAX_FINANCE_MT);
    }
    $oTpl->assign('campaignFormId', $campaignForm->getId());
    $oTpl->assign('campaignForm', $campaignForm->serialize());
    if (!empty($campaign['campaignid']) && defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true) {
        $oTpl->assign('statusForm', $statusForm->serialize());
    }
    $oTpl->display();
    _echoDeliveryCappingJs();
    //footer
    phpAds_PageFooter();
}
Пример #21
0
                        }
                    }
                }
            }
        }
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("plugin-index", new OA_Admin_UI_Model_PageHeaderModel($GLOBALS['strPlugins']), '', false, true);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
if (is_null($oTpl)) {
    if (array_key_exists('selection', $_REQUEST) && $_REQUEST['selection'] == 'groups') {
        $oTpl = new OA_Admin_Template('plugin-group-index-list.html');
        $oTpl->assign('aWarnings', $oComponentGroupManager->aWarnings);
        $oTpl->assign('selected', 'groups');
        $oTpl->assign('aPlugins', $oComponentGroupManager->getComponentGroupsList());
    } else {
        $oTpl = new OA_Admin_Template('plugin-index.html');
        $oTpl->assign('selected', 'plugins');
        $oTpl->assign('aPackages', $oPluginManager->getPackagesList());
        $oTpl->assign('aWarnings', $oPluginManager->aWarnings);
        $oTpl->assign('aErrors', $oPluginManager->aErrors);
        $oTpl->assign('aMessages', $oPluginManager->aMessages);
    }
}
$oTpl->display();
phpAds_PageFooter();
Пример #22
0
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("plugin-index", new OA_Admin_UI_Model_PageHeaderModel($GLOBALS['strPlugins']), '', false, true);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
if (is_null($oTpl)) {
    if (array_key_exists('selection', $_REQUEST) && $_REQUEST['selection'] == 'groups') {
        $oTpl = new OA_Admin_Template('plugin-group-index-list.html');
        $oTpl->assign('aWarnings', $oComponentGroupManager->aWarnings);
        $oTpl->assign('selected', 'groups');
        $oTpl->assign('aPlugins', $oComponentGroupManager->getComponentGroupsList());
    } else {
        $oTpl = new OA_Admin_Template('plugin-index.html');
        $oTpl->assign('selected', 'plugins');
        $oTpl->assign('aPackages', $oPluginManager->getPackagesList());
        $oTpl->assign('aWarnings', $oPluginManager->aWarnings);
        $oTpl->assign('aErrors', $oPluginManager->aErrors);
        $oTpl->assign('aMessages', $oPluginManager->aMessages);
    }
}
// Determine if config file is writable
$configLocked = !OA_Admin_Settings::isConfigWritable();
$image = $configLocked ? 'closed' : 'open';
$oTpl->assign('configLocked', $configLocked);
$oTpl->assign('image', $image);
$oTpl->assign('token', phpAds_SessionGetToken());
$oTpl->display();
phpAds_PageFooter();
Пример #23
0
function displayPage($aZone, $form)
{
    $pageName = basename($_SERVER['SCRIPT_NAME']);
    $agencyId = OA_Permission::getAgencyId();
    $aEntities = array('affiliateid' => $aZone['affiliateid'], 'zoneid' => $aZone['zoneid']);
    $aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId));
    $aOtherZones = Admin_DA::getZones(array('publisher_id' => $aZone['affiliateid']));
    MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('zone-advanced.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    _echoDeliveryCappingJs();
    //footer
    phpAds_PageFooter();
}
Пример #24
0
        $orderdirection = '';
    }
}
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('website-index.html');
$dalAffiliates = OA_Dal::factoryDAL('affiliates');
$aWebsitesZones = $dalAffiliates->getWebsitesAndZonesByAgencyId();
$itemsPerPage = 250;
$oPager = OX_buildPager($aWebsitesZones, $itemsPerPage);
$oTopPager = OX_buildPager($aWebsitesZones, $itemsPerPage, false);
list($itemsFrom, $itemsTo) = $oPager->getOffsetByPageId();
$aWebsitesZones = array_slice($aWebsitesZones, $itemsFrom - 1, $itemsPerPage, true);
$oTpl->assign('pager', $oPager);
$oTpl->assign('topPager', $oTopPager);
$oTpl->assign('affiliates', $aWebsitesZones);
$oTpl->assign('listorder', $listorder);
$oTpl->assign('orderdirection', $orderdirection);
$oTpl->assign('phpAds_ZoneBanner', phpAds_ZoneBanner);
$oTpl->assign('phpAds_ZoneInterstitial', phpAds_ZoneInterstitial);
$oTpl->assign('phpAds_ZonePopup', phpAds_ZonePopup);
$oTpl->assign('phpAds_ZoneText' . phpAds_ZoneText);
$oTpl->assign('showAdDirect', defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true ? true : false);
/*-------------------------------------------------------*/
/* Store preferences                                     */
/*-------------------------------------------------------*/
$session['prefs']['website-index.php']['listorder'] = $listorder;
$session['prefs']['website-index.php']['orderdirection'] = $orderdirection;
phpAds_SessionDataStore();
Пример #25
0
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
// Register input variables
// TODO: This variable has been added to demonstrate that clicking on
// links from error messages could bring the already entered e-mail address
// to the new form. Feel free to keep it or remove, depending on the
// implementation strategy.
phpAds_registerGlobalUnslashed('email');
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("4.1.3.4.7.1");
// TODO: The path here should probably start with the advertiser's data
// Not sure if we need to include the campaign and banner in the path though.
// We'll need to clarify this with the Product team.
echo "<img src='" . OX::assetPath() . "/images/icon-affiliate.gif' align='absmiddle'>&nbsp;<b>Link existing AdSense Account</b><br /><br /><br />";
phpAds_ShowSections(array("4.1.3.4.7.1"));
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('adsense-link.html');
$oTpl->assign('fields', array(array('title' => 'Existing AdSense Account Identification', 'fields' => array(array('name' => 'email', 'label' => 'Email', 'value' => $email, 'id' => 'adsenseemail', 'title' => 'Provide valid email', 'clientValid' => 'required:true,email:true'), array('name' => 'phone5digits', 'label' => 'Last 5 digits of phone number', 'value' => '', 'id' => 'phonedigits', 'title' => 'Provide last 5 phone digits', 'maxlength' => '5', 'clientValid' => 'required:true,number:true'), array('name' => 'postalcode', 'label' => 'Postal Code', 'value' => '', 'id' => 'postcode', 'title' => 'Provide postal code', 'clientValid' => 'required:true'))), array('title' => 'Name for the AdSense Account in OpenX', 'fields' => array(array('name' => 'name', 'label' => 'Name for the AdSense Account in OpenX', 'value' => '', 'id' => 'accountname', 'title' => 'Provide name in OpenX', 'clientValid' => 'required:true')))));
//var_dump($oTpl);
//die();
$oTpl->display();
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageFooter();
// output using the $oOption object
$aPreferences[0]['text'] = $group . ' ' . $strPreferences;
$count = count($aConfig['preferences']);
$i = 0;
foreach ($aConfig['preferences'] as $k => $v) {
    $aPreferences[0]['items'][] = array('type' => $v['type'], 'name' => $group . '_' . $v['name'], 'text' => $v['label'], 'req' => $v['required'], 'size' => $v['size'], 'value' => $v['value'], 'visible' => $v['visible']);
    //add break after a field excluding last
    $i++;
    if ($i < $count) {
        $aPreferences[0]['items'][] = array('type' => 'break');
    }
}
$aPreferences[0]['items'][] = array('type' => 'hiddenfield', 'name' => 'plugin', 'value' => $plugin);
$aPreferences[0]['items'][] = array('type' => 'hiddenfield', 'name' => 'group', 'value' => $group);
$GLOBALS['_MAX']['PREF_EXTRA'] = OA_Preferences::loadPreferences(true, true);
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("plugin-index", new OA_Admin_UI_Model_PageHeaderModel($GLOBALS['strPluginPreferences']), '', false, true);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
//display back link
$oTpl = new OA_Admin_Template('plugin-group-preferences.html');
$oTpl->assign('backURL', MAX::constructURL(MAX_URL_ADMIN, $backURL));
$oTpl->assign('plugin', $plugin);
$oTpl->assign('group', $group);
$oTpl->display();
//display options form
$oOptions->show($aPreferences, $aErrormessage);
phpAds_PageFooter();
    }
    $aCampaigns[$campaignId] = $aCampaign;
}
$aCount = array('campaigns' => 0, 'campaigns_hidden' => 0);
$campaignshidden = 0;
if (isset($aCampaigns) && is_array($aCampaigns) && count($aCampaigns) > 0) {
    reset($aCampaigns);
    while (list($key, $campaign) = each($aCampaigns)) {
        $aCount['campaigns']++;
        if ($hideinactive == true && ($campaign['status'] != OA_ENTITY_STATUS_RUNNING || $campaign['status'] == OA_ENTITY_STATUS_RUNNING && count($campaign['banners']) == 0 && count($campaign['banners']) < $campaign['count'])) {
            $aCount['campaigns_hidden']++;
            unset($aCampaigns[$key]);
        }
    }
}
$oTpl->assign('clientId', $clientid);
$oTpl->assign('aCampaigns', $aCampaigns);
$oTpl->assign('aCount', $aCount);
$oTpl->assign('hideinactive', $hideinactive);
$oTpl->assign('listorder', $listorder);
$oTpl->assign('orderdirection', $orderdirection);
$oTpl->assign('showconversions', $conf['logging']['trackerImpressions']);
$oTpl->assign('isAdvertiser', OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER));
$oTpl->assign('canEdit', OA_Permission::hasPermission(OA_PERM_BANNER_ACTIVATE) || OA_Permission::hasPermission(OA_PERM_BANNER_EDIT));
$oTpl->assign('isManager', OA_Permission::isAccount(OA_ACCOUNT_MANAGER));
/*-------------------------------------------------------*/
/* Store preferences                                     */
/*-------------------------------------------------------*/
$session['prefs']['advertiser-campaigns.php'][$clientid]['hideinactive'] = $hideinactive;
$session['prefs']['advertiser-campaigns.php'][$clientid]['listorder'] = $listorder;
$session['prefs']['advertiser-campaigns.php'][$clientid]['orderdirection'] = $orderdirection;
Пример #28
0
 /**
  * A method to display an M2M/Dashboard error
  *
  * @param PEAR_Error $oError
  */
 function showError($oError)
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     $oTpl = new OA_Admin_Template('dashboard/error.html');
     $errorCode = $oError->getCode();
     $nativeErrorMessage = $oError->getMessage();
     // Set error message
     if (isset($GLOBALS['strDashboardErrorMsg' . $errorCode])) {
         $errorMessage = $GLOBALS['strDashboardErrorMsg' . $errorCode];
     } else {
         if (!empty($nativeErrorMessage)) {
             $errorMessage = $nativeErrorMessage;
             // Don't show this message twice on error page
             unset($nativeErrorMessage);
         } else {
             $errorMessage = $GLOBALS['strDashboardGenericError'];
         }
     }
     // Set error description
     if (isset($GLOBALS['strDashboardErrorDsc' . $errorCode])) {
         $errorDescription = $GLOBALS['strDashboardErrorDsc' . $errorCode];
     }
     $oTpl->assign('errorCode', $errorCode);
     $oTpl->assign('errorMessage', $errorMessage);
     $oTpl->assign('systemMessage', $nativeErrorMessage);
     $oTpl->assign('errorDescription', $errorDescription);
     $oTpl->display();
 }
Пример #29
0
function displayPage($channel, $form)
{
    $pageName = basename($_SERVER['PHP_SELF']);
    $agencyId = OA_Permission::getAgencyId();
    // Obtain the needed data
    if (!empty($channel['affiliateid'])) {
        $aEntities = array('agencyid' => $agencyId, 'affiliateid' => $channel['affiliateid'], 'channelid' => $channel['channelid']);
        // Editing a channel at the publisher level; Only use the
        // channels at this publisher level for the navigation bar
        $aOtherChannels = Admin_DA::getChannels(array('publisher_id' => $channel['affiliateid']));
    } else {
        $aEntities = array('agencyid' => $agencyId, 'channelid' => $channel['channelid']);
        // Editing a channel at the agency level; Only use the
        // channels at this agency level for the navigation bar
        $aOtherChannels = Admin_DA::getChannels(array('agency_id' => $agencyId, 'channel_type' => 'agency'));
    }
    //show header and breadcrumbs
    MAX_displayNavigationChannel($pageName, $aOtherChannels, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('channel-edit.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->assign('formId', $form->getId());
    $oTpl->display();
    //show footer
    phpAds_PageFooter();
}
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();
}