original_string: public function download_dataformat_selector($label, $base, $name = 'dataformat', $params = array()) {
  
          $formats = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
          $options = array();
          foreach ($formats as $format) {
              if ($format->is_enabled()) {
                  $options[] = array(
                      'value' => $format->name,
                      'label' => get_string('dataformat', $format->component),
                  );
              }
          }
          $hiddenparams = array();
          foreach ($params as $key => $value) {
              $hiddenparams[] = array(
                  'name' => $key,
                  'value' => $value,
              );
          }
          $data = array(
              'label' => $label,
              'base' => $base,
              'name' => $name,
              'params' => $hiddenparams,
              'options' => $options,
              'sesskey' => sesskey(),
              'submit' => get_string('download'),
          );
  
          return $this->render_from_template('core/dataformat_selector', $data);
      }
code: public function download_dataformat_selector($label, $base, $name = 'dataformat', $params = array()) {
  
          $formats = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
          $options = array();
          foreach ($formats as $format) {
              if ($format->is_enabled()) {
                  $options[] = array(
                      'value' => $format->name,
                      'label' => get_string('dataformat', $format->component),
                  );
              }
          }
          $hiddenparams = array();
          foreach ($params as $key => $value) {
              $hiddenparams[] = array(
                  'name' => $key,
                  'value' => $value,
              );
          }
          $data = array(
              'label' => $label,
              'base' => $base,
              'name' => $name,
              'params' => $hiddenparams,
              'options' => $options,
              'sesskey' => sesskey(),
              'submit' => get_string('download'),
          );
  
          return $this->render_from_template('core/dataformat_selector', $data);
      }
code_tokens: public function download_dataformat_selector ( $ label , $ base , $ name = 'dataformat' , $ params = array ( ) ) { $ formats = core_plugin_manager :: instance ( ) -> get_plugins_of_type ( 'dataformat' ) ; $ options = array ( ) ; foreach ( $ formats as $ format ) { if ( $ format -> is_enabled ( ) ) { $ options [ ] = array ( 'value' => $ format -> name , 'label' => get_string ( 'dataformat' , $ format -> component ) , ) ; } } $ hiddenparams = array ( ) ; foreach ( $ params as $ key => $ value ) { $ hiddenparams [ ] = array ( 'name' => $ key , 'value' => $ value , ) ; } $ data = array ( 'label' => $ label , 'base' => $ base , 'name' => $ name , 'params' => $ hiddenparams , 'options' => $ options , 'sesskey' => sesskey ( ) , 'submit' => get_string ( 'download' ) , ) ; return $ this -> render_from_template ( 'core/dataformat_selector' , $ data ) ; }
docstring: Returns a dataformat selection and download form
  
  @param string $label A text label
  @param moodle_url|string $base The download page url
  @param string $name The query param which will hold the type of the download
  @param array $params Extra params sent to the download page
  @return string HTML fragment
docstring_tokens: Returns a dataformat selection and download form