aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/6.0.9_notification_positioning.php
blob: d6693f3e56be1e9de6e1528a4c5949a62546cbbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
class NotificationPositioning extends Migration
{
    public function description()
    {
        return 'Adds a personal config option to select the on-screen position of system notifications';
    }

    protected function up()
    {
        DBManager::get()->execute(
            "INSERT IGNORE INTO `config` VALUES (:field, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc)",
            [
                'field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT',
                'value' => 'topcenter',
                'type' => 'string',
                'range' => 'user',
                'section' => '',
                'desc' => 'Wo sollen Systembenachrichtigungen im Fenster angezeigt werden? Gültige Werte sind "topcenter" und "bottomright"'
            ]
        );
    }

    protected function down()
    {
        DBManager::get()->execute(
            "DELETE FROM `config_values` WHERE `field` = :field",
            ['field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT']
        );
        DBManager::get()->execute(
            "DELETE FROM `config` WHERE `field` = :field",
            ['field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT']
        );
    }
};