/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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); }
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(); } } }
/** * 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); }
/** * 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(); }
/** * A static method to display a login screen * * @static * * @param string $sMessage * @param string $sessionID * @param bool $inlineLogin */ function displayLogin($sMessage = '', $sessionID = 0, $inLineLogin = false) { global $strUsername, $strPassword, $strLogin, $strWelcomeTo, $strEnterUsername, $strNoAdminInteface, $strForgotPassword; $aConf = $GLOBALS['_MAX']['CONF']; $aPref = $GLOBALS['_MAX']['PREF']; header('Cache-Control: max-age=0, no-cache, proxy-revalidate, must-revalidate'); if (!$inLineLogin) { phpAds_PageHeader(phpAds_Login); } // Check environment settings $oSystemMgr = new OA_Environment_Manager(); $aSysInfo = $oSystemMgr->checkSystem(); foreach ($aSysInfo as $env => $vals) { $errDetails = ''; if (is_array($vals['error'])) { $errDetails = '<ul>'; if ($env == 'PERMS') { foreach ($vals['actual'] as $key => $val) { if ($val['error']) { $errDetails .= '<li>' . htmlspecialchars($val['file']) . ' ' . htmlspecialchars($val['result']) . '</li>'; } } } else { foreach ($vals['actual'] as $key => $val) { $errDetails .= '<li>' . htmlspecialchars($key) . ' => ' . htmlspecialchars($val) . '</li>'; } } $errDetails .= '</ul>'; foreach ($vals['error'] as $key => $err) { phpAds_Die(' Error: ' . $err, $errDetails); } } } $oTpl = new OA_Admin_Template('login.html'); // we build the URL of the current page to use a redirect URL after login // this code should work on all server configurations hence why it is a bit complicated // inspired by http://dev.piwik.org/svn/trunk/core/Url.php getCurrentUrl() $url = ''; if (!empty($_SERVER['PATH_INFO'])) { $url = $_SERVER['PATH_INFO']; } else { if (!empty($_SERVER['REQUEST_URI'])) { if (($pos = strpos($_SERVER['REQUEST_URI'], "?")) !== false) { $url = substr($_SERVER['REQUEST_URI'], 0, $pos); } else { $url = $_SERVER['REQUEST_URI']; } } } if (empty($url)) { $url = $_SERVER['SCRIPT_NAME']; } if (!empty($_SERVER['QUERY_STRING'])) { $url .= '?' . $_SERVER['QUERY_STRING']; } if (!empty($url)) { // remove any extra slashes that would confuse the browser (see OX-5234) $url = '/' . ltrim($url, '/'); } $appName = !empty($aConf['ui']['applicationName']) ? $aConf['ui']['applicationName'] : MAX_PRODUCT_NAME; $oTpl->assign('uiEnabled', $aConf['ui']['enabled']); $oTpl->assign('formAction', $url); $oTpl->assign('sessionID', $sessionID); $oTpl->assign('appName', $appName); $oTpl->assign('message', $sMessage); $oTpl->display(); phpAds_PageFooter(); exit; }
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(); }
/** * 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(); }
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(); }
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(); }
/** * A method to launch and display the widget */ function display() { if ($this->draw) { $useAntialias = is_callable('imageantialias'); $Canvas = Image_Canvas::factory('png', array('width' => 239, 'height' => 132, 'antialias' => $useAntialias ? 'native' : false)); $Graph = Image_Graph::factory('graph', $Canvas); if (is_callable('imagettftext')) { $Font = $Graph->addNew('ttf_font', MAX_PATH . '/lib/fonts/Bitstream/Vera.ttf'); $Font->setSize(7); $Graph->setFont($Font); } else { // TTF library not available, use standard bitmap font $Graph->setFontSize(7); } $Datasets = array(Image_Graph::factory('dataset'), Image_Graph::factory('dataset')); $Datasets[0]->setName('Impressions'); $Datasets[1]->setName('Clicks'); foreach ($this->aData[0] as $k => $v) { $Datasets[0]->addPoint($k, $v); } $scaleY2 = 1.75; $maxImpr = max($this->aData[0]); $maxClick = max($this->aData[1]); $relation = $maxImpr / ($maxClick > 0 ? $maxClick : 1); // impressions/clicks $factor = $relation / $scaleY2; //scale down to make click ~ 57% of impressions bar height foreach ($this->aData[1] as $k => $v) { $Datasets[1]->addPoint($k, $v * $factor); } $Graph->add($Plotarea = Image_Graph::factory('plotarea')); $PlotBg = Image_Graph::factory('Fill_Array'); $PlotBg->addColor('white'); $PlotFg = Image_Graph::factory('Line_Array'); $PlotFg->addColor('white'); $Plotarea->setBackground($PlotBg); $Plotarea->setBorderColor('white'); $Grid = $Plotarea->addNew('line_grid', IMAGE_GRAPH_AXIS_Y); $Grid->setLineColor('#cccccc'); $Plot = $Plotarea->addNew('bar', array($Datasets)); $Plot->setLineColor('black@0.2'); $FillArray = Image_Graph::factory('Fill_Array'); $FillArray->add(Image_Graph::factory('Fill_Gradient', array(IMAGE_GRAPH_GRAD_VERTICAL, '#b5da3c', '#6a9a2a'))); $FillArray->add(Image_Graph::factory('Fill_Gradient', array(IMAGE_GRAPH_GRAD_VERTICAL, '#bb5c9e', '#8b4a9e'))); $Plot->setFillStyle($FillArray); $AxisY2 = $Plotarea->addNew('axis', array(IMAGE_GRAPH_AXIS_Y_SECONDARY)); $AxisY2->forceMaximum(max($this->aData[1]) * $scaleY2 + 1); $AxisY = $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y); if (!max($this->aData[0])) { $AxisY->forceMaximum(1); } $func = create_function('$value', 'return OA_Dashboard_Widget_Graph::_formatY($value);'); $AxisY->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Function', $func)); $AxisY2->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Function', $func)); ob_start(); $Graph->done(); $content = ob_get_clean(); $this->oTpl->assign('content', $content); } else { $this->oTpl->assign('title', $this->title); $this->oTpl->assign('imageSrc', "dashboard.php?widget={$this->widgetName}&draw=1&cb=" . $this->oTpl->cacheId); } $this->oTpl->display(); }
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(); }
function displayPage($bannerid, $campaignid, $clientid, $bannerTypes, $aBanner, $type, $form, $ext_bannertype, $formDisabled = false) { // Initialise some parameters $pageName = basename($_SERVER['SCRIPT_NAME']); $aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid); $entityId = OA_Permission::getEntityId(); if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) { $entityType = 'advertiser_id'; } else { $entityType = 'agency_id'; } // Display navigation $aOtherCampaigns = Admin_DA::getPlacements(array($entityType => $entityId)); $aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignid), false); // Display banner preview MAX_displayNavigationBanner($pageName, $aOtherCampaigns, $aOtherBanners, $aEntities); //actual page content - type chooser and form /*-------------------------------------------------------*/ /* Main code */ /*-------------------------------------------------------*/ $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', $ext_bannertype ? $ext_bannertype : $type); $oTpl->assign('bannerHeight', $aBanner["height"]); $oTpl->assign('bannerWidth', $aBanner["width"]); $oTpl->assign('disabled', $formDisabled); $oTpl->assign('form', $form->serialize()); $oTpl->display(); /*********************************************************/ /* HTML framework */ /*********************************************************/ phpAds_PageFooter(); }
/** * A static method to display a login screen * * @static * * @param string $sMessage * @param string $sessionID * @param bool $inlineLogin */ function displayLogin($sMessage = '', $sessionID = 0, $inLineLogin = false) { global $strUsername, $strPassword, $strLogin, $strWelcomeTo, $strEnterUsername, $strNoAdminInteface, $strForgotPassword; $aConf = $GLOBALS['_MAX']['CONF']; $aPref = $GLOBALS['_MAX']['PREF']; @header('Cache-Control: max-age=0, no-cache, proxy-revalidate, must-revalidate'); if (!$inLineLogin) { phpAds_PageHeader(phpAds_Login); } // Check environment settings $oSystemMgr = new OA_Environment_Manager(); $aSysInfo = $oSystemMgr->checkSystem(); foreach ($aSysInfo as $env => $vals) { $errDetails = ''; if (is_array($vals['error']) && !empty($vals['error'])) { if ($env == 'PERMS') { // Just note that some file/folders are unwritable and that more information can be found in the debug.log OA_Admin_UI::queueMessage('Error: File permission errors detected.<br />These <em>may</em> impact the accurate delivery of your ads,<br />See the debug.log file for the list of unwritable files', 'global', 'error', 0); } else { foreach ($vals['error'] as $key => $val) { $errDetails .= '<li>' . htmlspecialchars($key) . ' => ' . htmlspecialchars($val) . '</li>'; } phpAds_Die(' Error: ' . $err, $errDetails); } } } $oTpl = new OA_Admin_Template('login.html'); $appName = !empty($aConf['ui']['applicationName']) ? $aConf['ui']['applicationName'] : PRODUCT_NAME; $oTpl->assign('uiEnabled', $aConf['ui']['enabled']); $oTpl->assign('sessionID', $sessionID); $oTpl->assign('appName', $appName); $oTpl->assign('message', $sMessage); $oTpl->display(); phpAds_PageFooter(); exit; }
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(); }
function displayPage($zone, $form, $zoneErrors = null) { //header and breadcrumbs $pageName = basename($_SERVER['PHP_SELF']); $agencyId = OA_Permission::getAgencyId(); $aEntities = array('affiliateid' => $zone['affiliateid'], 'zoneid' => $zone['zoneid']); $aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId)); $aOtherZones = Admin_DA::getZones(array('publisher_id' => $zone['affiliateid'])); MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities); //get template and display form $oTpl = new OA_Admin_Template('zone-edit.html'); $oTpl->assign('zoneid', $zone['zoneid']); $oTpl->assign('zoneHeight', $zone["height"]); $oTpl->assign('zoneWidth', $zone["width"]); $oTpl->assign('zoneErrors', $zoneErrors); $oTpl->assign('form', $form->serialize()); $oTpl->display(); //footer phpAds_PageFooter(); }
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'> <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();
function displayPage($tracker, $form) { //header and breadcrumbs if ($tracker['trackerid'] != "") { $doClients = OA_Dal::factoryDO('clients'); $doClients->whereAdd('clientid <>' . $tracker['clientid']); if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) { $doClients->agencyid = OA_Permission::getAgencyId(); } $doClients->find(); $aOtherAdvertisers = array(); while ($doClients->fetch() && ($row = $doClients->toArray())) { $aOtherAdvertisers[] = $row; } MAX_displayNavigationTracker($tracker['clientid'], $tracker['trackerid'], $aOtherAdvertisers); } else { // New tracker $oHeaderModel = MAX_displayTrackerBreadcrumbs($tracker['clientid'], null); phpAds_PageHeader("tracker-edit_new", $oHeaderModel); } //get template and display form $oTpl = new OA_Admin_Template('tracker-edit.html'); $oTpl->assign('form', $form->serialize()); $oTpl->assign('formId', $form->getId()); $oTpl->display(); //footer phpAds_PageFooter(); }
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($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(); }