original_string: public function render_stepsdefinitions($stepsdefinitions, $form) {
          global $CFG;
          require_once($CFG->libdir . '/behat/classes/behat_selectors.php');
  
          $html = $this->generic_info();
  
          // Form.
          ob_start();
          $form->display();
          $html .= ob_get_contents();
          ob_end_clean();
  
          if (empty($stepsdefinitions)) {
              $stepsdefinitions = get_string('nostepsdefinitions', 'tool_behat');
          } else {
  
              $stepsdefinitions = implode('', $stepsdefinitions);
  
              // Replace text selector type arguments with a user-friendly select.
              $stepsdefinitions = preg_replace_callback('/(TEXT_SELECTOR\d?_STRING)/',
                  function ($matches) {
                      return html_writer::select(behat_selectors::get_allowed_text_selectors(), uniqid());
                  },
                  $stepsdefinitions
              );
  
              // Replace selector type arguments with a user-friendly select.
              $stepsdefinitions = preg_replace_callback('/(SELECTOR\d?_STRING)/',
                  function ($matches) {
                      return html_writer::select(behat_selectors::get_allowed_selectors(), uniqid());
                  },
                  $stepsdefinitions
              );
  
              // Replace simple OR options.
              $regex = '#\(\?P<[^>]+>([^\)|]+\|[^\)]+)\)#';
              $stepsdefinitions = preg_replace_callback($regex,
                  function($matches){
                      return html_writer::select(explode('|', $matches[1]), uniqid());
                  },
                  $stepsdefinitions
              );
  
              $stepsdefinitions = preg_replace_callback('/(FIELD_VALUE_STRING)/',
                  function ($matches) {
                      global $CFG;
  
                      // Creating a link to a popup with the help.
                      $url = new moodle_url(
                          '/help.php',
                          array(
                              'component' => 'tool_behat',
                              'identifier' => 'fieldvalueargument',
                              'lang' => current_language()
                          )
                      );
  
                      // Note: this title is displayed only if JS is disabled,
                      // otherwise the link will have the new ajax tooltip.
                      $title = get_string('fieldvalueargument', 'tool_behat');
                      $title = get_string('helpprefix2', '', trim($title, ". \t"));
  
                      $attributes = array('href' => $url, 'title' => $title,
                          'aria-haspopup' => 'true', 'target' => '_blank');
  
                      $output = html_writer::tag('a', 'FIELD_VALUE_STRING', $attributes);
                      return html_writer::tag('span', $output, array('class' => 'helptooltip'));
                  },
                  $stepsdefinitions
              );
          }
  
          // Steps definitions.
          $html .= html_writer::tag('div', $stepsdefinitions, array('class' => 'steps-definitions'));
  
          $html .= $this->output->footer();
  
          return $html;
      }
code: public function render_stepsdefinitions($stepsdefinitions, $form) {
          global $CFG;
          require_once($CFG->libdir . '/behat/classes/behat_selectors.php');
  
          $html = $this->generic_info();
  
          // Form.
          ob_start();
          $form->display();
          $html .= ob_get_contents();
          ob_end_clean();
  
          if (empty($stepsdefinitions)) {
              $stepsdefinitions = get_string('nostepsdefinitions', 'tool_behat');
          } else {
  
              $stepsdefinitions = implode('', $stepsdefinitions);
  
              // Replace text selector type arguments with a user-friendly select.
              $stepsdefinitions = preg_replace_callback('/(TEXT_SELECTOR\d?_STRING)/',
                  function ($matches) {
                      return html_writer::select(behat_selectors::get_allowed_text_selectors(), uniqid());
                  },
                  $stepsdefinitions
              );
  
              // Replace selector type arguments with a user-friendly select.
              $stepsdefinitions = preg_replace_callback('/(SELECTOR\d?_STRING)/',
                  function ($matches) {
                      return html_writer::select(behat_selectors::get_allowed_selectors(), uniqid());
                  },
                  $stepsdefinitions
              );
  
              // Replace simple OR options.
              $regex = '#\(\?P<[^>]+>([^\)|]+\|[^\)]+)\)#';
              $stepsdefinitions = preg_replace_callback($regex,
                  function($matches){
                      return html_writer::select(explode('|', $matches[1]), uniqid());
                  },
                  $stepsdefinitions
              );
  
              $stepsdefinitions = preg_replace_callback('/(FIELD_VALUE_STRING)/',
                  function ($matches) {
                      global $CFG;
  
                      // Creating a link to a popup with the help.
                      $url = new moodle_url(
                          '/help.php',
                          array(
                              'component' => 'tool_behat',
                              'identifier' => 'fieldvalueargument',
                              'lang' => current_language()
                          )
                      );
  
                      // Note: this title is displayed only if JS is disabled,
                      // otherwise the link will have the new ajax tooltip.
                      $title = get_string('fieldvalueargument', 'tool_behat');
                      $title = get_string('helpprefix2', '', trim($title, ". \t"));
  
                      $attributes = array('href' => $url, 'title' => $title,
                          'aria-haspopup' => 'true', 'target' => '_blank');
  
                      $output = html_writer::tag('a', 'FIELD_VALUE_STRING', $attributes);
                      return html_writer::tag('span', $output, array('class' => 'helptooltip'));
                  },
                  $stepsdefinitions
              );
          }
  
          // Steps definitions.
          $html .= html_writer::tag('div', $stepsdefinitions, array('class' => 'steps-definitions'));
  
          $html .= $this->output->footer();
  
          return $html;
      }
