本文整理汇总了PHP中Admin_DA::getChannels方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::getChannels方法的具体用法?PHP Admin_DA::getChannels怎么用?PHP Admin_DA::getChannels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::getChannels方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayPage
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();
}
示例2: basename
OA_Permission::enforceAccessToObject('channel', $channelid);
$pageName = basename($_SERVER['SCRIPT_NAME']);
$agencyId = OA_Permission::getAgencyId();
$tabindex = 1;
if (!empty($affiliateid)) {
OA_Permission::enforceAccessToObject('affiliates', $affiliateid);
/*-------------------------------------------------------*/
/* Store preferences */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
phpAds_SessionDataStore();
$aEntities = array('agencyid' => $agencyId, 'affiliateid' => $affiliateid, 'channelid' => $channelid);
$aOtherChannels = Admin_DA::getChannels(array('publisher_id' => $affiliateid));
} else {
$aEntities = array('agencyid' => $agencyId, 'channelid' => $channelid);
$aOtherChannels = Admin_DA::getChannels(array('agency_id' => $agencyId, 'channel_type' => 'agency'));
}
/*-------------------------------------------------------*/
/* Process submitted form */
/*-------------------------------------------------------*/
if (!empty($action)) {
if (empty($acl)) {
$acl = array();
}
$acl = MAX_AclAdjust($acl, $action);
} elseif (!empty($submit)) {
$acl = isset($acl) ? $acl : array();
// Only save when inputs are valid
if (OX_AclCheckInputsFields($acl, $pageName) === true) {
if (MAX_AclSave($acl, $aEntities)) {
// Queue confirmation message
示例3: phpAds_registerGlobal
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+---------------------------------------------------------------------------+
$Id: channel-index.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/max/other/html.php';
// Register input variables
phpAds_registerGlobal('acl', 'action', 'submit');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
// Initialise some parameters
$pageName = basename($_SERVER['PHP_SELF']);
$agencyId = OA_Permission::getEntityId();
$tabindex = 1;
/*-------------------------------------------------------*/
/* HTML framework */
/*-------------------------------------------------------*/
phpAds_PageHeader("5.7");
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
echo "<img src='" . OX::assetPath() . "/images/icon-channel-add.gif' border='0' align='absmiddle'> ";
echo "<a href='channel-edit.php?agencyid={$agencyId}' accesskey='" . $keyAddNew . "'>{$GLOBALS['strAddNewChannel_Key']}</a> ";
phpAds_ShowBreak();
$channels = Admin_DA::getChannels(array('agency_id' => $agencyId), true);
MAX_displayChannels($channels, array('agencyid' => $agencyId));
phpAds_PageFooter();
示例4: MAX_checkChannel
function MAX_checkChannel($agencyId, $channelId)
{
$allowed = false;
if (MAX_checkGenericId($agencyId) && MAX_checkGenericId($channelId)) {
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
$allowed = count(Admin_DA::getChannels(array('channel_id' => $channelId, 'channel_type' => 'admin')));
} elseif (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$allowed = count(Admin_DA::getChannels(array('agency_id' => $agencyId, 'channel_id' => $channelId)));
} elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$allowed = false;
}
}
return $allowed;
}
示例5: getChannels
function getChannels()
{
global $list_filters;
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
// set publisher id if list is to be filtered by publisher
if (isset($list_filters['publisher'])) {
$aParams = array('publisher_id' => $list_filters['publisher']);
// get channels owned by this publisher's agency
$aPublisher = Admin_DA::getPublisher($list_filters['publisher']);
$agencyId = $aPublisher['agency_id'];
if ($agencyId != 0) {
// check that this publisher actually has an agency
$aParams2 = array('agency_id' => $agencyId, 'publisher_id' => 0);
$aAgencyChannels = Admin_DA::getChannels($aParams2);
}
}
$aChannels = Admin_DA::getChannels($aParams);
// add any agency-owned channels
if (isset($aAgencyChannels)) {
foreach ($aAgencyChannels as $channelId => $aAgencyChannel) {
$aChannels[$channelId] = $aAgencyChannel;
}
}
} elseif (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams = array('agency_id' => OA_Permission::getEntityId());
// set publisher id if list is to be filtered by publisher
if (isset($list_filters['publisher'])) {
$aParams = array('agency_id' => OA_Permission::getEntityId(), 'publisher_id' => $list_filters['publisher']);
}
$aChannels = Admin_DA::getChannels($aParams);
// add agency-owned channels
$aParams = array('agency_id' => OA_Permission::getEntityId(), 'publisher_id' => 0);
$aAgencyChannels = Admin_DA::getChannels($aParams);
foreach ($aAgencyChannels as $channelId => $aAgencyChannel) {
$aChannels[$channelId] = $aAgencyChannel;
}
} elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$aParams = array('publisher_id' => OA_Permission::getEntityId());
$aPublishers = Admin_DA::getPublishers($aParams);
$aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
$aChannels = Admin_DA::getChannels($aParams);
// get channels owned by this publisher's agency
$aPublisher = Admin_DA::getPublisher(OA_Permission::getEntityId());
$agencyId = $aPublisher['agency_id'];
if ($agencyId != 0) {
// check that this publisher actually has an agency
$aParams2 = array('agency_id' => $agencyId, 'publisher_id' => 0);
$aAgencyChannels = Admin_DA::getChannels($aParams2);
}
// add agency-owned channels
if (isset($aAgencyChannels)) {
foreach ($aAgencyChannels as $channelId => $aAgencyChannel) {
$aChannels[$channelId] = $aAgencyChannel;
}
}
} else {
$aPublishers = array();
$aChannels = array();
}
// add admin-owned channels
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER) || OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
// add admin-owned channels
$aParams = array('agency_id' => 0, 'publisher_id' => 0);
$aAdminChannels = Admin_DA::getChannels($aParams);
foreach ($aAdminChannels as $channelId => $aAdminChannel) {
$aChannels[$channelId] = $aAdminChannel;
}
}
$aChannelArray = array();
foreach ($aChannels as $channelId => $aChannel) {
$aChannelArray[$channelId] = phpAds_buildName($channelId, $aChannel['name']);
}
return $aChannelArray;
}
示例6: basename
//bad id, redirect
$page = basename($_SERVER['SCRIPT_NAME']);
OX_Admin_Redirect::redirect($page);
}
}
/*-------------------------------------------------------*/
/* HTML framework */
/*-------------------------------------------------------*/
$oHeaderModel = buildHeaderModel($affiliateid);
phpAds_PageHeader(null, $oHeaderModel);
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('channel-index.html');
$channels = Admin_DA::getChannels(array('publisher_id' => $affiliateid), true);
$aChannels = array();
foreach ($channels as $channelId => $channel) {
$aChannels[$channelId] = $channel;
}
$oTpl->assign('aChannels', $aChannels);
$oTpl->assign('entityUrl', 'affiliate-channels.php');
$oTpl->assign('entityId', 'affiliateid=' . $affiliateid);
$oTpl->assign('affiliateId', $affiliateid);
/*-------------------------------------------------------*/
/* Store preferences */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* HTML framework */