本文整理汇总了PHP中AdminHelper::echoFormOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHelper::echoFormOptions方法的具体用法?PHP AdminHelper::echoFormOptions怎么用?PHP AdminHelper::echoFormOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminHelper
的用法示例。
在下文中一共展示了AdminHelper::echoFormOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
interfaces soon.
</span></p>
<form method="post" action="">
<input type="hidden" name="doeventadd" value="makeitso" />
<label for="event_date">Date</label><br />
<input type="text" id="event_date" name="event_date" value="" placeholder="MM/DD/YYYY" />
<div class="row_seperator">.</div>
<label for="event_venue">Venue</label><br />
<select id="event_venue" name="event_venue">
<option value="0" selected="selected">Unknown (Will be listed as 'TBA')</option>
<?php
AdminHelper::echoFormOptions('venues');
?>
</select>
<div class="row_seperator">.</div>
<label for="event_comment">Comments (Support, CD Release, etc)</label><br />
<textarea rows="3" id="event_comment" name="event_comment"></textarea>
<div class="row_seperator">.</div>
<label for="event_purchase_url">Ticket Purchase URL</label><br />
<input type="text" id="event_purchase_url" name="event_purchase_url" value="" placeholder="Ticket Link URL" />
<div class="row_seperator">.</div>
<input type='checkbox' class='checkorradio' name='event_ispublished' value='' checked='checked' /> Published?
<input type='checkbox' class='checkorradio' name='event_iscancelled' value='' /> Cancelled?
示例2: array
// current paypal
$settings_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'getsettings', 'type' => 'payment_defaults', 'user_id' => $cash_admin->effective_user_id));
if (is_array($settings_response['payload'])) {
$pp_default = $settings_response['payload']['pp_default'];
$pp_micro = $settings_response['payload']['pp_micro'];
} else {
$pp_default = 0;
$pp_micro = 0;
}
$cash_admin->page_data['currency_options'] = AdminHelper::echoCurrencyOptions($current_currency);
$pp = array();
foreach ($page_data_object->getConnectionsByType('com.paypal') as $ppq) {
$pp[$ppq['id']] = $ppq['name'];
}
$cash_admin->page_data['paypal_default_options'] = AdminHelper::echoFormOptions($pp, $pp_default, false, true);
$cash_admin->page_data['paypal_micro_options'] = AdminHelper::echoFormOptions($pp, $pp_micro, false, true);
// handle regions
if (isset($_POST['region1'])) {
$regions = array('region1' => $_POST['region1'], 'region2' => $_POST['region2']);
$settings_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'setsettings', 'type' => 'regions', 'value' => $regions, 'user_id' => $cash_admin->effective_user_id));
if ($settings_response['payload']) {
AdminHelper::formSuccess('Success.', '/commerce/');
}
}
// now get the current setting
$settings_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'getsettings', 'type' => 'regions', 'user_id' => $cash_admin->effective_user_id));
if ($settings_response['payload']) {
$cash_admin->page_data['region1'] = $settings_response['payload']['region1'];
$cash_admin->page_data['region2'] = $settings_response['payload']['region2'];
} else {
$cash_admin->page_data['noshippingregions'] = true;
示例3: array
<?php
// Identify the workflow state:
if (AdminHelper::elementFormSubmitted($_POST)) {
if (isset($_POST['do_not_verify'])) {
$do_not_verify = 1;
} else {
$do_not_verify = 0;
}
AdminHelper::handleElementFormPOST($_POST, $cash_admin, array('message_invalid_email' => $_POST['message_invalid_email'], 'message_instructions' => $_POST['message_instructions'], 'image_url' => $_POST['image_url'], 'email_subject' => $_POST['email_subject'], 'email_message' => $_POST['email_message'], 'email_html_message' => $_POST['email_html_message'], 'message_success' => $_POST['message_success'], 'email_list_id' => $_POST['email_list_id'], 'asset_id' => $_POST['asset_id'], 'do_not_verify' => $do_not_verify));
}
// Page data needed for a blank 'add' form:
$cash_admin->page_data['options_people_lists'] = AdminHelper::echoFormOptions('items', 0, false, true);
$cash_admin->page_data['options_assets'] = AdminHelper::echoFormOptions('items', 0, false, 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_invalid_email'] = $current_element['options']['message_invalid_email'];
$cash_admin->page_data['options_message_instructions'] = $current_element['options']['message_instructions'];
$cash_admin->page_data['options_message_success'] = $current_element['options']['message_success'];
$cash_admin->page_data['options_message_privacy'] = $current_element['options']['message_privacy'];
$cash_admin->page_data['options_image_url'] = $current_element['options']['image_url'];
$cash_admin->page_data['options_email_subject'] = $current_element['options']['email_subject'];
$cash_admin->page_data['options_email_message'] = $current_element['options']['email_message'];
$cash_admin->page_data['options_email_html_message'] = $current_element['options']['email_html_message'];
$cash_admin->page_data['options_do_not_verify'] = $current_element['options']['do_not_verify'];
$cash_admin->page_data['options_people_lists'] = AdminHelper::echoFormOptions('people_lists', $current_element['options']['email_list_id'], false, true);
$cash_admin->page_data['options_assets'] = AdminHelper::echoFormOptions('assets', $current_element['options']['asset_id'], false, true);
}
示例4: array_merge
<?php
if (isset($_POST['doitemadd'])) {
// do the actual list add stuffs...
$effective_user = AdminHelper::getPersistentData('cash_effective_user');
$add_response = $cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'additem', 'user_id' => $effective_user, 'name' => $_POST['item_name'], 'description' => $_POST['item_description'], 'price' => $_POST['item_price'], 'digital_fulfillment' => 1, 'fulfillment_asset' => $_POST['item_fulfillment_asset']), 'eventaddattempt');
$cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'getitem', 'id' => $add_response['payload']), 'getitem');
} else {
// parsing posted data:
if (isset($_POST['doitemedit'])) {
// do the actual list add stuffs...
$item_id = $request_parameters[0];
$event_edit_request = $cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'edititem', 'name' => $_POST['item_name'], 'description' => $_POST['item_description'], 'price' => $_POST['item_price'], 'fulfillment_asset' => $_POST['item_fulfillment_asset'], 'id' => $item_id), 'itemeditattempt');
if ($event_edit_request['status_uid'] == 'commerce_edititem_200') {
$cash_admin->page_data['page_message'] = 'Success. Edited.';
} else {
$cash_admin->page_data['error_message'] = 'Error. There was a problem editing the item.';
}
}
$cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'getitem', 'id' => $request_parameters[0]), 'getitem');
}
$item_response = $cash_admin->getStoredResponse('getitem', true);
if (is_array($item_response)) {
$cash_admin->page_data = array_merge($cash_admin->page_data, $item_response);
if (isset($_POST['doitemadd'])) {
$cash_admin->page_data['page_message'] = 'Success. Event added.';
}
$cash_admin->page_data['asset_options'] = AdminHelper::echoFormOptions('assets', $item_response['fulfillment_asset'], $cash_admin->getAllFavoriteAssets(), true);
}
$cash_admin->setPageContentTemplate('commerce_items_edit');
示例5: strtotime
if (isset($_POST['doeventedit'])) {
// do the actual list add stuffs...
$event_id = $request_parameters[0];
$eventispublished = 0;
$eventiscancelled = 0;
if (isset($_POST['event_ispublished'])) {
$eventispublished = 1;
}
if (isset($_POST['event_iscancelled'])) {
$eventiscancelled = 1;
}
$edit_response = $cash_admin->requestAndStore(array('cash_request_type' => 'calendar', 'cash_action' => 'editevent', 'date' => strtotime($_POST['event_date']), 'venue_id' => $_POST['event_venue'], 'comment' => $_POST['event_comment'], 'purchase_url' => $_POST['event_purchase_url'], 'published' => $eventispublished, 'cancelled' => $eventiscancelled, 'event_id' => $event_id), 'eventeditattempt');
if ($edit_response['status_uid'] == 'calendar_editevent_200') {
$cash_admin->page_data['page_message'] = 'Success. Edited.';
} else {
$cash_admin->page_data['error_message'] = 'Error. There was a problem editing the event.';
}
}
$event_response = $cash_admin->requestAndStore(array('cash_request_type' => 'calendar', 'cash_action' => 'getevent', 'event_id' => $request_parameters[0]), 'getevent');
$current_event = $event_response['payload'];
if (is_array($current_event)) {
$cash_admin->page_data = array_merge($cash_admin->page_data, $current_event);
}
$cash_admin->page_data['venue_options'] = AdminHelper::echoFormOptions('venues', $current_event['venue_id'], false, true);
$cash_admin->page_data['formatted_date'] = date('m/j/Y h:iA T', $current_event['date']);
if ($cash_admin->page_data['published']) {
$cash_admin->page_data['published'] = 1;
}
$cash_admin->page_data['form_state_action'] = 'doeventedit';
$cash_admin->page_data['event_button_text'] = 'Edit the event';
$cash_admin->setPageContentTemplate('calendar_events_details');
示例6: strtotime
<?php
// parsing posted data:
if (isset($_POST['doeventadd'])) {
// do the actual list add stuffs...
$effective_user = $cash_admin->effective_user_id;
$eventispublished = 0;
$eventiscancelled = 0;
if (isset($_POST['event_ispublished'])) {
$eventispublished = 1;
}
if (isset($_POST['event_iscancelled'])) {
$eventiscancelled = 1;
}
$add_response = $cash_admin->requestAndStore(array('cash_request_type' => 'calendar', 'cash_action' => 'addevent', 'date' => strtotime($_POST['event_date']), 'venue_id' => $_POST['event_venue'], 'comment' => $_POST['event_comment'], 'purchase_url' => $_POST['event_purchase_url'], 'published' => $eventispublished, 'cancelled' => $eventiscancelled, 'user_id' => $effective_user));
if ($add_response['payload']) {
AdminHelper::formSuccess('Success. Event added.', '/calendar/events/edit/' . $add_response['payload']);
} else {
AdminHelper::formFailure('Error. Something just didn\'t work right.', '/calendar/events/add/');
}
}
$cash_admin->page_data['venue_options'] = AdminHelper::echoFormOptions('venues', 0, false, true);
$cash_admin->page_data['form_state_action'] = 'doeventadd';
$cash_admin->page_data['event_button_text'] = 'Add the event';
$cash_admin->setPageContentTemplate('calendar_events_details');
示例7: formatElementValue
public static function formatElementValue($value, $type, $formatting_data = false)
{
$return_val = $value;
if ($type == 'select') {
$return_val = AdminHelper::echoFormOptions($formatting_data, $value, false, true, true);
}
return $return_val;
}
示例8: date
interfaces soon.
</span></p>
<form method="post" action="">
<input type="hidden" name="doeventedit" value="makeitso" />
<label for="event_date">Date</label><br />
<input type="text" id="event_date" name="event_date" value="<? echo date('m/j/Y h:iA T',$current_event['date']); ?>" />
<div class="row_seperator">.</div>
<label for="event_venue">Venue</label><br />
<select id="event_venue" name="event_venue">
<option value="0" selected="selected">Unknown (Will be listed as 'TBA')</option>
<?php
AdminHelper::echoFormOptions('venues', $current_event['venue_id']);
?>
</select>
<div class="row_seperator">.</div>
<label for="event_comment">Comments (Support, CD Release, etc)</label><br />
<textarea rows="3" id="event_comment" name="event_comment"><?php
echo $current_event['comments'];
?>
</textarea>
<div class="row_seperator">.</div>
<label for="event_purchase_url">Ticket Purchase URL</label><br />
<input type="text" id="event_purchase_url" name="event_purchase_url" value="<?php
echo $current_event['purchase_url'];
?>
示例9:
$checkstring = "";
}
?>
<input type='checkbox' class='checkorradio' name='do_not_verify' value='' <?php
echo $checkstring;
?>
/> <label for="do_not_verify">Skip email verification</label>
</div>
<div class="col_oneoftwo lastcol">
<label for="asset_id">The Downloadable Asset</label><br />
<select id="asset_id" name="asset_id">
<option value="0">none</option>
<?php
AdminHelper::echoFormOptions('assets', $page_data['options']->asset_id);
?>
</select>
<br /><br />
<a href="<?php
echo ADMIN_WWW_BASE_PATH;
?>
/assets/add/"><small>OR ADD NEW ASSET</small></a>
</div>
<div class="row_seperator">.</div>
<br />
<label for="message_invalid_email">Invalid Email Error Message</label><br />
示例10:
<?php
if ($page_message) {
echo '<p><span class="highlightcopy">' . $page_message . '</span></p>';
}
?>
<p>
Paste in a list of email addresses, separated by comma or a new line. Optionally
add to an existing list.
</p>
<form name="batchaddcontacts" method="post" action="">
<input type="hidden" name="dobatchcontactsadd" value="makeitso" />
<div>
<label>Email Addresses</label>
<textarea id="element_content" name="element_content" class="tall"></textarea>
<div class="row_seperator">.</div>
<label for="email_list_id">Target List</label><br />
<select id="email_list_id" name="email_list_id">
<option value="0">none</option>
<?php
AdminHelper::echoFormOptions('people_lists');
?>
</select>
</div>
<div>
<br />
<input class="button" type="submit" value="Add Contacts" />
</div>
</form>
示例11: foreach
<?php
$items_response = $cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'getitemsforuser', 'user_id' => $cash_admin->effective_user_id));
$releases_response = $cash_admin->requestAndStore(array('cash_request_type' => 'asset', 'cash_action' => 'getassetsforuser', 'type' => 'release', 'user_id' => $cash_admin->effective_user_id));
$cash_admin->page_data['assets_options'] = AdminHelper::echoFormOptions('assets', false, $cash_admin->getAllFavoriteAssets(), true);
if (is_array($items_response['payload'])) {
// IF there is an attached asset and IF it's a release then say so
foreach ($items_response['payload'] as &$item) {
$item['release_asset'] = false;
if (is_array($releases_response['payload'])) {
foreach ($releases_response['payload'] as $release) {
if ($item['fulfillment_asset'] == $release['id']) {
$item['release_asset'] = true;
break;
}
}
}
}
$cash_admin->page_data['items_all'] = new ArrayIterator(array_reverse($items_response['payload']));
}
$cash_admin->setPageContentTemplate('commerce_items');
示例12:
<?php
$cash_admin->page_data['form_state_action'] = 'doitemadd';
if (isset($request_parameters[1])) {
if ($request_parameters[0] == 'selectedasset') {
$cash_admin->page_data['asset_options'] = AdminHelper::echoFormOptions('assets', $request_parameters[1], false, true);
}
} else {
$cash_admin->page_data['asset_options'] = AdminHelper::echoFormOptions('assets', 0, false, true);
}
$cash_admin->setPageContentTemplate('commerce_items_details');
示例13: count
$tag_markup .= "<input type='text' name='tag{$tag_counter}' value='{$tag}' placeholder='Tag' />";
$tag_counter = $tag_counter + 1;
}
}
$cash_admin->page_data['tag_counter'] = $tag_counter;
$cash_admin->page_data['tag_markup'] = $tag_markup;
// Reset page title to reflect the asset:
$cash_admin->page_data['ui_title'] = 'Edit “' . $cash_admin->page_data['title'] . '”';
// Code count
if ($asset_codes) {
$cash_admin->page_data['asset_codes_count'] = count($asset_codes);
}
if ($cash_admin->page_data['type'] == 'file') {
// parent id options markup:
$cash_admin->page_data['parent_options'] = '<option value="0" selected="selected">None</option>';
$cash_admin->page_data['parent_options'] .= AdminHelper::echoFormOptions('assets', $cash_admin->page_data['parent_id'], $cash_admin->getAllFavoriteAssets(), true);
// 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', $cash_admin->page_data['connection_id'], true);
if ($cash_admin->page_data['connection_id'] != 0) {
$cash_admin->page_data['show_make_public'] = true;
}
// set the view
$cash_admin->setPageContentTemplate('assets_details_file');
} else {
if ($cash_admin->page_data['type'] == 'release') {
$fulfillment_response = $cash_admin->requestAndStore(array('cash_request_type' => 'asset', 'cash_action' => 'getfulfillmentassets', 'asset_details' => $asset_response['payload']));
if ($fulfillment_response['payload']) {
$cash_admin->page_data['fulfillment_files'] = new ArrayIterator($fulfillment_response['payload']);
}
if (isset($cash_admin->page_data['metadata']['private'])) {
示例14: str_replace
<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('"', '"', $current_asset['location']);
?>
" />
</div>
<div class="row_seperator">.</div>
<div>
<label for="parent_id">Place in asset (Parent)</label><br />
<select id="parent_id" name="parent_id">
<option value="0" selected="selected">None</option>
<?php
AdminHelper::echoFormOptions('assets', $current_asset['parent_id'], $cash_admin->getAllFavoriteAssets());
?>
</select>
</div>
<div class="row_seperator">.</div><br />
<div class="col_oneoftwo">
<div>
<label>Tags</label><br />
<?php
$tag_counter = 1;
if (is_array($current_asset['tags'])) {
foreach ($current_asset['tags'] as $tag) {
echo "<input type='text' name='tag{$tag_counter}' value='{$tag}' placeholder='Tag' />";
$tag_counter = $tag_counter + 1;
示例15: array_map
<?php
if (isset($_POST['dobatchcontactsadd'])) {
if (!empty($_POST['element_content'])) {
$email_array = array_map('trim', explode(",", str_replace(PHP_EOL, ',', $_POST['element_content'])));
if (count($email_array) > 0) {
if ($_POST['email_list_id']) {
$total_added = 0;
foreach ($email_array as $address) {
$add_request = new CASHRequest(array('cash_request_type' => 'people', 'cash_action' => 'addaddresstolist', 'do_not_verify' => 1, 'address' => $address, 'list_id' => $_POST['email_list_id']));
if ($add_request->response['payload']) {
$total_added++;
}
}
$cash_admin->page_data['page_message'] = 'Success. Added ' . $total_added . ' new emails to your list.';
} else {
$cash_admin->page_data['page_message'] = 'Please select a list to add contacts to.';
}
}
}
}
$cash_admin->page_data['list_options'] = AdminHelper::echoFormOptions('people_lists', 0, false, true);
$cash_admin->setPageContentTemplate('people_contacts');