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


PHP AdminHelper::echoConnectionsOptions方法代码示例

本文整理汇总了PHP中AdminHelper::echoConnectionsOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHelper::echoConnectionsOptions方法的具体用法?PHP AdminHelper::echoConnectionsOptions怎么用?PHP AdminHelper::echoConnectionsOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AdminHelper的用法示例。


在下文中一共展示了AdminHelper::echoConnectionsOptions方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

        AdminHelper::formSuccess('Success. Asset added. Feel free to start adding details.', '/assets/edit/' . $add_response['payload']);
    } else {
        AdminHelper::formFailure('Error. Something just didn\'t work right.', '/assets/add/');
    }
}
$cash_admin->page_data['form_state_action'] = 'doassetadd';
$cash_admin->page_data['asset_button_text'] = 'Save changes';
// create type options with current selected:
if (isset($request_parameters[0])) {
    $add_type = $request_parameters[0];
    $cash_admin->page_data['type'] = $add_type;
    $cash_admin->page_data['ui_title'] = 'Assets: Add a ' . $add_type;
    if ($add_type == 'file') {
        // connection options markup:
        $cash_admin->page_data['connection_options'] = '<option value="0" selected="selected">None (Normal http:// link)</option>';
        $cash_admin->page_data['connection_options'] .= AdminHelper::echoConnectionsOptions('assets', 0, true);
        $cash_admin->page_data['show_location'] = true;
    }
} else {
    $add_type = 'file';
    $cash_admin->page_data['ui_title'] = 'Assets: Add an asset';
}
$type_options = array('file' => 'File', 'playlist' => 'Playlist', 'release' => 'Release');
$cash_admin->page_data['type_options_markup'] = '';
foreach ($type_options as $type => $value) {
    if ($add_type == $type) {
        $selected = ' selected="selected"';
    } else {
        $selected = '';
    }
    $cash_admin->page_data['type_options_markup'] .= '<option value="' . $type . '"' . $selected . '>' . $value . '</option>';
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:assets_add.php

示例2: ArrayIterator

<?php

$list_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getlistsforuser', 'user_id' => $cash_admin->effective_user_id));
// lists
if (is_array($list_response['payload'])) {
    $cash_admin->page_data['lists_all'] = new ArrayIterator($list_response['payload']);
}
$cash_admin->page_data['list_connection_options'] = AdminHelper::echoConnectionsOptions('lists', 0, true);
$cash_admin->setPageContentTemplate('people_lists');
开发者ID:JamesLinus,项目名称:platform,代码行数:9,代码来源:people_lists.php

示例3: str_replace

" />

		<div class="row_seperator">.</div>
		<label for="asset_description">Description</label><br />
		<textarea rows="3" id="asset_description" name="asset_description"><?php 
    echo str_replace('"', '&quot;', $current_asset['description']);
    ?>
</textarea>

		<div class="row_seperator">.</div>
		<div class="col_oneoftwo">
			<label for="connection_id">Use Settings</label><br />
			<select id="connection_id" name="connection_id">
				<option value="0" selected="selected">None (Normal http:// link)</option>
				<?php 
    AdminHelper::echoConnectionsOptions('assets', $current_asset['connection_id']);
    ?>
			</select>
		</div>

		<div class="col_oneoftwo lastcol">
			<label for="asset_location">Location (URI)</label><br />
			<input type="text" id="asset_location" name="asset_location" value="<?php 
    echo str_replace('"', '&quot;', $current_asset['location']);
    ?>
" />
		</div>

		<div class="row_seperator">.</div>
		<div>
			<label for="parent_id">Place in asset (Parent)</label><br />
开发者ID:blacktire,项目名称:DIY,代码行数:31,代码来源:assets_edit_file.php

示例4: echoFormOptions

 /**
  * Tell it what you need. It makes dropdowns. It's a dropdown robot travelling
  * at the speed of light — it'll make a supersonic nerd of you. Don't stop it.
  *
  * @return array
  */
 public static function echoFormOptions($base_type, $selected = 0, $range = false, $return = false, $shownone = true)
 {
     global $admin_primary_cash_request;
     $available_options = false;
     $all_options = '';
     if ($shownone) {
         $all_options = '<option value="0">None</option>';
     }
     if (is_array($base_type)) {
         $available_options = array();
         foreach ($base_type as $key => $value) {
             $available_options[] = array('id' => $key, 'display' => $value);
         }
         $display_information = 'display';
     } else {
         // fix for an old style. we prefer '/' in app.json but use '_' in other calls
         $base_type = str_replace('/', '_', $base_type);
         if (substr($base_type, 0, 7) == 'connect') {
             $scope = explode('_', $base_type);
             return AdminHelper::echoConnectionsOptions($scope[1], $selected, true);
         }
         switch ($base_type) {
             case 'assets':
                 $plant_name = 'asset';
                 $action_name = 'getassetsforuser';
                 $display_information = 'title';
                 if ($range) {
                     if (!in_array($selected, $range)) {
                         $range[] = $selected;
                     }
                 }
                 break;
             case 'people_lists':
                 $plant_name = 'people';
                 $action_name = 'getlistsforuser';
                 $display_information = 'name';
                 break;
             case 'venues':
             case 'calendar_venues':
                 $plant_name = 'calendar';
                 $action_name = 'getallvenues';
                 $display_information = 'name';
                 break;
             case 'items':
             case 'commerce_items':
                 $plant_name = 'commerce';
                 $action_name = 'getitemsforuser';
                 $display_information = 'name';
                 break;
         }
         global $admin_primary_cash_request;
         $admin_primary_cash_request->processRequest(array('cash_request_type' => $plant_name, 'cash_action' => $action_name, 'user_id' => AdminHelper::getPersistentData('cash_effective_user'), 'parent_id' => 0));
         if (is_array($admin_primary_cash_request->response['payload']) && $admin_primary_cash_request->response['status_code'] == 200) {
             $available_options = $admin_primary_cash_request->response['payload'];
         }
     }
     if (is_array($available_options)) {
         foreach ($available_options as $item) {
             $doloop = true;
             if ($range) {
                 if (!in_array($item['id'], $range)) {
                     $doloop = false;
                 }
             }
             if ($doloop) {
                 $selected_string = '';
                 if ($item['id'] == $selected) {
                     $selected_string = ' selected="selected"';
                 }
                 $all_options .= '<option value="' . $item['id'] . '"' . $selected_string . '>' . $item[$display_information] . '</option>';
             }
         }
     } else {
         $all_options = false;
     }
     if ($return) {
         return $all_options;
     } else {
         echo $all_options;
     }
 }
开发者ID:JamesLinus,项目名称:platform,代码行数:87,代码来源:AdminHelper.php

示例5: array

<?php

// Identify the workflow state:
if (AdminHelper::elementFormSubmitted($_POST)) {
    AdminHelper::handleElementFormPOST($_POST, $cash_admin, array('message_error' => $_POST['message_error'], 'message_success' => $_POST['message_success'], 'item_id' => $_POST['item_id'], 'connection_id' => $_POST['connection_id']));
}
// Page data needed for a blank 'add' form:
$cash_admin->page_data['options_items_dropdown'] = AdminHelper::echoFormOptions('items', 0, false, true);
$cash_admin->page_data['options_connections_dropdown'] = AdminHelper::echoConnectionsOptions('commerce', 0, true);
$current_element = $cash_admin->getCurrentElement();
if ($current_element) {
    // Current element found, so fill in the 'edit' form, basics first:
    AdminHelper::setBasicElementFormData($cash_admin);
    // Now any element-specific options:
    $cash_admin->page_data['options_message_success'] = $current_element['options']['message_success'];
    $cash_admin->page_data['options_message_error'] = $current_element['options']['message_error'];
    $cash_admin->page_data['options_items_dropdown'] = AdminHelper::echoFormOptions('items', $current_element['options']['item_id'], false, true);
    $cash_admin->page_data['options_connections_dropdown'] = AdminHelper::echoConnectionsOptions('commerce', $current_element['options']['connection_id'], true);
}
开发者ID:blacktire,项目名称:DIY,代码行数:19,代码来源:admin.php

示例6:

		<h3>Asset Details</h3>
		<label for="asset_title">Title / Name</label><br />
		<input type="text" id="asset_title" name="asset_title" value="" placeholder="Give It A Name" />

		<div class="row_seperator">.</div>
		<label for="asset_description">Description</label><br />
		<textarea rows="3" id="asset_description" name="asset_description"></textarea>

		<div class="row_seperator">.</div>
		<div class="col_oneoftwo">
			<label for="connection_id">Use Settings</label><br />
			<select id="connection_id" name="connection_id">
				<option value="0" selected="selected">None (Normal http:// link)</option>
				<?php 
    AdminHelper::echoConnectionsOptions('assets');
    ?>
			</select>
		</div>

		<div class="col_oneoftwo lastcol">
			<label for="asset_location">Location (URI)</label><br />
			<input type="text" id="asset_location" name="asset_location" value="" placeholder="URL, S3 path, or SoundCloud URL" />
		</div>

		<div class="row_seperator">.</div><br />

		<div class="col_oneoftwo">
			<div>
				<label>Tags</label><br />
				<a href="#" class="injectbefore" rev="<input type='text' name='tag' value='' placeholder='Tag' />"><small>+ ADD TAG</small></a>
开发者ID:blacktire,项目名称:DIY,代码行数:30,代码来源:assets_add_file.php

示例7: array_merge

<?php

// parsing posted data:
if (isset($_POST['dolistedit'])) {
    // do the actual list add stuffs...
    $effective_user = AdminHelper::getPersistentData('cash_effective_user');
    $edit_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'editlist', 'list_id' => $request_parameters[0], 'name' => $_POST['list_name'], 'description' => $_POST['list_description'], 'connection_id' => $_POST['connection_id']), 'editresponse');
    if ($edit_response['status_uid'] == 'people_editlist_200') {
        $cash_admin->page_data['page_message'] = 'Success. Edited.';
    } else {
        $cash_admin->page_data['error_message'] = 'Error. There was a problem editing the event.';
    }
}
$current_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getlist', 'list_id' => $request_parameters[0]), 'getlist');
$cash_admin->page_data['ui_title'] = 'People: Edit "' . $current_response['payload']['name'] . '"';
$current_list = $current_response['payload'];
if (is_array($current_list)) {
    $cash_admin->page_data = array_merge($cash_admin->page_data, $current_list);
}
if ($current_list['connection_id'] == 0) {
    $cash_admin->page_data['no_selected_connection'] = true;
}
$cash_admin->page_data['connection_options'] = AdminHelper::echoConnectionsOptions('lists', $current_list['connection_id'], true);
$cash_admin->page_data['form_state_action'] = 'dolistedit';
$cash_admin->page_data['list_button_text'] = 'Edit the list';
$cash_admin->setPageContentTemplate('people_lists_details');
开发者ID:blacktire,项目名称:DIY,代码行数:26,代码来源:people_lists_edit.php

示例8:

<?php

$cash_admin->page_data['ui_title'] = '';
$cash_admin->page_data['id'] = $request_parameters[0];
$cash_admin->page_data['connection_options'] = AdminHelper::echoConnectionsOptions('mass_email', 0, true);
$cash_admin->setPageContentTemplate('commerce_items_send');
开发者ID:JamesLinus,项目名称:platform,代码行数:6,代码来源:commerce_items_send.php


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