Project

General

Profile

Download (19.3 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * pkg.php
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2013 BSD Perimeter
7
 * Copyright (c) 2013-2016 Electric Sheep Fencing
8
 * Copyright (c) 2014-2022 Rubicon Communications, LLC (Netgate)
9
 * All rights reserved.
10
 *
11
 * Licensed under the Apache License, Version 2.0 (the "License");
12
 * you may not use this file except in compliance with the License.
13
 * You may obtain a copy of the License at
14
 *
15
 * http://www.apache.org/licenses/LICENSE-2.0
16
 *
17
 * Unless required by applicable law or agreed to in writing, software
18
 * distributed under the License is distributed on an "AS IS" BASIS,
19
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
 * See the License for the specific language governing permissions and
21
 * limitations under the License.
22
 */
23

    
24
##|+PRIV
25
##|*IDENT=page-package-settings
26
##|*NAME=Package: Settings
27
##|*DESCR=Allow access to the 'Package: Settings' page.
28
##|*MATCH=pkg.php*
29
##|-PRIV
30

    
31
require_once("guiconfig.inc");
32
require_once("pkg-utils.inc");
33

    
34
function domTT_title($title_msg) {
35
	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');\"";
36
}
37

    
38
$xml = $_REQUEST['xml'];
39

    
40
if ($xml == "") {
41
	$pgtitle = array(gettext("Package"), gettext("Editor"));
42
	$pglinks = array("", "@self");
43
	include("head.inc");
44
	print_info_box(gettext("No valid package defined."), 'danger', false);
45
	include("foot.inc");
46
	exit;
47
} else {
48
	$pkg_xml_prefix = "/usr/local/pkg/";
49
	$pkg_full_path = "{$pkg_xml_prefix}/{$xml}";
50
	$pkg_realpath = realpath($pkg_full_path);
51
	if (empty($pkg_realpath)) {
52
		$path_error = sprintf(gettext("Package path %s not found."), htmlspecialchars($pkg_full_path));
53
	} else if (substr_compare($pkg_realpath, $pkg_xml_prefix, 0, strlen($pkg_xml_prefix))) {
54
		$path_error = sprintf(gettext("Invalid path %s specified."), htmlspecialchars($pkg_full_path));
55
	}
56

    
57
	if (!empty($path_error)) {
58
		include("head.inc");
59
		print_info_box($path_error . "<br />" . gettext("Try reinstalling the package."), 'danger', false);
60
		include("foot.inc");
61
		die;
62
	}
63

    
64
	if (file_exists($pkg_full_path)) {
65
		$pkg = parse_xml_config_pkg($pkg_full_path, "packagegui");
66
	} else {
67
		include("head.inc");
68
		print_info_box(sprintf(gettext("File not found %s."), htmlspecialchars($xml)), 'danger', false);
69
		include("foot.inc");
70
		exit;
71
	}
72
}
73

    
74
if ($pkg['donotsave'] != "") {
75
	header("Location: pkg_edit.php?xml=" . $xml);
76
	exit;
77
}
78

    
79
if ($pkg['include_file'] != "") {
80
	require_once($pkg['include_file']);
81
}
82

    
83
if ($_REQUEST['startdisplayingat']) {
84
	$startdisplayingat = $_REQUEST['startdisplayingat'];
85
}
86

    
87
if ($_REQUEST['display_maximum_rows']) {
88
	if ($_REQUEST['display_maximum_rows']) {
89
		$display_maximum_rows = $_REQUEST['display_maximum_rows'];
90
	}
91
}
92

    
93
$evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
94

    
95
if ($_REQUEST['act'] == "update") {
96

    
97
	if (is_array($config['installedpackages'][$pkg['name']]) && $pkg['name'] != "" && $_REQUEST['ids'] !="") {
98
		// get current values
99
		$current_values=$config['installedpackages'][$pkg['name']]['config'];
100
		// get updated ids
101
		parse_str($_REQUEST['ids'], $update_list);
102
		// sort ids to know what to change
103
		// useful to do not lose data when using sorting and paging
104
		$sort_list=$update_list['ids'];
105
		sort($sort_list);
106
		// apply updates
107
		foreach ($update_list['ids'] as $key=> $value) {
108
			$config['installedpackages'][$pkg['name']]['config'][$sort_list[$key]]=$current_values[$update_list['ids'][$key]];
109
		}
110
		// save current config
111
		write_config(gettext("Package configuration changes saved from package settings page."));
112
		// sync package
113
		eval ("{$pkg['custom_php_resync_config_command']}");
114
	}
115
	// function called via jquery, no need to continue after save changes.
116
	exit;
117
}
118
if ($_REQUEST['act'] == "del") {
119
	// loop through our fieldnames and automatically setup the fieldnames
120
	// in the environment.	ie: a fieldname of username with a value of
121
	// testuser would automatically eval $username = "testuser";
122
	foreach ($evaledvar as $ip) {
123
		if ($pkg['adddeleteeditpagefields']['columnitem']) {
124
			foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
125
				${xml_safe_fieldname($column['fielddescr'])} = $ip[xml_safe_fieldname($column['fieldname'])];
126
			}
127
		}
128
	}
129

    
130
	init_config_arr(array('installedpackages', xml_safe_fieldname($pkg['name']), 'config'));
131
	$a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
132

    
133
	if ($a_pkg[$_REQUEST['id']]) {
134
		unset($a_pkg[$_REQUEST['id']]);
135
		write_config(gettext("Package configuration item deleted from package settings page."));
136
		if ($pkg['custom_delete_php_command'] != "") {
137
			if ($pkg['custom_php_command_before_form'] != "") {
138
				eval($pkg['custom_php_command_before_form']);
139
			}
140
			eval($pkg['custom_delete_php_command']);
141
		}
142
		header("Location:  pkg.php?xml=" . $xml);
143
		exit;
144
	}
145
}
146

    
147
ob_start();
148

    
149
$iflist = get_configured_interface_with_descr(true);
150
$evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
151

    
152
if ($pkg['custom_php_global_functions'] != "") {
153
	eval($pkg['custom_php_global_functions']);
154
}
155

    
156
if ($pkg['custom_php_command_before_form'] != "") {
157
	eval($pkg['custom_php_command_before_form']);
158
}
159

    
160
// Breadcrumb
161
if ($pkg['title'] != "") {
162
	/*if (!$only_edit) {						// Is any package still making use of this?? Is this something that is still wanted, considering the breadcrumb policy https://redmine.pfsense.org/issues/5527
163
 		$pkg['title'] = $pkg['title'] . '/Edit';		// If this needs to live on, then it has to be moved to run AFTER "foreach ($pkg['tabs']['tab'] as $tab)"-loop. This due to $pgtitle[] = $tab['text'];
164
	}*/
165
	if (strpos($pkg['title'], '/')) {
166
		$title = explode('/', $pkg['title']);
167

    
168
		foreach ($title as $subtitle) {
169
			$pgtitle[] = gettext($subtitle);
170
			$pglinks[] = "@self";
171
		}
172
	} else {
173
		$pgtitle = array(gettext("Package"), gettext($pkg['title']));
174
		$pglinks = array("", "@self");
175
	}
176
} else {
177
	$pgtitle = array(gettext("Package"), gettext("Editor"));
178
	$pglinks = array("", "@self");
179
}
180

    
181
if ($pkg['tabs'] != "") {
182
	$tab_array = array();
183
	foreach ($pkg['tabs']['tab'] as $tab) {
184
		if ($tab['tab_level']) {
185
			$tab_level = $tab['tab_level'];
186
		} else {
187
			$tab_level = 1;
188
		}
189
		if (isset($tab['active'])) {
190
			$active = true;
191
			$pgtitle[] = $tab['text'];
192
			$pglinks[] = "@self";
193
		} else {
194
			$active = false;
195
		}
196
		$urltmp = "";
197
		if ($tab['url'] != "") {
198
			$urltmp = $tab['url'];
199
		}
200
		if ($tab['xml'] != "") {
201
			$urltmp = "pkg_edit.php?xml=" . $tab['xml'];
202
		}
203

    
204
		$addresswithport = getenv("HTTP_HOST");
205
		$colonpos = strpos($addresswithport, ":");
206
		if ($colonpos !== False) {
207
			//my url is actually just the IP address of the pfsense box
208
			$myurl = substr($addresswithport, 0, $colonpos);
209
		} else {
210
			$myurl = $addresswithport;
211
		}
212
		// eval url so that above $myurl item can be processed if need be.
213
		$url = str_replace('$myurl', $myurl, $urltmp);
214

    
215
		$tab_array[$tab_level][] = array(
216
			$tab['text'],
217
			$active,
218
			$url
219
		);
220
	}
221

    
222
	ksort($tab_array);
223
}
224

    
225
if (!empty($pkg['tabs'])) {
226
	$shortcut_section = $pkg['shortcut_section'];
227
}
228

    
229
include("head.inc");
230
if (isset($tab_array)) {
231
	foreach ($tab_array as $tabid => $tab) {
232
		display_top_tabs($tab);
233
	}
234
}
235

    
236
?>
237

    
238
<script type="text/javascript">
239
//<![CDATA[
240
events.push(function() {
241

    
242
	function setFilter(filtertext) {
243
		$('#pkg_filter').val(filtertext);
244
		document.pkgform.submit();
245
	}
246

    
247
<?php
248
	if ($pkg['adddeleteeditpagefields']['movable']) {
249
?>
250
		$('#mainarea table tbody').sortable({
251
		items: 'tr.sortable',
252
			cursor: 'move',
253
			distance: 10,
254
			opacity: 0.8,
255
			helper: function(e, ui) {
256
				ui.children().each(function() {
257
					$(this).width($(this).width());
258
				});
259
			return ui;
260
			},
261
		});
262
<?php
263
	}
264
?>
265
});
266

    
267
function save_changes_to_xml(xml) {
268
	var ids = $('#mainarea table tbody').sortable('serialize', {key:"ids[]"});
269
	var strloading="<?=gettext('Saving changes...')?>";
270
	if (confirm("<?=gettext("Confirmation Required to save changes.")?>")) {
271
		$.ajax({
272
			type: 'get',
273
			cache: false,
274
			url: "<?=$_SERVER['SCRIPT_NAME']?>",
275
			data: {xml:'<?=$xml?>', act:'update', ids: ids},
276
			beforeSend: function() {
277
				$('#savemsg').empty().html(strloading);
278
			},
279
			error: function(data) {
280
				$('#savemsg').empty().html('Error:' + data);
281
			},
282
			success: function(data) {
283
				$('#savemsg').empty().html(data);
284
			}
285
		});
286
	}
287
}
288

    
289
//]]>
290
</script>
291

    
292
<?php
293
if ($_REQUEST['savemsg'] != "") {
294
	$savemsg = htmlspecialchars($_REQUEST['savemsg']);
295
}
296

    
297
if ($savemsg) {
298
	print_info_box($savemsg, 'success');
299
}
300
?>
301

    
302
<form action="pkg.php" name="pkgform" method="get">
303
	<input type='hidden' name='xml' value='<?=$_REQUEST['xml']?>' />
