当前位置: 首页>>代码示例>>PHP>>正文


PHP OA_Permission::getOwnedAccounts方法代码示例

本文整理汇总了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();
 }
开发者ID:Jaree,项目名称:revive-adserver,代码行数:66,代码来源:CampaignOverview.php


注:本文中的OA_Permission::getOwnedAccounts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。