3
* Xibo - Digital Signage - http://www.xibo.org.uk
4
* Copyright (C) 2012-2015 Spring Signage Ltd - http://www.springsignage.com
6
* This file is part of Xibo.
8
* Xibo is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Affero General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
13
* Xibo is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Affero General Public License for more details.
18
* You should have received a copy of the GNU Affero General Public License
19
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
3
* Spring Signage Ltd - http://www.springsignage.com
4
* Copyright (C) 2015 Spring Signage Ltd
7
$formFields[] = Form::AddText('windowsCommand', __('Windows Command'), NULL,
8
__('Enter a Windows Command Line compatible command'), 'w');
10
$formFields[] = Form::AddText('linuxCommand', __('Android / Linux Command'), NULL,
11
__('Enter an Android / Linux Command Line compatible command'), 'l');
23
14
{% extends "form-base.twig" %}
33
24
{% trans "Save" %}, $("#shellCommandAddForm").submit()
36
{% block formFieldActions %}
41
"operation": "equals",
43
".loop-fields": { "display": "none" }
49
"operation": "equals",
51
".loop-fields": { "display": "none" }
59
".loop-fields": { "display": "block" }
67
".loop-fields": { "display": "block" }
70
"field": "useDuration",
73
"operation": "is:checked",
75
".duration-fields": { "display": "none" },
76
".loop-fields": { "display": "none" }
79
"field": "useDuration",
82
"operation": "is:checked",
84
".duration-fields": { "display": "none" },
85
".loop-fields": { "display": "none" }
88
"field": "useDuration",
91
"operation": "is:checked",
93
".duration-fields": { "display": "block" }
96
"field": "useDuration",
99
"operation": "is:checked",
101
".duration-fields": { "display": "block" }
104
"field": "commandCode",
107
"operation": "equals",
109
".non-command-fields": { "display": "block" }
112
"field": "commandCode",
117
".non-command-fields": { "display": "none" }
120
"field": "commandCode",
123
"operation": "equals",
125
".non-command-fields": { "display": "block" }
128
"field": "commandCode",
133
".non-command-fields": { "display": "none" }
138
27
{% block formHtml %}
140
29
<div class="col-md-12">
141
30
<form id="shellCommandAddForm" class="XiboForm form-horizontal" method="post" action="{{ urlFor("module.widget.add", {type: module.widget.type, id: playlist.playlistId}) }}">
142
{% set title %}{% trans "Name" %}{% endset %}
143
{% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
144
{{ forms.input("name", title, "", helpText) }}
146
{% set title %}{% trans "Command" %}{% endset %}
147
{% set helpText %}{% trans "Pick a command" %}{% endset %}
148
{{ forms.dropdown("commandCode", "single", title, "", [{code:"", command: ""}]|merge(commands), "code", "command", helpText) }}
150
31
{% set title %}{% trans "Windows Command" %}{% endset %}
151
32
{% set helpText %}{% trans "Enter a Windows Command Line compatible command" %}{% endset %}
152
{{ forms.input("windowsCommand", title, "", helpText, "non-command-fields") }}
154
{% set title %}{% trans "Launch the command via Windows Command Line" %}{% endset %}
155
{% set helpText %}{% trans "Should the player launch this command through the windows command line (cmd.exe)? This is useful for batch files. If you try to terminate this command only the command line will be terminated." %}{% endset %}
156
{{ forms.checkbox("launchThroughCmd", title, 1, helpText, "non-command-fields") }}
33
{{ forms.text("windowsCommand", title, "", helpText) }}
158
35
{% set title %}{% trans "Android / Linux Command" %}{% endset %}
159
36
{% set helpText %}{% trans "Enter an Android / Linux Command Line compatible command" %}{% endset %}
160
{{ forms.input("linuxCommand", title, "", helpText, "non-command-fields") }}
162
{% set title %}{% trans "Set a duration?" %}{% endset %}
163
{% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
164
{{ forms.checkbox("useDuration", title, 0, helpText, "non-command-fields") }}
166
{% set title %}{% trans "Duration" %}{% endset %}
167
{% set helpText %}{% trans "The duration in seconds this should be displayed" %}{% endset %}
168
{{ forms.number("duration", title, module.getModule().defaultDuration, helpText, "duration-fields non-command-fields", "required") }}
170
{% set title %}{% trans "Terminate the command once the duration elapses?" %}{% endset %}
171
{% set helpText %}{% trans "Should the player forcefully terminate the command after the duration specified. Leave unchecked to let the command terminate naturally." %}{% endset %}
172
{{ forms.checkbox("terminateCommand", title, 0, helpText, "duration-fields non-command-fields") }}
174
{% set title %}{% trans "Use taskkill to terminate commands?" %}{% endset %}
175
{% set helpText %}{% trans "On Windows, should the player use taskkill to terminate commands." %}{% endset %}
176
{{ forms.checkbox("useTaskkill", title, 0, helpText, "duration-fields non-command-fields") }}
37
{{ forms.text("linuxCommand", title, "", helpText) }}