Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 23... Línea 23...
23
use core_reportbuilder\local\report\column;
23
use core_reportbuilder\local\report\column;
Línea 24... Línea 24...
24
 
24
 
25
/**
25
/**
26
 * Column group concatenation aggregation type
26
 * Column group concatenation aggregation type
-
 
27
 *
-
 
28
 * The value used for the separator between aggregated items can be specified by passing the 'separator' option
-
 
29
 * via {@see column::set_aggregation} or {@see column::set_aggregation_options} methods
27
 *
30
 *
28
 * @package     core_reportbuilder
31
 * @package     core_reportbuilder
29
 * @copyright   2021 Paul Holden <paulh@moodle.com>
32
 * @copyright   2021 Paul Holden <paulh@moodle.com>
30
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31
 */
34
 */
Línea 98... Línea 101...
98
     * @param array $values
101
     * @param array $values
99
     * @param array $callbacks
102
     * @param array $callbacks
100
     * @param int $columntype
103
     * @param int $columntype
101
     * @return mixed
104
     * @return mixed
102
     */
105
     */
103
    public static function format_value($value, array $values, array $callbacks, int $columntype) {
106
    public function format_value($value, array $values, array $callbacks, int $columntype) {
104
        $firstvalue = reset($values);
107
        $firstvalue = reset($values);
105
        if ($firstvalue === null) {
108
        if ($firstvalue === null) {
106
            return '';
109
            return '';
107
        }
110
        }
Línea 131... Línea 134...
131
 
134
 
132
            // Once we've re-constructed each value, we can apply callbacks to it.
135
            // Once we've re-constructed each value, we can apply callbacks to it.
133
            $formattedvalues[] = parent::format_value($originalvalue, $originalvalues, $callbacks, $columntype);
136
            $formattedvalues[] = parent::format_value($originalvalue, $originalvalues, $callbacks, $columntype);
Línea -... Línea 137...
-
 
137
        }
-
 
138
 
-
 
139
        // Determine separator based on passed options, defaulting to language pack list separator.
134
        }
140
        $separator = array_key_exists('separator', $this->options)
-
 
141
            ? (string) $this->options['separator']
135
 
142
            : get_string('listsep', 'langconfig') . ' ';
136
        $listseparator = get_string('listsep', 'langconfig') . ' ';
143
 
137
        return implode($listseparator, $formattedvalues);
144
        return implode($separator, $formattedvalues);