Esempio n. 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()) {
         OA::disableErrorHandling();
         $oRss =& new XML_RSS($this->url);
         $result = $oRss->parse();
         OA::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();
 }
Esempio n. 2
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();
 }
Esempio n. 3
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;
 }
Esempio n. 4
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);
 }
Esempio n. 5
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();
 }
Esempio n. 6
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);
 }
Esempio n. 7
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);
 }
Esempio n. 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;
 }
 function init($templateName, $adminGroupName)
 {
     parent::init($templateName);
     //since previous version was using relative path and $adminGroupName was
     //ignored (and thus could be incorect and cannot be relied on), for backward compatibility check if absolute path is correct
     //if not use relative one
     $pluginBaseDir = $this->get_template_vars('pluginBaseDir');
     //with trailing /
     $pluginTemplateDir = $this->get_template_vars('pluginTemplateDir');
     //with trailing /
     $absoluteTemplateDir = $pluginBaseDir . $adminGroupName . $pluginTemplateDir;
     $this->template_dir = is_dir($absoluteTemplateDir) ? $absoluteTemplateDir : $pluginTemplateDir;
 }
Esempio n. 10
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();
 }
Esempio n. 11
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();
         }
     }
 }
Esempio n. 12
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();
}
<?php

/* Smarty version 2.6.18, created on 2016-01-08 10:56:39
   compiled from /var/www/html/adserver/revive-adserver-3.2.2/lib/templates/admin/form/custom-campaign-remaining-conv.html */
require_once SMARTY_CORE_DIR . 'core.load_plugins.php';
smarty_core_load_plugins(array('plugins' => array(array('function', 't', '/var/www/html/adserver/revive-adserver-3.2.2/lib/templates/admin/form/custom-campaign-remaining-conv.html', 15, false))), $this);
?>

<span id="conversions_remaining_span" style="display: none">
    <?php 
echo OA_Admin_Template::_function_t(array('str' => 'ConversionsRemaining'), $this);
?>
:<span id='conversions_remaining_count'><?php 
echo $this->_tpl_vars['_e']['vars']['conversionsRemaining'];
?>
</span>
</span>
     $_smarty_tpl_vars = $this->_tpl_vars;
     $this->_smarty_include(array('smarty_include_tpl_file' => "layout/links-container.html", 'smarty_include_vars' => array('aLinks' => $this->_tpl_vars['aTools'], 'title' => $this->_tpl_vars['linksTitle'], 'cssClass' => 'tools')));
     $this->_tpl_vars = $_smarty_tpl_vars;
     unset($_smarty_tpl_vars);
     ?>
       </li>
       <?php 
 }
 ?>
       <?php 
 if (count($this->_tpl_vars['aShortcuts'])) {
     ?>
       <li class='alignRight'>
           <?php 
     ob_start();
     echo OA_Admin_Template::_function_t(array('str' => 'Shortcuts'), $this);
     $this->_smarty_vars['capture']['default'] = ob_get_contents();
     $this->assign('linksTitle', ob_get_contents());
     ob_end_clean();
     ?>
           <?php 
     $_smarty_tpl_vars = $this->_tpl_vars;
     $this->_smarty_include(array('smarty_include_tpl_file' => "layout/links-container.html", 'smarty_include_vars' => array('aLinks' => $this->_tpl_vars['aShortcuts'], 'title' => $this->_tpl_vars['linksTitle'], 'cssClass' => 'shortcuts')));
     $this->_tpl_vars = $_smarty_tpl_vars;
     unset($_smarty_tpl_vars);
     ?>
       </li>
       <?php 
 }
 ?>
   </ul>
                        </li>
                        <li>
                          <a href='affiliate-zones.php?affiliateid=<?php 
            echo $this->_tpl_vars['key'];
            ?>
' class='inlineIcon iconZones'><?php 
            echo OA_Admin_Template::_function_t(array('str' => 'Zones'), $this);
            ?>
</a>
                        </li>
                        <li>
                            <a href='affiliate-channels.php?affiliateid=<?php 
            echo $this->_tpl_vars['key'];
            ?>
' class='inlineIcon iconTargetingChannels'><?php 
            echo OA_Admin_Template::_function_t(array('str' => 'Channels'), $this);
            ?>
</a>
                        </li>
                    </ul>
                </td>
            </tr>
    <?php 
        }
    }
    unset($_from);
    ?>
       </tbody>
