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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
|
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>Form1</class>
<widget class="Dialog">
<property name="name">
<cstring>Form1</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>553</width>
<height>325</height>
</rect>
</property>
<property name="caption">
<string>Variable passing demo with PHP</string>
</property>
<property name="icon">
<pixmap>image0</pixmap>
</property>
<property name="associations" stdset="0">
<stringlist>
<string></string>
<string>AboutDialog1.initialize("Variable passing demo", "", "0.1", "Copyright 2008")
AboutDialog1.addAuthor("Eric Laffoon", "Designer", "eric@kdewebdev.org", "http://kittyhooch.com")
AboutDialog1.setHomepage("http://kommander.kdewebdev.org")
AboutDialog1.setBugAddress("eric@kdewebdev.org")
AboutDialog1.setDescription("Demo of passing arguments to and from scripts,
You can also pass an echo to stdout back from
your script by calling your script with
echo(ScriptObject.execute)")
AboutDialog1.setLicense("GPL_V2")
PopupMenu1.insertMenuItem("Help About", "PopupMenu1", 1)
if str_length(exec("ls -1 /usr/bin/php")) == 0 then
message_error("This dialog requires command line PHP installed as /usr/bin/php in order to show the external script functions with PHP. if it is installed elsewhere you could edit the PHP script sheebang in the dialog or create a symlink on your system.", "PHP not detected")
endif</string>
<string></string>
</stringlist>
</property>
<property name="useInternalParser">
<bool>true</bool>
</property>
<property name="toolTip" stdset="0">
<string></string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="Label" row="2" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>Label8</cstring>
</property>
<property name="text">
<string>Value to pass back</string>
</property>
</widget>
<widget class="ExecButton" row="3" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>ExecButton3</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Pass I&nternally</string>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>ret = ScriptObject2.execute(LineEdit7.text, LineEdit1.text, LineEdit2.text)
LineEdit6.setText(ret)</string>
</stringlist>
</property>
</widget>
<widget class="Label" row="4" column="0">
<property name="name">
<cstring>Label9</cstring>
</property>
<property name="text">
<string>Set</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="Label" row="6" column="0">
<property name="name">
<cstring>Label6_2</cstring>
</property>
<property name="text">
<string>Pass back</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="ExecButton" row="3" column="4" rowspan="1" colspan="2">
<property name="name">
<cstring>ExecButton72</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>P&ass to PHP Script</string>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>// test for PHP
pt = exec("php --version")
if str_contains(pt, "Zend") then
php = ScriptObjectPHP.execute(LineEdit7.text,LineEdit1.text,LineEdit2.text)
LineEdit4.setText(php)
else
message_error("It looks like PHP CLI is not installed and on your path")
endif</string>
</stringlist>
</property>
</widget>
<widget class="Label" row="6" column="3" rowspan="1" colspan="2">
<property name="name">
<cstring>Label6</cstring>
</property>
<property name="text">
<string>Pass back</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="Label" row="4" column="3" rowspan="1" colspan="2">
<property name="name">
<cstring>Label5</cstring>
</property>
<property name="text">
<string>Set with @</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="Label" row="5" column="3" rowspan="1" colspan="2">
<property name="name">
<cstring>Label37</cstring>
</property>
<property name="text">
<string>Return</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="LineEdit" row="4" column="5" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit3</cstring>
</property>
</widget>
<widget class="Label" row="5" column="0">
<property name="name">
<cstring>Label37_2</cstring>
</property>
<property name="text">
<string>Return</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="LineEdit" row="5" column="5" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit4</cstring>
</property>
</widget>
<widget class="LineEdit" row="6" column="5" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit5</cstring>
</property>
</widget>
<widget class="LineEdit" row="5" column="1" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit6</cstring>
</property>
</widget>
<widget class="LineEdit" row="4" column="1" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit8</cstring>
</property>
</widget>
<widget class="LineEdit" row="6" column="1" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit9</cstring>
</property>
</widget>
<widget class="ScriptObject" row="3" column="2">
<property name="name">
<cstring>ScriptObject2</cstring>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>LineEdit8.setText("Kommander "+_VERSION)
LineEdit9.setText(Self.Item(0))
x = Self.Item(1)/Self.Item(2)
return(x)</string>
</stringlist>
</property>
</widget>
<widget class="ScriptObject" row="3" column="6">
<property name="name">
<cstring>ScriptObjectPHP</cstring>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>#!/usr/bin/php
<?php
@LineEdit3.setText(Kommander @global(VERSION))
@LineEdit5.setText(@Self.Item(0))
echo round(@Self.Item(1)/@Self.Item(2),5)
?></string>
</stringlist>
</property>
</widget>
<widget class="Label" row="0" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>Label12</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Numbers to pass to scripts</string>
</property>
</widget>
<widget class="LineEdit" row="2" column="2" rowspan="1" colspan="4">
<property name="name">
<cstring>LineEdit7</cstring>
</property>
<property name="text">
<string>Pass back</string>
</property>
<property name="toolTip" stdset="0">
<string>right click on dialog for about dialog</string>
</property>
</widget>
<spacer row="3" column="3">
<property name="name">
<cstring>Spacer1</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>108</width>
<height>0</height>
</size>
</property>
</spacer>
<widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="7">
<property name="name">
<cstring>Layout1</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<spacer>
<property name="name">
<cstring>Spacer3</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>71</width>
<height>0</height>
</size>
</property>
</spacer>
<widget class="Label">
<property name="name">
<cstring>Label35</cstring>
</property>
<property name="text">
<string>op 1</string>
</property>
</widget>
<widget class="LineEdit">
<property name="name">
<cstring>LineEdit1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>22</string>
</property>
</widget>
<widget class="Label">
<property name="name">
<cstring>Label36</cstring>
</property>
<property name="text">
<string>/ op 2</string>
</property>
</widget>
<widget class="LineEdit">
<property name="name">
<cstring>LineEdit2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>7</string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>Spacer2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>71</width>
<height>0</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<widget class="AboutDialog" row="0" column="5">
<property name="name">
<cstring>AboutDialog1</cstring>
</property>
<property name="associations" stdset="0">
<stringlist>
<string></string>
</stringlist>
</property>
</widget>
<widget class="PopupMenu" row="0" column="4">
<property name="name">
<cstring>PopupMenu1</cstring>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>AboutDialog1.execute</string>
</stringlist>
</property>
</widget>
</grid>
</widget>
<images>
<image name="image0">
<data format="XPM.GZ" length="6350">789ca598d94f1fc911c7dff7af40db6faba877a667baa747511e8c01e3030c06cc11e5a1aa7a86cbdc603051fef734f5ad9fed5d2952a4f521fba3beeaae1a7eff6de9606b63e9b7df7fb9bba7fb53599213ba5dfaad3c5c5c7cfbe7bffef1ef5f7e0d61a9fee9425e0abffeed975fb7ef976469f3ea727a013f56708dfe7a61597069b372068729f6cabbe0dcc8acbc622c4599c1a10dad72f1ca5d1370bfc77d5dcb01e70770176252de51eebb1c21df96720c6d87f51edcd3202fec5e29a7c01dee3b541e43dfa9b2ee4699dbd88e2a0f2997861a5d97040ed441dfa83c776d8ff5a3176e9b466cff6be5b6ded7aabe07ca5d37f6f4c2f400ee1bc84f1f95fb2859d7654f39a6766495c729a7b66d3a5dc77d431fa2ca2b9f9573ecb2ae975999dafa80ae5f1a0f0df6ef83fb79507bf927701e65d0f39372b507cef3837102fb2be3a1d1fd1efb4b65f87f193c3454f4fcaaf294a3e8ba6b5e3834ed88f3a528b72d352a0fef1b33e4f5df9443655d776aefd02d582e94fb568c3be3b9813ddf2a577b6695df6d1bf3a8f662514eed64fa7c521e6a38ea79867c39b48dfa9f8e95c705fb1f0c79d55f8142d7a8feee1a9cbaacfafb013c24d8c7df29f398912fee8db2c431e17d562ea137ff41be52eda9f2ca15784c05f10e7da7ba5fe5e3afc6b1d1789333f0200cff6e2acf21415f4fc643837cd5f8ace99971de6bfe756d65bc770aee52d0f8e77be550d7555efe0c4e09f1e95ae52e8c382fe7e0ae4680aeef832345e4eb2a788cd08f351fbb18b8d1fc70deb858bee1be983bc67b9aef55ba453c6d1b4b8b7a73094e7d823d37c15944f575b7ca43985ae4f7163813d6f98b71417c7bd82b6766c8ff9d8bbe479a9fdd1826e8ef173c9bfc199c02e4f167e09c08f1fb4e9916e749c0718c6a0f817e9ce70279b5fe75656c0bce6bfdeea6b1401e79569ec750903fa7c65dd1f749fdd7b75d84bd68cf3899bc1d38ce51f7b3c64f1f6a81837f37c0fdd4e9fb45e3b9efbb01f6a457c6638bf7efc07966c4eb9a721c09fef7e0347403de3b048f52501fd51ffdd091f94beb479fc75c50bfb5fef463c7886f5f8ca5457d5a07f78dc973021e479ca76cccd6dfde1897a2f92cd7df19f9f200e66e02639d3a8b57ff15cc11eb1c94b9ea83fc1fc1d4a27ffa4730e709f9a9fda697b117f873dd7886bd44fb5b5f16e759e3a79faa01105ff7604eb8af683cf573df427fd27c8c4ddfc05ea2fe8b6dead0cfbcde17bb61863fc4836998d05fb53ebdb4e309f5f69371467cb1d6c318fb8c7940b41fc594ad3e8bda230ebdc59fc3f9816982fce7606967f85bf329e6aa2fcedf1a0f93dadbad19cf13f255e3258e6326f81ffa513fb6e89fc7600a45f38b5be3cee23119cf13ea9dc67be47a5edff747e034637e21cdafda0c09eb0c798426d88b36c1dc9a7c9067ea6dde7207e03a5ea01fdc1bd714d3f31a4f351bfb80fe7e011ed3a8f672cf606a102facf1949a7ec67d740fe61efef26aff3a8d7419f553e33d853a70a1bf6b7ca5eaff84fa7c09e63a10eafe689c2dbe351f534fc4e87f9b6066cb8ff7c613e291d4be29d6fc80fe97c684fda4fd28a52a0fe6870b70951ff1a5f99e061a11ffe2c0dfe5db302e33fa81ceaf29c7087bf30c1e53863c03b8ca83fa087dc6d8e37dbf0c669970df0765926646bdd478484c05eb0c7b72f537e261c738435fdf8317e77d671c26d85ffb7d7a891f5d27e823d59ee8075a8f53a9fae2fd2be31efa5334a609fd17f217e9cc7eda4fd2944a07be06d7fbd0efcf8c05e7a9372e789fb51ea5991bab072acfd04446fcc83b6369e1ff67e3a9457e9d825313109f5bc66d40fdd1fe31b4291beb7b43a8e7f57eeac0d2c05e148c5bc48fcbc619f6259d67872ece013c82ebf8827ab307ce92d45fa4fd63e853ead01fb51e0fb1be8f7e7108ce39a1be607fa49170ff07f0c29feec27898314f6bbd1952b4fc746aef614813be47dc399832a17edc81a5b7fcb9361e511f59fd33e4dabe21df93710c88e7b7e0fa3ee4d37a338ca9833dbc185bbde1c9389abd9e8d5340fdb835ce01f322de1f47ca8807cdf781d380fa4f2b0b0e88cf2fe03aeec1deb65fac5f11e247aaffd01fb4df0ea59e473eed826b3d417d867da6349a7c37c6847ac94fc605eb04f9a76a3fdc8ff89917e769d7d8ced3155826f88f35bf7293d8d64f8ca780786fc143d3a17e1b2fdea31b63863f44e325b7f53eb59fc77dede2bc4ce04c09f6d57a9043ae21a8f2ec81ab3de0ff75b0c80c7be1fe2e31fce1ee8d05f9e4eec0436bf1cee05a2f50ff347e725fc73bc4db7be301f2b947b044f467a7f37dfd9a317b91379e218f837e491af45fa7f3681eaaff11af3a0fe43c04c4179f82c5fa0d69bdafd3fae23eed8f99eb38827eb40c9638213ebf804b67fb35de6b3a0c01f543f3af0e2f09f586b51ee56960e4a3877c53e94d9fcbef8cefd7c138ce9897609f3a3d05f8e7192cd6df58e51fdb41ccde6b6059f40fad7f6390d1ea19f6f7b9ef313fbc06978cf748eb6ffd5a0ce66f9d6fea746cf313a93feab8dbf69837b57fd66c8df6f31331ce3df245fd33723d8ff96ad378b07eba62cc33ea95c6d72839a19ed2b231c11f74042ec9eedb3266c8ef57bf33ecadf5b54ebb56df48e38b9a2c3de637adb7d48e8dfdfca50117abaf7edf58709f68fda0900bf4753be0ba8efea7f580fa3ce1e73f746e3cf78897042ec5f455fd292e5834fe285579b05ffb130d63077fc9a371847d49e7833abd14bcef3e1acf33fa81e63351b507f24feb35f1d4d8bafabf7eac36789f35bfa88cf58341d7b57ed15426bb7f024f2dce93f6a33add2e58e781fa315d2750dd1fc153b0f7745eaa5f3b61c63ca1f5f4659a34d678abd3d382757eaa5f1fc6dbf7ffffefbfb6df3b4ffa2f7bf1c54ff57fb33ffe5ffbfdb13ff1a7fecc9ffb2ffec25ffa2b7fed6ffcadbff3f7fec17ff58ffee90ffbbff967ffca2ffbd77ec5affa35ffc6affbb7fe9d7fef3ff80dbfe93ffaadc57ebfed3ff91dbfebf7fc67bfef0ffca13ff28d6f7df09def7df4c90f3efb11fb9d77ce916327aeb8c9cdeed89db85377e6cedd1777e12edd95bb76377e5cc8ef6edd9dbb770feeab7b744fee5bfdfbec5eb965f7daadb855b7e6deb875f7f6677ddd3bf7de7d701b6eb3defed16db96df7c9edb85db7e73ebb7d77e00eddd18ffdae71ad0bae73bd8b2eb9c1e55a1e3cd5982426a15207cb998e7feca7133aa5333aa72f7441977445d77443b77447f7f4405fe9919ee81b3dd3abeffb97e935add02aadd11b5aa7b7f48eded307daa04dfa485bb44d9f68877669effbfecfb44f07744847d4504b813aea2952a297196964cf8e8999e587beb5384d3cf3319ff0299ff1397fe10bbee42bbee61bbee53bbee7871ff2f3577ee427fec6cffc8a97f935aff02aaff11b5ee7b7fc8edff307dee0cd9ff67fe42ddee64fbcc3bbbcc79f799f0ff8908fea44d372e08e7bae9f873fdb9f07ae9fbfe2c509098b4891496639961339953339972f72f1f37eb9942bb9961bb9953bb99707f92a8ff224dfe4595ed513cbf2fa8ff12c2bb22a6bf246d6e52d277927efe5836cc8a67c942dd9964fb2f3a7fdbbb2279f655f0ee4508ea491568274527bb8241924cbf8e77cf1a31f8b2faed40c2b5c84e652eaffa632ffa5fcfdcfdf7ff92f64b3cec5</data>
</image>
</images>
<connections>
<connection>
<sender>Form1</sender>
<signal>contextMenuRequested(int,int)</signal>
<receiver>PopupMenu1</receiver>
<slot>popup(int,int)</slot>
</connection>
</connections>
<layoutdefaults spacing="6" margin="11"/>
</UI>
|