You are here

function global_filter_init in Views Global Filter 6

Same name and namespace in other branches
  1. 8 global_filter.module \global_filter_init()
  2. 7 global_filter.module \global_filter_init()

File

./global_filter.module, line 105
global_filter.module

Code

function global_filter_init() {
  global $user;

  // This is here to make sure that the default filter settings (from the user
  // profile) are immediately active without requiring 'Set' to be pressed.
  if ($user->uid && is_array($_SESSION)) {
    $num_filters = variable_get('global_filter_num_filters', GLOBAL_FILTER_DEF_NUM_FILTERS);
    for ($i = 1; $i <= $num_filters; $i++) {
      $field_name = variable_get("global_filter_{$i}", '');
      if ($field_name && !isset($_SESSION['global_filter'][$field_name])) {

        // @tobeported
        // $_SESSION['global_filter'][$field_name] = global_filter_user_profile_field($field_name);
      }
    }
  }
  if (variable_get('global_filter_view_autocycle_every_click', FALSE)) {
    global_filter_get_view_next_value();
  }
}