function globallink_add_cart_form_elements in GlobalLink Connect for Drupal 7.7
11 calls to globallink_add_cart_form_elements()
- globallink_beans_dashboard_form in globallink_beans/
globallink_beans_send.inc - Builds form to create a beans submission.
- globallink_block_dashboard_form in globallink_block/
globallink_block_send.inc - Builds form to create a block submission.
- globallink_commerce_dashboard_form in globallink_commerce/
globallink_commerce_send.inc - Builds form to create a commerce submission.
- globallink_dashboard_node_form in ./
globallink_send_translations.inc - Builds form to create a GlobalLink submission.
- globallink_entity_dashboard_form in globallink_entity/
globallink_entity_send.inc - Builds form to create an entity submission.
File
- ./
globallink_send_translations.inc, line 975
Code
function globallink_add_cart_form_elements(&$form, $header, $rows, $default_checked, $cart_count) {
ctools_include('modal');
ctools_modal_add_js();
$disabled = FALSE;
if ($cart_count == 0) {
$disabled = TRUE;
}
$form['url'] = array(
'#type' => 'hidden',
// Workaround for button instead of link
// The name of the class is the #id of ajax button with "-url" suffix.
'#attributes' => array(
'class' => array(
'gl-add-to-cart-url',
),
),
'#value' => url('admin/create-submission/nojs'),
);
$form['add-to-cart'] = array(
'#type' => 'submit',
'#value' => t('Create Submission'),
'#prefix' => '<div class="form-operations">',
'#suffix' => '<div id="update-cart-count">' . $cart_count . '</div>',
'#attributes' => array(
'title' => t('Create a GlobalLink Submission'),
'class' => array(
'globallink-cart-button',
'ctools-use-modal',
),
),
'#id' => 'gl-add-to-cart',
'#disabled' => $disabled,
);
$form['remove-from-cart'] = array(
'#type' => 'button',
'#value' => t('Clear'),
'#suffix' => '</div>',
'#attributes' => array(
'title' => t('Clear Submission'),
'class' => array(
'globallink-cart-clear-button',
),
),
'#ajax' => array(
'callback' => 'globallink_dashboard_node_form_ajax_empty_cart',
),
'#id' => 'gl-remove-from-cart',
'#disabled' => $disabled,
);
$form['table'] = array(
'#type' => 'tableselect',
'#header' => $header,
'#options' => $rows,
'#empty' => t('No items available'),
'#default_value' => $default_checked,
'#attributes' => array(
'class' => array(
'globallink-send-page-row',
),
),
);
}