Project

General

Profile

Download (19.5 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	pkg.php
4
/*
5
/* ====================================================================
6
 *	Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *
8
 *	Redistribution and use in source and binary forms, with or without modification,
9
 *	are permitted provided that the following conditions are met:
10
 *
11
 *	1. Redistributions of source code must retain the above copyright notice,
12
 *		this list of conditions and the following disclaimer.
13
 *
14
 *	2. Redistributions in binary form must reproduce the above copyright
15
 *		notice, this list of conditions and the following disclaimer in
16
 *		the documentation and/or other materials provided with the
17
 *		distribution.
18
 *
19
 *	3. All advertising materials mentioning features or use of this software
20
 *		must display the following acknowledgment:
21
 *		"This product includes software developed by the pfSense Project
22
 *		 for use in the pfSense software distribution. (http://www.pfsense.org/).
23
 *
24
 *	4. The names "pfSense" and "pfSense Project" must not be used to
25
 *		 endorse or promote products derived from this software without
26
 *		 prior written permission. For written permission, please contact
27
 *		 coreteam@pfsense.org.
28
 *
29
 *	5. Products derived from this software may not be called "pfSense"
30
 *		nor may "pfSense" appear in their names without prior written
31
 *		permission of the Electric Sheep Fencing, LLC.
32
 *
33
 *	6. Redistributions of any form whatsoever must retain the following
34
 *		acknowledgment:
35
 *
36
 *	"This product includes software developed by the pfSense Project
37
 *	for use in the pfSense software distribution (http://www.pfsense.org/).
38
 *
39
 *	THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
40
 *	EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41
 *	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42
 *	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
43
 *	ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44
 *	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45
 *	NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46
 *	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
 *	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48
 *	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49
 *	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50
 *	OF THE POSSIBILITY OF SUCH DAMAGE.
51
 *
52
 *	====================================================================
53
 *
54
 */
55

    
56
##|+PRIV
57
##|*IDENT=page-package-settings
58
##|*NAME=Package: Settings
59
##|*DESCR=Allow access to the 'Package: Settings' page.
60
##|*MATCH=pkg.php*
61
##|-PRIV
62

    
63
require_once("guiconfig.inc");
64
require_once("pkg-utils.inc");
65

    
66
function gentitle_pkg($pgname) {
67
	global $config;
68
	return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname;
69
}
70

    
71
function domTT_title($title_msg) {
72
	print "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '".gettext($title_msg)."', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\"";
73
}
74

    
75
$xml = $_REQUEST['xml'];
76

    
77
if ($xml == "") {
78
	include("head.inc");
79
	print_info_box_np(gettext("ERROR: No valid package defined."));
80
	include("foot.inc");
81
	exit;
82
} else {
83
	$pkg_xml_prefix = "/usr/local/pkg/";
84
	$pkg_full_path = "{$pkg_xml_prefix}/{$xml}";
85
	if (substr_compare(realpath($pkg_full_path), $pkg_xml_prefix, 0, strlen($pkg_xml_prefix))) {
86
		print_info_box_np(gettext("ERROR: Invalid path specified."));
87
		die;
88
	}
89
	if (file_exists($pkg_full_path)) {
90
		$pkg = parse_xml_config_pkg($pkg_full_path, "packagegui");
91
	} else {
92
		include("head.inc");
93
		print_info_box_np(gettext("File not found ") . htmlspecialchars($xml));
94
		include("foot.inc");
95
		exit;
96
	}
97
}
98

    
99
if ($pkg['donotsave'] != "") {
100
	header("Location: pkg_edit.php?xml=" . $xml);
101
	exit;
102
}
103

    
104
if ($pkg['include_file'] != "") {
105
	require_once($pkg['include_file']);
106
}
107

    
108
if ($_REQUEST['startdisplayingat']) {
109
	$startdisplayingat = $_REQUEST['startdisplayingat'];
110
}
111

    
112
if ($_REQUEST['display_maximum_rows']) {
113
	if ($_REQUEST['display_maximum_rows']) {
114
		$display_maximum_rows = $_REQUEST['display_maximum_rows'];
115
	}
116
}
117

    
118
$evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
119

    
120
if ($_GET['act'] == "update") {
121

    
122
	if (is_array($config['installedpackages'][$pkg['name']]) && $pkg['name'] != "" && $_REQUEST['ids'] !="") {
123
		#get current values
124
		$current_values=$config['installedpackages'][$pkg['name']]['config'];
125
		#get updated ids
126
		parse_str($_REQUEST['ids'], $update_list);
127
		#sort ids to know what to change
128
		#useful to do not lose data when using sorting and paging
129
		$sort_list=$update_list['ids'];
130
		sort($sort_list);
131
		#apply updates
132
		foreach ($update_list['ids'] as $key=> $value) {
133
			$config['installedpackages'][$pkg['name']]['config'][$sort_list[$key]]=$current_values[$update_list['ids'][$key]];
134
		}
135
		#save current config
136
		write_config();
137
		#sync package
138
		eval ("{$pkg['custom_php_resync_config_command']}");
139
	}
140
	#function called via jquery, no need to continue after save changes.
141
	exit;
142
}
143
if ($_GET['act'] == "del") {
144
	// loop through our fieldnames and automatically setup the fieldnames
145
	// in the environment.	ie: a fieldname of username with a value of
146
	// testuser would automatically eval $username = "testuser";
147
	foreach ($evaledvar as $ip) {
148
		if ($pkg['adddeleteeditpagefields']['columnitem']) {
149
			foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
150
				${xml_safe_fieldname($column['fielddescr'])} = $ip[xml_safe_fieldname($column['fieldname'])];
151
			}
152
		}
153
	}
154

    
155
	$a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
156

    
157
	if ($a_pkg[$_GET['id']]) {
158
		unset($a_pkg[$_GET['id']]);
159
		write_config();
160
		if ($pkg['custom_delete_php_command'] != "") {
161
			if ($pkg['custom_php_command_before_form'] != "") {
162
				eval($pkg['custom_php_command_before_form']);
163
			}
164
			eval($pkg['custom_delete_php_command']);
165
		}
166
		header("Location:  pkg.php?xml=" . $xml);
167
		exit;
168
	}
169
}
170

    
171
ob_start();
172

    
173
$iflist = get_configured_interface_with_descr(false, true);
174
$evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
175

    
176
if ($pkg['custom_php_global_functions'] != "") {
177
	eval($pkg['custom_php_global_functions']);
178
}
179

    
180
if ($pkg['custom_php_command_before_form'] != "") {
181
	eval($pkg['custom_php_command_before_form']);
182
}
183

    
184
// Breadcrumb
185
if ($pkg['title'] != "") {
186
	if (!$only_edit) {
187
 		$pkg['title'] = $pkg['title'] . '/Edit';
188
	}
189
	if (strpos($pkg['title'], '/')) {
190
		$title = explode('/', $pkg['title']);
191

    
192
		foreach ($title as $subtitle) {
193
			$pgtitle[] = gettext($subtitle);
194
		}
195
	} else {
196
		$pgtitle = array(gettext("Package"), gettext($pkg['title']));
197
	}
198
} else {
199
	$pgtitle = array(gettext("Package"), gettext("Editor"));
200
}
201

    
202
include("head.inc");
203

    
204
?>
205

    
206
<script type="text/javascript">
207
//<![CDATA[
208
events.push(function() {
209
	function setFilter(filtertext) {
210
		jQuery('#pkg_filter').val(filtertext);
211
		document.pkgform.submit();
212
	}
213

    
214
	<?php
215
		if ($pkg['adddeleteeditpagefields']['movable']) {
216
	?>
217
				$('#mainarea table tbody').sortable({
218
				items: 'tr.sortable',
219
					cursor: 'move',
220
					distance: 10,
221
					opacity: 0.8,
222
					helper: function(e, ui) {
223
						ui.children().each(function() {
224
							jQuery(this).width(jQuery(this).width());
225
						});
226
					return ui;
227
					},
228
				});
229

    
230

    
231
			function save_changes_to_xml(xml) {
232
				var ids = $('#mainarea table tbody').sortable('serialize', {key:"ids[]"});
233
				var strloading="<?=gettext('Saving changes...')?>";
234
				if (confirm("<?=gettext("Do you really want to save changes?")?>")) {
235
					$.ajax({
236
						type: 'get',
237
						cache: false,
238
						url: "<?=$_SERVER['SCRIPT_NAME']?>",
239
						data: {xml:'<?=$xml?>', act:'update', ids: ids},
240
						beforeSend: function() {
241
							$('#savemsg').empty().html(strloading);
242
						},
243
						error: function(data) {
244
							$('#savemsg').empty().html('Error:' + data);
245
						},
246
						success: function(data) {
247
							$('#savemsg').empty().html(data);
248
						}
249
					});
250
				}
251
			}
252
	<?php
253
		}
254
	?>
255
});
256
//]]>
257
</script>
258

    
259
<?php
260
if ($_GET['savemsg'] != "") {
261
	$savemsg = htmlspecialchars($_GET['savemsg']);
262
}
263

    
264
if ($savemsg) {
265
	print_info_box($savemsg, 'success');
266
}
267
?>
268

    
269
<form action="pkg.php" name="pkgform" method="get">
270
	<input type='hidden' name='xml' value='<?=$_REQUEST['xml']?>' />
