function displayPage($form, $aMessages = '')
{
    phpAds_PageHeader('devtools-plugins', '', '../../');
    $oTpl = new OA_Plugin_Template('oxPlugin.html', 'oxPlugin');
    //$oTpl->debugging = true;
    $oTpl->assign('aMessages', $aMessages);
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    phpAds_PageFooter();
}
    }
}
$aCount = array('banners' => 0, 'banners_hidden' => 0);
$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]);
        }
    }
}
$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('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));
$session['prefs']['campaign-banners.php'][$campaignid]['hideinactive'] = $hideinactive;
$session['prefs']['campaign-banners.php'][$campaignid]['listorder'] = $listorder;
$session['prefs']['campaign-banners.php'][$campaignid]['orderdirection'] = $orderdirection;
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid] = $campaignid;
phpAds_SessionDataStore();
$oTpl->display();
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
require_once 'testPlugin-common.php';
phpAds_PageHeader("test-plugin-0", '', '../../');
$oTpl = new OA_Plugin_Template('testPlugin.html', 'testPlugin');
$message = 'Test Plugin';
$oTpl->assign('message', $message);
$oTpl->display();
$dispatcher = OA_Admin_Plugins_EventDispatcher::singleton();
$context = new OA_Admin_Plugins_EventContext();
$context->pageId = 'test-plugin-0';
$context->templates = array();
$templates = $dispatcher->onAfterContent($context);
//process results
foreach ($templates as $oPluginTemplate) {
    if (is_a($oPluginTemplate, 'Smarty')) {
        $oPluginTemplate->display();
    }
}
phpAds_PageFooter();
        case '4-1':
            OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
            $message = 'Dynamic submenu 4-1';
            $menu = 'demo-menu-4';
            // PageHeader function needs to know the *parent* menu
            setCurrentLeftMenuSubItem('demo-menu-4-1');
            break;
        case '4-2':
            OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
            $message = 'Dynamic submenu 4-2';
            $menu = 'demo-menu-4';
            // PageHeader function needs to know the *parent* menu
            setCurrentLeftMenuSubItem('demo-menu-4-2');
            break;
    }
    $colour = $GLOBALS['_MAX']['PREF']['demoUserInterface_demopref_' . OA_Permission::getAccountType(true)];
    //$image   = 'demoUI'.$i.'.jpg';
    $message = $message;
    addLeftMenuSubItem('demo-menu-4-1', 'demo submenu 4-1', 'plugins/demoUserInterface/demoUI-page.php?action=4-1');
    addLeftMenuSubItem('demo-menu-4-2', 'demo submenu 4-2', 'plugins/demoUserInterface/demoUI-page.php?action=4-2');
    phpAds_PageHeader($menu, '', '../../');
    $oTpl = new OA_Plugin_Template('demoUI.html', 'demoUserInterface');
    //$oTpl->assign('image',$image);
    $oTpl->assign('message', $message);
    $oTpl->assign('colour', $colour);
    $oTpl->display();
    phpAds_PageFooter();
} else {
    require_once LIB_PATH . '/Admin/Redirect.php';
    OX_Admin_Redirect::redirect('plugins/demoUserInterface/demoUI-index.php');
}
    case 'home':
        // info page
        include "templates/home.html";
        break;
    case 'noframe':
        // 1st menu
        include "templates/noframe.html";
        break;
    case 'frame':
        // 2nd menu
        $src = $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . '/demoXajax-frame.php';
        include "templates/frame.html";
        break;
    case 'frame-smarty':
        // 3rd menu
        require_once MAX_PATH . '/lib/OA/Admin/TemplatePlugin.php';
        $oTpl = new OA_Plugin_Template('frame-smarty.html', 'demoXajax');
        $oTpl->debugging = false;
        $src = $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . '/demoXajax-frame.php';
        $oTpl->assign('src', $src);
        $oTpl->display();
        break;
    case 'noframe-smarty':
        // 4th menu
        require_once MAX_PATH . '/lib/OA/Admin/TemplatePlugin.php';
        $oTpl = new OA_Plugin_Template('noframe.html', 'demoXajax');
        $oTpl->debugging = false;
        $oTpl->display();
        break;
}
phpAds_PageFooter();
示例#6
0
<?php

