aboutsummaryrefslogtreecommitdiff
path: root/app/views/global_search/settings.php
blob: e4e1e0eb3a827a5b0af73de2eedbb350de638627 (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
<form class="default" action="<?= $controller->url_for('globalsearch/saveconfig') ?>" method="post">
    <section>
        <label>
            <span class="required">
                <?= _('Wieviele Ergebnisse pro Kategorie sollen in der Schnellsuche angezeigt werden?') ?>
            </span>
            <input type="number" name="entries_per_type" size="5"
                   value="<?= intval(Config::get()->GLOBALSEARCH_MAX_RESULT_OF_TYPE) ?>" required>
        </label>
    </section>
    <br>
    <section>
        <label>
            <?= _('Auf welche Art sollen die Suchergebnisse aus der Datenbank gelesen werden?') ?>
            <select name="async_queries" size="1">
                <?php if (in_array('mysqli', get_loaded_extensions())) : ?>
                    <option value="1"<?= Config::get()->GLOBALSEARCH_ASYNC_QUERIES ? ' selected' : '' ?>>
                        <?= _('Asynchron, via mysqli') ?>
                    </option>
                <?php endif ?>
                <option value="0"<?= Config::get()->GLOBALSEARCH_ASYNC_QUERIES ? '' : ' selected' ?>>
                    <?= _('Synchron, via PDO') ?>
                </option>
            </select>
        </label>
    </section>
    <br>
    <section>
        <table class="default sortable-table" id="globalsearch-modules">
            <caption>
                <?= _('In welcher Reihenfolge sollen Suchergebnisse erscheinen?') ?>
            </caption>
            <colgroup>
                <col width="10">
                <col>
                <col width="50">
                <col width="50">
            </colgroup>
            <thead>
                <tr>
                    <th></th>
                    <th><?= _('Kategorie') ?></th>
                    <th><?= _('Aktiv?') ?></th>
                    <th><?= _('Volltext?') ?></th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($modules as $module) : ?>
                    <tr>
                        <td class="dragHandle"></td>
                        <td>
                            <?php $resourcesInactive = (get_class($module) == 'GlobalSearchResources' ||
                                get_class($module) == 'GlobalSearchRoomBookings') && !Config::get()->RESOURCES_ENABLE ?>
                            <label for="active[<?= htmlReady(get_class($module)) ?>]"
                                <?php if ($resourcesInactive) : ?>
                                    class="inactive-settings-category"
                                    data-tooltip="<?= htmlReady(sprintf(_('%s sind inaktiv, da die Ressourcenverwaltung derzeit deaktiviert ist.'), $module->getName())) ?>"
                                <?php endif ?>
                            >
                                <?= htmlReady($module->getName()) ?>
                            </label>
                            <input type="hidden" name="modules[<?= htmlReady(get_class($module)) ?>][class]"
                                   value="<?= htmlReady(get_class($module)) ?>">
                        </td>
                        <td>
                            <input type="checkbox" id="active[<?= htmlReady(get_class($module)) ?>]"
                                   name="modules[<?= htmlReady(get_class($module)) ?>][active]" value="1"
                                <?= $config[get_class($module)]['active'] && !$resourcesInactive ? ' checked' : '' ?>
                                <?= $resourcesInactive ? ' disabled' : '' ?>>
                        </td>
                        <td>
                            <?php if (is_a($module, 'GlobalSearchFulltext')) : ?>
                                <input type="checkbox" name="modules[<?= htmlReady(get_class($module)) ?>][fulltext]"
                                       value="1"<?= $config[get_class($module)]['fulltext'] ? ' checked' : ''?>>
                            <?php endif ?>
                        </td>
                    </tr>
                <?php endforeach ?>
            </tbody>
        </table>
    </section>
    <?= CSRFProtection::tokenTag() ?>
    <footer data-dialog-button>
        <?= \Studip\Button::createAccept(_('Speichern'), 'submit')?>
    </footer>
</form>

<script language="JavaScript" type="text/javascript">
    //<!--
    jQuery('#globalsearch-modules tbody').sortable();
    //-->
</script>