original_string: public function role_mappings($rolemappings, $roles) {
          $roles[0] = get_string('none');
          $output  = html_writer::start_tag('div', array('class' => 'restore-rolemappings'));
          $output .= $this->output->heading(get_string('restorerolemappings', 'backup'), 2);
          foreach ($rolemappings as $id => $mapping) {
              $label = $mapping->name;
              $name = 'mapping'.$id;
              $selected = $mapping->targetroleid;
              $output .= $this->backup_detail_select($label, $name, $roles, $mapping->targetroleid, false, array(), $mapping->description);
          }
          $output .= html_writer::end_tag('div');
          return $output;
      }
code: public function role_mappings($rolemappings, $roles) {
          $roles[0] = get_string('none');
          $output  = html_writer::start_tag('div', array('class' => 'restore-rolemappings'));
          $output .= $this->output->heading(get_string('restorerolemappings', 'backup'), 2);
          foreach ($rolemappings as $id => $mapping) {
              $label = $mapping->name;
              $name = 'mapping'.$id;
              $selected = $mapping->targetroleid;
              $output .= $this->backup_detail_select($label, $name, $roles, $mapping->targetroleid, false, array(), $mapping->description);
          }
          $output .= html_writer::end_tag('div');
          return $output;
      }
code_tokens: public function role_mappings ( $ rolemappings , $ roles ) { $ roles [ 0 ] = get_string ( 'none' ) ; $ output = html_writer :: start_tag ( 'div' , array ( 'class' => 'restore-rolemappings' ) ) ; $ output .= $ this -> output -> heading ( get_string ( 'restorerolemappings' , 'backup' ) , 2 ) ; foreach ( $ rolemappings as $ id => $ mapping ) { $ label = $ mapping -> name ; $ name = 'mapping' . $ id ; $ selected = $ mapping -> targetroleid ; $ output .= $ this -> backup_detail_select ( $ label , $ name , $ roles , $ mapping -> targetroleid , false , array ( ) , $ mapping -> description ) ; } $ output .= html_writer :: end_tag ( 'div' ) ; return $ output ; }
docstring: Displays a role mapping interface
  
  @param array $rolemappings
  @param array $roles
  @return string
docstring_tokens: Displays a role mapping interface