You are here

function globallink_commerce_dashboard_pager_form in GlobalLink Connect for Drupal 7.7

Builds form to add pagination to commerce send dashboard.

1 string reference to 'globallink_commerce_dashboard_pager_form'
globallink_commerce_dashboard in globallink_commerce/globallink_commerce_send.inc
Builds forms on commerce send dashboard.

File

globallink_commerce/globallink_commerce_send.inc, line 153

Code

function globallink_commerce_dashboard_pager_form() {
  $module_path = drupal_get_path('module', 'globallink');
  drupal_add_css($module_path . '/css/globallink.css');
  $form = array();
  $locales = globallink_get_mapped_drupal_locales(FALSE);
  if (!empty($locales)) {
    $form['page_counter']['markup'] = array(
      '#type' => 'container',
      '#attributes' => array(
        'class' => array(
          'tpt-center',
        ),
      ),
    );
    $form['page_counter']['markup']['p_count'] = array(
      '#type' => 'textfield',
      '#size' => 5,
      '#default_value' => isset($_SESSION['globallink_commerce_page_count']) ? $_SESSION['globallink_commerce_page_count'][0] : TPT_PAGER_LIMIT,
      '#field_prefix' => t('Show') . '  ',
      '#field_suffix' => '  ' . t('records') . '    ',
      '#prefix' => '<div class="container-inline">',
    );
    $form['page_counter']['markup']['action'] = array(
      '#type' => 'submit',
      '#value' => t('Go'),
      '#suffix' => '</div>',
      '#limit_validation_errors' => array(),
      '#submit' => array(
        'globallink_commerce_dashboard_pager_form_submit',
      ),
      '#access' => TRUE,
    );
  }
  return $form;
}