本文整理汇总了PHP中OA_Admin_Template::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Admin_Template::assign方法的具体用法?PHP OA_Admin_Template::assign怎么用?PHP OA_Admin_Template::assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OA_Admin_Template
的用法示例。
在下文中一共展示了OA_Admin_Template::assign方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* 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: 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();
}
示例3: 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();
}
示例4: createView
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;
}
示例5: createTemplateWithModel
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: assignModel
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: 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);
}
示例8: createTemplateWithModel
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: showFooter
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: 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 {
$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: displayPage
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: array
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();
示例13: implode
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);
示例14: setTemplateVariables
/**
* 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')))));
}
}
示例15:
<?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";