You are here

function jquerymobile_process_actions in jQuery Mobile module 7.2

Same name and namespace in other branches
  1. 7 jquerymobile.module \jquerymobile_process_actions()

Implements hook_process_actions().

1 string reference to 'jquerymobile_process_actions'
jquerymobile_element_info_alter in ./jquerymobile.module
Implements hook_element_info_alter().

File

./jquerymobile.module, line 271

Code

function jquerymobile_process_actions($element) {
  global $theme_key;
  if (_jquerymobile_is_mobile_theme($theme_key)) {
    $number_letters = array(
      1 => 'a',
      2 => 'b',
      3 => 'c',
      4 => 'd',
      5 => 'e',
    );
    $children = element_children($element);
    $count = count($children) - 1;
    if ($count) {
      $element['#attributes']['class'][] = 'ui-grid-' . $number_letters[$count];
      $grid_block_count = 1;
      foreach ($children as $key) {
        $element[$key]['#prefix'] = '<div class="ui-block-' . $number_letters[$grid_block_count] . '">';
        $element[$key]['#suffix'] = '</div>';
        $grid_block_count++;
      }
    }
  }
  return $element;
}