You are here

function commerce_backoffice_content_form_alter in Commerce Backoffice 7

Implements hook_form_alter().

File

./commerce_backoffice_content.module, line 16

Code

function commerce_backoffice_content_form_alter(&$form, &$form_state, $form_id) {

  // Alter the exposed filters for the content view.
  if (isset($form['submit']['#id']) && $form['submit']['#id'] == 'edit-submit-commerce-backoffice-content') {
    $form['non_product_display_node_type']['#attributes'] = array(
      'data-placeholder' => array(
        t('All content types'),
      ),
    );
    $form['status']['#options']['All'] = t('All statuses');
    $form['combine']['#attributes'] = array(
      'placeholder' => array(
        t('Search by title or author'),
      ),
    );
  }

  // Alter the exposed filters for the comments view.
  if (isset($form['submit']['#id']) && $form['submit']['#id'] == 'edit-submit-commerce-backoffice-comments') {
    $form['combine']['#attributes'] = array(
      'placeholder' => array(
        t('Search by subject or author'),
      ),
    );
  }
}