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