File: view_create.twig

package info (click to toggle)
phpmyadmin 4%3A5.2.2-really%2Bdfsg-1%2Bdeb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 140,312 kB
  • sloc: javascript: 228,455; php: 166,904; xml: 17,847; sql: 504; sh: 275; makefile: 209; python: 205
file content (120 lines) | stat: -rw-r--r-- 4,844 bytes parent folder | download | duplicates (3)
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
<!-- CREATE VIEW options -->
<div id="div_view_options">
    <form method="post" action="{{ url('/view/create') }}">
    {{ get_hidden_inputs(url_params) }}
    <fieldset class="pma-fieldset">
        <legend>
            {% if ajax_dialog %}
                {% trans 'Details' %}
            {% else %}
                {% if view['operation'] == 'create' %}
                    {% trans 'Create view' %}
                {% else %}
                    {% trans 'Edit view' %}
                {% endif %}
            {% endif %}
        </legend>
        <table class="table align-middle rte_table">
            {% if view['operation'] == 'create' %}
                <tr>
                    <td class="text-nowrap"><label for="or_replace">OR REPLACE</label></td>
                    <td>
                        <input type="checkbox" name="view[or_replace]" id="or_replace"
                            {% if (view['or_replace']) %} checked="checked" {% endif %}
                            value="1">
                    </td>
                </tr>
            {% endif %}

            <tr>
                <td class="text-nowrap"><label for="algorithm">ALGORITHM</label></td>
                <td>
                    <select name="view[algorithm]" id="algorithm">
                        {% for option in view_algorithm_options %}
                            <option value="{{ option }}"
                                {% if view['algorithm'] == option %}
                                    selected="selected"
                                {% endif %}
                            >{{ option }}</option>
                        {% endfor %}
                    </select>
                </td>
            </tr>

            <tr>
                <td class="text-nowrap">{% trans 'Definer' %}</td>
                <td><input type="text" maxlength="100" size="50" name="view[definer]" value="{{ view['definer'] }}"></td>
            </tr>

            <tr>
                <td class="text-nowrap">SQL SECURITY</td>
                <td>
                    <select name="view[sql_security]">
                        <option value=""></option>
                        {% for option in view_security_options %}
                            <option value="{{ option }}"
                                {% if option == view['sql_security'] %} selected="selected" {% endif %}
                            >{{ option }}</option>
                        {% endfor %}
                    </select>
                </td>
            </tr>

            {% if view['operation'] == 'create' %}
                <tr>
                    <td class="text-nowrap">{% trans 'VIEW name' %}</td>
                    <td>
                        <input type="text" size="20" name="view[name]" onfocus="this.select()" maxlength="64" value="{{ view['name'] }}">
                    </td>
                </tr>
            {% else %}
                <tr>
                    <td>
                        <input type="hidden" name="view[name]" value="{{ view['name'] }}">
                    </td>
                </tr>
            {% endif %}

            <tr>
                <td class="text-nowrap">{% trans 'Column names' %}</td>
                <td>
                    <input type="text" maxlength="100" size="50" name="view[column_names]" onfocus="this.select()"  value="{{ view['column_names'] }}">
                </td>
            </tr>

            <tr>
                <td class="text-nowrap">AS</td>
                <td>
                    <textarea name="view[as]" id="view_as" rows="15" cols="40" dir="{{ text_dir }}">{{ view['as'] }}</textarea><br>
                    <input type="button" value="Format" id="format" class="btn btn-secondary button sqlbutton">
                    <span id="querymessage"></span>
                </td>
            </tr>

            <tr>
                <td class="text-nowrap">WITH CHECK OPTION</td>
                <td>
                    <select name="view[with]">
                        <option value=""></option>
                        {% for option in view_with_options %}
                            <option value="{{ option }}"
                                {% if option == view['with'] %} selected="selected" {% endif %}
                            >{{ option }}</option>
                        {% endfor %}
                    </select>
                </td>
            </tr>

        </table>
    </fieldset>

    <input type="hidden" name="ajax_request" value="1" />
    <input type="hidden" name="{{ (view['operation'] == 'create') ? 'createview' : 'alterview' }}" value="1" />

    {% if ajax_dialog == false %}
        <input type="hidden" name="ajax_dialog" value="1" />
        <input type="submit" class="btn btn-primary" name="" value="{% trans 'Go' %}" />
    {% endif %}

    </form>
</div>