<?php 
}
if (!empty($this->_tpl_vars['pager']->links)) {
Esempio n. 16
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();
        $orderdirection = 'down';
    } else {
        $orderdirection = 'up';
    }
}
$setPerPage = MAX_getStoredValue('setPerPage', 10);
$pageID = MAX_getStoredValue('pageID', 1);
// Setup date selector
$aPeriod = array('period_preset' => $periodPreset, 'period_start' => $startDate, 'period_end' => $endDate);
$daySpan = new OA_Admin_UI_Audit_DaySpanField('period');
$daySpan->setValueFromArray($aPeriod);
$daySpan->enableAutoSubmit();
// Initialize parameters
$pageName = basename($_SERVER['SCRIPT_NAME']);
// Load template
$oTpl = new OA_Admin_Template('userlog-index.html');
// Get advertisers & publishers for filters
$showAdvertisers = OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADMIN);
$showPublishers = OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADMIN);
$agencyId = OA_Permission::getAgencyId();
// Get advertisers if we show them
$aAdvertiser = $aPublisher = array();
if ($showAdvertisers) {
    if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
        $tempAdvertiserId = OA_Permission::getEntityId();
        $aAdvertiserList = Admin_DA::getAdvertisers(array('advertiser_id' => $tempAdvertiserId));
    } else {
        $aAdvertiserList = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
    }
    $aAdvertiser[0] = $GLOBALS['strSelectAdvertiser'];
    foreach ($aAdvertiserList as $key => $aValue) {
    } else {
        $listorder = '';
    }
}
if (!isset($orderdirection)) {
    if (isset($session['prefs']['campaign-banners.php'][$campaignid]['orderdirection'])) {
        $orderdirection = $session['prefs']['campaign-banners.php'][$campaignid]['orderdirection'];
    } else {
        $orderdirection = '';
    }
}
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('banner-index.html');
$doBanners = OA_Dal::factoryDO('banners');
$doBanners->campaignid = $campaignid;
$doBanners->addListorderBy($listorder, $orderdirection);
$doBanners->selectAdd('storagetype AS type');
$doBanners->find();
$countActive = 0;
while ($doBanners->fetch() && ($row = $doBanners->toArray())) {
    $banners[$row['bannerid']] = $row;
    $banners[$row['bannerid']]['active'] = $banners[$row['bannerid']]["status"] == OA_ENTITY_STATUS_RUNNING;
    $banners[$row['bannerid']]['description'] = $strUntitled;
    if (isset($banners[$row['bannerid']]['alt']) && $banners[$row['bannerid']]['alt'] != '') {
        $banners[$row['bannerid']]['description'] = $banners[$row['bannerid']]['alt'];
    }
    // mask banner name if anonymous campaign
    $campaign_details = Admin_DA::getPlacement($row['campaignid']);
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();
Esempio n. 20
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();
}
    ?>
    <?php 
    if ($this->_tpl_vars['disableSubmit']) {
        ?>
        <br /><br /><input type="submit" name="submitsettings" value="<?php 
        echo OA_Admin_Template::_function_t(array('str' => 'SaveChanges'), $this);
        ?>
" tabindex="<?php 
        echo $this->_tpl_vars['tabindex']++;
        ?>
" disabled></form>
    <?php 
    } else {
        ?>
        <br /><br /><input type="submit" name="submitsettings" value="<?php 
        echo OA_Admin_Template::_function_t(array('str' => 'SaveChanges'), $this);
        ?>
" tabindex="<?php 
        echo $this->_tpl_vars['tabindex']++;
        ?>
"></form>
    <?php 
    }
}
?>

