@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | return $x; |
49 | 49 | } |
50 | 50 | |
51 | -function pm_team_form($user, $teamid, $error=null) { |
|
51 | +function pm_team_form($user, $teamid, $error = null) { |
|
52 | 52 | global $bbcode_html, $bbcode_js; |
53 | 53 | $team = BoincTeam::lookup_id($teamid); |
54 | 54 | if (!$team) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | error_page("not admin"); |
59 | 59 | } |
60 | 60 | |
61 | - page_head(tra("Send message to team"),'','','', $bbcode_js); |
|
61 | + page_head(tra("Send message to team"), '', '', '', $bbcode_js); |
|
62 | 62 | |
63 | 63 | $subject = post_str("subject", true); |
64 | 64 | $content = post_str("content", true); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | function pm_form($replyto, $userid, $error = null) { |
103 | 103 | global $bbcode_html, $bbcode_js; |
104 | 104 | global $g_logged_in_user; |
105 | - page_head(tra("Send private message"),'','','', $bbcode_js); |
|
105 | + page_head(tra("Send private message"), '', '', '', $bbcode_js); |
|
106 | 106 | |
107 | 107 | if (post_str("preview", true) == tra("Preview")) { |
108 | 108 | $content = post_str("content", true); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | if (!$user) { |
127 | 127 | error_page("Sender no longer exists"); |
128 | 128 | } |
129 | - $writeto = UNIQUE_USER_NAME?$user->name:$userid." (".$user->name.")"; |
|
129 | + $writeto = UNIQUE_USER_NAME ? $user->name : $userid." (".$user->name.")"; |
|
130 | 130 | $subject = $message->subject; |
131 | 131 | if (substr($subject, 0, 3) != "re:") { |
132 | 132 | $subject = "re: ".$subject; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if (!$user) { |
137 | 137 | error_page("Sender no longer exists"); |
138 | 138 | } |
139 | - $writeto = UNIQUE_USER_NAME?$user->name:$userid." (".$user->name.")"; |
|
139 | + $writeto = UNIQUE_USER_NAME ? $user->name : $userid." (".$user->name.")"; |
|
140 | 140 | } else { |
141 | 141 | $writeto = sanitize_tags(post_str("to", true)); |
142 | 142 | $subject = post_str("subject", true); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | function send_pm_notification_email( |
190 | 190 | $logged_in_user, $to_user, $subject, $content |
191 | 191 | ) { |
192 | - $message = " |
|
192 | + $message = " |
|
193 | 193 | You have received a new private message at ".PROJECT.". |
194 | 194 | |
195 | 195 | From: $logged_in_user->name (ID $logged_in_user->id) |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $pm = BoincPrivateMessage::lookup_id($notify->opaque); |
220 | 220 | $from_user = BoincUser::lookup_id($pm->senderid); |
221 | 221 | if (!$pm || !$from_user) return null; |
222 | - return "<a href=pm.php>".tra("Private message%1 from %2, subject:" , "</a>", $from_user->name )." $pm->subject"; |
|
222 | + return "<a href=pm.php>".tra("Private message%1 from %2, subject:", "</a>", $from_user->name)." $pm->subject"; |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | function pm_send_msg($from_user, $to_user, $subject, $content, $send_email) { |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | |
284 | 284 | function pm_email_remind($user) { |
285 | 285 | if (!$user->prefs->pm_notification) { |
286 | - return "<br><small>" . |
|
286 | + return "<br><small>". |
|
287 | 287 | tra( |
288 | 288 | "For email notification, %1 edit community prefs %2", |
289 | 289 | '<a href="edit_forum_preferences_form.php">', '</a>' |
290 | - ) . |
|
290 | + ). |
|
291 | 291 | "</small>" |
292 | 292 | ; |
293 | 293 | } |
@@ -313,5 +313,5 @@ discard block |
||
313 | 313 | } |
314 | 314 | } |
315 | 315 | |
316 | -$cvs_version_tracker[]="\$Id: pm.inc 14019 2007-11-01 23:04:39Z davea $"; |
|
316 | +$cvs_version_tracker[] = "\$Id: pm.inc 14019 2007-11-01 23:04:39Z davea $"; |
|
317 | 317 | ?> |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | // ------------ Notification ----------- |
39 | 39 | |
40 | 40 | row1(tra("Notifications")); |
41 | -$ch0 = $user->prefs->pm_notification==0?"checked":""; |
|
42 | -$ch1 = $user->prefs->pm_notification==1?"checked":""; |
|
43 | -$ch2 = $user->prefs->pm_notification==2?"checked":""; |
|
41 | +$ch0 = $user->prefs->pm_notification == 0 ? "checked" : ""; |
|
42 | +$ch1 = $user->prefs->pm_notification == 1 ? "checked" : ""; |
|
43 | +$ch2 = $user->prefs->pm_notification == 2 ? "checked" : ""; |
|
44 | 44 | row2( |
45 | 45 | tra("How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?"), |
46 | 46 | "<input type=radio name=pm_notification value=0 $ch0> ".tra("On my Account page (no email)")." |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | // ------------ Forum identity ----------- |
54 | 54 | |
55 | 55 | $select_0 = $select_1 = $select_2 = ""; |
56 | -if (strlen($user->prefs->avatar)){ |
|
57 | - if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar |
|
56 | +if (strlen($user->prefs->avatar)) { |
|
57 | + if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18) == "//www.gravatar.com") { // Gravatar |
|
58 | 58 | $select_1 = "checked=\"true\""; |
59 | 59 | } else { |
60 | 60 | $select_2 = "checked=\"true\""; |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2."> |
74 | 74 | <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">" |
75 | 75 | ); |
76 | -if (strlen($user->prefs->avatar)){ |
|
76 | +if (strlen($user->prefs->avatar)) { |
|
77 | 77 | row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>", |
78 | 78 | "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">"); |
79 | 79 | } |
80 | 80 | |
81 | -$signature_by_default = $user->prefs->no_signature_by_default==false?"checked=\"checked\"":""; |
|
81 | +$signature_by_default = $user->prefs->no_signature_by_default == false ? "checked=\"checked\"" : ""; |
|
82 | 82 | |
83 | -$signature=$user->prefs->signature; |
|
84 | -$maxlen=250; |
|
83 | +$signature = $user->prefs->signature; |
|
84 | +$maxlen = 250; |
|
85 | 85 | $x = ''; |
86 | 86 | if (!NO_COMPUTING) { |
87 | 87 | $x = tra( |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | tra("Attach signature by default") |
104 | 104 | ) |
105 | 105 | ); |
106 | -if ($user->prefs->signature!=""){ |
|
106 | +if ($user->prefs->signature != "") { |
|
107 | 107 | row2(tra("Signature preview"). |
108 | 108 | "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>", |
109 | 109 | output_transform($user->prefs->signature) |
@@ -112,13 +112,13 @@ discard block |
||
112 | 112 | |
113 | 113 | // ------------ Message display ----------- |
114 | 114 | |
115 | -$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":""; |
|
116 | -$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":""; |
|
117 | -$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":""; |
|
118 | -$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":""; |
|
119 | -$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":""; |
|
120 | -$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":""; |
|
121 | -$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":""; |
|
115 | +$forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : ""; |
|
116 | +$forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : ""; |
|
117 | +$forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : ""; |
|
118 | +$forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : ""; |
|
119 | +$forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : ""; |
|
120 | +$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : ""; |
|
121 | +$forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : ""; |
|
122 | 122 | |
123 | 123 | $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount); |
124 | 124 | $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | <input class="btn btn-default" type="submit" name="remove%d" value="%s"> |
165 | 165 | <br> |
166 | 166 | ', |
167 | - UNIQUE_USER_NAME?'':"$blocked_user->id -", |
|
167 | + UNIQUE_USER_NAME ? '' : "$blocked_user->id -", |
|
168 | 168 | user_links($blocked_user), |
169 | 169 | $blocked_user->id, |
170 | 170 | tra("Unblock") |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | tra("Blocked users"), |
179 | 179 | tra('Ignore message board posts and private messages from these users.') |
180 | 180 | ), |
181 | - $blocked_str?$blocked_str:'---' |
|
181 | + $blocked_str ? $blocked_str : '---' |
|
182 | 182 | ); |
183 | 183 | row2( |
184 | 184 | tra('Block user'), |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | <input type="text" name="forum_filter_user" size=12> |
189 | 189 | <input class="btn btn-default" type="submit" name="add_user_to_filter" value="%s"> |
190 | 190 | ', |
191 | - UNIQUE_USER_NAME?tra('User name'):tra('User ID (For instance: 123456789)'), |
|
191 | + UNIQUE_USER_NAME ?tra('User name') : tra('User ID (For instance: 123456789)'), |
|
192 | 192 | tra("Block") |
193 | 193 | ) |
194 | 194 | ); |
@@ -206,5 +206,5 @@ discard block |
||
206 | 206 | end_table(); |
207 | 207 | page_tail(); |
208 | 208 | |
209 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
209 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
210 | 210 | ?> |
@@ -53,8 +53,9 @@ discard block |
||
53 | 53 | // ------------ Forum identity ----------- |
54 | 54 | |
55 | 55 | $select_0 = $select_1 = $select_2 = ""; |
56 | -if (strlen($user->prefs->avatar)){ |
|
57 | - if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar |
|
56 | +if (strlen($user->prefs->avatar)) { |
|
57 | + if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { |
|
58 | +// Gravatar |
|
58 | 59 | $select_1 = "checked=\"true\""; |
59 | 60 | } else { |
60 | 61 | $select_2 = "checked=\"true\""; |
@@ -73,7 +74,7 @@ discard block |
||
73 | 74 | <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2."> |
74 | 75 | <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">" |
75 | 76 | ); |
76 | -if (strlen($user->prefs->avatar)){ |
|
77 | +if (strlen($user->prefs->avatar)) { |
|
77 | 78 | row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>", |
78 | 79 | "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">"); |
79 | 80 | } |
@@ -103,7 +104,7 @@ discard block |
||
103 | 104 | tra("Attach signature by default") |
104 | 105 | ) |
105 | 106 | ); |
106 | -if ($user->prefs->signature!=""){ |
|
107 | +if ($user->prefs->signature!="") { |
|
107 | 108 | row2(tra("Signature preview"). |
108 | 109 | "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>", |
109 | 110 | output_transform($user->prefs->signature) |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | foreach ($files as $file) { |
62 | 62 | $path = "$dir/$file"; |
63 | 63 | [$err, $file_size, $file_md5] = sandbox_parse_link_file($path); |
64 | - if (!$err){ |
|
64 | + if (!$err) { |
|
65 | 65 | if (strcmp($md5, $file_md5) == 0) { |
66 | 66 | $exist = true; |
67 | 67 | $elf = $file; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | $files = sandbox_file_names($user); |
126 | 126 | foreach ($files as $f) { |
127 | - if ($regexp && !preg_match("/$regexp/",$f)) continue; |
|
127 | + if ($regexp && !preg_match("/$regexp/", $f)) continue; |
|
128 | 128 | $x .= "<option value=\"$f\">$f</option>\n"; |
129 | 129 | } |
130 | 130 | $x .= "</select>\n"; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | // TODO: this is a kludge. |
155 | 155 | // Should we use the job_file and batch_file_assoc tables instead? |
156 | 156 | // |
157 | -function sandbox_file_in_use($user, $file){ |
|
157 | +function sandbox_file_in_use($user, $file) { |
|
158 | 158 | $ufiles = array(); |
159 | 159 | |
160 | 160 | $pbatches = BoincBatch::enum( |
@@ -164,16 +164,16 @@ discard block |
||
164 | 164 | ); |
165 | 165 | if (!$pbatches) return false; |
166 | 166 | |
167 | - foreach ($pbatches as $batch){ |
|
168 | - $wus = BoincWorkUnit::enum("batch = $batch->id limit 1" ); |
|
169 | - if ($wus == null){ |
|
167 | + foreach ($pbatches as $batch) { |
|
168 | + $wus = BoincWorkUnit::enum("batch = $batch->id limit 1"); |
|
169 | + if ($wus == null) { |
|
170 | 170 | continue; |
171 | 171 | } |
172 | - foreach($wus as $wu){ |
|
172 | + foreach ($wus as $wu) { |
|
173 | 173 | $x = "<in>".$wu->xml_doc."</in>"; |
174 | 174 | $x = simplexml_load_string($x); |
175 | 175 | global $fanout; |
176 | - foreach($x->workunit->file_ref as $fr){ |
|
176 | + foreach ($x->workunit->file_ref as $fr) { |
|
177 | 177 | $pname = (string)$fr->file_name; |
178 | 178 | $ufiles[] = $pname; |
179 | 179 | } |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | $dir = sandbox_dir($user); |
183 | 183 | $path = $dir."/".$file; |
184 | 184 | list($err, $size, $md5) = sandbox_parse_link_file($path); |
185 | - if (!$err){ |
|
185 | + if (!$err) { |
|
186 | 186 | $f = sandbox_file_name($user, $md5); |
187 | - foreach($ufiles as $uf) { |
|
188 | - if (strcmp($f,$uf) == 0){ |
|
187 | + foreach ($ufiles as $uf) { |
|
188 | + if (strcmp($f, $uf) == 0) { |
|
189 | 189 | return true; |
190 | 190 | } |
191 | 191 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | foreach ($files as $file) { |
62 | 62 | $path = "$dir/$file"; |
63 | 63 | [$err, $file_size, $file_md5] = sandbox_parse_link_file($path); |
64 | - if (!$err){ |
|
64 | + if (!$err) { |
|
65 | 65 | if (strcmp($md5, $file_md5) == 0) { |
66 | 66 | $exist = true; |
67 | 67 | $elf = $file; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | // TODO: this is a kludge. |
155 | 155 | // Should we use the job_file and batch_file_assoc tables instead? |
156 | 156 | // |
157 | -function sandbox_file_in_use($user, $file){ |
|
157 | +function sandbox_file_in_use($user, $file) { |
|
158 | 158 | $ufiles = array(); |
159 | 159 | |
160 | 160 | $pbatches = BoincBatch::enum( |
@@ -164,16 +164,16 @@ discard block |
||
164 | 164 | ); |
165 | 165 | if (!$pbatches) return false; |
166 | 166 | |
167 | - foreach ($pbatches as $batch){ |
|
167 | + foreach ($pbatches as $batch) { |
|
168 | 168 | $wus = BoincWorkUnit::enum("batch = $batch->id limit 1" ); |
169 | - if ($wus == null){ |
|
169 | + if ($wus == null) { |
|
170 | 170 | continue; |
171 | 171 | } |
172 | - foreach($wus as $wu){ |
|
172 | + foreach($wus as $wu) { |
|
173 | 173 | $x = "<in>".$wu->xml_doc."</in>"; |
174 | 174 | $x = simplexml_load_string($x); |
175 | 175 | global $fanout; |
176 | - foreach($x->workunit->file_ref as $fr){ |
|
176 | + foreach($x->workunit->file_ref as $fr) { |
|
177 | 177 | $pname = (string)$fr->file_name; |
178 | 178 | $ufiles[] = $pname; |
179 | 179 | } |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | $dir = sandbox_dir($user); |
183 | 183 | $path = $dir."/".$file; |
184 | 184 | list($err, $size, $md5) = sandbox_parse_link_file($path); |
185 | - if (!$err){ |
|
185 | + if (!$err) { |
|
186 | 186 | $f = sandbox_file_name($user, $md5); |
187 | 187 | foreach($ufiles as $uf) { |
188 | - if (strcmp($f,$uf) == 0){ |
|
188 | + if (strcmp($f,$uf) == 0) { |
|
189 | 189 | return true; |
190 | 190 | } |
191 | 191 | } |
@@ -141,12 +141,12 @@ discard block |
||
141 | 141 | // prefix for links; needed for pages not in top dir |
142 | 142 | $user, |
143 | 143 | // logged-in user, if any |
144 | - $fixed=false, |
|
144 | + $fixed = false, |
|
145 | 145 | // if true, navbar is fixed at top of page. |
146 | 146 | // NOTE: if you do this, you must set a global var $fixed_navbar |
147 | 147 | // to true at compile time |
148 | 148 | // (it needs to be set when page_head() is called). |
149 | - $inverse=false |
|
149 | + $inverse = false |
|
150 | 150 | // white on black? |
151 | 151 | ) { |
152 | 152 | global $master_url; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | // output a panel. |
216 | 216 | // $content_func is a function that generates the panel contents |
217 | 217 | // |
218 | -function panel($title, $content_func, $class="panel-primary", $body_class="") { |
|
218 | +function panel($title, $content_func, $class = "panel-primary", $body_class = "") { |
|
219 | 219 | echo sprintf('<div class="panel %s"> |
220 | 220 | ', $class |
221 | 221 | ); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | // $left_width is the width of left column in 1/12 units. |
243 | 243 | // $arg is passed to the functions. |
244 | 244 | // |
245 | -function grid($top_func, $left_func, $right_func, $left_width=6, $arg=null) { |
|
245 | +function grid($top_func, $left_func, $right_func, $left_width = 6, $arg = null) { |
|
246 | 246 | echo ' |
247 | 247 | <div class="container-fluid"> |
248 | 248 | '; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | </div> |
258 | 258 | '; |
259 | 259 | } |
260 | - $right_width = 12-$left_width; |
|
260 | + $right_width = 12 - $left_width; |
|
261 | 261 | echo ' |
262 | 262 | <div class="row"> |
263 | 263 | <div class="col-sm-'.$left_width.'"> |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // use extra = "name=x" |
282 | 282 | // call forum_focus(x, foo) after defining the field |
283 | 283 | // |
284 | -function form_start($action, $method='get', $extra='') { |
|
284 | +function form_start($action, $method = 'get', $extra = '') { |
|
285 | 285 | echo sprintf( |
286 | 286 | '<div class="container-fluid"> |
287 | 287 | <form class="form-horizontal" method="%s" action="%s" %s>' |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | // just the input field |
314 | 314 | // |
315 | 315 | function form_input_text_field( |
316 | - $name, $value='', $type='text', $attrs='', $extra='' |
|
316 | + $name, $value = '', $type = 'text', $attrs = '', $extra = '' |
|
317 | 317 | ) { |
318 | 318 | return sprintf( |
319 | 319 | '<input %s type="%s" class="form-control" name="%s" value="%s">%s', |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | // the whole row |
325 | 325 | // |
326 | 326 | function form_input_text( |
327 | - $label, $name, $value='', $type='text', $attrs='', $extra='' |
|
327 | + $label, $name, $value = '', $type = 'text', $attrs = '', $extra = '' |
|
328 | 328 | ) { |
329 | 329 | echo sprintf(' |
330 | 330 | <div class="form-group"> |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | ); |
353 | 353 | } |
354 | 354 | |
355 | -function form_input_textarea($label, $name, $value='', $nrows=4) { |
|
355 | +function form_input_textarea($label, $name, $value = '', $nrows = 4) { |
|
356 | 356 | echo sprintf(' |
357 | 357 | <div class="form-group"> |
358 | 358 | <label align=right class="%s" for="%s">%s</label> |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | // $items is either a string of <option> elements, or an array |
370 | 370 | // |
371 | -function form_select($label, $name, $items, $selected=null) { |
|
371 | +function form_select($label, $name, $items, $selected = null) { |
|
372 | 372 | echo sprintf(' |
373 | 373 | <div class="form-group"> |
374 | 374 | <label align=right class="%s" for="%s">%s</label> |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | foreach ($items as $i) { |
382 | 382 | echo sprintf( |
383 | 383 | '<option %s value=%s>%s</option>', |
384 | - ($i[0]==$selected)?'selected':'', |
|
384 | + ($i[0] == $selected) ? 'selected' : '', |
|
385 | 385 | $i[0], $i[1] |
386 | 386 | ); |
387 | 387 | } |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | // same, for multiple select. |
395 | 395 | // $selected, if non-null, is a list of selected values |
396 | 396 | // |
397 | -function form_select_multiple($label, $name, $items, $selected=null) { |
|
397 | +function form_select_multiple($label, $name, $items, $selected = null) { |
|
398 | 398 | echo sprintf(' |
399 | 399 | <div class="form-group"> |
400 | 400 | <label align=right class="%s" for="%s">%s</label> |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | foreach ($items as $i) { |
407 | 407 | echo sprintf( |
408 | 408 | '<option %s value=%s>%s</option>', |
409 | - ($selected && in_array($i[0], $selected))?'selected':'', |
|
409 | + ($selected && in_array($i[0], $selected)) ? 'selected' : '', |
|
410 | 410 | $i[0], $i[1] |
411 | 411 | ); |
412 | 412 | } |
@@ -415,12 +415,12 @@ discard block |
||
415 | 415 | |
416 | 416 | // return a list of string for checkbox items |
417 | 417 | // |
418 | -function checkbox_item_strings($items, $attrs='') { |
|
418 | +function checkbox_item_strings($items, $attrs = '') { |
|
419 | 419 | $x = []; |
420 | 420 | foreach ($items as $i) { |
421 | 421 | $x[] = sprintf('<input %s type="checkbox" name="%s" %s> %s |
422 | 422 | ', |
423 | - $attrs, $i[0], $i[2]?"checked":"", $i[1] |
|
423 | + $attrs, $i[0], $i[2] ? "checked" : "", $i[1] |
|
424 | 424 | ); |
425 | 425 | } |
426 | 426 | return $x; |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | |
429 | 429 | // $items is list of (name, label, checked) |
430 | 430 | // |
431 | -function form_checkboxes($label, $items, $attrs='') { |
|
431 | +function form_checkboxes($label, $items, $attrs = '') { |
|
432 | 432 | echo sprintf(' |
433 | 433 | <div class="form-group"> |
434 | 434 | <label align=right class="%s">%s</label> |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | FORM_LEFT_CLASS, $label, FORM_RIGHT_CLASS |
455 | 455 | ); |
456 | 456 | foreach ($items as $i) { |
457 | - $checked = ($selected == $i[0])?"checked":""; |
|
457 | + $checked = ($selected == $i[0]) ? "checked" : ""; |
|
458 | 458 | echo sprintf('<input type="radio" name="%s" value="%s" %s> %s <br> |
459 | 459 | ', |
460 | 460 | $name, $i[0], $checked, $i[1] |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | '; |
488 | 488 | } |
489 | 489 | |
490 | -function form_submit($text, $attrs='') { |
|
490 | +function form_submit($text, $attrs = '') { |
|
491 | 491 | form_general( |
492 | 492 | "", |
493 | 493 | sprintf( |
@@ -497,11 +497,11 @@ discard block |
||
497 | 497 | ); |
498 | 498 | } |
499 | 499 | |
500 | -function form_checkbox($label, $name, $checked=false) { |
|
500 | +function form_checkbox($label, $name, $checked = false) { |
|
501 | 501 | echo sprintf(' |
502 | 502 | <div class="form-group"> |
503 | 503 | <input type="checkbox" name="%s" %s> <span class="lead">%s</span> |
504 | 504 | </div> |
505 | - ', $name, $checked?"checked":"", $label |
|
505 | + ', $name, $checked ? "checked" : "", $label |
|
506 | 506 | ); |
507 | 507 | } |