original_string: public static function bootstrap() {
          global $PAGE;
  
          if (!isloggedin() || isguestuser()) {
              return;
          }
  
          if (in_array($PAGE->pagelayout, ['maintenance', 'print', 'redirect'])) {
              // Do not try to show user tours inside iframe, in maintenance mode,
              // when printing, or during redirects.
              return;
          }
  
          if (self::$bootstrapped) {
              return;
          }
          self::$bootstrapped = true;
  
          if ($tour = manager::get_current_tour()) {
              $PAGE->requires->js_call_amd('tool_usertours/usertours', 'init', [
                      $tour->get_id(),
                      $tour->should_show_for_user(),
                      $PAGE->context->id,
                  ]);
          }
      }
code: public static function bootstrap() {
          global $PAGE;
  
          if (!isloggedin() || isguestuser()) {
              return;
          }
  
          if (in_array($PAGE->pagelayout, ['maintenance', 'print', 'redirect'])) {
              // Do not try to show user tours inside iframe, in maintenance mode,
              // when printing, or during redirects.
              return;
          }
  
          if (self::$bootstrapped) {
              return;
          }
          self::$bootstrapped = true;
  
          if ($tour = manager::get_current_tour()) {
              $PAGE->requires->js_call_amd('tool_usertours/usertours', 'init', [
                      $tour->get_id(),
                      $tour->should_show_for_user(),
                      $PAGE->context->id,
                  ]);
          }
      }
code_tokens: public static function bootstrap ( ) { global $ PAGE ; if ( ! isloggedin ( ) || isguestuser ( ) ) { return ; } if ( in_array ( $ PAGE -> pagelayout , [ 'maintenance' , 'print' , 'redirect' ] ) ) { // Do not try to show user tours inside iframe, in maintenance mode, // when printing, or during redirects. return ; } if ( self :: $ bootstrapped ) { return ; } self :: $ bootstrapped = true ; if ( $ tour = manager :: get_current_tour ( ) ) { $ PAGE -> requires -> js_call_amd ( 'tool_usertours/usertours' , 'init' , [ $ tour -> get_id ( ) , $ tour -> should_show_for_user ( ) , $ PAGE -> context -> id , ] ) ; } }
docstring: Handle addition of the tour into the current page.
docstring_tokens: Handle addition of the tour into the current page .