Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 87... Línea 87...
87
     * Returns list of all available columns
87
     * Returns list of all available columns
88
     *
88
     *
89
     * @return column[]
89
     * @return column[]
90
     */
90
     */
91
    protected function get_all_columns(): array {
91
    protected function get_all_columns(): array {
92
        global $DB;
-
 
93
 
-
 
94
        $postalias = $this->get_table_alias('post');
92
        $postalias = $this->get_table_alias('post');
Línea 95... Línea 93...
95
 
93
 
96
        // Title.
94
        // Title.
97
        $columns[] = (new column(
95
        $columns[] = (new column(
Línea 120... Línea 118...
120
                }
118
                }
121
                return html_writer::link(new moodle_url('/blog/index.php', ['entryid' => $post->id]), $subject);
119
                return html_writer::link(new moodle_url('/blog/index.php', ['entryid' => $post->id]), $subject);
122
            });
120
            });
Línea 123... Línea 121...
123
 
121
 
124
        // Body.
-
 
125
        $summaryfieldsql = "{$postalias}.summary";
-
 
126
        if ($DB->get_dbfamily() === 'oracle') {
-
 
127
            $summaryfieldsql = $DB->sql_order_by_text($summaryfieldsql, 1024);
-
 
128
        }
-
 
129
 
122
        // Body.
130
        $columns[] = (new column(
123
        $columns[] = (new column(
131
            'body',
124
            'body',
132
            new lang_string('entrybody', 'core_blog'),
125
            new lang_string('entrybody', 'core_blog'),
133
            $this->get_entity_name()
126
            $this->get_entity_name()
134
        ))
127
        ))
135
            ->add_joins($this->get_joins())
128
            ->add_joins($this->get_joins())
136
            ->set_type(column::TYPE_LONGTEXT)
129
            ->set_type(column::TYPE_LONGTEXT)
137
            ->add_field($summaryfieldsql, 'summary')
130
            ->add_fields("{$postalias}.summary, {$postalias}.summaryformat, {$postalias}.id")
138
            ->add_fields("{$postalias}.summaryformat, {$postalias}.id")
131
            ->set_is_sortable(true)
139
            ->add_callback(static function(?string $summary, stdClass $post): string {
132
            ->add_callback(static function(?string $summary, stdClass $post): string {
140
                global $CFG;
133
                global $CFG;
Línea 141... Línea 134...
141
                require_once("{$CFG->libdir}/filelib.php");
134
                require_once("{$CFG->libdir}/filelib.php");
Línea 257... Línea 250...
257
        $filters[] = (new filter(
250
        $filters[] = (new filter(
258
            text::class,
251
            text::class,
259
            'body',
252
            'body',
260
            new lang_string('entrybody', 'core_blog'),
253
            new lang_string('entrybody', 'core_blog'),
261
            $this->get_entity_name(),
254
            $this->get_entity_name(),
262
            $DB->sql_cast_to_char("{$postalias}.summary")
255
            "{$postalias}.summary"
263
        ))
256
        ))
264
            ->add_joins($this->get_joins());
257
            ->add_joins($this->get_joins());
Línea 265... Línea 258...
265
 
258
 
266
        // Attachment.
259
        // Attachment.