original_string: public function setup_page_for_globally_available_filters($page) {
          $context = context_system::instance();
          $filterdata = filter_get_globally_enabled_filters_with_config();
          foreach ($filterdata as $name => $config) {
              if (isset($this->textfilters[$context->id][$name])) {
                  $filter = $this->textfilters[$context->id][$name];
              } else {
                  $filter = $this->make_filter_object($name, $context, $config);
                  if (is_null($filter)) {
                      continue;
                  }
              }
              $filter->setup($page, $context);
          }
      }
code: public function setup_page_for_globally_available_filters($page) {
          $context = context_system::instance();
          $filterdata = filter_get_globally_enabled_filters_with_config();
          foreach ($filterdata as $name => $config) {
              if (isset($this->textfilters[$context->id][$name])) {
                  $filter = $this->textfilters[$context->id][$name];
              } else {
                  $filter = $this->make_filter_object($name, $context, $config);
                  if (is_null($filter)) {
                      continue;
                  }
              }
              $filter->setup($page, $context);
          }
      }
code_tokens: public function setup_page_for_globally_available_filters ( $ page ) { $ context = context_system :: instance ( ) ; $ filterdata = filter_get_globally_enabled_filters_with_config ( ) ; foreach ( $ filterdata as $ name => $ config ) { if ( isset ( $ this -> textfilters [ $ context -> id ] [ $ name ] ) ) { $ filter = $ this -> textfilters [ $ context -> id ] [ $ name ] ; } else { $ filter = $ this -> make_filter_object ( $ name , $ context , $ config ) ; if ( is_null ( $ filter ) ) { continue ; } } $ filter -> setup ( $ page , $ context ) ; } }
docstring: Setup the page for globally available filters.
  
  This helps setting up the page for filters which may be applied to
  the page, even if they do not belong to the current context, or are
  not yet visible because the content is lazily added (ajax). This method
  always uses to the system context which determines the globally
  available filters.
  
  This should only ever be called once per request.
  
  @param moodle_page $page The page.
  @since Moodle 3.2
docstring_tokens: Setup the page for globally available filters .