本文整理匯總了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();
}