271
<?php
272
	if ($pkg['tabs'] != "") {
273
		$tab_array = array();
274
		foreach ($pkg['tabs']['tab'] as $tab) {
275
			if ($tab['tab_level']) {
276
				$tab_level = $tab['tab_level'];
277
			} else {
278
				$tab_level = 1;
279
			}
280
			if (isset($tab['active'])) {
281
				$active = true;
282
			} else {
283
				$active = false;
284
			}
285
			if (isset($tab['no_drop_down'])) {
286
				$no_drop_down = true;
287
			}
288
			$urltmp = "";
289
			if ($tab['url'] != "") {
290
				$urltmp = $tab['url'];
291
			}
292
			if ($tab['xml'] != "") {
293
				$urltmp = "pkg_edit.php?xml=" . $tab['xml'];
294
			}
295

    
296
			$addresswithport = getenv("HTTP_HOST");
297
			$colonpos = strpos($addresswithport, ":");
298
			if ($colonpos !== False) {
299
				//my url is actually just the IP address of the pfsense box
300
				$myurl = substr($addresswithport, 0, $colonpos);
301
			} else {
302
				$myurl = $addresswithport;
303
			}
304
			// eval url so that above $myurl item can be processed if need be.
305
			$url = str_replace('$myurl', $myurl, $urltmp);
306

    
307
			$tab_array[$tab_level][] = array(
308
				$tab['text'],
309
				$active,
310
				$url
311
			);
312
		}
313

    
314
		ksort($tab_array);
315
		foreach ($tab_array as $tab) {
316
			display_top_tabs($tab, $no_drop_down);
317
		}
318
	}
