Permalink
Browse files

Cleanup

  • Loading branch information...
CloCkWeRX committed Nov 5, 2015
1 parent 6283d53 commit 5af9f9996fb92de3ad96ef48089be617320705d6
Showing with 32 additions and 20 deletions.
  1. +32 −20 Services/Mailman.php
View
@@ -671,26 +671,38 @@ public function listinfo($string)
'submit',
'hidden',
);
- //get inputs
- foreach ($queries as $query) {
- foreach ($query as $item){
- $type = strtolower($item->getAttribute('type'));
- $type = (empty($type)) ? 'textarea' : $type;
- if(in_array($type,$ignore_types)) continue; //ignore defined types
- $name = $item->getAttribute('name');
- $value = ($type === 'textarea') ? $item->nodeValue : $item->getAttribute('value');
- $checked = $item->getAttribute('checked');
- //initialize checkbox array if it's not set
- if($type === 'checkbox' && !isset($a[$name])) $a[$name] = array();
- //skip non checked values
- if($type === 'radio' && $checked !== 'checked') continue;
- if($type === 'checkbox' && $checked !== 'checked') continue;
- if($type === 'checkbox') {
- $a[$name][] = $value;
- } else {
- $a[$name] = $value;
- }
- }
+ //get inputs
+ foreach ($queries as $query) {
+ foreach ($query as $item) {
+ $type = strtolower($item->getAttribute('type'));
+ $type = (empty($type)) ? 'textarea' : $type;
+ if (in_array($type, $ignore_types)) {
+ continue; //ignore defined types
+ }
+
+ $name = $item->getAttribute('name');
+ $value = ($type === 'textarea') ? $item->nodeValue : $item->getAttribute('value');
+ $checked = $item->getAttribute('checked');
+
+ //initialize checkbox array if it's not set
+ if ($type === 'checkbox' && !isset($a[$name])) {
+ $a[$name] = array();
+ }
+
+ //skip non checked values
+ if ($type === 'radio' && $checked !== 'checked') {
+ continue;
+ }
+ if ($type === 'checkbox' && $checked !== 'checked') {
+ continue;
+ }
+
+ if ($type === 'checkbox') {
+ $a[$name][] = $value;
+ } else {
+ $a[$name] = $value;
+ }
+ }
}
ksort($a);
return $a;

0 comments on commit 5af9f99

Please sign in to comment.