Project

General

Profile

« Previous | Next » 

Revision ef2029df

Added by Scott Ullrich almost 15 years ago

Reformat file. No functional changes

View differences:

usr/local/www/pkg.php
48 48
$xml = htmlspecialchars($_REQUEST['xml']);
49 49

  
50 50
if($xml == "") {
51
            print_info_box_np(gettext("ERROR: No package defined."));
52
            die;
51
	print_info_box_np(gettext("ERROR: No package defined."));
52
	die;
53 53
} else {
54
            $pkg = parse_xml_config_pkg("/usr/local/pkg/" . $xml, "packagegui");
54
	$pkg = parse_xml_config_pkg("/usr/local/pkg/" . $xml, "packagegui");
55 55
}
56 56

  
57 57
if($pkg['donotsave'] <> "") {
......
73 73
$evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
74 74

  
75 75
if ($_GET['act'] == "del") {
76
	    // loop through our fieldnames and automatically setup the fieldnames
77
	    // in the environment.  ie: a fieldname of username with a value of
78
            // testuser would automatically eval $username = "testuser";
79
	    foreach ($evaledvar as $ip) {
76
		// loop through our fieldnames and automatically setup the fieldnames
77
		// in the environment.  ie: a fieldname of username with a value of
78
		// testuser would automatically eval $username = "testuser";
79
		foreach ($evaledvar as $ip) {
80 80
			if($pkg['adddeleteeditpagefields']['columnitem'])
81 81
			  foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
82 82
				  ${xml_safe_fieldname($column['fielddescr'])} = $ip[xml_safe_fieldname($column['fieldname'])];
83 83
			  }
84
	    }
84
		}
85 85

  
86
	    $a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
86
		$a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
87 87

  
88
	    if ($a_pkg[$_GET['id']]) {
88
		if ($a_pkg[$_GET['id']]) {
89 89
			unset($a_pkg[$_GET['id']]);
90 90
			write_config();
91 91
			if($pkg['custom_delete_php_command'] <> "") {
......
104 104
$evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
105 105

  
106 106
if($pkg['custom_php_global_functions'] <> "")
107
        eval($pkg['custom_php_global_functions']);
107
	eval($pkg['custom_php_global_functions']);
108 108

  
109 109
if($pkg['custom_php_command_before_form'] <> "")
110 110
	eval($pkg['custom_php_command_before_form']);
......
125 125
<table width="100%" border="0" cellpadding="0" cellspacing="0">
126 126
<?php
127 127
if ($pkg['tabs'] <> "") {
128
    echo '<tr><td>';
129
    $tab_array = array();
130
    foreach($pkg['tabs']['tab'] as $tab) {
131
        if(isset($tab['active'])) {
132
                $active = true;
133
        } else {
134
                $active = false;
135
        }
136
        $urltmp = "";
137
        if($tab['url'] <> "") $urltmp = $tab['url'];
138
        if($tab['xml'] <> "") $urltmp = "pkg_edit.php?xml=" . $tab['xml'];
128
	echo '<tr><td>';
129
	$tab_array = array();
130
	foreach($pkg['tabs']['tab'] as $tab) {
131
		if(isset($tab['active'])) {
132
			$active = true;
133
		} else {
134
			$active = false;
135
		}
136
		$urltmp = "";
137
		if($tab['url'] <> "") 
138
			$urltmp = $tab['url'];
139
		if($tab['xml'] <> "") 
140
			$urltmp = "pkg_edit.php?xml=" . $tab['xml'];
139 141

  
140
        $myurl = getenv("HTTP_HOST");
141
        // eval url so that above $myurl item can be processed if need be.
142
        $url = str_replace('$myurl', $myurl, $urltmp);
143
        $tab_array[] = array(
144
                                $tab['text'],
145
                                $active,
146
                                $url
147
                        );
142
		$myurl = getenv("HTTP_HOST");
143
		// eval url so that above $myurl item can be processed if need be.
144
		$url = str_replace('$myurl', $myurl, $urltmp);
145
		$tab_array[] = array(
146
			$tab['text'],
147
			$active,
148
			$url
149
		);
148 150
    }
149
    display_top_tabs($tab_array);
150
    echo '</td></tr>';
151
	display_top_tabs($tab_array);
152
	echo '</td></tr>';
151 153
}
152 154
?>
153 155
<script>
......
161 163
		<td class="tabcont">
162 164
			<table width="100%" border="0" cellpadding="6" cellspacing="0">
163 165
<?php
164
				/* Handle sorting bar A-Z and filtering */				
166
				/* Handle filtering bar A-Z */				
165 167
				$include_filtering_inputbox = false;
166 168
				$colspan = 0;
167
				if($pkg['adddeleteeditpagefields']['columnitem'] <> "") {
169
				if($pkg['adddeleteeditpagefields']['columnitem'] <> "") 
168 170
					foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column)
169 171
						$colspan++;
170
				}
171 172
				if($pkg['fields']['field']) {
172 173
					// First find the sorting type field if it exists
173 174
					foreach($pkg['fields']['field'] as $field) {
......
177 178
							if($field['display_maximum_rows'])
178 179
								$display_maximum_rows = $field['display_maximum_rows'];
179 180
							echo "<tr><td class='listhdrr' colspan='$colspan'><center>";
180
							echo "Sorting: ";
181
							echo "Filter by: ";
181 182
							$isfirst = true;
182 183
							for($char = 65; $char < 91; $char++) {
183 184
								if(!$isfirst) 
......
188 189
							echo "</td></tr>";
189 190
							echo "<tr><td class='listhdrr' colspan='$colspan'><center>";
190 191
							if($field['sortablefields']) {
191
								echo "Filter by: <select name='pkg_filter_type'>";
192
								echo "Filter field: <select name='pkg_filter_type'>";
192 193
								foreach($field['sortablefields']['item'] as $si) {
193 194
									if($si['name'] == $_REQUEST['pkg_filter_type']) 
194 195
										$SELECTED = "SELECTED";
......
210 211
				$cols = 0;
211 212
				if($pkg['adddeleteeditpagefields']['columnitem'] <> "") {
212 213
				    foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) {
213
					echo "<td class=\"listhdrr\">" . $column['fielddescr'] . "</td>";
214
					$cols++;
214
						echo "<td class=\"listhdrr\">" . $column['fielddescr'] . "</td>";
215
						$cols++;
215 216
				    }
216 217
				}
217 218
				echo "</tr>";
......
344 345

  
345 346
</body>
346 347
</html>
347

  
348
<?php
349

  
350
echo "<!-- filter_fieldname: {$filter_fieldname} -->";
351
echo "<!-- filter_regex: {$filter_regex} -->";
352

  
353
?>

Also available in: Unified diff