319
?>
320
		<div id="mainarea" class="panel panel-default">
321
			<table id="mainarea" class="table table-striped table-hover table-condensed">
322
				<thead>
323
<?php
324
	/* Handle filtering bar A-Z */
325
	$include_filtering_inputbox = false;
326
	$colspan = 0;
327
	if ($pkg['adddeleteeditpagefields']['columnitem'] != "") {
328
		foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
329
			$colspan++;
330
		}
331
	}
332
	if ($pkg['fields']['field']) {
333
		// First find the sorting type field if it exists
334
		foreach ($pkg['fields']['field'] as $field) {
335
			if ($field['type'] == "sorting") {
336
				if (isset($field['include_filtering_inputbox'])) {
337
					$include_filtering_inputbox = true;
338
				}
339
				if ($display_maximum_rows < 1) {
340
					if ($field['display_maximum_rows']) {
341
						$display_maximum_rows = $field['display_maximum_rows'];
342
					}
343
				}
344
				echo "<tr><td colspan='$colspan' align='center'>";
345
				echo "Filter by: ";
346
				$isfirst = true;
347
				for ($char = 65; $char < 91; $char++) {
348
					if (!$isfirst) {
349
						echo " | ";
350
					}
351
					echo "<a href=\"#\" onclick=\"setFilter('" . chr($char) . "');\">" . chr($char) . "</a>";
352
					$isfirst = false;
353
				}
354
				echo "</td></tr>";
355
				echo "<tr><td colspan='$colspan' align='center'>";
356
				if ($field['sortablefields']) {
357
					echo "Filter field: <select name='pkg_filter_type'>";
358
					foreach ($field['sortablefields']['item'] as $si) {
359
						if ($si['name'] == $_REQUEST['pkg_filter_type']) {
360
							$SELECTED = "selected";
361
						} else {
362
							$SELECTED = "";
363
						}
364
						echo "<option value='{$si['name']}' {$SELECTED}>{$si['name']}</option>";
365
					}
366
					echo "</select>";
367
				}
368
				if ($include_filtering_inputbox) {
369
					echo "&nbsp;&nbsp;Filter text: <input id='pkg_filter' name='pkg_filter' value='" . $_REQUEST['pkg_filter'] . "' /><input type='submit' value='Filter' />";
370
				}
371
				echo "</td></tr><tr><td><font size='-3'>&nbsp;</font></td></tr>";
372
			}
373
		}
374
	}
375
?>
376
				<tr>
377

    
378
<?php
379
	if ($display_maximum_rows) {
380
		$totalpages = ceil(round((count($evaledvar) / $display_maximum_rows), 9));
381
		$page = 1;
382
		$tmpcount = 0;
383
		$tmppp = 0;
384
		if (is_array($evaledvar)) {
385
			foreach ($evaledvar as $ipa) {
386
				if ($tmpcount == $display_maximum_rows) {
387
					$page++;
388
					$tmpcount = 0;
389
				}
390
				if ($tmppp == $startdisplayingat) {
391
					break;
392
				}
393
				$tmpcount++;
394
				$tmppp++;
395
			}
396
		}
397
		echo "<tr><th colspan='" . count($pkg['adddeleteeditpagefields']['columnitem']) . "'>";
398
		echo "<table width='100%' summary=''>";
399
		echo "<tr>";
400
		echo "<td align='left'>Displaying page $page of $totalpages</b></td>";
401
		echo "<td align='right'>Rows per page: <select onchange='document.pkgform.submit();' name='display_maximum_rows'>";
402
		for ($x = 0; $x < 250; $x++) {
403
			if ($x == $display_maximum_rows) {
404
				$SELECTED = "selected";
405
			} else {
406
				$SELECTED = "";
407
			}
408
			echo "<option value='$x' $SELECTED>$x</option>\n";
409
			$x = $x + 4;
410
		}
411
		echo "</select></td></tr>";
412
		echo "</table>";
413
		echo "</th></tr>";
414
	}
415
	
416
	$cols = 0;
417
	if ($pkg['adddeleteeditpagefields']['columnitem'] != "") {
418
		foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
419
			echo "<th class=\"listhdrr\">" . $column['fielddescr'] . "</th>";
420
			$cols++;
421
		}
422
	}
423
?>
424
				</tr>
425
				</thead>
426
				<tbody>
427
<?php
428
	$i = 0;
429
	$pagination_counter = 0;
430
	if ($evaledvar) {
431
		foreach ($evaledvar as $ip) {
432
			if ($startdisplayingat) {
433
				if ($i < $startdisplayingat) {
434
					$i++;
435
					continue;
436
				}
437
			}
438
			if ($_REQUEST['pkg_filter']) {
439
				// Handle filtered items
440
				if ($pkg['fields']['field'] && !$filter_regex) {
441
					// First find the sorting type field if it exists
442
					foreach ($pkg['fields']['field'] as $field) {
443
						if ($field['type'] == "sorting") {
444
							if ($field['sortablefields']['item']) {
445
								foreach ($field['sortablefields']['item'] as $sf) {
446
									if ($sf['name'] == $_REQUEST['pkg_filter_type']) {
447
										$filter_fieldname = $sf['fieldname'];
448
										#Use a default regex on sortable fields when none is declared
449
										if ($sf['regex']) {
450
											$filter_regex = str_replace("%FILTERTEXT%", $_REQUEST['pkg_filter'], trim($sf['regex']));
451
										} else {
452
											$filter_regex = "/{$_REQUEST['pkg_filter']}/i";
453
										}
454
									}
455
								}
456
							}
457
						}
458
					}
459
				}
460
				// Do we have something to filter on?
461
				unset($filter_matches);
462
				if ($pkg['adddeleteeditpagefields']['columnitem'] != "") {
463
					foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
464
						$fieldname = $ip[xml_safe_fieldname($column['fieldname'])];
465
						if ($column['fieldname'] == $filter_fieldname) {
466
							if ($filter_regex) {
467
								//echo "$filter_regex - $fieldname<p/>";
468
								preg_match($filter_regex, $fieldname, $filter_matches);
469
								break;
470
							}
471
						}
472
					}
473
				}
474
				if (!$filter_matches) {
475
					$i++;
476
					continue;
477
				}
478
			}
479
			if ($pkg['adddeleteeditpagefields']['movable']) {
480
				echo "<tr valign=\"top\" class=\"sortable\" id=\"id_{$i}\">\n";
481
			} else {
482
				echo "<tr valign=\"top\">\n";
483
			}
484
			if ($pkg['adddeleteeditpagefields']['columnitem'] != "") {
485
				foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
486
					if ($column['fieldname'] == "description") {
487
						$class = "listbg";
488
					} else {
489
						$class = "listlr";
490
					}
491
?>
492
					<td class="<?=$class?>" ondblclick="document.location='pkg_edit.php?xml=<?=$xml?>&amp;act=edit&amp;id=<?=$i?>';">
493
<?php
494
					$fieldname = $ip[xml_safe_fieldname($column['fieldname'])];
495
					#Check if columnitem has a type field declared
496
					if ($column['type'] == "checkbox") {
497
						if ($fieldname == "") {
498
							echo gettext("No");
499
						} else {
500
							echo gettext("Yes");
501
						}
502
					} else if ($column['type'] == "interface") {
503
						echo $column['prefix'] . $iflist[$fieldname] . $column['suffix'];
504
					} else {
505
						#Check if columnitem has an encoding field declared
506
						if ($column['encoding'] == "base64") {
507
							echo $column['prefix'] . base64_decode($fieldname) . $column['suffix'];
508
						#Check if there is a custom info to show when $fieldname is not empty
509
						} else if ($column['listmodeon'] && $fieldname != "") {
510
							echo $column['prefix'] . gettext($column['listmodeon']). $column['suffix'];
511
						#Check if there is a custom info to show when $fieldname is empty
512
						} else if ($column['listmodeoff'] && $fieldname == "") {
513
							echo $column['prefix'] .gettext($column['listmodeoff']). $column['suffix'];
514
						} else {
515
							echo $column['prefix'] . $fieldname ." ". $column['suffix'];
516
						}
517
					}
518
?>
519
					</td>
520
<?php
521
				} // foreach columnitem
522
			} // if columnitem
523
?>
524
					<td valign="middle" class="list nowrap">
525
						<table border="0" cellspacing="0" cellpadding="1" summary="icons">
526
							<tr>
527
<?php
528
			#Show custom description to edit button if defined
529
			$edit_msg=($pkg['adddeleteeditpagefields']['edittext']?$pkg['adddeleteeditpagefields']['edittext']:"Edit this item");
530
?>
531
								<td><a class="btn btn-xs btn-info" href="pkg_edit.php?xml=<?=$xml?>&amp;act=edit&amp;id=<?=$i?>"><?=$edit_msg?></a></td>
532
<?php
533
			#Show custom description to delete button if defined
534
			$delete_msg=($pkg['adddeleteeditpagefields']['deletetext']?$pkg['adddeleteeditpagefields']['deletetext']:"Delete this item");
535
?>
536
								<td>&nbsp;<a class="btn btn-xs btn-danger" href="pkg.php?xml=<?=$xml?>&amp;act=del&amp;id=<?=$i?>"><?=gettext("Delete")?></a></td>
537
							</tr>
538
						</tbody>
539
					</table>
540
				</td>
541
<?php
542
			echo "</tr>\n"; // Pairs with an echo tr some way above
543
			// Handle pagination and display_maximum_rows
544
			if ($display_maximum_rows) {
545
				if ($pagination_counter == ($display_maximum_rows-1) or
546
					$i == (count($evaledvar)-1)) {
547
					$colcount = count($pkg['adddeleteeditpagefields']['columnitem']);
548
					$final_footer = "";
549
					$final_footer .= "<tr><td colspan='$colcount'>";
550
					$final_footer .= "<table width='100%' summary=''><tr>";
551
					$final_footer .= "<td align='left'>";
552
					$startingat = $startdisplayingat - $display_maximum_rows;
553
					if ($startingat > -1) {
554
						$final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat={$startingat}&amp;display_maximum_rows={$display_maximum_rows}'>";
555
					} else if ($startdisplayingat > 1) {
556
						$final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat=0&amp;display_maximum_rows={$display_maximum_rows}'>";
557
					}
558
					$final_footer .= "<font size='2'><< Previous page</font></a>";
559
					if ($tmppp + $display_maximum_rows > count($evaledvar)) {
560
						$endingrecord = count($evaledvar);
561
					} else {
562
						$endingrecord = $tmppp + $display_maximum_rows;
563
					}
564
					$final_footer .= "</td><td align='center'>";
565
					$tmppp++;
566
					$final_footer .= "<font size='2'>Displaying {$tmppp} - {$endingrecord} / " . count($evaledvar) . " records";
567
					$final_footer .= "</font></td><td align='right'>&nbsp;";
568
					if (($i+1) < count($evaledvar)) {
569
						$final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat=" . ($startdisplayingat + $display_maximum_rows) . "&amp;display_maximum_rows={$display_maximum_rows}'>";
570
					}
571
					$final_footer .= "<font size='2'>Next page >></font></a>";
572
					$final_footer .= "</td></tr></table></td></tr>";
573
					$i = count($evaledvar);
574
					break;
575
				}
576
			}
577
			$i++;
578
			$pagination_counter++;
579
		} // foreach evaledvar
580
	} // if evaledvar
581
?>
582
				<tr>
583
					<td colspan="<?=$cols?>"></td>
584
					<td>
585
						<table border="0" cellspacing="0" cellpadding="1" summary="icons">
586
							<tr>
587
<?php
588
	#Show custom description to add button if defined
589
	$add_msg=($pkg['adddeleteeditpagefields']['addtext']?$pkg['adddeleteeditpagefields']['addtext']:"Add a new item");
590
?>
591
								<td><a href="pkg_edit.php?xml=<?=$xml?>&amp;id=<?=$i?>" class="btn btn-sm btn-success"><?=gettext('Add')?></a></td>
592
<?php
593
	#Show description button and info if defined
594
	if ($pkg['adddeleteeditpagefields']['description']) {
595
?>
596
								<td>
597
									<i class="fa fa-info-circle"><?=$pkg['adddeleteeditpagefields']['description']?></i>
598
								</td>
599
<?php
600
	}
601
?>
602
							</tr>
603
						</table>
604
					</td>
605
				</tr>
606
				<?=$final_footer?>
607
<?php
608
	#Show save button only when movable is defined
609
	if ($pkg['adddeleteeditpagefields']['movable']) {
610
?>
611

    
612

    
613

    
614
<?php
615
	}
616
?>
617
			</table>
618
			</div>
619
		<input class="btn btn-primary" type="button" value="Save" name="Submit" onclick="save_changes_to_xml('<?=$xml?>')" />
620

    
621
</form>
622
<?php
623
echo "<!-- filter_fieldname: {$filter_fieldname} -->";
624
echo "<!-- filter_regex: {$filter_regex} -->";
625

    
626
include("foot.inc"); ?>
(100-100/228)