You are here

function views_bulk_operations_profile_action_form in Views Bulk Operations (VBO) 6

Same name and namespace in other branches
  1. 6.3 profile.action.inc \views_bulk_operations_profile_action_form()

File

actions/profile.action.inc, line 20

Code

function views_bulk_operations_profile_action_form($context) {
  drupal_add_js(drupal_get_path('module', 'views_bulk_operations') . '/js/profile.action.js');
  $form = array();
  foreach (profile_categories() as $category) {
    $form += profile_form_profile($context, NULL, $category['name']);
    $fields = _profile_get_fields($category['name']);
    while ($field = db_fetch_object($fields)) {
      $form[$category['name']][$field->name]['#required'] = FALSE;
      $form[$field->name . '_check'] = array(
        '#type' => 'checkbox',
        '#attributes' => array(
          'class' => 'profile-action-toggler',
          'onchange' => 'Drupal.vbo.profileAction.updateField(this, true)',
        ),
        '#default_value' => @$context[$field->name . '_check'],
      );
    }
  }
  $form['#theme'] = 'views_bulk_operations_profile_action_form';
  return $form;
}