code_tokens: public function render_stepsdefinitions ( $ stepsdefinitions , $ form ) { global $ CFG ; require_once ( $ CFG -> libdir . '/behat/classes/behat_selectors.php' ) ; $ html = $ this -> generic_info ( ) ; // Form. ob_start ( ) ; $ form -> display ( ) ; $ html .= ob_get_contents ( ) ; ob_end_clean ( ) ; if ( empty ( $ stepsdefinitions ) ) { $ stepsdefinitions = get_string ( 'nostepsdefinitions' , 'tool_behat' ) ; } else { $ stepsdefinitions = implode ( '' , $ stepsdefinitions ) ; // Replace text selector type arguments with a user-friendly select. $ stepsdefinitions = preg_replace_callback ( '/(TEXT_SELECTOR\d?_STRING)/' , function ( $ matches ) { return html_writer :: select ( behat_selectors :: get_allowed_text_selectors ( ) , uniqid ( ) ) ; } , $ stepsdefinitions ) ; // Replace selector type arguments with a user-friendly select. $ stepsdefinitions = preg_replace_callback ( '/(SELECTOR\d?_STRING)/' , function ( $ matches ) { return html_writer :: select ( behat_selectors :: get_allowed_selectors ( ) , uniqid ( ) ) ; } , $ stepsdefinitions ) ; // Replace simple OR options. $ regex = '#\(\?P<[^>]+>([^\)|]+\|[^\)]+)\)#' ; $ stepsdefinitions = preg_replace_callback ( $ regex , function ( $ matches ) { return html_writer :: select ( explode ( '|' , $ matches [ 1 ] ) , uniqid ( ) ) ; } , $ stepsdefinitions ) ; $ stepsdefinitions = preg_replace_callback ( '/(FIELD_VALUE_STRING)/' , function ( $ matches ) { global $ CFG ; // Creating a link to a popup with the help. $ url = new moodle_url ( '/help.php' , array ( 'component' => 'tool_behat' , 'identifier' => 'fieldvalueargument' , 'lang' => current_language ( ) ) ) ; // Note: this title is displayed only if JS is disabled, // otherwise the link will have the new ajax tooltip. $ title = get_string ( 'fieldvalueargument' , 'tool_behat' ) ; $ title = get_string ( 'helpprefix2' , '' , trim ( $ title , ". \t" ) ) ; $ attributes = array ( 'href' => $ url , 'title' => $ title , 'aria-haspopup' => 'true' , 'target' => '_blank' ) ; $ output = html_writer :: tag ( 'a' , 'FIELD_VALUE_STRING' , $ attributes ) ; return html_writer :: tag ( 'span' , $ output , array ( 'class' => 'helptooltip' ) ) ; } , $ stepsdefinitions ) ; } // Steps definitions. $ html .= html_writer :: tag ( 'div' , $ stepsdefinitions , array ( 'class' => 'steps-definitions' ) ) ; $ html .= $ this -> output -> footer ( ) ; return $ html ; }
docstring: Renders the list of available steps according to the submitted filters.
  
  @param mixed $stepsdefinitions Available steps array.
  @param moodleform $form
  @return string HTML code
docstring_tokens: Renders the list of available steps according to the submitted filters .