aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/6.1.17_create_forum_help_tour.php
blob: 85d0da8d2ef903848df714e948a96ec660680531 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php

final class CreateForumHelpTour extends Migration
{

    function description()
    {
        return 'Adds a help tour for the new forum and links it in the system';
    }

    public function up()
    {
        // Create entries for forum tour.
        DBManager::get()->exec(
            "INSERT IGNORE INTO `help_tours` VALUES (
                '33fa547967cfa9b7edab321f5d8ca744',
                'ea68d2f9d7b81d01d2d3ea38a105c734',
                'Forum - Der Einstieg',
                '6.1 - Die Tour durch das noch leere Forum.',
                'tour',
                'autor,tutor,dozent,admin,root',
                1,
                'de',
                '6.1',
                '',
                '',
                UNIX_TIMESTAMP(),
                UNIX_TIMESTAMP()
            )"
        );
        DBManager::get()->exec(
            "INSERT IGNORE INTO `help_tour_settings` VALUES (
                'ea68d2f9d7b81d01d2d3ea38a105c734',
                1,
                'autostart_once',
                UNIX_TIMESTAMP(),
                UNIX_TIMESTAMP()
            )"
        );

        $steps = [
            [
                'step' => 1,
                'title' => 'Willkommen!',
                'tip' => 'Hier ist ein Ort für Diskussionen, Ankündigungen und gemeinsames Arbeiten.',
                'orientation' => 'B',
                'css_selector' => '#nav_course_forum > a:nth-child(1)',
                'route' => 'dispatch.php/course/forum/topics',
            ],
            [
                'step' => 2,
                'title' => 'Diskussion starten',
                'tip' => 'Beginnen Sie im Aktionsmenü eine Diskussion zu einem bestehenden oder neuen Thema.',
                'orientation' => 'R',
                'css_selector' => '#link-430746eaab49d0ff0bcac73c2bc7a0a7 > a:nth-child(1)',
                'route' => 'dispatch.php/course/forum/topics',
            ],
            [
                'step' => 3,
                'title' => 'Themenübersicht',
                'tip' => 'Ein Thema ist ein Überordner, der mehrere Diskussionen enthält. Dies ist zugleich die Startseite des Forums.',
                'orientation' => 'R',
                'css_selector' => '#nav_forum_topics',
                'route' => 'dispatch.php/course/forum/topics',
            ],
            [
                'step' => 4,
                'title' => 'Alle Diskussionen',
                'tip' => 'Hier finden Sie eine Übersicht aller stattfindenden Diskussionen.',
                'orientation' => 'R',
                'css_selector' => '#nav_forum_discussions',
                'route' => 'dispatch.php/course/forum/topics',
            ],
            [
                'step' => 5,
                'title' => 'Letzte Aktivität',
                'tip' => 'Die neuesten Beiträge finden Sie, indem Sie alle Diskussionen absteigend nach „Letzte Aktivität“ sortieren.',
                'orientation' => 'B',
                'css_selector' => '.sortdesc',
                'route' => 'dispatch.php/course/forum/discussions',
            ],
            [
                'step' => 6,
                'title' => 'Abonnements',
                'tip' => 'Welche Themen und Beiträge verfolgen Sie?',
                'orientation' => 'R',
                'css_selector' => '#nav_forum_subscriptions',
                'route' => 'dispatch.php/course/forum/topics',
            ],
            [
                'step' => 7,
                'title' => 'Kategorien',
                'tip' => 'Sie fassen mehrere Themen zusammen und sind optional.',
                'orientation' => 'B',
                'css_selector' => '#nav_forum_categories',
                'route' => 'dispatch.php/course/forum/topics',
            ],
            [
                'step' => 8,
                'title' => 'Tour & Hilfe',
                'tip' => 'Diese Tour und weitere Hilfeseiten finden Sie hier.',
                'orientation' => 'B',
                'css_selector' => '#helpbar_icon > svg:nth-child(1)',
                'route' => 'dispatch.php/course/forum/topics',
            ],
            [
                'step' => 9,
                'title' => 'Auf in den Austausch!',
                'tip' => 'Worüber wollen Sie diskutieren?',
                'orientation' => 'B',
                'css_selector' => 'a.button--icon-label',
                'route' => 'dispatch.php/course/forum/topics',
            ]
        ];
        $stmt = DBManager::get()->prepare(
            "INSERT IGNORE INTO `help_tour_steps`
            VALUES
            (
                 :tour_id,
                 :step,
                 :title,
                 :tip,
                 :orientation,
                 :interactive,
                 :css_selector,
                 :route,
                 :action_prev,
                 :action_next,
                 :author_email,
                 :mkdate,
                 :chdate
             )"
        );
        $meta = [
            'tour_id' => 'ea68d2f9d7b81d01d2d3ea38a105c734',
            'interactive' => 0,
            'action_prev' => '',
            'action_next' => '',
            'author_email' => '',
            'mkdate' => time(),
            'chdate' => time()
        ];
        foreach ($steps as $step) {
            $stmt->execute(array_merge($meta, $step));
        }
    }

    public function down()
    {
        $tour = ['tour_id' => 'ea68d2f9d7b81d01d2d3ea38a105c734'];
        DBManager::get()->execute("DELETE FROM `help_tours` WHERE `tour_id` = :tour_id", $tour);
        DBManager::get()->execute("DELETE FROM `help_tour_steps` WHERE `tour_id` = :tour_id", $tour);
        DBManager::get()->execute("DELETE FROM `help_tour_settings` WHERE `tour_id` = :tour_id", $tour);
    }

}