diff --git a/index.php b/index.php index da29a40f..e95278d3 100644 --- a/index.php +++ b/index.php @@ -231,7 +231,10 @@ $opencast = apibridge::get_instance($ocinstanceid); $table = $renderer->create_videos_tables('ignore', $headers, $columns, $baseurl); $sortcolumns = $table->get_sort_columns(); - +// If we don't have a sortcolumn we sort by date desc. +if (empty($sortcolumns)) { + $sortcolumns = ['start_date' => 3]; +} echo $OUTPUT->header(); diff --git a/renderer.php b/renderer.php index 43d2e128..c1ed0f10 100644 --- a/renderer.php +++ b/renderer.php @@ -263,7 +263,9 @@ public function create_videos_tables($id, $headers, $columns, $baseurl) { $table->no_sorting('published'); $table->no_sorting('visibility'); // This column cannot be sortable because it does not mean anything to Opencast! $table->no_sorting('select'); - $table->sortable(true, 'start_date', SORT_DESC); + $table->text_sorting('title'); + $table->sortable(true, null, SORT_DESC); + $table->maxsortkeys = 1; $table->column_style('selectall', 'max-width', '40px'); $table->column_style('start_date', 'min-width', '125px');