original_string: protected static function get_duration_text($seconds) {
          if (empty($seconds)) {
              return get_string('none');
          }
          $data = self::parse_seconds($seconds);
          switch ($data['u']) {
              case (60*60*24*7):
                  return get_string('numweeks', '', $data['v']);
              case (60*60*24):
                  return get_string('numdays', '', $data['v']);
              case (60*60):
                  return get_string('numhours', '', $data['v']);
              case (60):
                  return get_string('numminutes', '', $data['v']);
              default:
                  return get_string('numseconds', '', $data['v']*$data['u']);
          }
      }
code: protected static function get_duration_text($seconds) {
          if (empty($seconds)) {
              return get_string('none');
          }
          $data = self::parse_seconds($seconds);
          switch ($data['u']) {
              case (60*60*24*7):
                  return get_string('numweeks', '', $data['v']);
              case (60*60*24):
                  return get_string('numdays', '', $data['v']);
              case (60*60):
                  return get_string('numhours', '', $data['v']);
              case (60):
                  return get_string('numminutes', '', $data['v']);
              default:
                  return get_string('numseconds', '', $data['v']*$data['u']);
          }
      }
code_tokens: protected static function get_duration_text ( $ seconds ) { if ( empty ( $ seconds ) ) { return get_string ( 'none' ) ; } $ data = self :: parse_seconds ( $ seconds ) ; switch ( $ data [ 'u' ] ) { case ( 60 * 60 * 24 * 7 ) : return get_string ( 'numweeks' , '' , $ data [ 'v' ] ) ; case ( 60 * 60 * 24 ) : return get_string ( 'numdays' , '' , $ data [ 'v' ] ) ; case ( 60 * 60 ) : return get_string ( 'numhours' , '' , $ data [ 'v' ] ) ; case ( 60 ) : return get_string ( 'numminutes' , '' , $ data [ 'v' ] ) ; default : return get_string ( 'numseconds' , '' , $ data [ 'v' ] * $ data [ 'u' ] ) ; } }
docstring: Converts seconds to some more user friendly string.
  @static
  @param int $seconds
  @return string
docstring_tokens: Converts seconds to some more user friendly string .