本文整理汇总了PHP中AdminHelper::getConnectionsByScope方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHelper::getConnectionsByScope方法的具体用法?PHP AdminHelper::getConnectionsByScope怎么用?PHP AdminHelper::getConnectionsByScope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminHelper
的用法示例。
在下文中一共展示了AdminHelper::getConnectionsByScope方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
//Asset connections?
$cash_admin->page_data['connection'] = AdminHelper::getConnectionsByScope('assets');
// Deal with download code requests
if (isset($_REQUEST['add_codes_qty']) && $request_parameters[0]) {
if ($_REQUEST['add_codes_qty'] > 0) {
$total_added = 0;
for ($i = 1; $i <= $_POST['add_codes_qty']; $i++) {
$addcode_response = $cash_admin->requestAndStore(array('cash_request_type' => 'asset', 'cash_action' => 'addlockcode', 'asset_id' => $request_parameters[0]));
if ($addcode_response['payload']) {
$total_added++;
}
}
$cash_admin->page_data['page_message'] = 'Added ' . $total_added . ' new download codes';
}
}
$asset_codes = false;
if ($request_parameters[0]) {
$getcodes_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'getlockcodes', 'scope_table_alias' => 'assets', 'scope_table_id' => $request_parameters[0]));
$asset_codes = $getcodes_response['payload'];
}
if (isset($_REQUEST['exportcodes']) && $request_parameters[0]) {
header('Content-Disposition: attachment; filename="codes_' . $request_parameters[0] . '_export.csv"');
if ($asset_codes) {
echo '"code","creation date","claim date"' . "\n";
foreach ($asset_codes as $code) {
echo '"' . $code['uid'] . '"';
echo ',"' . date('M j, Y h:iA T', $code['creation_date']) . '"';
if ($code['claim_date']) {
echo ',"' . date('M j, Y h:iA T', $code['claim_date']) . '"';
示例2: array
$items_response = $cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'getitemsforuser', 'user_id' => $cash_admin->effective_user_id));
$order_request = array('cash_request_type' => 'commerce', 'cash_action' => 'getordersforuser', 'user_id' => $cash_admin->effective_user_id, 'max_returned' => 11, 'skip' => ($cash_admin->page_data['current_page'] - 1) * 10, 'deep' => true);
if ($cash_admin->page_data['no_filter']) {
$order_request['unfulfilled_only'] = 1;
}
if ($filter == 'week') {
$order_request['since_date'] = time() - 604800;
}
if ($filter == 'byitem') {
$order_request['cash_action'] = 'getordersbyitem';
$order_request['item_id'] = $request_parameters[$filter_key + 2];
$cash_admin->page_data['filter_item_id'] = $order_request['item_id'];
}
$orders_response = $cash_admin->requestAndStore($order_request);
//Commerce connection or Items present?
$cash_admin->page_data['connection'] = AdminHelper::getConnectionsByScope('commerce') || $items_response['payload'];
// Return Connection
$page_data_object = new CASHConnection(AdminHelper::getPersistentData('cash_effective_user'));
$settings_types_data = $page_data_object->getConnectionTypes('commerce');
$all_services = array();
$typecount = 1;
foreach ($settings_types_data as $key => $data) {
if ($typecount % 2 == 0) {
$alternating_type = true;
} else {
$alternating_type = false;
}
if (file_exists(ADMIN_BASE_PATH . '/assets/images/settings/' . $key . '.png')) {
$service_has_image = true;
} else {
$service_has_image = false;
示例3: time
}
if ($filter == 'week') {
$order_request['since_date'] = time() - 604800;
}
if ($filter == 'byitem') {
$order_request['cash_action'] = 'getordersbyitem';
$order_request['item_id'] = $request_parameters[$filter_key + 2];
$cash_admin->page_data['filter_item_id'] = $order_request['item_id'];
}
$orders_response = $cash_admin->requestAndStore($order_request);
/*******************************************************************************
*
* 5. GET ALL VALID SERVICE CONNECTIONS FOR FIRST-USE
*
******************************************************************************/
$cash_admin->page_data['connection'] = AdminHelper::getConnectionsByScope('commerce');
if (!$cash_admin->page_data['connection']) {
if (!is_array($orders_response['payload'])) {
$cash_admin->page_data['firstuse'] = true;
$settings_types_data = $page_data_object->getConnectionTypes('commerce');
$all_services = array();
$typecount = 1;
foreach ($settings_types_data as $key => $data) {
if ($typecount % 2 == 0) {
$alternating_type = true;
} else {
$alternating_type = false;
}
if (file_exists(ADMIN_BASE_PATH . '/assets/images/settings/' . $key . '.png')) {
$service_has_image = true;
} else {
示例4: echoConnectionsOptions
/**
* Finds settings matching a specified scope and echoes them out formatted
* for a dropdown box in a form
*
*/
public static function echoConnectionsOptions($scope, $selected = false, $return = false)
{
$applicable_settings_array = AdminHelper::getConnectionsByScope($scope);
$all_connections = '<option value="0">None</option>';
// echo out the proper dropdown bits
if ($applicable_settings_array) {
$settings_count = 1;
foreach ($applicable_settings_array as $setting) {
$echo_selected = '';
if ($setting['id'] == $selected) {
$echo_selected = ' selected="selected"';
}
$all_connections .= '<option value="' . $setting['id'] . '"' . $echo_selected . '>' . $setting['name'] . '</option>';
}
if ($return) {
return $all_connections;
} else {
echo $all_connections;
}
}
}
示例5: CASHConnection
/*
$playlists_response = $cash_admin->requestAndStore(
array(
'cash_request_type' => 'asset',
'cash_action' => 'getassetsforuser',
'type' => 'playlist',
'parent_id' => 0,
'user_id' => $user_id
)
);
*/
$files_response = $cash_admin->requestAndStore(array('cash_request_type' => 'asset', 'cash_action' => 'getassetsforuser', 'type' => 'file', 'parent_id' => 0, 'user_id' => $user_id));
// we need to get all items for the user to determine if an asset is monetized
$items_response = $cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'getitemsforuser', 'user_id' => $cash_admin->effective_user_id));
//Commerce connection, release or files present?
$cash_admin->page_data['connection'] = AdminHelper::getConnectionsByScope('assets') || $releases_response['payload'] || $files_response['payload'];
// Return Connection
$page_data_object = new CASHConnection(AdminHelper::getPersistentData('cash_effective_user'));
$settings_types_data = $page_data_object->getConnectionTypes('assets');
$all_services = array();
$typecount = 1;
foreach ($settings_types_data as $key => $data) {
if ($typecount % 2 == 0) {
$alternating_type = true;
} else {
$alternating_type = false;
}
if (file_exists(ADMIN_BASE_PATH . '/assets/images/settings/' . $key . '.png')) {
$service_has_image = true;
} else {
$service_has_image = false;
示例6: array
} else {
$alternating_type = false;
}
if (file_exists(ADMIN_BASE_PATH . '/assets/images/settings/' . $key . '.png')) {
$service_has_image = true;
} else {
$service_has_image = false;
}
if (in_array($cash_admin->platform_type, $data['compatibility'])) {
$all_services[] = array('key' => $key, 'name' => $data['name'], 'description' => $data['description'], 'link' => $data['link'], 'alternating_type' => $alternating_type, 'service_has_image' => $service_has_image);
$typecount++;
}
}
$cash_admin->page_data['all_services'] = new ArrayIterator($all_services);
//people mass email connection present?
$cash_admin->page_data['mass_connection'] = AdminHelper::getConnectionsByScope('mass_email');
// Return Mass Email Connections
$page_data_object = new CASHConnection(AdminHelper::getPersistentData('cash_effective_user'));
$settings_mass_types_data = $page_data_object->getConnectionTypes('mass_email');
$all_mass_services = array();
$typecount = 1;
if (is_array($settings_mass_types_data)) {
foreach ($settings_mass_types_data as $key => $data) {
if ($typecount % 2 == 0) {
$alternating_type = true;
} else {
$alternating_type = false;
}
if (file_exists(ADMIN_BASE_PATH . '/assets/images/settings/' . $key . '.png')) {
$service_has_image = true;
} else {