You are here

function private_message_preprocess_container in Private Message 8.2

Same name and namespace in other branches
  1. 8 private_message.module \private_message_preprocess_container()

Implements hook_preprocess_container().

Adds a custom class to the containers that can be targeted, as the default classes may be altered in themes/templates, and therefore should not be depended upon.

File

./private_message.module, line 488
Contains hooks for the private message module.

Code

function private_message_preprocess_container(&$vars) {
  if (!empty($vars['element']['#id'])) {
    if (strpos('edit-members-wrapper', $vars['element']['#id']) === 0) {

      // Add a custom class to the private message members widget container.
      $vars['attributes']['class'][] = 'private_message_members_widget_default_wrapper';
    }
    elseif (strpos('edit-message-wrapper', $vars['element']['#id']) === 0) {

      // Add a custom class to the private message members widget container.
      $vars['attributes']['class'][] = 'private_message_message_widget_default_wrapper';
    }
  }
}