304
		<div id="mainarea" class="panel panel-default">
305
			<table id="mainarea" class="table table-striped table-hover table-condensed">
306
				<thead>
307
<?php
308
	/* Handle filtering bar A-Z */
309
	$include_filtering_inputbox = false;
310
	$colspan = 0;
311
	if ($pkg['adddeleteeditpagefields']['columnitem'] != "") {
312
		foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
313
			$colspan++;
314
		}
315
	}
316
	if ($pkg['fields']['field']) {
317
		// First find the sorting type field if it exists
318
		foreach ($pkg['fields']['field'] as $field) {
319
			if ($field['type'] == "sorting") {
320
				if (isset($field['include_filtering_inputbox'])) {
321
					$include_filtering_inputbox = true;
322
				}
323
				if ($display_maximum_rows < 1) {
324
					if ($field['display_maximum_rows']) {
325
						$display_maximum_rows = $field['display_maximum_rows'];
326
					}
327
				}
328
				echo "<tr><td colspan='$colspan' class='text-center'>";
329
				echo gettext("Filter by: ");
330
				$isfirst = true;
331
				for ($char = 65; $char < 91; $char++) {
332
					if (!$isfirst) {
333
						echo " | ";
334
					}
335
					echo "<a href=\"#\" onclick=\"setFilter('" . chr($char) . "');\">" . chr($char) . "</a>";
336
					$isfirst = false;
337
				}
338
				echo "</td></tr>";
339
				echo "<tr><td colspan='$colspan' class='text-center'>";
340
				if ($field['sortablefields']) {
341
					echo gettext("Filter field: ") . "<select name='pkg_filter_type'>";
342
					foreach ($field['sortablefields']['item'] as $si) {
343
						if ($si['name'] == $_REQUEST['pkg_filter_type']) {
344
							$SELECTED = "selected";
345
						} else {
346
							$SELECTED = "";
347
						}
348
						echo "<option value='{$si['name']}' {$SELECTED}>{$si['name']}</option>";
349
					}
350
					echo "</select>";
351
				}
352
				if ($include_filtering_inputbox) {
353
					echo '&nbsp;&nbsp;' . gettext("Filter text: ") . '<input id="pkg_filter" name="pkg_filter" value="' . htmlspecialchars($_REQUEST['pkg_filter']) . '" />';
354
					echo '&nbsp;<button type="submit" value="Filter" class="btn btn-primary btn-xs">';
355
					echo '<i class="fa fa-filter icon-embed-btn"></i>';
356
					echo gettext("Filter");
357
					echo "</button>";
358
				}
359
				echo "</td></tr><tr><td><font size='-3'>&nbsp;</font></td></tr>";
360
			}
361
		}
362
	}
363
?>
364
				<tr>
365

    
366
<?php
367
	if ($display_maximum_rows) {
368
		$totalpages = ceil(round((count($evaledvar) / $display_maximum_rows), 9));
369
		$page = 1;
370
		$tmpcount = 0;
371
		$tmppp = 0;
372
		if (is_array($evaledvar)) {
373
			foreach ($evaledvar as $ipa) {
374
				if ($tmpcount == $display_maximum_rows) {
375
					$page++;
376
					$tmpcount = 0;
377
				}
378
				if ($tmppp == $startdisplayingat) {
379
					break;
380
				}
381
				$tmpcount++;
382
				$tmppp++;
383
			}
384
		}
385
		echo "<tr><th colspan='" . count($pkg['adddeleteeditpagefields']['columnitem']) . "'>";
386
		echo "<table width='100%' summary=''>";
387
		echo "<tr>";
388
		echo "<td class='text-left'>" . sprintf(gettext('Displaying page %1$s of %2$s'), $page, $totalpages) . "</b></td>";
389
		echo "<td class='text-right'>" . gettext("Rows per page: ") . "<select onchange='document.pkgform.submit();' name='display_maximum_rows'>";
390
		for ($x = 0; $x < 250; $x++) {
391
			if ($x == $display_maximum_rows) {
392
				$SELECTED = "selected";
393
			} else {
394
				$SELECTED = "";
395
			}
396
			echo "<option value='$x' $SELECTED>$x</option>\n";
397
			$x = $x + 4;
398
		}
399
		echo "</select></td></tr>";
400
		echo "</table>";
401
		echo "</th></tr>";
402
	}
403

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

    
604
</form>
605
<?php
606
include("foot.inc"); ?>
(94-94/228)