Completed
Pull Request — master (#1954)
by Christian
10:19
created
html/ops/fix_project_prefs.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             // changing the tree in a loop has strange results so do it separately
77 77
             $to_remove = array();
78 78
             $ids = array();
79
-            foreach($appids as $elem) {
79
+            foreach ($appids as $elem) {
80 80
                 $ids[] = $elem->nodeValue;
81 81
                 $to_remove[] = $elem;
82 82
             }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         exit(1);
95 95
     }
96 96
     $appids = $node->getElementsByTagName("app_id");
97
-    if ($appids->length == 0 ) return;
97
+    if ($appids->length == 0) return;
98 98
     // changing the tree in a loop has strange results so do it separately
99 99
     $to_remove = array();
100 100
     $ids = array();
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         $to_remove = array();
130 130
         foreach ($subNodes as $subNode) {
131 131
             // ignore empty text nodes which are basically whitespace from indentation (only relevant if preserveWhiteSpace is set to true above)
132
-            if (($subNode->nodeType != XML_TEXT_NODE) || (($subNode->nodeType == XML_TEXT_NODE) &&(strlen(trim($subNode->wholeText))>=1))) {
132
+            if (($subNode->nodeType != XML_TEXT_NODE) || (($subNode->nodeType == XML_TEXT_NODE) && (strlen(trim($subNode->wholeText)) >= 1))) {
133 133
                 if ($subNode->nodeName == "venue") {
134 134
                     if (!$subNode->hasChildNodes()) {
135 135
                         // empty venue tag, clean this up too
Please login to merge, or discard this patch.
html/project.sample/project_specific_prefs.inc 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 //      Also error-check values, and return errors in $errors->*
34 34
 
35 35
 function option($name, $val) {
36
-    $x = ($name == $val) ?  "selected" : "";
36
+    $x = ($name == $val) ? "selected" : "";
37 37
     return "<option name='$name' $x>$name\n";
38 38
 }
39 39
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 if (APP_SELECT_PREFS) {
54 54
     $app_array = array();
55 55
     $apps = BoincApp::enum("deprecated=0");
56
-    foreach($apps as $app) {
56
+    foreach ($apps as $app) {
57 57
         $app_array[] = array($app->id, $app->user_friendly_name);
58 58
     }
59 59
 } else {
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 }
92 92
 
93 93
 function number_select($name, $max, $n) {
94
-    $sel = ($n == 0) ? "selected":"";
94
+    $sel = ($n == 0) ? "selected" : "";
95 95
     $x = "<select class=\"form-control input-sm\" name=$name> <option value=0 $sel>".tra("No limit")."</option>";
96
-    for ($i=1; $i<=$max; $i++) {
97
-        $sel = ($n == $i) ? "selected":"";
96
+    for ($i = 1; $i <= $max; $i++) {
97
+        $sel = ($n == $i) ? "selected" : "";
98 98
         $x .= "<option value=$i $sel>$i</option>";
99 99
     }
100 100
     $x .= "</select>";
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     return tra("No limit");
107 107
 }
108 108
 
109
-function project_specific_prefs_edit($prefs, $error=false) {
109
+function project_specific_prefs_edit($prefs, $error = false) {
110 110
     global $app_array;
111 111
     if (COLOR_PREFS) {
112 112
         $x = $prefs->color_scheme;
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
             } else {
133 133
                 $present = true;
134 134
             }
135
-            $checked = $present?"checked":"";
135
+            $checked = $present ? "checked" : "";
136 136
             $x .= "<input type=checkbox name=app_id_$app_id $checked> $app_name<br>";
137 137
         }
138 138
         tooltip_row2(APP_SELECT_TOOLTIP, APP_SELECT_DESC, $x);
139
-        $checked = $prefs->allow_non_selected_apps?"checked":"";
139
+        $checked = $prefs->allow_non_selected_apps ? "checked" : "";
140 140
         row2(ACCEPT_ANY_DESC, "<input type=checkbox name=allow_non_selected_apps $checked>");
141 141
     }
142 142
     if (NON_GRAPHICAL_PREF) {
143
-        $checked = $prefs->non_graphical?"checked":"";
143
+        $checked = $prefs->non_graphical ? "checked" : "";
144 144
         row2(
145 145
             NON_GRAPHICAL_DESC,
146 146
             "<input type=checkbox name=non_graphical $checked>"
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
     return $x;
217 217
 }
218 218
 
219
-function project_specific_prefs_show($prefs, $columns=false) {
219
+function project_specific_prefs_show($prefs, $columns = false) {
220 220
     global $app_array;
221 221
     if ($columns) {
222 222
         if (COLOR_PREFS) {
223
-            row_defs(COLOR_DESC,"color_scheme", "", "", $prefs);
223
+            row_defs(COLOR_DESC, "color_scheme", "", "", $prefs);
224 224
         }
225 225
         if (GFX_CPU_PREFS) {
226 226
             row_defs(MAX_GFX_CPU_PCT_DESC, "max_gfx_cpu_pct", "", "", $prefs);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             row2(ACCEPT_ANY_DESC, $prefs->allow_non_selected_apps_text);
255 255
         }
256 256
         if (NON_GRAPHICAL_PREF) {
257
-            row2(NON_GRAPHICAL_DESC, $prefs->non_graphical?tra("yes"):tra("no"));
257
+            row2(NON_GRAPHICAL_DESC, $prefs->non_graphical ? tra("yes") : tra("no"));
258 258
         }
259 259
         if (MAX_JOBS_PREF) {
260 260
             row2(tra("Max # jobs"), limit_string($prefs->max_jobs));
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
         $cursor = 0;
278 278
         while ($thisxml = parse_next_element($prefs_xml, "<app_id>", $cursor)) {
279 279
             if (is_numeric($thisxml)) {
280
-                $n = (int) $thisxml;
280
+                $n = (int)$thisxml;
281 281
                 $prefs->app_ids[] = $n;
282 282
             }
283 283
         }
284 284
         $prefs->allow_non_selected_apps = parse_element($prefs_xml, "<allow_non_selected_apps>");
285
-        $prefs->allow_non_selected_apps_text = $prefs->allow_non_selected_apps?"yes":"no";
285
+        $prefs->allow_non_selected_apps_text = $prefs->allow_non_selected_apps ? "yes" : "no";
286 286
     }
287 287
     if (NON_GRAPHICAL_PREF) {
288 288
         $prefs->non_graphical = parse_bool($prefs_xml, "non_graphical");
@@ -296,6 +296,6 @@  discard block
 block discarded – undo
296 296
     return $prefs;
297 297
 }
298 298
 
299
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
299
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
300 300
 
301 301
 ?>
Please login to merge, or discard this patch.