Skip to content
Snippets Groups Projects
Commit b6e85daf authored by David Siegfried's avatar David Siegfried
Browse files

add new config-option MAX_SHOW_ADMIN_COURSES, fixes #2853

Closes #2853

Merge request studip/studip!1931
parent 2df5804d
No related branches found
No related tags found
No related merge requests found
...@@ -294,7 +294,7 @@ class Admin_CoursesController extends AuthenticatedController ...@@ -294,7 +294,7 @@ class Admin_CoursesController extends AuthenticatedController
PageLayout::setTitle(_('Verwaltung von Veranstaltungen und Einrichtungen')); PageLayout::setTitle(_('Verwaltung von Veranstaltungen und Einrichtungen'));
// Add admission functions. // Add admission functions.
PageLayout::addScript('studip-admission.js'); PageLayout::addScript('studip-admission.js');
$this->max_show_courses = 500; $this->max_show_courses = Config::get()->MAX_SHOW_ADMIN_COURSES;
} }
/** /**
......
<?php
final class AddMaxShowAdminCoursesConfig extends Migration
{
public function description()
{
return 'Adds the configuration MAX_SHOW_ADMIN_COURSES, if it doesn\'t exist yet and set a default value.';
}
public function up()
{
DBManager::get()->exec("INSERT IGNORE INTO `config`
(`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`)
VALUES
(
'MAX_SHOW_ADMIN_COURSES',
500,
'integer',
'global',
'MeineVeranstaltungen',
UNIX_TIMESTAMP(),
UNIX_TIMESTAMP(),
'Wie viele Veranstaltungen sollen auf der Admin-Veranstaltungsseite angezeigt werden.'
)"
);
}
public function down()
{
DBManager::get()->exec("DELETE FROM `config_values` WHERE `field` = 'MAX_SHOW_ADMIN_COURSES'");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment