Project

General

Profile

Download (19.4 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

    
210
	function setFilter(filtertext) {
211
		jQuery('#pkg_filter').val(filtertext);
212
		document.pkgform.submit();
213
	}
214

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

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

    
257
//]]>
258
</script>
259

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

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

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

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

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

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

    
379
<?php
380
	if ($display_maximum_rows) {
381
		$totalpages = ceil(round((count($evaledvar) / $display_maximum_rows), 9));
382
		$page = 1;
383
		$tmpcount = 0;
384
		$tmppp = 0;
385
		if (is_array($evaledvar)) {
386
			foreach ($evaledvar as $ipa) {
387
				if ($tmpcount == $display_maximum_rows) {
388
					$page++;
389
					$tmpcount = 0;
390
				}
391
				if ($tmppp == $startdisplayingat) {
392
					break;
393
				}
394
				$tmpcount++;
395
				$tmppp++;
396
			}
397
		}
398
		echo "<tr><th colspan='" . count($pkg['adddeleteeditpagefields']['columnitem']) . "'>";
399
		echo "<table width='100%' summary=''>";
400
		echo "<tr>";
401
		echo "<td align='left'>Displaying page $page of $totalpages</b></td>";
402
		echo "<td align='right'>Rows per page: <select onchange='document.pkgform.submit();' name='display_maximum_rows'>";
403
		for ($x = 0; $x < 250; $x++) {
404
			if ($x == $display_maximum_rows) {
405
				$SELECTED = "selected";
406
			} else {
407
				$SELECTED = "";
408
			}
409
			echo "<option value='$x' $SELECTED>$x</option>\n";
410
			$x = $x + 4;
411
		}
412
		echo "</select></td></tr>";
413
		echo "</table>";
414
		echo "</th></tr>";
415
	}
416

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

    
613

    
614

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

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

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