require_once '../../../../init.php';
require_once '../../config.php';
require_once MAX_PATH . '/lib/OA/Admin/TemplatePlugin.php';
$production = $GLOBALS['_MAX']['CONF']['debug']['production'];
$urlIframe = "./players-content.html";
// TEMPLATE
$oTpl = new OA_Plugin_Template('players.html', 'openXVideoAds');
$oTpl->assign('urlIframe', $urlIframe);
phpAds_PageHeader("players-vast", '', '../../');
$oTpl->display();
phpAds_PageFooter();
+---------------------------------------------------------------------------+
*/
require_once 'testPlugin-common.php';
$oTpl = new OA_Plugin_Template('testPlugin.html', 'testPlugin');
if (isset($_REQUEST['action']) && isset($GLOBALS['_MAX']['CONF']['testPlugin'][$_REQUEST['action']])) {
    $otestPluginTable = OA_Dal::factoryDO('testplugin_table');
    $otestPluginTable->testplugin_id = $GLOBALS['_MAX']['CONF']['testPlugin'][$_REQUEST['action']];
    $otestPluginTable->find(true);
    $message = $otestPluginTable->testplugin_desc;
    switch ($_REQUEST['action']) {
        case '1':
            phpAds_PageHeader("test-plugin-1", '', '../../');
            $image = 'testPlugin1.jpg';
            break;
        case '2':
            phpAds_PageHeader("test-plugin-2", '', '../../');
            $image = 'testPlugin1.jpg';
            break;
        case '3':
            phpAds_PageHeader("test-plugin-3", '', '../../');
            $image = 'testPlugin2.jpg';
            break;
    }
} else {
    $image = '';
    $message = '';
}
$oTpl->assign('image', $image);
$oTpl->assign('message', $message);
$oTpl->display();
phpAds_PageFooter();
function display_page($banner_id, $campaign_id, $client_id)
{
    $page_name = basename($_SERVER['PHP_SELF']);
    $entities = array('clientid' => $client_id, 'campaignid' => $campaign_id, 'bannerid' => $banner_id);
    $entity_id = OA_Permission::getEntityId();
    if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
        $entity_type = 'advertiser_id';
    } else {
        $entity_type = 'agency_id';
    }
    // Display navigation
    $other_campaigns = Admin_DA::getPlacements(array($entity_type => $entity_id));
    $other_banners = Admin_DA::getAds(array('placement_id' => $campaign_id), false);
    displayNavigationBanner($page_name, $other_campaigns, $other_banners, $entities);
    if (!empty($banner_id)) {
        $template_id = OA_Dal::factoryDO('Zpbanners')->get_zp_banner_id((int) $banner_id);
        $form = explode('|', form_ajax_request($template_id));
    }
    $template = new OA_Plugin_Template('designer-form.html', 'bannerDesigner');
    //$oTpl->debugging = true;
    $template->assign('bannerid', $banner_id);
    $template->assign('campaignid', $campaign_id);
    $template->assign('clientid', $client_id);
    $template->assign('template_id', $template_id);
    $template->assign('form', $form);
    $template->display();
    phpAds_PageFooter();
}
            } else {
                // Date do not expand when looking at Banners or Zones
                $selectedDimensionExpanded = false;
            }
        }
    }
}
if ($selectedDimensionExpanded && !empty($expandId)) {
    $expandedDataTable = $videoReport->getVastStatistics($entity, $entityId, $selectedDimensionExpanded, $startDate, $endDate, $dimension, $expandId);
}
$isThereAnyData = @$summaryRow[1] > 0;
// TEMPLATE
$oTpl = new OA_Plugin_Template('video-report.html', 'openXVideoAds');
$oTpl->register_function('url', 'smarty_function_url');
$oTpl->register_modifier('formatNumber', 'smarty_modifier_formatNumber');
$oTpl->assign('isThereAnyData', $isThereAnyData);
$oTpl->assign('isThereAtLeastTwoDataPoints', $isThereAtLeastTwoDataPoints);
$oTpl->assign('entityName', ucfirst($entity));
$oTpl->assign('dataForTopGraphInJsonFormat', $topGraphJSON);
$oTpl->assign('dataForBottomGraphInJsonFormat', $bottomGraphJSON);
$oTpl->assign('dataTable', $dataTable);
$oTpl->assign('expandedDataTable', $expandedDataTable);
$oTpl->assign('selectedDimensionExpanded', urlencode($selectedDimensionExpanded));
$oTpl->assign('columns', $columns);
$oTpl->assign('summaryRow', $summaryRow);
$oTpl->assign('availableDateRanges', $availableDateRanges);
$oTpl->assign('thirtyDaysAgo', $thirtyDaysAgo);
$oTpl->assign('expandId', urlencode($expandId));
$oTpl->assign('today', $today);
$oTpl->assign('startDate', $startDate);
$oTpl->assign('endDate', $endDate);