<?php 
echo '
<script language=\'JavaScript\' type="text/javascript">
<!--
    function setUploadConversionValues() {
require_once SMARTY_CORE_DIR . 'core.load_plugins.php';
smarty_core_load_plugins(array('plugins' => array(array('function', 't', '/var/www/html/adserver/revive-adserver-3.2.2/lib/templates/admin/form/custom-campaign-type-note.html', 16, false))), $this);
?>

<div>
    <div <?php 
if ($this->_tpl_vars['elem']['vars']['radioId']) {
    ?>
id="info-<?php 
    echo $this->_tpl_vars['elem']['vars']['radioId'];
    ?>
"<?php 
}
?>
 class="type-desc">
        <?php 
if ($this->_tpl_vars['elem']['vars']['radioId']) {
    ?>
<label for="<?php 
    echo $this->_tpl_vars['elem']['vars']['radioId'];
    ?>
"><?php 
}
echo OA_Admin_Template::_function_t(array('str' => $this->_tpl_vars['elem']['vars']['infoKey']), $this);
if ($this->_tpl_vars['elem']['vars']['radioId']) {
    ?>
</label><?php 
}
?>
    </div>
</div>
                    ?>
                    <?php 
                }
                ?>
                  </td>
                  <?php 
                if ($this->_tpl_vars['configLocked']) {
                    ?>
&nbsp;<?php 
                } else {
                    ?>
<td><a href='plugin-index.php?action=uninstall&amp;package=<?php 
                    echo $this->_tpl_vars['name'];
                    ?>
&amp;<?php 
                    echo OA_Admin_Template::_add_session_token(array(), $this);
                    ?>
' ><span class="action icon uninstall">Uninstall</span></a></td><?php 
                }
                ?>
              </tr>
          <?php 
            }
            ?>
        <?php 
        }
    }
    unset($_from);
    ?>
       <?php 
}
Esempio n. 24
0
     $oExtensionManager->cachePreferenceOptions();
     break;
 case 'hook':
     // this rebuilds the cached array that holds the component hook registration array
     require_once LIB_PATH . '/Extension/ExtensionCommon.php';
     $oExtensionManager = new OX_Extension_Common();
     $oExtensionManager->cacheComponentHooks();
     break;
 case 'reg':
     // currently rewrites delivery hooks to conf
     require_once LIB_PATH . '/Extension/ExtensionDelivery.php';
     $oExtensionManager = new OX_Extension_Delivery();
     $oExtensionManager->runTasksOnDemand();
     break;
 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);
Esempio n. 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.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();
 /**
  * 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')))));
     }
 }
    } else {
        $listorder = '';
    }
}
if (!isset($orderdirection)) {
    if (isset($session['prefs']['advertiser-campaigns.php'][$clientid]['orderdirection'])) {
        $orderdirection = $session['prefs']['advertiser-campaigns.php'][$clientid]['orderdirection'];
    } else {
        $orderdirection = '';
    }
}
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('campaign-index.html');
// Get clients & campaign and build the tree
$dalCampaigns = OA_Dal::factoryDAL('campaigns');
$aCampaigns = $dalCampaigns->getClientCampaigns($clientid, $listorder, $orderdirection, array(DataObjects_Campaigns::CAMPAIGN_TYPE_MARKET_CONTRACT));
foreach ($aCampaigns as $campaignId => $aCampaign) {
    $aCampaign['impressions'] = phpAds_formatNumber($aCampaign['views']);
    $aCampaign['clicks'] = phpAds_formatNumber($aCampaign['clicks']);
    $aCampaign['conversions'] = phpAds_formatNumber($aCampaign['conversions']);
    if (!empty($aCampaign['activate_time'])) {
        $oActivateDate = new Date($aCampaign['activate_time']);
        $oTz = $oActivateDate->tz;
        $oActivateDate->setTZbyID('UTC');
        $oActivateDate->convertTZ($oTz);
        $aCampaign['activate'] = $oActivateDate->format($date_format);
    } else {
        $aCampaign['activate'] = '-';
Esempio n. 28
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();
 }
Esempio n. 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();
}
<?php

/* Smarty version 2.6.18, created on 2016-01-08 10:56:39
   compiled from /var/www/html/adserver/revive-adserver-3.2.2/lib/templates/admin/form/custom-pricing-campaign-date-limit-set-note.html */
require_once SMARTY_CORE_DIR . 'core.load_plugins.php';
smarty_core_load_plugins(array('plugins' => array(array('function', 't', '/var/www/html/adserver/revive-adserver-3.2.2/lib/templates/admin/form/custom-pricing-campaign-date-limit-set-note.html', 14, false))), $this);
?>

<span class="link" help="help-limits-disabled-<?php 
echo $this->_tpl_vars['elem']['vars']['type'];
?>
"><span class="icon icon-info"><?php 
echo OA_Admin_Template::_function_t(array('str' => 'WhyDisabled'), $this);
?>
</span></span>
<div class="hide" id="help-limits-disabled-<?php 
echo $this->_tpl_vars['elem']['vars']['type'];
?>
" style="height: auto; width: 290px;">
    <?php 
echo OA_Admin_Template::_function_t(array('str' => 'CannotSetBothDateAndLimit'), $this);
?>

</div>