@@ -60,7 +60,7 @@ |
||
60 | 60 | echo 'Hint: Example greps: "RESULT#106876", "26fe99aa_25636_00119.wu_1", "WU#8152", "too many errors", "2003-07-17", "CRITICAL" <br>'; |
61 | 61 | |
62 | 62 | if (strlen($f)) { |
63 | - $f = "../log*/". $f; |
|
63 | + $f = "../log*/". $f; |
|
64 | 64 | } else { |
65 | 65 | $f = "../log*/*.log"; |
66 | 66 | } |
@@ -27,19 +27,19 @@ discard block |
||
27 | 27 | exit("Error: couldn't get log_dir from config file."); |
28 | 28 | } |
29 | 29 | |
30 | -if( isset($_GET["f"]) ){ |
|
30 | +if (isset($_GET["f"])) { |
|
31 | 31 | $f = $_GET["f"]; |
32 | 32 | $f = escapeshellcmd($f); |
33 | 33 | } else { |
34 | 34 | $f = ""; |
35 | 35 | } |
36 | -if( isset($_GET["s"]) ){ |
|
36 | +if (isset($_GET["s"])) { |
|
37 | 37 | $s = $_GET["s"]; |
38 | 38 | $s = escapeshellcmd($s); |
39 | 39 | } else { |
40 | 40 | $s = ""; |
41 | 41 | } |
42 | -if( isset($_GET["l"]) ){ |
|
42 | +if (isset($_GET["l"])) { |
|
43 | 43 | $l = (int)$_GET["l"]; |
44 | 44 | } else { |
45 | 45 | $l = 0; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | echo 'Hint: Example greps: "RESULT#106876", "26fe99aa_25636_00119.wu_1", "WU#8152", "too many errors", "2003-07-17", "CRITICAL" <br>'; |
61 | 61 | |
62 | 62 | if (strlen($f)) { |
63 | - $f = "../log*/". $f; |
|
63 | + $f = "../log*/".$f; |
|
64 | 64 | } else { |
65 | 65 | $f = "../log*/*.log"; |
66 | 66 | } |
@@ -27,19 +27,19 @@ |
||
27 | 27 | exit("Error: couldn't get log_dir from config file."); |
28 | 28 | } |
29 | 29 | |
30 | -if( isset($_GET["f"]) ){ |
|
30 | +if( isset($_GET["f"]) ) { |
|
31 | 31 | $f = $_GET["f"]; |
32 | 32 | $f = escapeshellcmd($f); |
33 | 33 | } else { |
34 | 34 | $f = ""; |
35 | 35 | } |
36 | -if( isset($_GET["s"]) ){ |
|
36 | +if( isset($_GET["s"]) ) { |
|
37 | 37 | $s = $_GET["s"]; |
38 | 38 | $s = escapeshellcmd($s); |
39 | 39 | } else { |
40 | 40 | $s = ""; |
41 | 41 | } |
42 | -if( isset($_GET["l"]) ){ |
|
42 | +if( isset($_GET["l"]) ) { |
|
43 | 43 | $l = (int)$_GET["l"]; |
44 | 44 | } else { |
45 | 45 | $l = 0; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $view->base_table = 'node'; |
15 | 15 | $view->core = 0; |
16 | 16 | $view->api_version = '2'; |
17 | - $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
|
17 | + $view->disabled = false; /* Edit this to true to make a default view disabled initially */ |
|
18 | 18 | $handler = $view->new_display('default', 'Defaults', 'default'); |
19 | 19 | $handler->override_option('relationships', array( |
20 | 20 | 'content_profile_rel' => array( |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | 'news' => 'news', |
71 | 71 | ), |
72 | 72 | 'group' => '0', |
73 | - 'exposed' => FALSE, |
|
73 | + 'exposed' => false, |
|
74 | 74 | 'expose' => array( |
75 | - 'operator' => FALSE, |
|
75 | + 'operator' => false, |
|
76 | 76 | 'label' => '', |
77 | 77 | ), |
78 | 78 | 'id' => 'type', |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | 'operator' => '=', |
85 | 85 | 'value' => '1', |
86 | 86 | 'group' => '0', |
87 | - 'exposed' => FALSE, |
|
87 | + 'exposed' => false, |
|
88 | 88 | 'expose' => array( |
89 | - 'operator' => FALSE, |
|
89 | + 'operator' => false, |
|
90 | 90 | 'label' => '', |
91 | 91 | ), |
92 | 92 | 'id' => 'status', |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | 'hide_empty' => 1, |
312 | 312 | 'empty_zero' => 0, |
313 | 313 | 'hide_alter_empty' => 0, |
314 | - 'set_precision' => FALSE, |
|
314 | + 'set_precision' => false, |
|
315 | 315 | 'precision' => 0, |
316 | 316 | 'decimal' => '.', |
317 | 317 | 'separator' => '', |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | 'news' => 'news', |
468 | 468 | ), |
469 | 469 | 'group' => '0', |
470 | - 'exposed' => FALSE, |
|
470 | + 'exposed' => false, |
|
471 | 471 | 'expose' => array( |
472 | - 'operator' => FALSE, |
|
472 | + 'operator' => false, |
|
473 | 473 | 'label' => '', |
474 | 474 | ), |
475 | 475 | 'id' => 'type', |
@@ -481,9 +481,9 @@ discard block |
||
481 | 481 | 'operator' => '=', |
482 | 482 | 'value' => '1', |
483 | 483 | 'group' => '0', |
484 | - 'exposed' => FALSE, |
|
484 | + 'exposed' => false, |
|
485 | 485 | 'expose' => array( |
486 | - 'operator' => FALSE, |
|
486 | + 'operator' => false, |
|
487 | 487 | 'label' => '', |
488 | 488 | ), |
489 | 489 | 'id' => 'status', |
@@ -500,9 +500,9 @@ discard block |
||
500 | 500 | 'max' => '', |
501 | 501 | ), |
502 | 502 | 'group' => '0', |
503 | - 'exposed' => FALSE, |
|
503 | + 'exposed' => false, |
|
504 | 504 | 'expose' => array( |
505 | - 'operator' => FALSE, |
|
505 | + 'operator' => false, |
|
506 | 506 | 'label' => '', |
507 | 507 | ), |
508 | 508 | 'id' => 'changed', |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | )); |
517 | 517 | $handler->override_option('style_plugin', 'rss'); |
518 | 518 | $handler->override_option('style_options', array( |
519 | - 'mission_description' => FALSE, |
|
519 | + 'mission_description' => false, |
|
520 | 520 | 'description' => '', |
521 | 521 | )); |
522 | 522 | $handler->override_option('row_plugin', 'node_rss'); |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | 'page_2' => 'page_2', |
545 | 545 | 'default' => 0, |
546 | 546 | )); |
547 | - $handler->override_option('sitename_title', FALSE); |
|
547 | + $handler->override_option('sitename_title', false); |
|
548 | 548 | $handler = $view->new_display('page', 'Short blurbs', 'page_2'); |
549 | 549 | $handler->override_option('relationships', array()); |
550 | 550 | $handler->override_option('fields', array( |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | 'hide_empty' => 1, |
826 | 826 | 'empty_zero' => 0, |
827 | 827 | 'hide_alter_empty' => 0, |
828 | - 'set_precision' => FALSE, |
|
828 | + 'set_precision' => false, |
|
829 | 829 | 'precision' => 0, |
830 | 830 | 'decimal' => '.', |
831 | 831 | 'separator' => '', |
@@ -882,9 +882,9 @@ discard block |
||
882 | 882 | 'news' => 'news', |
883 | 883 | ), |
884 | 884 | 'group' => '0', |
885 | - 'exposed' => FALSE, |
|
885 | + 'exposed' => false, |
|
886 | 886 | 'expose' => array( |
887 | - 'operator' => FALSE, |
|
887 | + 'operator' => false, |
|
888 | 888 | 'label' => '', |
889 | 889 | ), |
890 | 890 | 'id' => 'type', |
@@ -896,9 +896,9 @@ discard block |
||
896 | 896 | 'operator' => '=', |
897 | 897 | 'value' => '1', |
898 | 898 | 'group' => '0', |
899 | - 'exposed' => FALSE, |
|
899 | + 'exposed' => false, |
|
900 | 900 | 'expose' => array( |
901 | - 'operator' => FALSE, |
|
901 | + 'operator' => false, |
|
902 | 902 | 'label' => '', |
903 | 903 | ), |
904 | 904 | 'id' => 'status', |
@@ -910,9 +910,9 @@ discard block |
||
910 | 910 | 'operator' => '=', |
911 | 911 | 'value' => '1', |
912 | 912 | 'group' => '0', |
913 | - 'exposed' => FALSE, |
|
913 | + 'exposed' => false, |
|
914 | 914 | 'expose' => array( |
915 | - 'operator' => FALSE, |
|
915 | + 'operator' => false, |
|
916 | 916 | 'label' => '', |
917 | 917 | ), |
918 | 918 | 'id' => 'promote', |
@@ -4,114 +4,114 @@ discard block |
||
4 | 4 | * Implementation of hook_views_default_views(). |
5 | 5 | */ |
6 | 6 | function news_views_default_views() { |
7 | - $views = array(); |
|
7 | + $views = array(); |
|
8 | 8 | |
9 | - // Exported view: news |
|
10 | - $view = new view; |
|
11 | - $view->name = 'news'; |
|
12 | - $view->description = ''; |
|
13 | - $view->tag = ''; |
|
14 | - $view->base_table = 'node'; |
|
15 | - $view->core = 0; |
|
16 | - $view->api_version = '2'; |
|
17 | - $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
|
18 | - $handler = $view->new_display('default', 'Defaults', 'default'); |
|
19 | - $handler->override_option('relationships', array( |
|
9 | + // Exported view: news |
|
10 | + $view = new view; |
|
11 | + $view->name = 'news'; |
|
12 | + $view->description = ''; |
|
13 | + $view->tag = ''; |
|
14 | + $view->base_table = 'node'; |
|
15 | + $view->core = 0; |
|
16 | + $view->api_version = '2'; |
|
17 | + $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
|
18 | + $handler = $view->new_display('default', 'Defaults', 'default'); |
|
19 | + $handler->override_option('relationships', array( |
|
20 | 20 | 'content_profile_rel' => array( |
21 | - 'id' => 'content_profile_rel', |
|
22 | - 'table' => 'users', |
|
23 | - 'field' => 'content_profile_rel', |
|
21 | + 'id' => 'content_profile_rel', |
|
22 | + 'table' => 'users', |
|
23 | + 'field' => 'content_profile_rel', |
|
24 | 24 | ), |
25 | - )); |
|
26 | - $handler->override_option('fields', array( |
|
25 | + )); |
|
26 | + $handler->override_option('fields', array( |
|
27 | 27 | 'comment_count' => array( |
28 | - 'id' => 'comment_count', |
|
29 | - 'table' => 'node_comment_statistics', |
|
30 | - 'field' => 'comment_count', |
|
28 | + 'id' => 'comment_count', |
|
29 | + 'table' => 'node_comment_statistics', |
|
30 | + 'field' => 'comment_count', |
|
31 | 31 | ), |
32 | 32 | 'view_node' => array( |
33 | - 'id' => 'view_node', |
|
34 | - 'table' => 'node', |
|
35 | - 'field' => 'view_node', |
|
33 | + 'id' => 'view_node', |
|
34 | + 'table' => 'node', |
|
35 | + 'field' => 'view_node', |
|
36 | 36 | ), |
37 | 37 | 'created' => array( |
38 | - 'id' => 'created', |
|
39 | - 'table' => 'node', |
|
40 | - 'field' => 'created', |
|
38 | + 'id' => 'created', |
|
39 | + 'table' => 'node', |
|
40 | + 'field' => 'created', |
|
41 | 41 | ), |
42 | 42 | 'teaser' => array( |
43 | - 'id' => 'teaser', |
|
44 | - 'table' => 'node_revisions', |
|
45 | - 'field' => 'teaser', |
|
43 | + 'id' => 'teaser', |
|
44 | + 'table' => 'node_revisions', |
|
45 | + 'field' => 'teaser', |
|
46 | 46 | ), |
47 | 47 | 'title' => array( |
48 | - 'id' => 'title', |
|
49 | - 'table' => 'node', |
|
50 | - 'field' => 'title', |
|
48 | + 'id' => 'title', |
|
49 | + 'table' => 'node', |
|
50 | + 'field' => 'title', |
|
51 | 51 | ), |
52 | - )); |
|
53 | - $handler->override_option('sorts', array( |
|
52 | + )); |
|
53 | + $handler->override_option('sorts', array( |
|
54 | 54 | 'created_1' => array( |
55 | - 'order' => 'DESC', |
|
56 | - 'granularity' => 'second', |
|
57 | - 'id' => 'created_1', |
|
58 | - 'table' => 'node', |
|
59 | - 'field' => 'created', |
|
60 | - 'override' => array( |
|
55 | + 'order' => 'DESC', |
|
56 | + 'granularity' => 'second', |
|
57 | + 'id' => 'created_1', |
|
58 | + 'table' => 'node', |
|
59 | + 'field' => 'created', |
|
60 | + 'override' => array( |
|
61 | 61 | 'button' => 'Override', |
62 | - ), |
|
63 | - 'relationship' => 'none', |
|
62 | + ), |
|
63 | + 'relationship' => 'none', |
|
64 | 64 | ), |
65 | - )); |
|
66 | - $handler->override_option('filters', array( |
|
65 | + )); |
|
66 | + $handler->override_option('filters', array( |
|
67 | 67 | 'type' => array( |
68 | - 'operator' => 'in', |
|
69 | - 'value' => array( |
|
68 | + 'operator' => 'in', |
|
69 | + 'value' => array( |
|
70 | 70 | 'news' => 'news', |
71 | - ), |
|
72 | - 'group' => '0', |
|
73 | - 'exposed' => FALSE, |
|
74 | - 'expose' => array( |
|
71 | + ), |
|
72 | + 'group' => '0', |
|
73 | + 'exposed' => FALSE, |
|
74 | + 'expose' => array( |
|
75 | 75 | 'operator' => FALSE, |
76 | 76 | 'label' => '', |
77 | - ), |
|
78 | - 'id' => 'type', |
|
79 | - 'table' => 'node', |
|
80 | - 'field' => 'type', |
|
81 | - 'relationship' => 'none', |
|
77 | + ), |
|
78 | + 'id' => 'type', |
|
79 | + 'table' => 'node', |
|
80 | + 'field' => 'type', |
|
81 | + 'relationship' => 'none', |
|
82 | 82 | ), |
83 | 83 | 'status' => array( |
84 | - 'operator' => '=', |
|
85 | - 'value' => '1', |
|
86 | - 'group' => '0', |
|
87 | - 'exposed' => FALSE, |
|
88 | - 'expose' => array( |
|
84 | + 'operator' => '=', |
|
85 | + 'value' => '1', |
|
86 | + 'group' => '0', |
|
87 | + 'exposed' => FALSE, |
|
88 | + 'expose' => array( |
|
89 | 89 | 'operator' => FALSE, |
90 | 90 | 'label' => '', |
91 | - ), |
|
92 | - 'id' => 'status', |
|
93 | - 'table' => 'node', |
|
94 | - 'field' => 'status', |
|
95 | - 'relationship' => 'none', |
|
96 | - ), |
|
97 | - )); |
|
98 | - $handler->override_option('access', array( |
|
91 | + ), |
|
92 | + 'id' => 'status', |
|
93 | + 'table' => 'node', |
|
94 | + 'field' => 'status', |
|
95 | + 'relationship' => 'none', |
|
96 | + ), |
|
97 | + )); |
|
98 | + $handler->override_option('access', array( |
|
99 | 99 | 'type' => 'none', |
100 | - )); |
|
101 | - $handler->override_option('cache', array( |
|
100 | + )); |
|
101 | + $handler->override_option('cache', array( |
|
102 | 102 | 'type' => 'none', |
103 | - )); |
|
104 | - $handler->override_option('empty', 'No news is good news...'); |
|
105 | - $handler->override_option('empty_format', '5'); |
|
106 | - $handler->override_option('items_per_page', 3); |
|
107 | - $handler->override_option('use_pager', '1'); |
|
108 | - $handler->override_option('row_plugin', 'node'); |
|
109 | - $handler = $view->new_display('page', 'Page', 'page_1'); |
|
110 | - $handler->override_option('relationships', array()); |
|
111 | - $handler->override_option('fields', array( |
|
103 | + )); |
|
104 | + $handler->override_option('empty', 'No news is good news...'); |
|
105 | + $handler->override_option('empty_format', '5'); |
|
106 | + $handler->override_option('items_per_page', 3); |
|
107 | + $handler->override_option('use_pager', '1'); |
|
108 | + $handler->override_option('row_plugin', 'node'); |
|
109 | + $handler = $view->new_display('page', 'Page', 'page_1'); |
|
110 | + $handler->override_option('relationships', array()); |
|
111 | + $handler->override_option('fields', array( |
|
112 | 112 | 'title' => array( |
113 | - 'label' => '', |
|
114 | - 'alter' => array( |
|
113 | + 'label' => '', |
|
114 | + 'alter' => array( |
|
115 | 115 | 'alter_text' => 1, |
116 | 116 | 'text' => '<h2>[title]</h2>', |
117 | 117 | 'make_link' => 0, |
@@ -128,23 +128,23 @@ discard block |
||
128 | 128 | 'ellipsis' => 1, |
129 | 129 | 'html' => 0, |
130 | 130 | 'strip_tags' => 0, |
131 | - ), |
|
132 | - 'empty' => '', |
|
133 | - 'hide_empty' => 0, |
|
134 | - 'empty_zero' => 0, |
|
135 | - 'link_to_node' => 0, |
|
136 | - 'exclude' => 0, |
|
137 | - 'id' => 'title', |
|
138 | - 'table' => 'node', |
|
139 | - 'field' => 'title', |
|
140 | - 'override' => array( |
|
131 | + ), |
|
132 | + 'empty' => '', |
|
133 | + 'hide_empty' => 0, |
|
134 | + 'empty_zero' => 0, |
|
135 | + 'link_to_node' => 0, |
|
136 | + 'exclude' => 0, |
|
137 | + 'id' => 'title', |
|
138 | + 'table' => 'node', |
|
139 | + 'field' => 'title', |
|
140 | + 'override' => array( |
|
141 | 141 | 'button' => 'Use default', |
142 | - ), |
|
143 | - 'relationship' => 'none', |
|
142 | + ), |
|
143 | + 'relationship' => 'none', |
|
144 | 144 | ), |
145 | 145 | 'created' => array( |
146 | - 'label' => '', |
|
147 | - 'alter' => array( |
|
146 | + 'label' => '', |
|
147 | + 'alter' => array( |
|
148 | 148 | 'alter_text' => 0, |
149 | 149 | 'text' => '', |
150 | 150 | 'make_link' => 0, |
@@ -161,24 +161,24 @@ discard block |
||
161 | 161 | 'ellipsis' => 1, |
162 | 162 | 'html' => 0, |
163 | 163 | 'strip_tags' => 0, |
164 | - ), |
|
165 | - 'empty' => '', |
|
166 | - 'hide_empty' => 0, |
|
167 | - 'empty_zero' => 0, |
|
168 | - 'date_format' => 'custom', |
|
169 | - 'custom_date_format' => 'F d, Y', |
|
170 | - 'exclude' => 0, |
|
171 | - 'id' => 'created', |
|
172 | - 'table' => 'node', |
|
173 | - 'field' => 'created', |
|
174 | - 'override' => array( |
|
164 | + ), |
|
165 | + 'empty' => '', |
|
166 | + 'hide_empty' => 0, |
|
167 | + 'empty_zero' => 0, |
|
168 | + 'date_format' => 'custom', |
|
169 | + 'custom_date_format' => 'F d, Y', |
|
170 | + 'exclude' => 0, |
|
171 | + 'id' => 'created', |
|
172 | + 'table' => 'node', |
|
173 | + 'field' => 'created', |
|
174 | + 'override' => array( |
|
175 | 175 | 'button' => 'Use default', |
176 | - ), |
|
177 | - 'relationship' => 'none', |
|
176 | + ), |
|
177 | + 'relationship' => 'none', |
|
178 | 178 | ), |
179 | 179 | 'name' => array( |
180 | - 'label' => '', |
|
181 | - 'alter' => array( |
|
180 | + 'label' => '', |
|
181 | + 'alter' => array( |
|
182 | 182 | 'alter_text' => 1, |
183 | 183 | 'text' => ' / Posted by [name]', |
184 | 184 | 'make_link' => 0, |
@@ -197,26 +197,26 @@ discard block |
||
197 | 197 | 'ellipsis' => 1, |
198 | 198 | 'html' => 0, |
199 | 199 | 'strip_tags' => 0, |
200 | - ), |
|
201 | - 'empty' => '', |
|
202 | - 'hide_empty' => 0, |
|
203 | - 'empty_zero' => 0, |
|
204 | - 'hide_alter_empty' => 1, |
|
205 | - 'link_to_user' => 0, |
|
206 | - 'overwrite_anonymous' => 0, |
|
207 | - 'anonymous_text' => '', |
|
208 | - 'exclude' => 1, |
|
209 | - 'id' => 'name', |
|
210 | - 'table' => 'users', |
|
211 | - 'field' => 'name', |
|
212 | - 'override' => array( |
|
200 | + ), |
|
201 | + 'empty' => '', |
|
202 | + 'hide_empty' => 0, |
|
203 | + 'empty_zero' => 0, |
|
204 | + 'hide_alter_empty' => 1, |
|
205 | + 'link_to_user' => 0, |
|
206 | + 'overwrite_anonymous' => 0, |
|
207 | + 'anonymous_text' => '', |
|
208 | + 'exclude' => 1, |
|
209 | + 'id' => 'name', |
|
210 | + 'table' => 'users', |
|
211 | + 'field' => 'name', |
|
212 | + 'override' => array( |
|
213 | 213 | 'button' => 'Use default', |
214 | - ), |
|
215 | - 'relationship' => 'none', |
|
214 | + ), |
|
215 | + 'relationship' => 'none', |
|
216 | 216 | ), |
217 | 217 | 'teaser' => array( |
218 | - 'label' => '', |
|
219 | - 'alter' => array( |
|
218 | + 'label' => '', |
|
219 | + 'alter' => array( |
|
220 | 220 | 'alter_text' => 0, |
221 | 221 | 'text' => '', |
222 | 222 | 'make_link' => 0, |
@@ -235,23 +235,23 @@ discard block |
||
235 | 235 | 'ellipsis' => 1, |
236 | 236 | 'html' => 0, |
237 | 237 | 'strip_tags' => 0, |
238 | - ), |
|
239 | - 'empty' => '', |
|
240 | - 'hide_empty' => 0, |
|
241 | - 'empty_zero' => 0, |
|
242 | - 'hide_alter_empty' => 1, |
|
243 | - 'exclude' => 0, |
|
244 | - 'id' => 'teaser', |
|
245 | - 'table' => 'node_revisions', |
|
246 | - 'field' => 'teaser', |
|
247 | - 'override' => array( |
|
238 | + ), |
|
239 | + 'empty' => '', |
|
240 | + 'hide_empty' => 0, |
|
241 | + 'empty_zero' => 0, |
|
242 | + 'hide_alter_empty' => 1, |
|
243 | + 'exclude' => 0, |
|
244 | + 'id' => 'teaser', |
|
245 | + 'table' => 'node_revisions', |
|
246 | + 'field' => 'teaser', |
|
247 | + 'override' => array( |
|
248 | 248 | 'button' => 'Use default', |
249 | - ), |
|
250 | - 'relationship' => 'none', |
|
249 | + ), |
|
250 | + 'relationship' => 'none', |
|
251 | 251 | ), |
252 | 252 | 'view_node' => array( |
253 | - 'label' => '', |
|
254 | - 'alter' => array( |
|
253 | + 'label' => '', |
|
254 | + 'alter' => array( |
|
255 | 255 | 'alter_text' => 0, |
256 | 256 | 'text' => '', |
257 | 257 | 'make_link' => 0, |
@@ -270,24 +270,24 @@ discard block |
||
270 | 270 | 'ellipsis' => 1, |
271 | 271 | 'html' => 0, |
272 | 272 | 'strip_tags' => 0, |
273 | - ), |
|
274 | - 'empty' => '', |
|
275 | - 'hide_empty' => 0, |
|
276 | - 'empty_zero' => 0, |
|
277 | - 'hide_alter_empty' => 1, |
|
278 | - 'text' => 'more', |
|
279 | - 'exclude' => 0, |
|
280 | - 'id' => 'view_node', |
|
281 | - 'table' => 'node', |
|
282 | - 'field' => 'view_node', |
|
283 | - 'override' => array( |
|
273 | + ), |
|
274 | + 'empty' => '', |
|
275 | + 'hide_empty' => 0, |
|
276 | + 'empty_zero' => 0, |
|
277 | + 'hide_alter_empty' => 1, |
|
278 | + 'text' => 'more', |
|
279 | + 'exclude' => 0, |
|
280 | + 'id' => 'view_node', |
|
281 | + 'table' => 'node', |
|
282 | + 'field' => 'view_node', |
|
283 | + 'override' => array( |
|
284 | 284 | 'button' => 'Use default', |
285 | - ), |
|
286 | - 'relationship' => 'none', |
|
285 | + ), |
|
286 | + 'relationship' => 'none', |
|
287 | 287 | ), |
288 | 288 | 'comment_count' => array( |
289 | - 'label' => '', |
|
290 | - 'alter' => array( |
|
289 | + 'label' => '', |
|
290 | + 'alter' => array( |
|
291 | 291 | 'alter_text' => 0, |
292 | 292 | 'text' => '', |
293 | 293 | 'make_link' => 0, |
@@ -306,32 +306,32 @@ discard block |
||
306 | 306 | 'ellipsis' => 1, |
307 | 307 | 'html' => 0, |
308 | 308 | 'strip_tags' => 0, |
309 | - ), |
|
310 | - 'empty' => '0', |
|
311 | - 'hide_empty' => 1, |
|
312 | - 'empty_zero' => 0, |
|
313 | - 'hide_alter_empty' => 0, |
|
314 | - 'set_precision' => FALSE, |
|
315 | - 'precision' => 0, |
|
316 | - 'decimal' => '.', |
|
317 | - 'separator' => '', |
|
318 | - 'format_plural' => 0, |
|
319 | - 'format_plural_singular' => '1', |
|
320 | - 'format_plural_plural' => '@count', |
|
321 | - 'prefix' => '', |
|
322 | - 'suffix' => '', |
|
323 | - 'exclude' => 0, |
|
324 | - 'id' => 'comment_count', |
|
325 | - 'table' => 'node_comment_statistics', |
|
326 | - 'field' => 'comment_count', |
|
327 | - 'override' => array( |
|
309 | + ), |
|
310 | + 'empty' => '0', |
|
311 | + 'hide_empty' => 1, |
|
312 | + 'empty_zero' => 0, |
|
313 | + 'hide_alter_empty' => 0, |
|
314 | + 'set_precision' => FALSE, |
|
315 | + 'precision' => 0, |
|
316 | + 'decimal' => '.', |
|
317 | + 'separator' => '', |
|
318 | + 'format_plural' => 0, |
|
319 | + 'format_plural_singular' => '1', |
|
320 | + 'format_plural_plural' => '@count', |
|
321 | + 'prefix' => '', |
|
322 | + 'suffix' => '', |
|
323 | + 'exclude' => 0, |
|
324 | + 'id' => 'comment_count', |
|
325 | + 'table' => 'node_comment_statistics', |
|
326 | + 'field' => 'comment_count', |
|
327 | + 'override' => array( |
|
328 | 328 | 'button' => 'Use default', |
329 | - ), |
|
330 | - 'relationship' => 'none', |
|
329 | + ), |
|
330 | + 'relationship' => 'none', |
|
331 | 331 | ), |
332 | 332 | 'nothing' => array( |
333 | - 'label' => '', |
|
334 | - 'alter' => array( |
|
333 | + 'label' => '', |
|
334 | + 'alter' => array( |
|
335 | 335 | 'text' => '<div class="clearfix"></div>', |
336 | 336 | 'make_link' => 0, |
337 | 337 | 'path' => '', |
@@ -347,210 +347,210 @@ discard block |
||
347 | 347 | 'ellipsis' => 1, |
348 | 348 | 'html' => 0, |
349 | 349 | 'strip_tags' => 0, |
350 | - ), |
|
351 | - 'empty' => '', |
|
352 | - 'hide_empty' => 0, |
|
353 | - 'empty_zero' => 0, |
|
354 | - 'exclude' => 0, |
|
355 | - 'id' => 'nothing', |
|
356 | - 'table' => 'views', |
|
357 | - 'field' => 'nothing', |
|
358 | - 'override' => array( |
|
350 | + ), |
|
351 | + 'empty' => '', |
|
352 | + 'hide_empty' => 0, |
|
353 | + 'empty_zero' => 0, |
|
354 | + 'exclude' => 0, |
|
355 | + 'id' => 'nothing', |
|
356 | + 'table' => 'views', |
|
357 | + 'field' => 'nothing', |
|
358 | + 'override' => array( |
|
359 | 359 | 'button' => 'Use default', |
360 | - ), |
|
361 | - 'relationship' => 'none', |
|
362 | - ), |
|
363 | - )); |
|
364 | - $handler->override_option('title', 'News'); |
|
365 | - $handler->override_option('row_plugin', 'fields'); |
|
366 | - $handler->override_option('path', 'news'); |
|
367 | - $handler->override_option('menu', array( |
|
360 | + ), |
|
361 | + 'relationship' => 'none', |
|
362 | + ), |
|
363 | + )); |
|
364 | + $handler->override_option('title', 'News'); |
|
365 | + $handler->override_option('row_plugin', 'fields'); |
|
366 | + $handler->override_option('path', 'news'); |
|
367 | + $handler->override_option('menu', array( |
|
368 | 368 | 'type' => 'normal', |
369 | 369 | 'title' => 'News', |
370 | 370 | 'description' => '', |
371 | 371 | 'weight' => '0', |
372 | 372 | 'name' => 'navigation', |
373 | - )); |
|
374 | - $handler->override_option('tab_options', array( |
|
373 | + )); |
|
374 | + $handler->override_option('tab_options', array( |
|
375 | 375 | 'type' => 'none', |
376 | 376 | 'title' => '', |
377 | 377 | 'description' => '', |
378 | 378 | 'weight' => 0, |
379 | 379 | 'name' => 'navigation', |
380 | - )); |
|
381 | - $handler = $view->new_display('feed', 'Feed', 'feed_1'); |
|
382 | - $handler->override_option('arguments', array( |
|
380 | + )); |
|
381 | + $handler = $view->new_display('feed', 'Feed', 'feed_1'); |
|
382 | + $handler->override_option('arguments', array( |
|
383 | 383 | 'null' => array( |
384 | - 'default_action' => 'default', |
|
385 | - 'style_plugin' => 'default_summary', |
|
386 | - 'style_options' => array(), |
|
387 | - 'wildcard' => 'all', |
|
388 | - 'wildcard_substitution' => 'All', |
|
389 | - 'title' => '%1 | News', |
|
390 | - 'breadcrumb' => '', |
|
391 | - 'default_argument_type' => 'php', |
|
392 | - 'default_argument' => '', |
|
393 | - 'validate_type' => 'none', |
|
394 | - 'validate_fail' => 'not found', |
|
395 | - 'must_not_be' => 0, |
|
396 | - 'id' => 'null', |
|
397 | - 'table' => 'views', |
|
398 | - 'field' => 'null', |
|
399 | - 'validate_user_argument_type' => 'uid', |
|
400 | - 'validate_user_roles' => array( |
|
384 | + 'default_action' => 'default', |
|
385 | + 'style_plugin' => 'default_summary', |
|
386 | + 'style_options' => array(), |
|
387 | + 'wildcard' => 'all', |
|
388 | + 'wildcard_substitution' => 'All', |
|
389 | + 'title' => '%1 | News', |
|
390 | + 'breadcrumb' => '', |
|
391 | + 'default_argument_type' => 'php', |
|
392 | + 'default_argument' => '', |
|
393 | + 'validate_type' => 'none', |
|
394 | + 'validate_fail' => 'not found', |
|
395 | + 'must_not_be' => 0, |
|
396 | + 'id' => 'null', |
|
397 | + 'table' => 'views', |
|
398 | + 'field' => 'null', |
|
399 | + 'validate_user_argument_type' => 'uid', |
|
400 | + 'validate_user_roles' => array( |
|
401 | 401 | 2 => 0, |
402 | 402 | 4 => 0, |
403 | 403 | 7 => 0, |
404 | 404 | 5 => 0, |
405 | 405 | 3 => 0, |
406 | 406 | 6 => 0, |
407 | - ), |
|
408 | - 'me_redirect' => 0, |
|
409 | - 'me_validate_user_argument_type' => 'uid', |
|
410 | - 'me_validate_user_roles' => array( |
|
407 | + ), |
|
408 | + 'me_redirect' => 0, |
|
409 | + 'me_validate_user_argument_type' => 'uid', |
|
410 | + 'me_validate_user_roles' => array( |
|
411 | 411 | 2 => 0, |
412 | 412 | 4 => 0, |
413 | 413 | 7 => 0, |
414 | 414 | 5 => 0, |
415 | 415 | 3 => 0, |
416 | 416 | 6 => 0, |
417 | - ), |
|
418 | - 'override' => array( |
|
417 | + ), |
|
418 | + 'override' => array( |
|
419 | 419 | 'button' => 'Use default', |
420 | - ), |
|
421 | - 'relationship' => 'none', |
|
422 | - 'default_options_div_prefix' => '', |
|
423 | - 'default_taxonomy_tid_term_page' => 0, |
|
424 | - 'default_taxonomy_tid_node' => 0, |
|
425 | - 'default_taxonomy_tid_limit' => 0, |
|
426 | - 'default_taxonomy_tid_vids' => array( |
|
420 | + ), |
|
421 | + 'relationship' => 'none', |
|
422 | + 'default_options_div_prefix' => '', |
|
423 | + 'default_taxonomy_tid_term_page' => 0, |
|
424 | + 'default_taxonomy_tid_node' => 0, |
|
425 | + 'default_taxonomy_tid_limit' => 0, |
|
426 | + 'default_taxonomy_tid_vids' => array( |
|
427 | 427 | 1 => 0, |
428 | 428 | 2 => 0, |
429 | - ), |
|
430 | - 'default_argument_user' => 0, |
|
431 | - 'default_argument_fixed' => '', |
|
432 | - 'default_argument_php' => '// Use this to set a custom feed title that works both in the feed and |
|
429 | + ), |
|
430 | + 'default_argument_user' => 0, |
|
431 | + 'default_argument_fixed' => '', |
|
432 | + 'default_argument_php' => '// Use this to set a custom feed title that works both in the feed and |
|
433 | 433 | // in the auto discovery link in the page header |
434 | 434 | return variable_get(\'site_name\', \'Drupal-BOINC\'); |
435 | 435 | ', |
436 | - 'validate_argument_node_type' => array( |
|
436 | + 'validate_argument_node_type' => array( |
|
437 | 437 | 'page' => 0, |
438 | 438 | 'news' => 0, |
439 | 439 | 'profile' => 0, |
440 | 440 | 'forum' => 0, |
441 | 441 | 'panel' => 0, |
442 | 442 | 'story' => 0, |
443 | - ), |
|
444 | - 'validate_argument_node_access' => 0, |
|
445 | - 'validate_argument_nid_type' => 'nid', |
|
446 | - 'validate_argument_vocabulary' => array( |
|
443 | + ), |
|
444 | + 'validate_argument_node_access' => 0, |
|
445 | + 'validate_argument_nid_type' => 'nid', |
|
446 | + 'validate_argument_vocabulary' => array( |
|
447 | 447 | 1 => 0, |
448 | 448 | 2 => 0, |
449 | - ), |
|
450 | - 'validate_argument_type' => 'tid', |
|
451 | - 'validate_argument_transform' => 0, |
|
452 | - 'validate_user_restrict_roles' => 0, |
|
453 | - 'validate_argument_node_flag_name' => '*relationship*', |
|
454 | - 'validate_argument_node_flag_test' => 'flaggable', |
|
455 | - 'validate_argument_node_flag_id_type' => 'id', |
|
456 | - 'validate_argument_user_flag_name' => '*relationship*', |
|
457 | - 'validate_argument_user_flag_test' => 'flaggable', |
|
458 | - 'validate_argument_user_flag_id_type' => 'id', |
|
459 | - 'validate_argument_php' => '', |
|
460 | - 'me_validate_user_restrict_roles' => 0, |
|
461 | - ), |
|
462 | - )); |
|
463 | - $handler->override_option('filters', array( |
|
449 | + ), |
|
450 | + 'validate_argument_type' => 'tid', |
|
451 | + 'validate_argument_transform' => 0, |
|
452 | + 'validate_user_restrict_roles' => 0, |
|
453 | + 'validate_argument_node_flag_name' => '*relationship*', |
|
454 | + 'validate_argument_node_flag_test' => 'flaggable', |
|
455 | + 'validate_argument_node_flag_id_type' => 'id', |
|
456 | + 'validate_argument_user_flag_name' => '*relationship*', |
|
457 | + 'validate_argument_user_flag_test' => 'flaggable', |
|
458 | + 'validate_argument_user_flag_id_type' => 'id', |
|
459 | + 'validate_argument_php' => '', |
|
460 | + 'me_validate_user_restrict_roles' => 0, |
|
461 | + ), |
|
462 | + )); |
|
463 | + $handler->override_option('filters', array( |
|
464 | 464 | 'type' => array( |
465 | - 'operator' => 'in', |
|
466 | - 'value' => array( |
|
465 | + 'operator' => 'in', |
|
466 | + 'value' => array( |
|
467 | 467 | 'news' => 'news', |
468 | - ), |
|
469 | - 'group' => '0', |
|
470 | - 'exposed' => FALSE, |
|
471 | - 'expose' => array( |
|
468 | + ), |
|
469 | + 'group' => '0', |
|
470 | + 'exposed' => FALSE, |
|
471 | + 'expose' => array( |
|
472 | 472 | 'operator' => FALSE, |
473 | 473 | 'label' => '', |
474 | - ), |
|
475 | - 'id' => 'type', |
|
476 | - 'table' => 'node', |
|
477 | - 'field' => 'type', |
|
478 | - 'relationship' => 'none', |
|
474 | + ), |
|
475 | + 'id' => 'type', |
|
476 | + 'table' => 'node', |
|
477 | + 'field' => 'type', |
|
478 | + 'relationship' => 'none', |
|
479 | 479 | ), |
480 | 480 | 'status' => array( |
481 | - 'operator' => '=', |
|
482 | - 'value' => '1', |
|
483 | - 'group' => '0', |
|
484 | - 'exposed' => FALSE, |
|
485 | - 'expose' => array( |
|
481 | + 'operator' => '=', |
|
482 | + 'value' => '1', |
|
483 | + 'group' => '0', |
|
484 | + 'exposed' => FALSE, |
|
485 | + 'expose' => array( |
|
486 | 486 | 'operator' => FALSE, |
487 | 487 | 'label' => '', |
488 | - ), |
|
489 | - 'id' => 'status', |
|
490 | - 'table' => 'node', |
|
491 | - 'field' => 'status', |
|
492 | - 'relationship' => 'none', |
|
488 | + ), |
|
489 | + 'id' => 'status', |
|
490 | + 'table' => 'node', |
|
491 | + 'field' => 'status', |
|
492 | + 'relationship' => 'none', |
|
493 | 493 | ), |
494 | 494 | 'changed' => array( |
495 | - 'operator' => '>=', |
|
496 | - 'value' => array( |
|
495 | + 'operator' => '>=', |
|
496 | + 'value' => array( |
|
497 | 497 | 'type' => 'offset', |
498 | 498 | 'value' => '-90 days', |
499 | 499 | 'min' => '', |
500 | 500 | 'max' => '', |
501 | - ), |
|
502 | - 'group' => '0', |
|
503 | - 'exposed' => FALSE, |
|
504 | - 'expose' => array( |
|
501 | + ), |
|
502 | + 'group' => '0', |
|
503 | + 'exposed' => FALSE, |
|
504 | + 'expose' => array( |
|
505 | 505 | 'operator' => FALSE, |
506 | 506 | 'label' => '', |
507 | - ), |
|
508 | - 'id' => 'changed', |
|
509 | - 'table' => 'node', |
|
510 | - 'field' => 'changed', |
|
511 | - 'override' => array( |
|
507 | + ), |
|
508 | + 'id' => 'changed', |
|
509 | + 'table' => 'node', |
|
510 | + 'field' => 'changed', |
|
511 | + 'override' => array( |
|
512 | 512 | 'button' => 'Use default', |
513 | - ), |
|
514 | - 'relationship' => 'none', |
|
513 | + ), |
|
514 | + 'relationship' => 'none', |
|
515 | 515 | ), |
516 | - )); |
|
517 | - $handler->override_option('style_plugin', 'rss'); |
|
518 | - $handler->override_option('style_options', array( |
|
516 | + )); |
|
517 | + $handler->override_option('style_plugin', 'rss'); |
|
518 | + $handler->override_option('style_options', array( |
|
519 | 519 | 'mission_description' => FALSE, |
520 | 520 | 'description' => '', |
521 | - )); |
|
522 | - $handler->override_option('row_plugin', 'node_rss'); |
|
523 | - $handler->override_option('row_options', array( |
|
521 | + )); |
|
522 | + $handler->override_option('row_plugin', 'node_rss'); |
|
523 | + $handler->override_option('row_options', array( |
|
524 | 524 | 'relationship' => 'none', |
525 | 525 | 'item_length' => 'default', |
526 | - )); |
|
527 | - $handler->override_option('path', 'rss_main.php'); |
|
528 | - $handler->override_option('menu', array( |
|
526 | + )); |
|
527 | + $handler->override_option('path', 'rss_main.php'); |
|
528 | + $handler->override_option('menu', array( |
|
529 | 529 | 'type' => 'none', |
530 | 530 | 'title' => '', |
531 | 531 | 'description' => '', |
532 | 532 | 'weight' => 0, |
533 | 533 | 'name' => 'primary-links', |
534 | - )); |
|
535 | - $handler->override_option('tab_options', array( |
|
534 | + )); |
|
535 | + $handler->override_option('tab_options', array( |
|
536 | 536 | 'type' => 'none', |
537 | 537 | 'title' => '', |
538 | 538 | 'description' => '', |
539 | 539 | 'weight' => 0, |
540 | 540 | 'name' => 'navigation', |
541 | - )); |
|
542 | - $handler->override_option('displays', array( |
|
541 | + )); |
|
542 | + $handler->override_option('displays', array( |
|
543 | 543 | 'page_1' => 'page_1', |
544 | 544 | 'page_2' => 'page_2', |
545 | 545 | 'default' => 0, |
546 | - )); |
|
547 | - $handler->override_option('sitename_title', FALSE); |
|
548 | - $handler = $view->new_display('page', 'Short blurbs', 'page_2'); |
|
549 | - $handler->override_option('relationships', array()); |
|
550 | - $handler->override_option('fields', array( |
|
546 | + )); |
|
547 | + $handler->override_option('sitename_title', FALSE); |
|
548 | + $handler = $view->new_display('page', 'Short blurbs', 'page_2'); |
|
549 | + $handler->override_option('relationships', array()); |
|
550 | + $handler->override_option('fields', array( |
|
551 | 551 | 'nid' => array( |
552 | - 'label' => 'Nid', |
|
553 | - 'alter' => array( |
|
552 | + 'label' => 'Nid', |
|
553 | + 'alter' => array( |
|
554 | 554 | 'alter_text' => 0, |
555 | 555 | 'text' => '', |
556 | 556 | 'make_link' => 0, |
@@ -569,24 +569,24 @@ discard block |
||
569 | 569 | 'ellipsis' => 1, |
570 | 570 | 'html' => 0, |
571 | 571 | 'strip_tags' => 0, |
572 | - ), |
|
573 | - 'empty' => '', |
|
574 | - 'hide_empty' => 0, |
|
575 | - 'empty_zero' => 0, |
|
576 | - 'hide_alter_empty' => 1, |
|
577 | - 'link_to_node' => 0, |
|
578 | - 'exclude' => 1, |
|
579 | - 'id' => 'nid', |
|
580 | - 'table' => 'node', |
|
581 | - 'field' => 'nid', |
|
582 | - 'override' => array( |
|
572 | + ), |
|
573 | + 'empty' => '', |
|
574 | + 'hide_empty' => 0, |
|
575 | + 'empty_zero' => 0, |
|
576 | + 'hide_alter_empty' => 1, |
|
577 | + 'link_to_node' => 0, |
|
578 | + 'exclude' => 1, |
|
579 | + 'id' => 'nid', |
|
580 | + 'table' => 'node', |
|
581 | + 'field' => 'nid', |
|
582 | + 'override' => array( |
|
583 | 583 | 'button' => 'Use default', |
584 | - ), |
|
585 | - 'relationship' => 'none', |
|
584 | + ), |
|
585 | + 'relationship' => 'none', |
|
586 | 586 | ), |
587 | 587 | 'comment' => array( |
588 | - 'label' => 'Comment status', |
|
589 | - 'alter' => array( |
|
588 | + 'label' => 'Comment status', |
|
589 | + 'alter' => array( |
|
590 | 590 | 'alter_text' => 0, |
591 | 591 | 'text' => '', |
592 | 592 | 'make_link' => 0, |
@@ -605,23 +605,23 @@ discard block |
||
605 | 605 | 'ellipsis' => 1, |
606 | 606 | 'html' => 0, |
607 | 607 | 'strip_tags' => 0, |
608 | - ), |
|
609 | - 'empty' => '', |
|
610 | - 'hide_empty' => 0, |
|
611 | - 'empty_zero' => 0, |
|
612 | - 'hide_alter_empty' => 1, |
|
613 | - 'exclude' => 1, |
|
614 | - 'id' => 'comment', |
|
615 | - 'table' => 'node', |
|
616 | - 'field' => 'comment', |
|
617 | - 'override' => array( |
|
608 | + ), |
|
609 | + 'empty' => '', |
|
610 | + 'hide_empty' => 0, |
|
611 | + 'empty_zero' => 0, |
|
612 | + 'hide_alter_empty' => 1, |
|
613 | + 'exclude' => 1, |
|
614 | + 'id' => 'comment', |
|
615 | + 'table' => 'node', |
|
616 | + 'field' => 'comment', |
|
617 | + 'override' => array( |
|
618 | 618 | 'button' => 'Use default', |
619 | - ), |
|
620 | - 'relationship' => 'none', |
|
619 | + ), |
|
620 | + 'relationship' => 'none', |
|
621 | 621 | ), |
622 | 622 | 'title' => array( |
623 | - 'label' => '', |
|
624 | - 'alter' => array( |
|
623 | + 'label' => '', |
|
624 | + 'alter' => array( |
|
625 | 625 | 'alter_text' => 1, |
626 | 626 | 'text' => '<h2>[title]</h2>', |
627 | 627 | 'make_link' => 0, |
@@ -638,23 +638,23 @@ discard block |
||
638 | 638 | 'ellipsis' => 1, |
639 | 639 | 'html' => 0, |
640 | 640 | 'strip_tags' => 0, |
641 | - ), |
|
642 | - 'empty' => '', |
|
643 | - 'hide_empty' => 0, |
|
644 | - 'empty_zero' => 0, |
|
645 | - 'link_to_node' => 0, |
|
646 | - 'exclude' => 0, |
|
647 | - 'id' => 'title', |
|
648 | - 'table' => 'node', |
|
649 | - 'field' => 'title', |
|
650 | - 'override' => array( |
|
641 | + ), |
|
642 | + 'empty' => '', |
|
643 | + 'hide_empty' => 0, |
|
644 | + 'empty_zero' => 0, |
|
645 | + 'link_to_node' => 0, |
|
646 | + 'exclude' => 0, |
|
647 | + 'id' => 'title', |
|
648 | + 'table' => 'node', |
|
649 | + 'field' => 'title', |
|
650 | + 'override' => array( |
|
651 | 651 | 'button' => 'Use default', |
652 | - ), |
|
653 | - 'relationship' => 'none', |
|
652 | + ), |
|
653 | + 'relationship' => 'none', |
|
654 | 654 | ), |
655 | 655 | 'created' => array( |
656 | - 'label' => '', |
|
657 | - 'alter' => array( |
|
656 | + 'label' => '', |
|
657 | + 'alter' => array( |
|
658 | 658 | 'alter_text' => 0, |
659 | 659 | 'text' => '', |
660 | 660 | 'make_link' => 0, |
@@ -671,24 +671,24 @@ discard block |
||
671 | 671 | 'ellipsis' => 1, |
672 | 672 | 'html' => 0, |
673 | 673 | 'strip_tags' => 0, |
674 | - ), |
|
675 | - 'empty' => '', |
|
676 | - 'hide_empty' => 0, |
|
677 | - 'empty_zero' => 0, |
|
678 | - 'date_format' => 'custom', |
|
679 | - 'custom_date_format' => 'F d, Y', |
|
680 | - 'exclude' => 0, |
|
681 | - 'id' => 'created', |
|
682 | - 'table' => 'node', |
|
683 | - 'field' => 'created', |
|
684 | - 'override' => array( |
|
674 | + ), |
|
675 | + 'empty' => '', |
|
676 | + 'hide_empty' => 0, |
|
677 | + 'empty_zero' => 0, |
|
678 | + 'date_format' => 'custom', |
|
679 | + 'custom_date_format' => 'F d, Y', |
|
680 | + 'exclude' => 0, |
|
681 | + 'id' => 'created', |
|
682 | + 'table' => 'node', |
|
683 | + 'field' => 'created', |
|
684 | + 'override' => array( |
|
685 | 685 | 'button' => 'Use default', |
686 | - ), |
|
687 | - 'relationship' => 'none', |
|
686 | + ), |
|
687 | + 'relationship' => 'none', |
|
688 | 688 | ), |
689 | 689 | 'teaser' => array( |
690 | - 'label' => '', |
|
691 | - 'alter' => array( |
|
690 | + 'label' => '', |
|
691 | + 'alter' => array( |
|
692 | 692 | 'alter_text' => 0, |
693 | 693 | 'text' => '', |
694 | 694 | 'make_link' => 0, |
@@ -707,23 +707,23 @@ discard block |
||
707 | 707 | 'ellipsis' => 1, |
708 | 708 | 'html' => 0, |
709 | 709 | 'strip_tags' => 0, |
710 | - ), |
|
711 | - 'empty' => '', |
|
712 | - 'hide_empty' => 0, |
|
713 | - 'empty_zero' => 0, |
|
714 | - 'hide_alter_empty' => 1, |
|
715 | - 'exclude' => 0, |
|
716 | - 'id' => 'teaser', |
|
717 | - 'table' => 'node_revisions', |
|
718 | - 'field' => 'teaser', |
|
719 | - 'override' => array( |
|
710 | + ), |
|
711 | + 'empty' => '', |
|
712 | + 'hide_empty' => 0, |
|
713 | + 'empty_zero' => 0, |
|
714 | + 'hide_alter_empty' => 1, |
|
715 | + 'exclude' => 0, |
|
716 | + 'id' => 'teaser', |
|
717 | + 'table' => 'node_revisions', |
|
718 | + 'field' => 'teaser', |
|
719 | + 'override' => array( |
|
720 | 720 | 'button' => 'Use default', |
721 | - ), |
|
722 | - 'relationship' => 'none', |
|
721 | + ), |
|
722 | + 'relationship' => 'none', |
|
723 | 723 | ), |
724 | 724 | 'view_node_1' => array( |
725 | - 'label' => '', |
|
726 | - 'alter' => array( |
|
725 | + 'label' => '', |
|
726 | + 'alter' => array( |
|
727 | 727 | 'alter_text' => 0, |
728 | 728 | 'text' => '', |
729 | 729 | 'make_link' => 0, |
@@ -742,24 +742,24 @@ discard block |
||
742 | 742 | 'ellipsis' => 1, |
743 | 743 | 'html' => 0, |
744 | 744 | 'strip_tags' => 0, |
745 | - ), |
|
746 | - 'empty' => '', |
|
747 | - 'hide_empty' => 0, |
|
748 | - 'empty_zero' => 0, |
|
749 | - 'hide_alter_empty' => 1, |
|
750 | - 'text' => 'more', |
|
751 | - 'exclude' => 0, |
|
752 | - 'id' => 'view_node_1', |
|
753 | - 'table' => 'node', |
|
754 | - 'field' => 'view_node', |
|
755 | - 'override' => array( |
|
745 | + ), |
|
746 | + 'empty' => '', |
|
747 | + 'hide_empty' => 0, |
|
748 | + 'empty_zero' => 0, |
|
749 | + 'hide_alter_empty' => 1, |
|
750 | + 'text' => 'more', |
|
751 | + 'exclude' => 0, |
|
752 | + 'id' => 'view_node_1', |
|
753 | + 'table' => 'node', |
|
754 | + 'field' => 'view_node', |
|
755 | + 'override' => array( |
|
756 | 756 | 'button' => 'Use default', |
757 | - ), |
|
758 | - 'relationship' => 'none', |
|
757 | + ), |
|
758 | + 'relationship' => 'none', |
|
759 | 759 | ), |
760 | 760 | 'phpcode' => array( |
761 | - 'label' => '', |
|
762 | - 'alter' => array( |
|
761 | + 'label' => '', |
|
762 | + 'alter' => array( |
|
763 | 763 | 'alter_text' => 0, |
764 | 764 | 'text' => '', |
765 | 765 | 'make_link' => 0, |
@@ -778,30 +778,30 @@ discard block |
||
778 | 778 | 'ellipsis' => 1, |
779 | 779 | 'html' => 0, |
780 | 780 | 'strip_tags' => 0, |
781 | - ), |
|
782 | - 'empty' => '', |
|
783 | - 'hide_empty' => 0, |
|
784 | - 'empty_zero' => 0, |
|
785 | - 'hide_alter_empty' => 1, |
|
786 | - 'value' => '<?php |
|
781 | + ), |
|
782 | + 'empty' => '', |
|
783 | + 'hide_empty' => 0, |
|
784 | + 'empty_zero' => 0, |
|
785 | + 'hide_alter_empty' => 1, |
|
786 | + 'value' => '<?php |
|
787 | 787 | if ($data->node_comment == COMMENT_NODE_READ_WRITE) { |
788 | 788 | $cid = boincuser_get_first_unread_comment_id($data->nid); |
789 | 789 | $link = ($cid) ? "goto/comment/{$cid}" : "node/{$data->nid}"; |
790 | 790 | return l(bts(\'discuss\', array(), NULL, \'boinc:front-page-discuss-news\'), $link); |
791 | 791 | } |
792 | 792 | ?>', |
793 | - 'exclude' => 0, |
|
794 | - 'id' => 'phpcode', |
|
795 | - 'table' => 'customfield', |
|
796 | - 'field' => 'phpcode', |
|
797 | - 'override' => array( |
|
793 | + 'exclude' => 0, |
|
794 | + 'id' => 'phpcode', |
|
795 | + 'table' => 'customfield', |
|
796 | + 'field' => 'phpcode', |
|
797 | + 'override' => array( |
|
798 | 798 | 'button' => 'Use default', |
799 | - ), |
|
800 | - 'relationship' => 'none', |
|
799 | + ), |
|
800 | + 'relationship' => 'none', |
|
801 | 801 | ), |
802 | 802 | 'comment_count' => array( |
803 | - 'label' => '', |
|
804 | - 'alter' => array( |
|
803 | + 'label' => '', |
|
804 | + 'alter' => array( |
|
805 | 805 | 'alter_text' => 0, |
806 | 806 | 'text' => '', |
807 | 807 | 'make_link' => 0, |
@@ -820,32 +820,32 @@ discard block |
||
820 | 820 | 'ellipsis' => 1, |
821 | 821 | 'html' => 0, |
822 | 822 | 'strip_tags' => 0, |
823 | - ), |
|
824 | - 'empty' => '0', |
|
825 | - 'hide_empty' => 1, |
|
826 | - 'empty_zero' => 0, |
|
827 | - 'hide_alter_empty' => 0, |
|
828 | - 'set_precision' => FALSE, |
|
829 | - 'precision' => 0, |
|
830 | - 'decimal' => '.', |
|
831 | - 'separator' => '', |
|
832 | - 'format_plural' => 0, |
|
833 | - 'format_plural_singular' => '1', |
|
834 | - 'format_plural_plural' => '@count', |
|
835 | - 'prefix' => '', |
|
836 | - 'suffix' => '', |
|
837 | - 'exclude' => 0, |
|
838 | - 'id' => 'comment_count', |
|
839 | - 'table' => 'node_comment_statistics', |
|
840 | - 'field' => 'comment_count', |
|
841 | - 'override' => array( |
|
823 | + ), |
|
824 | + 'empty' => '0', |
|
825 | + 'hide_empty' => 1, |
|
826 | + 'empty_zero' => 0, |
|
827 | + 'hide_alter_empty' => 0, |
|
828 | + 'set_precision' => FALSE, |
|
829 | + 'precision' => 0, |
|
830 | + 'decimal' => '.', |
|
831 | + 'separator' => '', |
|
832 | + 'format_plural' => 0, |
|
833 | + 'format_plural_singular' => '1', |
|
834 | + 'format_plural_plural' => '@count', |
|
835 | + 'prefix' => '', |
|
836 | + 'suffix' => '', |
|
837 | + 'exclude' => 0, |
|
838 | + 'id' => 'comment_count', |
|
839 | + 'table' => 'node_comment_statistics', |
|
840 | + 'field' => 'comment_count', |
|
841 | + 'override' => array( |
|
842 | 842 | 'button' => 'Use default', |
843 | - ), |
|
844 | - 'relationship' => 'none', |
|
843 | + ), |
|
844 | + 'relationship' => 'none', |
|
845 | 845 | ), |
846 | 846 | 'nothing' => array( |
847 | - 'label' => '', |
|
848 | - 'alter' => array( |
|
847 | + 'label' => '', |
|
848 | + 'alter' => array( |
|
849 | 849 | 'text' => '<div class="clearfix"></div>', |
850 | 850 | 'make_link' => 0, |
851 | 851 | 'path' => '', |
@@ -861,88 +861,88 @@ discard block |
||
861 | 861 | 'ellipsis' => 1, |
862 | 862 | 'html' => 0, |
863 | 863 | 'strip_tags' => 0, |
864 | - ), |
|
865 | - 'empty' => '', |
|
866 | - 'hide_empty' => 0, |
|
867 | - 'empty_zero' => 0, |
|
868 | - 'exclude' => 0, |
|
869 | - 'id' => 'nothing', |
|
870 | - 'table' => 'views', |
|
871 | - 'field' => 'nothing', |
|
872 | - 'override' => array( |
|
864 | + ), |
|
865 | + 'empty' => '', |
|
866 | + 'hide_empty' => 0, |
|
867 | + 'empty_zero' => 0, |
|
868 | + 'exclude' => 0, |
|
869 | + 'id' => 'nothing', |
|
870 | + 'table' => 'views', |
|
871 | + 'field' => 'nothing', |
|
872 | + 'override' => array( |
|
873 | 873 | 'button' => 'Use default', |
874 | - ), |
|
875 | - 'relationship' => 'none', |
|
874 | + ), |
|
875 | + 'relationship' => 'none', |
|
876 | 876 | ), |
877 | - )); |
|
878 | - $handler->override_option('filters', array( |
|
877 | + )); |
|
878 | + $handler->override_option('filters', array( |
|
879 | 879 | 'type' => array( |
880 | - 'operator' => 'in', |
|
881 | - 'value' => array( |
|
880 | + 'operator' => 'in', |
|
881 | + 'value' => array( |
|
882 | 882 | 'news' => 'news', |
883 | - ), |
|
884 | - 'group' => '0', |
|
885 | - 'exposed' => FALSE, |
|
886 | - 'expose' => array( |
|
883 | + ), |
|
884 | + 'group' => '0', |
|
885 | + 'exposed' => FALSE, |
|
886 | + 'expose' => array( |
|
887 | 887 | 'operator' => FALSE, |
888 | 888 | 'label' => '', |
889 | - ), |
|
890 | - 'id' => 'type', |
|
891 | - 'table' => 'node', |
|
892 | - 'field' => 'type', |
|
893 | - 'relationship' => 'none', |
|
889 | + ), |
|
890 | + 'id' => 'type', |
|
891 | + 'table' => 'node', |
|
892 | + 'field' => 'type', |
|
893 | + 'relationship' => 'none', |
|
894 | 894 | ), |
895 | 895 | 'status' => array( |
896 | - 'operator' => '=', |
|
897 | - 'value' => '1', |
|
898 | - 'group' => '0', |
|
899 | - 'exposed' => FALSE, |
|
900 | - 'expose' => array( |
|
896 | + 'operator' => '=', |
|
897 | + 'value' => '1', |
|
898 | + 'group' => '0', |
|
899 | + 'exposed' => FALSE, |
|
900 | + 'expose' => array( |
|
901 | 901 | 'operator' => FALSE, |
902 | 902 | 'label' => '', |
903 | - ), |
|
904 | - 'id' => 'status', |
|
905 | - 'table' => 'node', |
|
906 | - 'field' => 'status', |
|
907 | - 'relationship' => 'none', |
|
903 | + ), |
|
904 | + 'id' => 'status', |
|
905 | + 'table' => 'node', |
|
906 | + 'field' => 'status', |
|
907 | + 'relationship' => 'none', |
|
908 | 908 | ), |
909 | 909 | 'promote' => array( |
910 | - 'operator' => '=', |
|
911 | - 'value' => '1', |
|
912 | - 'group' => '0', |
|
913 | - 'exposed' => FALSE, |
|
914 | - 'expose' => array( |
|
910 | + 'operator' => '=', |
|
911 | + 'value' => '1', |
|
912 | + 'group' => '0', |
|
913 | + 'exposed' => FALSE, |
|
914 | + 'expose' => array( |
|
915 | 915 | 'operator' => FALSE, |
916 | 916 | 'label' => '', |
917 | - ), |
|
918 | - 'id' => 'promote', |
|
919 | - 'table' => 'node', |
|
920 | - 'field' => 'promote', |
|
921 | - 'override' => array( |
|
917 | + ), |
|
918 | + 'id' => 'promote', |
|
919 | + 'table' => 'node', |
|
920 | + 'field' => 'promote', |
|
921 | + 'override' => array( |
|
922 | 922 | 'button' => 'Use default', |
923 | - ), |
|
924 | - 'relationship' => 'none', |
|
925 | - ), |
|
926 | - )); |
|
927 | - $handler->override_option('title', 'News'); |
|
928 | - $handler->override_option('row_plugin', 'fields'); |
|
929 | - $handler->override_option('path', 'news'); |
|
930 | - $handler->override_option('menu', array( |
|
923 | + ), |
|
924 | + 'relationship' => 'none', |
|
925 | + ), |
|
926 | + )); |
|
927 | + $handler->override_option('title', 'News'); |
|
928 | + $handler->override_option('row_plugin', 'fields'); |
|
929 | + $handler->override_option('path', 'news'); |
|
930 | + $handler->override_option('menu', array( |
|
931 | 931 | 'type' => 'default tab', |
932 | 932 | 'title' => 'News', |
933 | 933 | 'description' => '', |
934 | 934 | 'weight' => '0', |
935 | 935 | 'name' => 'navigation', |
936 | - )); |
|
937 | - $handler->override_option('tab_options', array( |
|
936 | + )); |
|
937 | + $handler->override_option('tab_options', array( |
|
938 | 938 | 'type' => 'none', |
939 | 939 | 'title' => '', |
940 | 940 | 'description' => '', |
941 | 941 | 'weight' => 0, |
942 | 942 | 'name' => 'navigation', |
943 | - )); |
|
943 | + )); |
|
944 | 944 | |
945 | - $views[$view->name] = $view; |
|
945 | + $views[$view->name] = $view; |
|
946 | 946 | |
947 | - return $views; |
|
947 | + return $views; |
|
948 | 948 | } |
@@ -626,13 +626,13 @@ discard block |
||
626 | 626 | $sender = user_load($sender->uid); |
627 | 627 | |
628 | 628 | switch ($status) { |
629 | - case FLAG_FRIEND_FLAGGED: |
|
630 | - // Sender accepted recipient's friend request |
|
631 | - $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
632 | - '!name' => $sender->boincuser_name, |
|
633 | - '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
634 | - ), NULL, 'boinc:friend-request-email'); |
|
635 | - $email['body'] = bts('!name confirmed you as a friend on !site. |
|
629 | + case FLAG_FRIEND_FLAGGED: |
|
630 | + // Sender accepted recipient's friend request |
|
631 | + $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
632 | + '!name' => $sender->boincuser_name, |
|
633 | + '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
634 | + ), NULL, 'boinc:friend-request-email'); |
|
635 | + $email['body'] = bts('!name confirmed you as a friend on !site. |
|
636 | 636 | |
637 | 637 | Follow this link to view his or her profile: |
638 | 638 | !link |
@@ -641,17 +641,17 @@ discard block |
||
641 | 641 | |
642 | 642 | Thanks, |
643 | 643 | The !site team', array( |
644 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
645 | - '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
646 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
647 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
648 | - ), array(), NULL, 'boinc:friend-request-email'); |
|
649 | - break; |
|
644 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
645 | + '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
646 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
647 | + '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
648 | + ), array(), NULL, 'boinc:friend-request-email'); |
|
649 | + break; |
|
650 | 650 | |
651 | - case FLAG_FRIEND_PENDING: |
|
652 | - // Sender is requesting to be recipient's friend |
|
653 | - $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email'); |
|
654 | - $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
651 | + case FLAG_FRIEND_PENDING: |
|
652 | + // Sender is requesting to be recipient's friend |
|
653 | + $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email'); |
|
654 | + $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
655 | 655 | |
656 | 656 | Follow the link below to view this request: |
657 | 657 | !link |
@@ -660,13 +660,13 @@ discard block |
||
660 | 660 | |
661 | 661 | Thanks, |
662 | 662 | The !site team', array( |
663 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
664 | - '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
665 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
666 | - '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
667 | - ), |
|
668 | - array(), NULL, 'boinc:friend-request-email'); |
|
669 | - break; |
|
663 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
664 | + '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
665 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
666 | + '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
667 | + ), |
|
668 | + array(), NULL, 'boinc:friend-request-email'); |
|
669 | + break; |
|
670 | 670 | } |
671 | 671 | return $email; |
672 | 672 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | function boinc_links__system_main_menu($links, $menu, $element) { |
84 | 84 | $html = ''; |
85 | - $html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
85 | + $html .= '<ul id="'.$menu['id'].'" class="'.$menu['class'].'">'."\n"; |
|
86 | 86 | $item_count = count($links); |
87 | 87 | $i = 1; |
88 | 88 | foreach ($links as $key => $link) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if (strpos($key, 'active-trail')) $classes[] = 'active'; |
91 | 91 | if ($i == 1) $classes[] = 'first'; |
92 | 92 | if ($i == $item_count) $classes[] = 'last'; |
93 | - $html .= '<li class="' . implode(' ', $classes) .'">'; |
|
93 | + $html .= '<li class="'.implode(' ', $classes).'">'; |
|
94 | 94 | if ($link['title'] == 'Home') { |
95 | 95 | $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | if ($link['href'] == 'dashboard') { |
100 | 100 | $item_count = privatemsg_unread_count(); |
101 | 101 | if ($item_count) { |
102 | - $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
102 | + $link['title'] .= '</a> <a href="'.url('messages').'" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">'.$item_count.'</span></div>'; |
|
103 | 103 | $link['html'] = TRUE; |
104 | 104 | $link['attributes']['class'] = 'compound'; |
105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if ($link['href'] == 'moderate') { |
110 | 110 | $item_count = boincuser_moderation_queue_count(); |
111 | 111 | if ($item_count) { |
112 | - $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
112 | + $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">'.$item_count.'</span></div>'; |
|
113 | 113 | $link['html'] = TRUE; |
114 | 114 | } |
115 | 115 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $html .= '</li>'; |
118 | 118 | $i++; |
119 | 119 | } |
120 | - $html .= '</ul>' . "\n"; |
|
120 | + $html .= '</ul>'."\n"; |
|
121 | 121 | return $html; |
122 | 122 | } |
123 | 123 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | return ''; |
133 | 133 | } |
134 | 134 | else { |
135 | - return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
|
135 | + return '<li '.($active ? 'class="active" ' : '').'>'.$link."</li>\n"; |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | if (empty($locality)) { |
198 | 198 | $locality = "en"; |
199 | 199 | } |
200 | - $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
200 | + $vars['flag_path'] = base_path().path_to_theme()."/images/flags/{$locality}.png"; |
|
201 | 201 | |
202 | 202 | $server_status_url = variable_get('boinc_server_status_url', ''); |
203 | 203 | if (!$server_status_url) { |
@@ -219,16 +219,16 @@ discard block |
||
219 | 219 | if (arg(0) == 'search') { |
220 | 220 | unset($vars['title']); |
221 | 221 | } |
222 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
222 | + else if ((arg(0) == 'account') AND (is_numeric(arg(1))) AND (empty(arg(2)))) { |
|
223 | 223 | unset($vars['title']); |
224 | 224 | } |
225 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
225 | + else if ((arg(0) == 'account') AND (arg(1) == 'profile')) { |
|
226 | 226 | unset($vars['title']); |
227 | 227 | } |
228 | - else if ( (arg(0)=='dashboard') ) { |
|
228 | + else if ((arg(0) == 'dashboard')) { |
|
229 | 229 | unset($vars['title']); |
230 | 230 | } |
231 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
231 | + else if ((arg(0) == 'community') AND ((arg(1) == 'teams') OR (arg(1) == 'stats'))) { |
|
232 | 232 | unset($vars['title']); |
233 | 233 | } |
234 | 234 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $tab = str_replace('li class="', 'li class="first ', $tab); |
245 | 245 | } |
246 | 246 | if ($key == $last_key) { |
247 | - $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
247 | + $tab = str_replace('li class="', 'li class="last ', $tab).'</ul>'; |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 | elseif (strpos($tab, 'li ')) { |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $tab = str_replace('li ', 'li class="first" ', $tab); |
253 | 253 | } |
254 | 254 | if ($key == $last_key) { |
255 | - $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
255 | + $tab = str_replace('li ', 'li class="last" ', $tab).'</ul>'; |
|
256 | 256 | } |
257 | 257 | } |
258 | 258 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | // Optionally, run node-type-specific preprocess functions, like |
291 | 291 | // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
292 | - $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
292 | + $function = __FUNCTION__.'_'.$vars['node']->type; |
|
293 | 293 | if (function_exists($function)) { |
294 | 294 | $function($vars, $hook); |
295 | 295 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $vars['node']->comment = 0; |
341 | 341 | |
342 | 342 | $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
343 | - $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
343 | + $page_count = max(ceil($vars['comment_count']/$comments_per_page), 1); |
|
344 | 344 | $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
345 | 345 | |
346 | 346 | $links = $vars['links']; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | case 'boinc_host': |
453 | 453 | $view = views_get_current_view(); |
454 | 454 | if (!($view->result)) { |
455 | - $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), NULL, 'boinc:host-details') . '</h3>'; |
|
455 | + $vars['footer'] = '<h3>'.bts('Host not found in database.', array(), NULL, 'boinc:host-details').'</h3>'; |
|
456 | 456 | } |
457 | 457 | break; |
458 | 458 | case 'boinc_host_list': |
@@ -471,10 +471,10 @@ discard block |
||
471 | 471 | |
472 | 472 | if ($result) { |
473 | 473 | // Display the stderr output in the footer |
474 | - $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
475 | - $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
474 | + $vars['footer'] = '<h3>'.bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog').'</h3>'; |
|
475 | + $vars['footer'] .= '<pre>'.htmlspecialchars($result->result_stderr_out).'</pre>'; |
|
476 | 476 | } else { |
477 | - $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
477 | + $vars['footer'] = '<h3>'.bts('Task not found in database.', array(), NULL, 'boinc:task-details').'</h3>'; |
|
478 | 478 | } |
479 | 479 | break; |
480 | 480 | case 'boinc_teams': |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | ob_start(); |
488 | 488 | // Get the workunit ID from the URL |
489 | 489 | $result_id = arg(1); |
490 | - require_boinc(array('util','boinc_db')); |
|
490 | + require_boinc(array('util', 'boinc_db')); |
|
491 | 491 | $wu = BoincWorkunit::lookup_id($result_id); |
492 | 492 | if ($wu) { |
493 | 493 | // Output from admin defined BOINC project-specific function |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | // Output of project_workunit() gets caught in the buffer |
496 | 496 | $vars['footer'] = ob_get_clean(); |
497 | 497 | } else { |
498 | - $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
498 | + $vars['footer'] = '<h3>'.bts('Workunit not found in database.', array(), NULL, 'boinc:workunit-details').'</h3>'; |
|
499 | 499 | } |
500 | 500 | default: |
501 | 501 | } |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
518 | 518 | } |
519 | 519 | elseif (is_string($user_image)) { |
520 | - $author_picture .= '<img src="' . $user_image . '"/>'; |
|
520 | + $author_picture .= '<img src="'.$user_image.'"/>'; |
|
521 | 521 | } |
522 | 522 | } |
523 | 523 | $author_picture .= '</div>'; |
@@ -556,14 +556,14 @@ discard block |
||
556 | 556 | case 'profile': |
557 | 557 | case 'user': |
558 | 558 | $node = $variables['result']['node']; |
559 | - $variables['url'] = url('account/' . $node->is_uid); |
|
559 | + $variables['url'] = url('account/'.$node->is_uid); |
|
560 | 560 | $variables['title'] = $node->tos_name; |
561 | 561 | $variables['user_image'] = boincuser_get_user_profile_image($node->is_uid); |
562 | 562 | $variables['account'] = user_load($node->is_uid); |
563 | 563 | break; |
564 | 564 | case 'team': |
565 | 565 | $node = $variables['result']['node']; |
566 | - $variables['url'] = url('/community/teams/' . $node->entity_id);; |
|
566 | + $variables['url'] = url('/community/teams/'.$node->entity_id); ; |
|
567 | 567 | break; |
568 | 568 | case 'forum': |
569 | 569 | $node = $variables['result']['node']; |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | // Parent forum topic title |
582 | 582 | $variables['parent_title'] = $drupalnode->title; |
583 | 583 | // Link to the parent forum topic |
584 | - $variables['parent_topic'] = l($drupalnode->title, drupal_get_path_alias('node/' . $nid) ); |
|
584 | + $variables['parent_topic'] = l($drupalnode->title, drupal_get_path_alias('node/'.$nid)); |
|
585 | 585 | // Get the taxonomy for the node, creates a link to the parent forum |
586 | 586 | $taxonomy = reset($drupalnode->taxonomy); |
587 | 587 | if ($vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | if (!arg(2)) { |
600 | 600 | $message = ''; |
601 | 601 | } |
602 | - return '<p>' . $message . '</p>'; |
|
602 | + return '<p>'.$message.'</p>'; |
|
603 | 603 | } |
604 | 604 | |
605 | 605 | /** |
@@ -615,11 +615,11 @@ discard block |
||
615 | 615 | |
616 | 616 | // Shorten the name when it is too long or it will break many tables. |
617 | 617 | if (drupal_strlen($name) > 20) { |
618 | - $name = drupal_substr($name, 0, 15) . '...'; |
|
618 | + $name = drupal_substr($name, 0, 15).'...'; |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | if (user_access('access user profiles')) { |
622 | - $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
622 | + $output = l($name, 'account/'.$object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
623 | 623 | } |
624 | 624 | else { |
625 | 625 | $output = check_plain($name); |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | $output = check_plain($object->name); |
638 | 638 | } |
639 | 639 | |
640 | - $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
|
640 | + $output .= ' ('.bts('not verified', array(), NULL, 'boinc:user-not-found').')'; |
|
641 | 641 | } |
642 | 642 | else { |
643 | 643 | $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | * Remove the link under text areas that reads: |
651 | 651 | * "More information about formatting options" |
652 | 652 | */ |
653 | -function boinc_filter_tips_more_info () { |
|
653 | +function boinc_filter_tips_more_info() { |
|
654 | 654 | return ''; |
655 | 655 | } |
656 | 656 | |
@@ -692,8 +692,8 @@ discard block |
||
692 | 692 | The !site team', array( |
693 | 693 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
694 | 694 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
695 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
696 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
695 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message').': '.$flag->friend_message : '', |
|
696 | + '!link' => url('account/'.$sender->uid, array('absolute' => TRUE)), |
|
697 | 697 | ), array(), NULL, 'boinc:friend-request-email'); |
698 | 698 | break; |
699 | 699 | |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | The !site team', array( |
712 | 712 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
713 | 713 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
714 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
714 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message').': '.$flag->friend_message : '', |
|
715 | 715 | '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
716 | 716 | ), |
717 | 717 | array(), NULL, 'boinc:friend-request-email'); |
@@ -724,13 +724,13 @@ discard block |
||
724 | 724 | * Edit action links |
725 | 725 | */ |
726 | 726 | function phptemplate_links($links, $attributes = array('class' => 'links')) { |
727 | - if ($links){ |
|
727 | + if ($links) { |
|
728 | 728 | // Remove flag-subscriptions link. It will be placed elsewhere. |
729 | 729 | if (isset($links['flag-subscriptions'])) { |
730 | 730 | unset($links['flag-subscriptions']); |
731 | 731 | } |
732 | 732 | // Reorder the links however you need them. |
733 | - $links = reorder_links($links, array('comment_edit','quote','comment_add','comment_reply','flag-abuse_comment','flag-abuse_node'), array('comment_delete')); |
|
733 | + $links = reorder_links($links, array('comment_edit', 'quote', 'comment_add', 'comment_reply', 'flag-abuse_comment', 'flag-abuse_node'), array('comment_delete')); |
|
734 | 734 | // Use the built-in theme_links() function to format the $links array. |
735 | 735 | return theme_links($links, $attributes); |
736 | 736 | } |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | // are the class attribute for the <li> tags. |
814 | 814 | $dom = new DOMDocument; |
815 | 815 | $dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8')); |
816 | - foreach($dom->getElementsByTagName('li') as $node) { |
|
816 | + foreach ($dom->getElementsByTagName('li') as $node) { |
|
817 | 817 | $key = $node->getAttribute("class"); |
818 | 818 | $alllinks[$key] = $dom->saveHTML($node); |
819 | 819 | } |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | "hide", "unhide", |
827 | 827 | "comment_delete", |
828 | 828 | ); |
829 | - foreach(array_keys($alllinks) as $key1) { |
|
829 | + foreach (array_keys($alllinks) as $key1) { |
|
830 | 830 | // Select string up to first space, if present. |
831 | 831 | $class1 = strtok($key1, ' '); |
832 | 832 | if (in_array($class1, $selected_classes)) { |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | $dom->loadHTML(mb_convert_encoding($alink, 'HTML-ENTITIES', 'UTF-8')); |
856 | 856 | |
857 | 857 | $myli = $dom->getElementsByTagName('li'); |
858 | - if ($myli->length>0) { |
|
858 | + if ($myli->length > 0) { |
|
859 | 859 | $newclasses = trim(($myli[0]->getAttribute("class"))." first"); |
860 | 860 | $myli[0]->setAttribute("class", $newclasses); |
861 | 861 | $alink = $dom->saveHTML($myli[0]); |
@@ -872,13 +872,13 @@ discard block |
||
872 | 872 | |
873 | 873 | $output = '<ul class="menu"><li class="first">'; |
874 | 874 | if ($user->uid) { |
875 | - $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
875 | + $output .= '<a href="'.url('logout').'">'.bts('Logout', array(), NULL, 'boinc:menu-link').'</a>'; |
|
876 | 876 | } else { |
877 | - $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
877 | + $output .= '<a href="'.url('user/login', array('query' => drupal_get_destination())).'">'.bts('Login', array(), NULL, 'boinc:menu-link').'</a>'; |
|
878 | 878 | } |
879 | 879 | $output .= '</li>'; |
880 | 880 | if (module_exists('global_search') OR module_exists('global_search_solr')) { |
881 | - $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), NULL, 'boinc:menu-link') .'</a> </l1>'; |
|
881 | + $output .= '<li class="last"> <a class="search" href="'.url('search/site').'">'.bts('search', array(), NULL, 'boinc:menu-link').'</a> </l1>'; |
|
882 | 882 | } |
883 | 883 | $output .= '</ul>'; |
884 | 884 | return $output; |
@@ -905,8 +905,8 @@ discard block |
||
905 | 905 | if ($ignored[$object->uid] == 0) { |
906 | 906 | $links['ignore_user'] = array( |
907 | 907 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
908 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
|
909 | - 'query' => 'destination='. $_GET['q'], |
|
908 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$object->uid, |
|
909 | + 'query' => 'destination='.$_GET['q'], |
|
910 | 910 | 'attributes' => array( |
911 | 911 | 'class' => 'ignore-user', |
912 | 912 | 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
@@ -921,8 +921,8 @@ discard block |
||
921 | 921 | if ($ignored[$object->uid] == 0) { |
922 | 922 | $links['ignore_user'] = array( |
923 | 923 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
924 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
|
925 | - 'query' => 'destination='. $_GET['q'], |
|
924 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$object->uid, |
|
925 | + 'query' => 'destination='.$_GET['q'], |
|
926 | 926 | 'attributes' => array( |
927 | 927 | 'class' => 'ignore-user', |
928 | 928 | 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
@@ -130,8 +130,7 @@ discard block |
||
130 | 130 | AND strpos($link, 'Edit Panel')) { |
131 | 131 | // Remove Edit Panel tab |
132 | 132 | return ''; |
133 | - } |
|
134 | - else { |
|
133 | + } else { |
|
135 | 134 | return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
136 | 135 | } |
137 | 136 | } |
@@ -218,17 +217,13 @@ discard block |
||
218 | 217 | // See: https://dev.gridrepublic.org/browse/DBOINC-65 |
219 | 218 | if (arg(0) == 'search') { |
220 | 219 | unset($vars['title']); |
221 | - } |
|
222 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
220 | + } else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
223 | 221 | unset($vars['title']); |
224 | - } |
|
225 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
222 | + } else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
226 | 223 | unset($vars['title']); |
227 | - } |
|
228 | - else if ( (arg(0)=='dashboard') ) { |
|
224 | + } else if ( (arg(0)=='dashboard') ) { |
|
229 | 225 | unset($vars['title']); |
230 | - } |
|
231 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
226 | + } else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
232 | 227 | unset($vars['title']); |
233 | 228 | } |
234 | 229 | |
@@ -246,8 +241,7 @@ discard block |
||
246 | 241 | if ($key == $last_key) { |
247 | 242 | $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
248 | 243 | } |
249 | - } |
|
250 | - elseif (strpos($tab, 'li ')) { |
|
244 | + } elseif (strpos($tab, 'li ')) { |
|
251 | 245 | if ($key == 0) { |
252 | 246 | $tab = str_replace('li ', 'li class="first" ', $tab); |
253 | 247 | } |
@@ -400,8 +394,7 @@ discard block |
||
400 | 394 | $cid = boincuser_get_first_unread_comment_id($topic->nid); |
401 | 395 | if ($cid) { |
402 | 396 | $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); |
403 | - } |
|
404 | - else { |
|
397 | + } else { |
|
405 | 398 | // User hasn't visited this topic before, so all replies are new... |
406 | 399 | $topic->new_replies = NULL; |
407 | 400 | } |
@@ -458,8 +451,7 @@ discard block |
||
458 | 451 | case 'boinc_host_list': |
459 | 452 | if ($vars['display_id'] == 'page_2') { |
460 | 453 | $vars['empty'] = boincwork_views_host_list_empty_text(); |
461 | - } |
|
462 | - elseif ($vars['display_id'] == 'page_1') { |
|
454 | + } elseif ($vars['display_id'] == 'page_1') { |
|
463 | 455 | $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
464 | 456 | } |
465 | 457 | break; |
@@ -515,8 +507,7 @@ discard block |
||
515 | 507 | if ($user_image) { |
516 | 508 | if (is_array($user_image) AND $user_image['image']['filepath']) { |
517 | 509 | $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
518 | - } |
|
519 | - elseif (is_string($user_image)) { |
|
510 | + } elseif (is_string($user_image)) { |
|
520 | 511 | $author_picture .= '<img src="' . $user_image . '"/>'; |
521 | 512 | } |
522 | 513 | } |
@@ -620,26 +611,22 @@ discard block |
||
620 | 611 | |
621 | 612 | if (user_access('access user profiles')) { |
622 | 613 | $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
623 | - } |
|
624 | - else { |
|
614 | + } else { |
|
625 | 615 | $output = check_plain($name); |
626 | 616 | } |
627 | - } |
|
628 | - else if ($object->name) { |
|
617 | + } else if ($object->name) { |
|
629 | 618 | // Sometimes modules display content composed by people who are |
630 | 619 | // not registered members of the site (e.g. mailing list or news |
631 | 620 | // aggregator modules). This clause enables modules to display |
632 | 621 | // the true author of the content. |
633 | 622 | if (!empty($object->homepage)) { |
634 | 623 | $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow'))); |
635 | - } |
|
636 | - else { |
|
624 | + } else { |
|
637 | 625 | $output = check_plain($object->name); |
638 | 626 | } |
639 | 627 | |
640 | 628 | $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
641 | - } |
|
642 | - else { |
|
629 | + } else { |
|
643 | 630 | $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
644 | 631 | } |
645 | 632 | |
@@ -724,7 +711,7 @@ discard block |
||
724 | 711 | * Edit action links |
725 | 712 | */ |
726 | 713 | function phptemplate_links($links, $attributes = array('class' => 'links')) { |
727 | - if ($links){ |
|
714 | + if ($links) { |
|
728 | 715 | // Remove flag-subscriptions link. It will be placed elsewhere. |
729 | 716 | if (isset($links['flag-subscriptions'])) { |
730 | 717 | unset($links['flag-subscriptions']); |
@@ -913,8 +900,7 @@ discard block |
||
913 | 900 | ), |
914 | 901 | ); |
915 | 902 | } |
916 | - } |
|
917 | - else if ($type == 'comment' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
903 | + } else if ($type == 'comment' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
918 | 904 | if (!isset($ignored[$object->uid])) { |
919 | 905 | $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
920 | 906 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if ($i == $item_count) $classes[] = 'last'; |
93 | 93 | $html .= '<li class="' . implode(' ', $classes) .'">'; |
94 | 94 | if ($link['title'] == 'Home') { |
95 | - $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
|
95 | + $link['title'] = bts('Home', array(), null, 'boinc:menu-link'); |
|
96 | 96 | } |
97 | 97 | if (module_exists('privatemsg')) { |
98 | 98 | // Put a new mail notification next to the Account menu item |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $item_count = privatemsg_unread_count(); |
101 | 101 | if ($item_count) { |
102 | 102 | $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
103 | - $link['html'] = TRUE; |
|
103 | + $link['html'] = true; |
|
104 | 104 | $link['attributes']['class'] = 'compound'; |
105 | 105 | } |
106 | 106 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $item_count = boincuser_moderation_queue_count(); |
111 | 111 | if ($item_count) { |
112 | 112 | $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
113 | - $link['html'] = TRUE; |
|
113 | + $link['html'] = true; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | $html .= l($link['title'], $link['href'], $link); |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | /** |
126 | 126 | * Remove undesired local task tabs |
127 | 127 | */ |
128 | -function boinc_menu_local_task($link, $active = FALSE) { |
|
129 | - if (strpos($link, 'admin/build/pages') !== FALSE |
|
130 | - AND strpos($link, 'Edit Panel')) { |
|
128 | +function boinc_menu_local_task($link, $active = false) { |
|
129 | + if (strpos($link, 'admin/build/pages') !== false |
|
130 | + and strpos($link, 'Edit Panel')) { |
|
131 | 131 | // Remove Edit Panel tab |
132 | 132 | return ''; |
133 | 133 | } |
@@ -219,16 +219,16 @@ discard block |
||
219 | 219 | if (arg(0) == 'search') { |
220 | 220 | unset($vars['title']); |
221 | 221 | } |
222 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
222 | + else if ( (arg(0)=='account') and (is_numeric(arg(1))) and (empty(arg(2))) ) { |
|
223 | 223 | unset($vars['title']); |
224 | 224 | } |
225 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
225 | + else if ( (arg(0)=='account') and (arg(1)=='profile') ) { |
|
226 | 226 | unset($vars['title']); |
227 | 227 | } |
228 | 228 | else if ( (arg(0)=='dashboard') ) { |
229 | 229 | unset($vars['title']); |
230 | 230 | } |
231 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
231 | + else if ( (arg(0)=='community') and ( (arg(1)=='teams') or (arg(1)=='stats') ) ) { |
|
232 | 232 | unset($vars['title']); |
233 | 233 | } |
234 | 234 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | unset($vars['links']['forum']); |
308 | 308 | // Add a link to manage subscriptions for the user |
309 | 309 | $vars['links']['subscriptions'] = array( |
310 | - 'title' => bts('Manage subscriptions', array(), NULL, 'boinc:forum-footer'), |
|
310 | + 'title' => bts('Manage subscriptions', array(), null, 'boinc:forum-footer'), |
|
311 | 311 | 'href' => 'account/prefs/subscriptions', |
312 | 312 | ); |
313 | 313 | } |
@@ -331,17 +331,17 @@ discard block |
||
331 | 331 | $vars['signature'] = check_markup($account->signature, $vars['node']->format); |
332 | 332 | |
333 | 333 | // Show signatures based on user preference |
334 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
334 | + $vars['show_signatures'] = ($user->hide_signatures) ? false : true; |
|
335 | 335 | |
336 | 336 | // Expose comment sort order so that the template can put the topic node |
337 | 337 | // content (i.e. initial post) at the very end if "Newest post first" is the |
338 | 338 | // preference used by this user |
339 | - $vars['oldest_post_first'] = ($user->sort != 1) ? TRUE : FALSE; |
|
339 | + $vars['oldest_post_first'] = ($user->sort != 1) ? true : false; |
|
340 | 340 | $vars['node']->comment = 0; |
341 | 341 | |
342 | - $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
|
342 | + $vars['first_page'] = (!isset($_GET['page']) or ($_GET['page'] < 1)); |
|
343 | 343 | $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
344 | - $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
|
344 | + $vars['last_page'] = ($page_count == 1 or ($page_count > 1 and $_GET['page'] == $page_count - 1)); |
|
345 | 345 | |
346 | 346 | $links = $vars['links']; |
347 | 347 | $moderator_links = array(); |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | $vars['locality'] = $language->language; |
379 | 379 | |
380 | 380 | // Show signatures based on user preference |
381 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
381 | + $vars['show_signatures'] = ($user->hide_signatures) ? false : true; |
|
382 | 382 | |
383 | 383 | $links = $vars['links']; |
384 | 384 | $moderator_links = array(); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | } |
404 | 404 | else { |
405 | 405 | // User hasn't visited this topic before, so all replies are new... |
406 | - $topic->new_replies = NULL; |
|
406 | + $topic->new_replies = null; |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | // Use same logic in forum.module to change message if topic has |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | case 'boinc_host': |
453 | 453 | $view = views_get_current_view(); |
454 | 454 | if (!($view->result)) { |
455 | - $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), NULL, 'boinc:host-details') . '</h3>'; |
|
455 | + $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), null, 'boinc:host-details') . '</h3>'; |
|
456 | 456 | } |
457 | 457 | break; |
458 | 458 | case 'boinc_host_list': |
@@ -471,10 +471,10 @@ discard block |
||
471 | 471 | |
472 | 472 | if ($result) { |
473 | 473 | // Display the stderr output in the footer |
474 | - $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
474 | + $vars['footer'] = '<h3>' . bts('Stderr output', array(), null, 'boinc:task-details-errorlog') .'</h3>'; |
|
475 | 475 | $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
476 | 476 | } else { |
477 | - $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
477 | + $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), null, 'boinc:task-details') . '</h3>'; |
|
478 | 478 | } |
479 | 479 | break; |
480 | 480 | case 'boinc_teams': |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | // Output of project_workunit() gets caught in the buffer |
496 | 496 | $vars['footer'] = ob_get_clean(); |
497 | 497 | } else { |
498 | - $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
498 | + $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), null, 'boinc:workunit-details') . '</h3>'; |
|
499 | 499 | } |
500 | 500 | default: |
501 | 501 | } |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $author_picture = '<div class="picture">'; |
514 | 514 | $user_image = boincuser_get_user_profile_image($vars['message']['author']->uid); |
515 | 515 | if ($user_image) { |
516 | - if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
516 | + if (is_array($user_image) and $user_image['image']['filepath']) { |
|
517 | 517 | $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
518 | 518 | } |
519 | 519 | elseif (is_string($user_image)) { |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | // Remove the mess of text under the search form and don't display "no results" |
596 | 596 | // if a search hasn't even been submitted |
597 | 597 | function boinc_apachesolr_search_noresults() { |
598 | - $message = bts('No results found...', array(), NULL, 'boinc:search-with-no-results'); |
|
598 | + $message = bts('No results found...', array(), null, 'boinc:search-with-no-results'); |
|
599 | 599 | if (!arg(2)) { |
600 | 600 | $message = ''; |
601 | 601 | } |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | } |
620 | 620 | |
621 | 621 | if (user_access('access user profiles')) { |
622 | - $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
622 | + $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), null, 'boinc:users-table')))); |
|
623 | 623 | } |
624 | 624 | else { |
625 | 625 | $output = check_plain($name); |
@@ -637,10 +637,10 @@ discard block |
||
637 | 637 | $output = check_plain($object->name); |
638 | 638 | } |
639 | 639 | |
640 | - $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
|
640 | + $output .= ' (' . bts('not verified', array(), null, 'boinc:user-not-found') . ')'; |
|
641 | 641 | } |
642 | 642 | else { |
643 | - $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
|
643 | + $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), null, 'boinc:anonymous-user'))); |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | return $output; |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | $email['subject'] = bts('!name accepted your friend request [!site]', array( |
681 | 681 | '!name' => $sender->boincuser_name, |
682 | 682 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
683 | - ), NULL, 'boinc:friend-request-email'); |
|
683 | + ), null, 'boinc:friend-request-email'); |
|
684 | 684 | $email['body'] = bts('!name confirmed you as a friend on !site. |
685 | 685 | |
686 | 686 | Follow this link to view his or her profile: |
@@ -692,14 +692,14 @@ discard block |
||
692 | 692 | The !site team', array( |
693 | 693 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
694 | 694 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
695 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
696 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
697 | - ), array(), NULL, 'boinc:friend-request-email'); |
|
695 | + '!message' => $flag->friend_message ? bts('Message', array(), null, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
696 | + '!link' => url('account/'. $sender->uid, array('absolute' => true)), |
|
697 | + ), array(), null, 'boinc:friend-request-email'); |
|
698 | 698 | break; |
699 | 699 | |
700 | 700 | case FLAG_FRIEND_PENDING: |
701 | 701 | // Sender is requesting to be recipient's friend |
702 | - $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email'); |
|
702 | + $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), null, 'boinc:friend-request-email'); |
|
703 | 703 | $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
704 | 704 | |
705 | 705 | Follow the link below to view this request: |
@@ -711,10 +711,10 @@ discard block |
||
711 | 711 | The !site team', array( |
712 | 712 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
713 | 713 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
714 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
715 | - '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
714 | + '!message' => $flag->friend_message ? bts('Message', array(), null, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
715 | + '!link' => url('goto/friend-requests', array('absolute' => true)), |
|
716 | 716 | ), |
717 | - array(), NULL, 'boinc:friend-request-email'); |
|
717 | + array(), null, 'boinc:friend-request-email'); |
|
718 | 718 | break; |
719 | 719 | } |
720 | 720 | return $email; |
@@ -872,13 +872,13 @@ discard block |
||
872 | 872 | |
873 | 873 | $output = '<ul class="menu"><li class="first">'; |
874 | 874 | if ($user->uid) { |
875 | - $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
875 | + $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), null, 'boinc:menu-link') . '</a>'; |
|
876 | 876 | } else { |
877 | - $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
877 | + $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), null, 'boinc:menu-link') . '</a>'; |
|
878 | 878 | } |
879 | 879 | $output .= '</li>'; |
880 | - if (module_exists('global_search') OR module_exists('global_search_solr')) { |
|
881 | - $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), NULL, 'boinc:menu-link') .'</a> </l1>'; |
|
880 | + if (module_exists('global_search') or module_exists('global_search_solr')) { |
|
881 | + $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), null, 'boinc:menu-link') .'</a> </l1>'; |
|
882 | 882 | } |
883 | 883 | $output .= '</ul>'; |
884 | 884 | return $output; |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | * Private function, based on ignore_user ignore_user_link() |
889 | 889 | * function. Modified for boinc functionality. |
890 | 890 | */ |
891 | -function _boinc_ignore_user_link($type, $object = NULL, $teaser = FALSE) { |
|
891 | +function _boinc_ignore_user_link($type, $object = null, $teaser = false) { |
|
892 | 892 | global $user; |
893 | 893 | |
894 | 894 | if (!$user || !$user->uid) { |
@@ -904,12 +904,12 @@ discard block |
||
904 | 904 | } |
905 | 905 | if ($ignored[$object->uid] == 0) { |
906 | 906 | $links['ignore_user'] = array( |
907 | - 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
|
907 | + 'title' => bts('Ignore user', array(), null, 'boinc:ignore-user-add'), |
|
908 | 908 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
909 | 909 | 'query' => 'destination='. $_GET['q'], |
910 | 910 | 'attributes' => array( |
911 | 911 | 'class' => 'ignore-user', |
912 | - 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
912 | + 'title' => bts('Add user to your ignore list', array(), null, 'boinc:ignore-user-add'), |
|
913 | 913 | ), |
914 | 914 | ); |
915 | 915 | } |
@@ -920,12 +920,12 @@ discard block |
||
920 | 920 | } |
921 | 921 | if ($ignored[$object->uid] == 0) { |
922 | 922 | $links['ignore_user'] = array( |
923 | - 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
|
923 | + 'title' => bts('Ignore user', array(), null, 'boinc:ignore-user-add'), |
|
924 | 924 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
925 | 925 | 'query' => 'destination='. $_GET['q'], |
926 | 926 | 'attributes' => array( |
927 | 927 | 'class' => 'ignore-user', |
928 | - 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
928 | + 'title' => bts('Add user to your ignore list', array(), null, 'boinc:ignore-user-add'), |
|
929 | 929 | ), |
930 | 930 | ); |
931 | 931 | } |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | * Implementation of HOOK_theme(). |
68 | 68 | */ |
69 | 69 | function boinc_theme(&$existing, $type, $theme, $path) { |
70 | - $hooks = zen_theme($existing, $type, $theme, $path); |
|
71 | - // Add your theme hooks like this: |
|
72 | - /* |
|
70 | + $hooks = zen_theme($existing, $type, $theme, $path); |
|
71 | + // Add your theme hooks like this: |
|
72 | + /* |
|
73 | 73 | $hooks['hook_name_here'] = array( // Details go here ); |
74 | 74 | */ |
75 | - // @TODO: Needs detailed comments. Patches welcome! |
|
76 | - return $hooks; |
|
75 | + // @TODO: Needs detailed comments. Patches welcome! |
|
76 | + return $hooks; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | |
@@ -81,44 +81,44 @@ discard block |
||
81 | 81 | * Adjust the rendering of the menu |
82 | 82 | */ |
83 | 83 | function boinc_links__system_main_menu($links, $menu, $element) { |
84 | - $html = ''; |
|
85 | - $html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
86 | - $item_count = count($links); |
|
87 | - $i = 1; |
|
88 | - foreach ($links as $key => $link) { |
|
84 | + $html = ''; |
|
85 | + $html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
86 | + $item_count = count($links); |
|
87 | + $i = 1; |
|
88 | + foreach ($links as $key => $link) { |
|
89 | 89 | $classes = array($key); |
90 | 90 | if (strpos($key, 'active-trail')) $classes[] = 'active'; |
91 | 91 | if ($i == 1) $classes[] = 'first'; |
92 | 92 | if ($i == $item_count) $classes[] = 'last'; |
93 | 93 | $html .= '<li class="' . implode(' ', $classes) .'">'; |
94 | 94 | if ($link['title'] == 'Home') { |
95 | - $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
|
95 | + $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
|
96 | 96 | } |
97 | 97 | if (module_exists('privatemsg')) { |
98 | - // Put a new mail notification next to the Account menu item |
|
99 | - if ($link['href'] == 'dashboard') { |
|
98 | + // Put a new mail notification next to the Account menu item |
|
99 | + if ($link['href'] == 'dashboard') { |
|
100 | 100 | $item_count = privatemsg_unread_count(); |
101 | 101 | if ($item_count) { |
102 | - $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
103 | - $link['html'] = TRUE; |
|
104 | - $link['attributes']['class'] = 'compound'; |
|
102 | + $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
103 | + $link['html'] = TRUE; |
|
104 | + $link['attributes']['class'] = 'compound'; |
|
105 | + } |
|
105 | 106 | } |
106 | - } |
|
107 | 107 | } |
108 | 108 | // Put a count of items on the Moderation menu item |
109 | 109 | if ($link['href'] == 'moderate') { |
110 | - $item_count = boincuser_moderation_queue_count(); |
|
111 | - if ($item_count) { |
|
110 | + $item_count = boincuser_moderation_queue_count(); |
|
111 | + if ($item_count) { |
|
112 | 112 | $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
113 | 113 | $link['html'] = TRUE; |
114 | - } |
|
114 | + } |
|
115 | 115 | } |
116 | 116 | $html .= l($link['title'], $link['href'], $link); |
117 | 117 | $html .= '</li>'; |
118 | 118 | $i++; |
119 | - } |
|
120 | - $html .= '</ul>' . "\n"; |
|
121 | - return $html; |
|
119 | + } |
|
120 | + $html .= '</ul>' . "\n"; |
|
121 | + return $html; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | * Remove undesired local task tabs |
127 | 127 | */ |
128 | 128 | function boinc_menu_local_task($link, $active = FALSE) { |
129 | - if (strpos($link, 'admin/build/pages') !== FALSE |
|
129 | + if (strpos($link, 'admin/build/pages') !== FALSE |
|
130 | 130 | AND strpos($link, 'Edit Panel')) { |
131 | 131 | // Remove Edit Panel tab |
132 | 132 | return ''; |
133 | - } |
|
134 | - else { |
|
133 | + } |
|
134 | + else { |
|
135 | 135 | return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
136 | - } |
|
136 | + } |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | |
@@ -169,103 +169,103 @@ discard block |
||
169 | 169 | * The name of the template being rendered ("page" in this case.) |
170 | 170 | */ |
171 | 171 | function boinc_preprocess_page(&$vars, $hook) { |
172 | - // Responsive Design: Add viewport meta tag to HTML head |
|
173 | - drupal_set_html_head('<meta name="viewport" content="width=device-width, initial-scale=1.0" />'); |
|
174 | - $vars['head'] = drupal_get_html_head(); |
|
175 | - //dpm($vars['head'], "preprocess (all) vars[head]"); |
|
176 | - |
|
177 | - // Expose comments to template files; this is needed so that comments can be |
|
178 | - // rendered in locations other than directly below the node content |
|
179 | - $vars['comments'] = $vars['comment_form'] = ''; |
|
180 | - if (module_exists('comment') && isset($vars['node'])) { |
|
172 | + // Responsive Design: Add viewport meta tag to HTML head |
|
173 | + drupal_set_html_head('<meta name="viewport" content="width=device-width, initial-scale=1.0" />'); |
|
174 | + $vars['head'] = drupal_get_html_head(); |
|
175 | + //dpm($vars['head'], "preprocess (all) vars[head]"); |
|
176 | + |
|
177 | + // Expose comments to template files; this is needed so that comments can be |
|
178 | + // rendered in locations other than directly below the node content |
|
179 | + $vars['comments'] = $vars['comment_form'] = ''; |
|
180 | + if (module_exists('comment') && isset($vars['node'])) { |
|
181 | 181 | $vars['comments'] = comment_render($vars['node']); |
182 | 182 | $vars['comment_form'] = drupal_get_form('comment_form', array('nid' => $vars['node']->nid)); |
183 | - } |
|
183 | + } |
|
184 | 184 | |
185 | - // Determine locale region code so the correct flag is displayed in footer |
|
186 | - global $language; |
|
187 | - global $theme_path; |
|
188 | - $locality = $language->language; |
|
189 | - if (strpos($language->language, '-')) { |
|
185 | + // Determine locale region code so the correct flag is displayed in footer |
|
186 | + global $language; |
|
187 | + global $theme_path; |
|
188 | + $locality = $language->language; |
|
189 | + if (strpos($language->language, '-')) { |
|
190 | 190 | $flag_icon = "{$theme_path}/images/flags/{$language->language}.png"; |
191 | 191 | if (!file_exists($flag_icon)) { |
192 | - $lang_code = explode('-', $language->language); |
|
193 | - $locality = $lang_code[0]; |
|
192 | + $lang_code = explode('-', $language->language); |
|
193 | + $locality = $lang_code[0]; |
|
194 | 194 | } |
195 | - } |
|
196 | - // If there is no language set for some reason, default to English (en). |
|
197 | - if (empty($locality)) { |
|
195 | + } |
|
196 | + // If there is no language set for some reason, default to English (en). |
|
197 | + if (empty($locality)) { |
|
198 | 198 | $locality = "en"; |
199 | - } |
|
200 | - $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
199 | + } |
|
200 | + $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
201 | 201 | |
202 | - $server_status_url = variable_get('boinc_server_status_url', ''); |
|
203 | - if (!$server_status_url) { |
|
202 | + $server_status_url = variable_get('boinc_server_status_url', ''); |
|
203 | + if (!$server_status_url) { |
|
204 | 204 | $server_status_url = 'server_status.php'; |
205 | - } |
|
206 | - $vars['server_status_url'] = $server_status_url; |
|
205 | + } |
|
206 | + $vars['server_status_url'] = $server_status_url; |
|
207 | 207 | |
208 | - $app_list_url = variable_get('boinc_app_list_url', ''); |
|
209 | - if (!$app_list_url) { |
|
208 | + $app_list_url = variable_get('boinc_app_list_url', ''); |
|
209 | + if (!$app_list_url) { |
|
210 | 210 | $app_list_url = 'apps.php'; |
211 | - } |
|
212 | - $vars['app_list_url'] = $app_list_url; |
|
213 | - |
|
214 | - // Remove title from certain pages using URL. |
|
215 | - // This is a kludge to remove the title of the page but not the |
|
216 | - // "head_title" which is placed in the HTML <head> section. Most of |
|
217 | - // these pages are defined in the Page Manager module. |
|
218 | - // See: https://dev.gridrepublic.org/browse/DBOINC-65 |
|
219 | - if (arg(0) == 'search') { |
|
211 | + } |
|
212 | + $vars['app_list_url'] = $app_list_url; |
|
213 | + |
|
214 | + // Remove title from certain pages using URL. |
|
215 | + // This is a kludge to remove the title of the page but not the |
|
216 | + // "head_title" which is placed in the HTML <head> section. Most of |
|
217 | + // these pages are defined in the Page Manager module. |
|
218 | + // See: https://dev.gridrepublic.org/browse/DBOINC-65 |
|
219 | + if (arg(0) == 'search') { |
|
220 | 220 | unset($vars['title']); |
221 | - } |
|
222 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
221 | + } |
|
222 | + else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
223 | 223 | unset($vars['title']); |
224 | - } |
|
225 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
224 | + } |
|
225 | + else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
226 | 226 | unset($vars['title']); |
227 | - } |
|
228 | - else if ( (arg(0)=='dashboard') ) { |
|
227 | + } |
|
228 | + else if ( (arg(0)=='dashboard') ) { |
|
229 | 229 | unset($vars['title']); |
230 | - } |
|
231 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
230 | + } |
|
231 | + else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
232 | 232 | unset($vars['title']); |
233 | - } |
|
233 | + } |
|
234 | 234 | |
235 | - // Apply classes to tabs to allow for better styling options |
|
236 | - $tabs = explode("\n", $vars['tabs']); |
|
237 | - array_pop($tabs); |
|
238 | - end($tabs); |
|
239 | - $last_key = key($tabs); |
|
240 | - |
|
241 | - foreach ($tabs as $key => &$tab) { |
|
242 | - if (strpos($tab, 'li class=')) { |
|
243 | - if ($key == 0) { |
|
244 | - $tab = str_replace('li class="', 'li class="first ', $tab); |
|
245 | - } |
|
246 | - if ($key == $last_key) { |
|
247 | - $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
248 | - } |
|
249 | - } |
|
250 | - elseif (strpos($tab, 'li ')) { |
|
251 | - if ($key == 0) { |
|
252 | - $tab = str_replace('li ', 'li class="first" ', $tab); |
|
253 | - } |
|
254 | - if ($key == $last_key) { |
|
255 | - $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
256 | - } |
|
257 | - } |
|
258 | - } |
|
259 | - $vars['tabs'] = implode("\n", $tabs); |
|
235 | + // Apply classes to tabs to allow for better styling options |
|
236 | + $tabs = explode("\n", $vars['tabs']); |
|
237 | + array_pop($tabs); |
|
238 | + end($tabs); |
|
239 | + $last_key = key($tabs); |
|
240 | + |
|
241 | + foreach ($tabs as $key => &$tab) { |
|
242 | + if (strpos($tab, 'li class=')) { |
|
243 | + if ($key == 0) { |
|
244 | + $tab = str_replace('li class="', 'li class="first ', $tab); |
|
245 | + } |
|
246 | + if ($key == $last_key) { |
|
247 | + $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
248 | + } |
|
249 | + } |
|
250 | + elseif (strpos($tab, 'li ')) { |
|
251 | + if ($key == 0) { |
|
252 | + $tab = str_replace('li ', 'li class="first" ', $tab); |
|
253 | + } |
|
254 | + if ($key == $last_key) { |
|
255 | + $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
256 | + } |
|
257 | + } |
|
258 | + } |
|
259 | + $vars['tabs'] = implode("\n", $tabs); |
|
260 | 260 | |
261 | - // Get the main menu but only for the branch the page is on. |
|
262 | - $vars['menu_tree_onlyactive'] = menu_tree('primary-links'); |
|
261 | + // Get the main menu but only for the branch the page is on. |
|
262 | + $vars['menu_tree_onlyactive'] = menu_tree('primary-links'); |
|
263 | 263 | |
264 | - // Create tertiary menu |
|
265 | - $vars['tertiary_links'] = menu_navigation_links(variable_get('menu_primary_links_source', 'primary-links'), 2); |
|
264 | + // Create tertiary menu |
|
265 | + $vars['tertiary_links'] = menu_navigation_links(variable_get('menu_primary_links_source', 'primary-links'), 2); |
|
266 | 266 | |
267 | - // Create action links |
|
268 | - $vars['action_links'] = _boinc_action_links(); |
|
267 | + // Create action links |
|
268 | + $vars['action_links'] = _boinc_action_links(); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -278,79 +278,79 @@ discard block |
||
278 | 278 | */ |
279 | 279 | function boinc_preprocess_node(&$vars, $hook) { |
280 | 280 | |
281 | - //$vars['sample_variable'] = t('Lorem ipsum.'); |
|
281 | + //$vars['sample_variable'] = t('Lorem ipsum.'); |
|
282 | 282 | |
283 | - // Detach subscribe link from the links list. Subscribe link will be placed |
|
284 | - // on page separately from links. |
|
285 | - if (!empty($vars['node']->links['flag-subscriptions']['title'])) { |
|
283 | + // Detach subscribe link from the links list. Subscribe link will be placed |
|
284 | + // on page separately from links. |
|
285 | + if (!empty($vars['node']->links['flag-subscriptions']['title'])) { |
|
286 | 286 | $vars['subscribe_link'] = $vars['node']->links['flag-subscriptions']['title']; |
287 | 287 | unset($vars['node']->links['flag-subscriptions']); |
288 | - } |
|
288 | + } |
|
289 | 289 | |
290 | - // Optionally, run node-type-specific preprocess functions, like |
|
291 | - // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
|
292 | - $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
293 | - if (function_exists($function)) { |
|
290 | + // Optionally, run node-type-specific preprocess functions, like |
|
291 | + // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
|
292 | + $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
293 | + if (function_exists($function)) { |
|
294 | 294 | $function($vars, $hook); |
295 | - } |
|
295 | + } |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
299 | 299 | * Preprocessing for forum lists |
300 | 300 | */ |
301 | 301 | function boinc_preprocess_forums(&$vars, $hook) { |
302 | - // Add a link to mark all forums as read |
|
303 | - module_load_include('inc', 'forum_tweaks', 'includes/mark-read'); |
|
304 | - forum_tweaks_get_mark_read_link($vars['tid'], $vars['links']); |
|
305 | - if (!$vars['parents']) { |
|
302 | + // Add a link to mark all forums as read |
|
303 | + module_load_include('inc', 'forum_tweaks', 'includes/mark-read'); |
|
304 | + forum_tweaks_get_mark_read_link($vars['tid'], $vars['links']); |
|
305 | + if (!$vars['parents']) { |
|
306 | 306 | // Remove the "Post new forum topic" link from the top level forum list |
307 | 307 | unset($vars['links']['forum']); |
308 | 308 | // Add a link to manage subscriptions for the user |
309 | 309 | $vars['links']['subscriptions'] = array( |
310 | - 'title' => bts('Manage subscriptions', array(), NULL, 'boinc:forum-footer'), |
|
311 | - 'href' => 'account/prefs/subscriptions', |
|
310 | + 'title' => bts('Manage subscriptions', array(), NULL, 'boinc:forum-footer'), |
|
311 | + 'href' => 'account/prefs/subscriptions', |
|
312 | 312 | ); |
313 | - } |
|
313 | + } |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
317 | 317 | * Preprocessing for forum type nodes |
318 | 318 | */ |
319 | 319 | function boinc_preprocess_node_forum(&$vars, $hook) { |
320 | - global $language; |
|
321 | - global $user; |
|
320 | + global $language; |
|
321 | + global $user; |
|
322 | 322 | |
323 | - // Locality |
|
324 | - $vars['locality'] = $language->language; |
|
323 | + // Locality |
|
324 | + $vars['locality'] = $language->language; |
|
325 | 325 | |
326 | - // Get the author of the node |
|
327 | - $account = user_load($vars['uid']); |
|
328 | - $comments_per_page = ($user->comments_per_page) ? $user->comments_per_page : variable_get("comment_default_per_page_{$vars['node']->type}", 50); |
|
326 | + // Get the author of the node |
|
327 | + $account = user_load($vars['uid']); |
|
328 | + $comments_per_page = ($user->comments_per_page) ? $user->comments_per_page : variable_get("comment_default_per_page_{$vars['node']->type}", 50); |
|
329 | 329 | |
330 | - // Add signature |
|
331 | - $vars['signature'] = check_markup($account->signature, $vars['node']->format); |
|
330 | + // Add signature |
|
331 | + $vars['signature'] = check_markup($account->signature, $vars['node']->format); |
|
332 | 332 | |
333 | - // Show signatures based on user preference |
|
334 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
333 | + // Show signatures based on user preference |
|
334 | + $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
335 | 335 | |
336 | - // Expose comment sort order so that the template can put the topic node |
|
337 | - // content (i.e. initial post) at the very end if "Newest post first" is the |
|
338 | - // preference used by this user |
|
339 | - $vars['oldest_post_first'] = ($user->sort != 1) ? TRUE : FALSE; |
|
340 | - $vars['node']->comment = 0; |
|
336 | + // Expose comment sort order so that the template can put the topic node |
|
337 | + // content (i.e. initial post) at the very end if "Newest post first" is the |
|
338 | + // preference used by this user |
|
339 | + $vars['oldest_post_first'] = ($user->sort != 1) ? TRUE : FALSE; |
|
340 | + $vars['node']->comment = 0; |
|
341 | 341 | |
342 | - $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
|
343 | - $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
344 | - $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
|
342 | + $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
|
343 | + $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
344 | + $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
|
345 | 345 | |
346 | - $links = $vars['links']; |
|
347 | - $moderator_links = array(); |
|
348 | - _boinc_create_moderator_links($links, $moderator_links); |
|
349 | - $vars['links'] = $links; |
|
350 | - $vars['moderator_links'] = $moderator_links; |
|
346 | + $links = $vars['links']; |
|
347 | + $moderator_links = array(); |
|
348 | + _boinc_create_moderator_links($links, $moderator_links); |
|
349 | + $vars['links'] = $links; |
|
350 | + $vars['moderator_links'] = $moderator_links; |
|
351 | 351 | |
352 | - // Ignore user link |
|
353 | - $vars['ignore_link'] = _boinc_ignore_user_link('node', $vars['node']); |
|
352 | + // Ignore user link |
|
353 | + $vars['ignore_link'] = _boinc_ignore_user_link('node', $vars['node']); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | |
@@ -371,48 +371,48 @@ discard block |
||
371 | 371 | * The name of the template being rendered ("comment" in this case.) |
372 | 372 | */ |
373 | 373 | function boinc_preprocess_comment(&$vars, $hook) { |
374 | - global $language; |
|
375 | - global $user; |
|
374 | + global $language; |
|
375 | + global $user; |
|
376 | 376 | |
377 | - // Locality |
|
378 | - $vars['locality'] = $language->language; |
|
377 | + // Locality |
|
378 | + $vars['locality'] = $language->language; |
|
379 | 379 | |
380 | - // Show signatures based on user preference |
|
381 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
380 | + // Show signatures based on user preference |
|
381 | + $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
382 | 382 | |
383 | - $links = $vars['links']; |
|
384 | - $moderator_links = array(); |
|
385 | - _boinc_create_moderator_links($links, $moderator_links); |
|
386 | - $vars['links'] = $links; |
|
387 | - $vars['moderator_links'] = $moderator_links; |
|
383 | + $links = $vars['links']; |
|
384 | + $moderator_links = array(); |
|
385 | + _boinc_create_moderator_links($links, $moderator_links); |
|
386 | + $vars['links'] = $links; |
|
387 | + $vars['moderator_links'] = $moderator_links; |
|
388 | 388 | |
389 | - // Ignore user link |
|
390 | - $vars['ignore_link'] = _boinc_ignore_user_link('comment', $vars['comment']); |
|
389 | + // Ignore user link |
|
390 | + $vars['ignore_link'] = _boinc_ignore_user_link('comment', $vars['comment']); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | /** |
394 | 394 | * |
395 | 395 | */ |
396 | 396 | function boinc_preprocess_forum_topic_list(&$variables) { |
397 | - if (!empty($variables['topics'])) { |
|
397 | + if (!empty($variables['topics'])) { |
|
398 | 398 | foreach ($variables['topics'] as $id => $topic) { |
399 | - if ($topic->new_replies) { |
|
399 | + if ($topic->new_replies) { |
|
400 | 400 | $cid = boincuser_get_first_unread_comment_id($topic->nid); |
401 | 401 | if ($cid) { |
402 | - $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); |
|
402 | + $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); |
|
403 | 403 | } |
404 | 404 | else { |
405 | - // User hasn't visited this topic before, so all replies are new... |
|
406 | - $topic->new_replies = NULL; |
|
405 | + // User hasn't visited this topic before, so all replies are new... |
|
406 | + $topic->new_replies = NULL; |
|
407 | + } |
|
407 | 408 | } |
408 | - } |
|
409 | - // Use same logic in forum.module to change message if topic has |
|
410 | - // moved. Changed link to match boinc path-added "community". |
|
411 | - if ($topic->forum_tid != $variables['tid']) { |
|
409 | + // Use same logic in forum.module to change message if topic has |
|
410 | + // moved. Changed link to match boinc path-added "community". |
|
411 | + if ($topic->forum_tid != $variables['tid']) { |
|
412 | 412 | $variables['topics'][$id]->message = l(t('This topic has been moved'), "community/forum/$topic->forum_tid"); |
413 | - } |
|
413 | + } |
|
414 | + } |
|
414 | 415 | } |
415 | - } |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | /** |
@@ -425,79 +425,79 @@ discard block |
||
425 | 425 | */ |
426 | 426 | ///* -- Delete this line if you want to use this function |
427 | 427 | function boinc_preprocess_views_view(&$vars, $hook) { |
428 | - switch ($vars['name']) { |
|
429 | - case 'boinc_account_computers': |
|
428 | + switch ($vars['name']) { |
|
429 | + case 'boinc_account_computers': |
|
430 | 430 | switch ($vars['display_id']) { |
431 | 431 | case 'page_1': |
432 | 432 | case 'panel_pane_1': |
433 | 433 | $vars['empty'] = boincwork_views_host_list_empty_text(); |
434 | - break; |
|
434 | + break; |
|
435 | 435 | case 'page_2': |
436 | 436 | $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
437 | - break; |
|
437 | + break; |
|
438 | 438 | case 'block_1': |
439 | 439 | $vars['empty'] = boincwork_views_host_list_empty_text('preferences'); |
440 | - break; |
|
440 | + break; |
|
441 | 441 | default: |
442 | 442 | } |
443 | 443 | break; |
444 | - case 'boinc_account_tasks_all': |
|
444 | + case 'boinc_account_tasks_all': |
|
445 | 445 | $vars['empty'] = boincwork_views_task_list_empty_text(); |
446 | 446 | break; |
447 | - case 'boinc_friends': |
|
447 | + case 'boinc_friends': |
|
448 | 448 | if ($vars['display_id'] == 'block_1') { |
449 | - $vars['header'] = boincuser_views_friends_block_header(); |
|
449 | + $vars['header'] = boincuser_views_friends_block_header(); |
|
450 | 450 | } |
451 | 451 | break; |
452 | - case 'boinc_host': |
|
452 | + case 'boinc_host': |
|
453 | 453 | $view = views_get_current_view(); |
454 | - if (!($view->result)) { |
|
454 | + if (!($view->result)) { |
|
455 | 455 | $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), NULL, 'boinc:host-details') . '</h3>'; |
456 | - } |
|
456 | + } |
|
457 | 457 | break; |
458 | - case 'boinc_host_list': |
|
458 | + case 'boinc_host_list': |
|
459 | 459 | if ($vars['display_id'] == 'page_2') { |
460 | - $vars['empty'] = boincwork_views_host_list_empty_text(); |
|
460 | + $vars['empty'] = boincwork_views_host_list_empty_text(); |
|
461 | 461 | } |
462 | 462 | elseif ($vars['display_id'] == 'page_1') { |
463 | - $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
|
463 | + $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
|
464 | 464 | } |
465 | 465 | break; |
466 | - case 'boinc_task': |
|
466 | + case 'boinc_task': |
|
467 | 467 | // Load view object (view data is not available in header / footer); execute view query |
468 | 468 | $view = views_get_current_view(); |
469 | 469 | $view->execute(); |
470 | 470 | $result = reset($view->result); |
471 | 471 | |
472 | 472 | if ($result) { |
473 | - // Display the stderr output in the footer |
|
474 | - $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
475 | - $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
473 | + // Display the stderr output in the footer |
|
474 | + $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
475 | + $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
476 | 476 | } else { |
477 | - $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
477 | + $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
478 | 478 | } |
479 | 479 | break; |
480 | - case 'boinc_teams': |
|
480 | + case 'boinc_teams': |
|
481 | 481 | if ($vars['display_id'] == 'panel_pane_3') { |
482 | - $team_id = arg(2); |
|
483 | - $vars['header'] = boincteam_manage_admins_panel_header($team_id); |
|
482 | + $team_id = arg(2); |
|
483 | + $vars['header'] = boincteam_manage_admins_panel_header($team_id); |
|
484 | 484 | } |
485 | 485 | break; |
486 | - case 'boinc_workunit': |
|
486 | + case 'boinc_workunit': |
|
487 | 487 | ob_start(); |
488 | 488 | // Get the workunit ID from the URL |
489 | 489 | $result_id = arg(1); |
490 | 490 | require_boinc(array('util','boinc_db')); |
491 | 491 | $wu = BoincWorkunit::lookup_id($result_id); |
492 | 492 | if ($wu) { |
493 | - // Output from admin defined BOINC project-specific function |
|
494 | - project_workunit($wu); |
|
495 | - // Output of project_workunit() gets caught in the buffer |
|
496 | - $vars['footer'] = ob_get_clean(); |
|
493 | + // Output from admin defined BOINC project-specific function |
|
494 | + project_workunit($wu); |
|
495 | + // Output of project_workunit() gets caught in the buffer |
|
496 | + $vars['footer'] = ob_get_clean(); |
|
497 | 497 | } else { |
498 | - $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
498 | + $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
499 | 499 | } |
500 | - default: |
|
500 | + default: |
|
501 | 501 | } |
502 | 502 | } |
503 | 503 | // */ |
@@ -510,19 +510,19 @@ discard block |
||
510 | 510 | */ |
511 | 511 | ///* -- Delete this line if you want to use this function |
512 | 512 | function boinc_preprocess_privatemsg_view(&$vars, $hook) { |
513 | - $author_picture = '<div class="picture">'; |
|
514 | - $user_image = boincuser_get_user_profile_image($vars['message']['author']->uid); |
|
515 | - if ($user_image) { |
|
513 | + $author_picture = '<div class="picture">'; |
|
514 | + $user_image = boincuser_get_user_profile_image($vars['message']['author']->uid); |
|
515 | + if ($user_image) { |
|
516 | 516 | if (is_array($user_image) AND $user_image['image']['filepath']) { |
517 | - $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
|
517 | + $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
|
518 | 518 | } |
519 | 519 | elseif (is_string($user_image)) { |
520 | - $author_picture .= '<img src="' . $user_image . '"/>'; |
|
520 | + $author_picture .= '<img src="' . $user_image . '"/>'; |
|
521 | 521 | } |
522 | - } |
|
523 | - $author_picture .= '</div>'; |
|
524 | - $vars['author_picture'] = $author_picture; |
|
525 | - $vars['message_timestamp'] = date('j M Y G:i:s T', $vars['message']['timestamp']); |
|
522 | + } |
|
523 | + $author_picture .= '</div>'; |
|
524 | + $vars['author_picture'] = $author_picture; |
|
525 | + $vars['message_timestamp'] = date('j M Y G:i:s T', $vars['message']['timestamp']); |
|
526 | 526 | } |
527 | 527 | // */ |
528 | 528 | |
@@ -541,19 +541,19 @@ discard block |
||
541 | 541 | // */ |
542 | 542 | |
543 | 543 | function boinc_preprocess_search_result(&$variables) { |
544 | - global $language; |
|
545 | - // Locality |
|
546 | - $variables['locality'] = $language->language; |
|
544 | + global $language; |
|
545 | + // Locality |
|
546 | + $variables['locality'] = $language->language; |
|
547 | 547 | |
548 | - // Change the format of the search result date/time in the info string. |
|
549 | - if ($variables['result']['date']) { |
|
548 | + // Change the format of the search result date/time in the info string. |
|
549 | + if ($variables['result']['date']) { |
|
550 | 550 | $variables['info_split']['date'] = date('j M Y G:i:s T', $variables['result']['date']); |
551 | - } |
|
552 | - $variables['info'] = implode(' - ', $variables['info_split']); |
|
551 | + } |
|
552 | + $variables['info'] = implode(' - ', $variables['info_split']); |
|
553 | 553 | |
554 | - $type = strtolower($variables['result']['bundle']); |
|
555 | - switch ($type) { |
|
556 | - case 'profile': |
|
554 | + $type = strtolower($variables['result']['bundle']); |
|
555 | + switch ($type) { |
|
556 | + case 'profile': |
|
557 | 557 | case 'user': |
558 | 558 | $node = $variables['result']['node']; |
559 | 559 | $variables['url'] = url('account/' . $node->is_uid); |
@@ -561,20 +561,20 @@ discard block |
||
561 | 561 | $variables['user_image'] = boincuser_get_user_profile_image($node->is_uid); |
562 | 562 | $variables['account'] = user_load($node->is_uid); |
563 | 563 | break; |
564 | - case 'team': |
|
564 | + case 'team': |
|
565 | 565 | $node = $variables['result']['node']; |
566 | 566 | $variables['url'] = url('/community/teams/' . $node->entity_id);; |
567 | 567 | break; |
568 | - case 'forum': |
|
568 | + case 'forum': |
|
569 | 569 | $node = $variables['result']['node']; |
570 | 570 | $drupalnode = node_load($node->entity_id); |
571 | 571 | // Get the taxonomy for the node, creates a link to the parent forum |
572 | 572 | $taxonomy = reset($drupalnode->taxonomy); |
573 | 573 | if ($vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
574 | - $variables['parent_forum'] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
574 | + $variables['parent_forum'] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
575 | 575 | } |
576 | 576 | break; |
577 | - case 'comment': |
|
577 | + case 'comment': |
|
578 | 578 | // Get the node id for this comment |
579 | 579 | $nid = $variables['result']['fields']['tos_content_extra']; |
580 | 580 | $drupalnode = node_load($nid); |
@@ -585,21 +585,21 @@ discard block |
||
585 | 585 | // Get the taxonomy for the node, creates a link to the parent forum |
586 | 586 | $taxonomy = reset($drupalnode->taxonomy); |
587 | 587 | if ($vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
588 | - $variables['parent_forum'] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
588 | + $variables['parent_forum'] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
589 | 589 | } |
590 | - break; |
|
591 | - default: |
|
590 | + break; |
|
591 | + default: |
|
592 | 592 | } |
593 | 593 | } |
594 | 594 | |
595 | 595 | // Remove the mess of text under the search form and don't display "no results" |
596 | 596 | // if a search hasn't even been submitted |
597 | 597 | function boinc_apachesolr_search_noresults() { |
598 | - $message = bts('No results found...', array(), NULL, 'boinc:search-with-no-results'); |
|
599 | - if (!arg(2)) { |
|
598 | + $message = bts('No results found...', array(), NULL, 'boinc:search-with-no-results'); |
|
599 | + if (!arg(2)) { |
|
600 | 600 | $message = ''; |
601 | - } |
|
602 | - return '<p>' . $message . '</p>'; |
|
601 | + } |
|
602 | + return '<p>' . $message . '</p>'; |
|
603 | 603 | } |
604 | 604 | |
605 | 605 | /** |
@@ -608,42 +608,42 @@ discard block |
||
608 | 608 | */ |
609 | 609 | function phptemplate_username($object) { |
610 | 610 | |
611 | - if ($object->uid && $object->name) { |
|
611 | + if ($object->uid && $object->name) { |
|
612 | 612 | |
613 | 613 | // Show the profile name in general, not the username |
614 | 614 | $name = user_load($object->uid)->boincuser_name; |
615 | 615 | |
616 | 616 | // Shorten the name when it is too long or it will break many tables. |
617 | 617 | if (drupal_strlen($name) > 20) { |
618 | - $name = drupal_substr($name, 0, 15) . '...'; |
|
618 | + $name = drupal_substr($name, 0, 15) . '...'; |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | if (user_access('access user profiles')) { |
622 | - $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
622 | + $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
623 | 623 | } |
624 | 624 | else { |
625 | - $output = check_plain($name); |
|
625 | + $output = check_plain($name); |
|
626 | 626 | } |
627 | - } |
|
628 | - else if ($object->name) { |
|
627 | + } |
|
628 | + else if ($object->name) { |
|
629 | 629 | // Sometimes modules display content composed by people who are |
630 | 630 | // not registered members of the site (e.g. mailing list or news |
631 | 631 | // aggregator modules). This clause enables modules to display |
632 | 632 | // the true author of the content. |
633 | 633 | if (!empty($object->homepage)) { |
634 | - $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow'))); |
|
634 | + $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow'))); |
|
635 | 635 | } |
636 | 636 | else { |
637 | - $output = check_plain($object->name); |
|
637 | + $output = check_plain($object->name); |
|
638 | 638 | } |
639 | 639 | |
640 | 640 | $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
641 | - } |
|
642 | - else { |
|
641 | + } |
|
642 | + else { |
|
643 | 643 | $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
644 | - } |
|
644 | + } |
|
645 | 645 | |
646 | - return $output; |
|
646 | + return $output; |
|
647 | 647 | } |
648 | 648 | |
649 | 649 | /** |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | * "More information about formatting options" |
652 | 652 | */ |
653 | 653 | function boinc_filter_tips_more_info () { |
654 | - return ''; |
|
654 | + return ''; |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | /** |
@@ -669,19 +669,19 @@ discard block |
||
669 | 669 | * An array containing the email [type] (mailkey), [subject] and [body]. |
670 | 670 | */ |
671 | 671 | function boinc_flag_friend_message_email($status, $flag, $recipient, $sender) { |
672 | - $email = array(); |
|
673 | - $email['type'] = 'flag-friend'; |
|
674 | - // Reload the sender to get a full user object |
|
675 | - $sender = user_load($sender->uid); |
|
672 | + $email = array(); |
|
673 | + $email['type'] = 'flag-friend'; |
|
674 | + // Reload the sender to get a full user object |
|
675 | + $sender = user_load($sender->uid); |
|
676 | 676 | |
677 | - switch ($status) { |
|
677 | + switch ($status) { |
|
678 | 678 | case FLAG_FRIEND_FLAGGED: |
679 | 679 | // Sender accepted recipient's friend request |
680 | 680 | $email['subject'] = bts('!name accepted your friend request [!site]', array( |
681 | 681 | '!name' => $sender->boincuser_name, |
682 | 682 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
683 | 683 | ), NULL, 'boinc:friend-request-email'); |
684 | - $email['body'] = bts('!name confirmed you as a friend on !site. |
|
684 | + $email['body'] = bts('!name confirmed you as a friend on !site. |
|
685 | 685 | |
686 | 686 | Follow this link to view his or her profile: |
687 | 687 | !link |
@@ -695,12 +695,12 @@ discard block |
||
695 | 695 | '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
696 | 696 | '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
697 | 697 | ), array(), NULL, 'boinc:friend-request-email'); |
698 | - break; |
|
698 | + break; |
|
699 | 699 | |
700 | 700 | case FLAG_FRIEND_PENDING: |
701 | 701 | // Sender is requesting to be recipient's friend |
702 | 702 | $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email'); |
703 | - $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
703 | + $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
704 | 704 | |
705 | 705 | Follow the link below to view this request: |
706 | 706 | !link |
@@ -714,26 +714,26 @@ discard block |
||
714 | 714 | '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
715 | 715 | '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
716 | 716 | ), |
717 | - array(), NULL, 'boinc:friend-request-email'); |
|
718 | - break; |
|
719 | - } |
|
720 | - return $email; |
|
717 | + array(), NULL, 'boinc:friend-request-email'); |
|
718 | + break; |
|
719 | + } |
|
720 | + return $email; |
|
721 | 721 | } |
722 | 722 | |
723 | 723 | /** |
724 | 724 | * Edit action links |
725 | 725 | */ |
726 | 726 | function phptemplate_links($links, $attributes = array('class' => 'links')) { |
727 | - if ($links){ |
|
727 | + if ($links){ |
|
728 | 728 | // Remove flag-subscriptions link. It will be placed elsewhere. |
729 | 729 | if (isset($links['flag-subscriptions'])) { |
730 | - unset($links['flag-subscriptions']); |
|
730 | + unset($links['flag-subscriptions']); |
|
731 | 731 | } |
732 | 732 | // Reorder the links however you need them. |
733 | 733 | $links = reorder_links($links, array('comment_edit','quote','comment_add','comment_reply','flag-abuse_comment','flag-abuse_node'), array('comment_delete')); |
734 | 734 | // Use the built-in theme_links() function to format the $links array. |
735 | 735 | return theme_links($links, $attributes); |
736 | - } |
|
736 | + } |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | /** |
@@ -777,8 +777,8 @@ discard block |
||
777 | 777 | * That is to say, get rid of it and use the views-view-table.tpl.php template. |
778 | 778 | */ |
779 | 779 | function boinc_tablesort_indicator($style) { |
780 | - return ''; |
|
781 | - /* |
|
780 | + return ''; |
|
781 | + /* |
|
782 | 782 | if ($style == "asc") { |
783 | 783 | return theme('image', 'misc/arrow-asc.png', t('sort icon'), t('sort ascending')); |
784 | 784 | } |
@@ -801,48 +801,48 @@ discard block |
||
801 | 801 | * |
802 | 802 | */ |
803 | 803 | function _boinc_create_moderator_links(&$links, &$moderator_links) { |
804 | - // If there are no links, then do nothing |
|
805 | - if (empty($links)) { |
|
804 | + // If there are no links, then do nothing |
|
805 | + if (empty($links)) { |
|
806 | 806 | return; |
807 | - } |
|
807 | + } |
|
808 | 808 | |
809 | - $alllinks = array(); |
|
810 | - $modlinks = array(); |
|
809 | + $alllinks = array(); |
|
810 | + $modlinks = array(); |
|
811 | 811 | |
812 | - // Create an array of HTML elements from the $links string, keys |
|
813 | - // are the class attribute for the <li> tags. |
|
814 | - $dom = new DOMDocument; |
|
815 | - $dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8')); |
|
816 | - foreach($dom->getElementsByTagName('li') as $node) { |
|
812 | + // Create an array of HTML elements from the $links string, keys |
|
813 | + // are the class attribute for the <li> tags. |
|
814 | + $dom = new DOMDocument; |
|
815 | + $dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8')); |
|
816 | + foreach($dom->getElementsByTagName('li') as $node) { |
|
817 | 817 | $key = $node->getAttribute("class"); |
818 | 818 | $alllinks[$key] = $dom->saveHTML($node); |
819 | - } |
|
819 | + } |
|
820 | 820 | |
821 | - // Select classes to be placed into moderator links array |
|
822 | - $selected_classes = array( |
|
821 | + // Select classes to be placed into moderator links array |
|
822 | + $selected_classes = array( |
|
823 | 823 | "make_sticky", "make_unsticky", |
824 | 824 | "lock", "unlock", |
825 | 825 | "convert", |
826 | 826 | "hide", "unhide", |
827 | 827 | "comment_delete", |
828 | - ); |
|
829 | - foreach(array_keys($alllinks) as $key1) { |
|
828 | + ); |
|
829 | + foreach(array_keys($alllinks) as $key1) { |
|
830 | 830 | // Select string up to first space, if present. |
831 | 831 | $class1 = strtok($key1, ' '); |
832 | 832 | if (in_array($class1, $selected_classes)) { |
833 | - if (empty($modlinks)) { |
|
833 | + if (empty($modlinks)) { |
|
834 | 834 | _boinc_firstlink($alllinks[$key1]); |
835 | - } |
|
836 | - $modlinks[$key1] = $alllinks[$key1]; |
|
837 | - unset($alllinks[$key1]); |
|
835 | + } |
|
836 | + $modlinks[$key1] = $alllinks[$key1]; |
|
837 | + unset($alllinks[$key1]); |
|
838 | 838 | } |
839 | - } |
|
840 | - // Convert the HTML arrays back into strings, wrap them in <ul> |
|
841 | - // tags |
|
842 | - $links = "<ul class=\"links\">".implode($alllinks)."</ul>"; |
|
843 | - $moderator_links = "<ul class=\"links\">".implode($modlinks)."</ul>"; |
|
839 | + } |
|
840 | + // Convert the HTML arrays back into strings, wrap them in <ul> |
|
841 | + // tags |
|
842 | + $links = "<ul class=\"links\">".implode($alllinks)."</ul>"; |
|
843 | + $moderator_links = "<ul class=\"links\">".implode($modlinks)."</ul>"; |
|
844 | 844 | |
845 | - return; |
|
845 | + return; |
|
846 | 846 | } |
847 | 847 | |
848 | 848 | /* |
@@ -850,38 +850,38 @@ discard block |
||
850 | 850 | * attribute to class. |
851 | 851 | */ |
852 | 852 | function _boinc_firstlink(&$alink) { |
853 | - if (!empty($alink)) { |
|
853 | + if (!empty($alink)) { |
|
854 | 854 | $dom = new DomDocument; |
855 | 855 | $dom->loadHTML(mb_convert_encoding($alink, 'HTML-ENTITIES', 'UTF-8')); |
856 | 856 | |
857 | 857 | $myli = $dom->getElementsByTagName('li'); |
858 | 858 | if ($myli->length>0) { |
859 | - $newclasses = trim(($myli[0]->getAttribute("class"))." first"); |
|
860 | - $myli[0]->setAttribute("class", $newclasses); |
|
861 | - $alink = $dom->saveHTML($myli[0]); |
|
859 | + $newclasses = trim(($myli[0]->getAttribute("class"))." first"); |
|
860 | + $myli[0]->setAttribute("class", $newclasses); |
|
861 | + $alink = $dom->saveHTML($myli[0]); |
|
862 | + } |
|
862 | 863 | } |
863 | - } |
|
864 | 864 | } |
865 | 865 | |
866 | 866 | /* |
867 | 867 | * Private function to generate the action links |
868 | 868 | */ |
869 | 869 | function _boinc_action_links() { |
870 | - global $user; |
|
871 | - global $base_path; |
|
870 | + global $user; |
|
871 | + global $base_path; |
|
872 | 872 | |
873 | - $output = '<ul class="menu"><li class="first">'; |
|
874 | - if ($user->uid) { |
|
873 | + $output = '<ul class="menu"><li class="first">'; |
|
874 | + if ($user->uid) { |
|
875 | 875 | $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), NULL, 'boinc:menu-link') . '</a>'; |
876 | - } else { |
|
876 | + } else { |
|
877 | 877 | $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), NULL, 'boinc:menu-link') . '</a>'; |
878 | - } |
|
879 | - $output .= '</li>'; |
|
880 | - if (module_exists('global_search') OR module_exists('global_search_solr')) { |
|
878 | + } |
|
879 | + $output .= '</li>'; |
|
880 | + if (module_exists('global_search') OR module_exists('global_search_solr')) { |
|
881 | 881 | $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), NULL, 'boinc:menu-link') .'</a> </l1>'; |
882 | - } |
|
883 | - $output .= '</ul>'; |
|
884 | - return $output; |
|
882 | + } |
|
883 | + $output .= '</ul>'; |
|
884 | + return $output; |
|
885 | 885 | } |
886 | 886 | |
887 | 887 | /** |
@@ -889,47 +889,47 @@ discard block |
||
889 | 889 | * function. Modified for boinc functionality. |
890 | 890 | */ |
891 | 891 | function _boinc_ignore_user_link($type, $object = NULL, $teaser = FALSE) { |
892 | - global $user; |
|
892 | + global $user; |
|
893 | 893 | |
894 | - if (!$user || !$user->uid) { |
|
894 | + if (!$user || !$user->uid) { |
|
895 | 895 | return; |
896 | - } |
|
896 | + } |
|
897 | 897 | |
898 | - static $ignored; |
|
899 | - $links = array(); |
|
898 | + static $ignored; |
|
899 | + $links = array(); |
|
900 | 900 | |
901 | - if ($type == 'node' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
901 | + if ($type == 'node' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
902 | 902 | if (!isset($ignored[$object->uid])) { |
903 | - $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
|
903 | + $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
|
904 | 904 | } |
905 | 905 | if ($ignored[$object->uid] == 0) { |
906 | - $links['ignore_user'] = array( |
|
906 | + $links['ignore_user'] = array( |
|
907 | 907 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
908 | 908 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
909 | 909 | 'query' => 'destination='. $_GET['q'], |
910 | 910 | 'attributes' => array( |
911 | - 'class' => 'ignore-user', |
|
912 | - 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
911 | + 'class' => 'ignore-user', |
|
912 | + 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
913 | 913 | ), |
914 | - ); |
|
914 | + ); |
|
915 | 915 | } |
916 | - } |
|
917 | - else if ($type == 'comment' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
916 | + } |
|
917 | + else if ($type == 'comment' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
918 | 918 | if (!isset($ignored[$object->uid])) { |
919 | - $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
|
919 | + $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
|
920 | 920 | } |
921 | 921 | if ($ignored[$object->uid] == 0) { |
922 | - $links['ignore_user'] = array( |
|
922 | + $links['ignore_user'] = array( |
|
923 | 923 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
924 | 924 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
925 | 925 | 'query' => 'destination='. $_GET['q'], |
926 | 926 | 'attributes' => array( |
927 | - 'class' => 'ignore-user', |
|
928 | - 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
927 | + 'class' => 'ignore-user', |
|
928 | + 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
929 | 929 | ), |
930 | - ); |
|
930 | + ); |
|
931 | + } |
|
931 | 932 | } |
932 | - } |
|
933 | 933 | |
934 | - return $links; |
|
934 | + return $links; |
|
935 | 935 | } |
@@ -4,41 +4,41 @@ discard block |
||
4 | 4 | * Implementation of hook_content_default_fields(). |
5 | 5 | */ |
6 | 6 | function user_profiles_content_default_fields() { |
7 | - $fields = array(); |
|
7 | + $fields = array(); |
|
8 | 8 | |
9 | - // Exported field: field_background |
|
10 | - $fields['profile-field_background'] = array( |
|
9 | + // Exported field: field_background |
|
10 | + $fields['profile-field_background'] = array( |
|
11 | 11 | 'field_name' => 'field_background', |
12 | 12 | 'type_name' => 'profile', |
13 | 13 | 'display_settings' => array( |
14 | - 'label' => array( |
|
14 | + 'label' => array( |
|
15 | 15 | 'format' => 'above', |
16 | 16 | 'exclude' => 0, |
17 | - ), |
|
18 | - 'teaser' => array( |
|
17 | + ), |
|
18 | + 'teaser' => array( |
|
19 | 19 | 'format' => 'default', |
20 | 20 | 'exclude' => 0, |
21 | - ), |
|
22 | - 'full' => array( |
|
21 | + ), |
|
22 | + 'full' => array( |
|
23 | 23 | 'format' => 'default', |
24 | 24 | 'exclude' => 0, |
25 | - ), |
|
26 | - '4' => array( |
|
25 | + ), |
|
26 | + '4' => array( |
|
27 | 27 | 'format' => 'default', |
28 | 28 | 'exclude' => 0, |
29 | - ), |
|
30 | - '2' => array( |
|
29 | + ), |
|
30 | + '2' => array( |
|
31 | 31 | 'format' => 'default', |
32 | 32 | 'exclude' => 0, |
33 | - ), |
|
34 | - '3' => array( |
|
33 | + ), |
|
34 | + '3' => array( |
|
35 | 35 | 'format' => 'default', |
36 | 36 | 'exclude' => 0, |
37 | - ), |
|
38 | - 'token' => array( |
|
37 | + ), |
|
38 | + 'token' => array( |
|
39 | 39 | 'format' => 'default', |
40 | 40 | 'exclude' => 0, |
41 | - ), |
|
41 | + ), |
|
42 | 42 | ), |
43 | 43 | 'widget_active' => '1', |
44 | 44 | 'type' => 'text', |
@@ -51,56 +51,56 @@ discard block |
||
51 | 51 | 'allowed_values' => '', |
52 | 52 | 'allowed_values_php' => '', |
53 | 53 | 'widget' => array( |
54 | - 'rows' => '10', |
|
55 | - 'size' => 60, |
|
56 | - 'default_value' => array( |
|
54 | + 'rows' => '10', |
|
55 | + 'size' => 60, |
|
56 | + 'default_value' => array( |
|
57 | 57 | '0' => array( |
58 | - 'value' => '', |
|
59 | - '_error_element' => 'default_value_widget][field_background][0][value', |
|
60 | - ), |
|
61 | - ), |
|
62 | - 'default_value_php' => NULL, |
|
63 | - 'label' => bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'), |
|
64 | - 'weight' => '3', |
|
65 | - 'description' => bts('Tell us about yourself. You could tell us where you\'re from, your age, occupation, hobbies, or anything else about yourself.', array(), NULL, 'boinc:account-profile-edit'), |
|
66 | - 'type' => 'text_textarea', |
|
67 | - 'module' => 'text', |
|
58 | + 'value' => '', |
|
59 | + '_error_element' => 'default_value_widget][field_background][0][value', |
|
60 | + ), |
|
61 | + ), |
|
62 | + 'default_value_php' => NULL, |
|
63 | + 'label' => bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'), |
|
64 | + 'weight' => '3', |
|
65 | + 'description' => bts('Tell us about yourself. You could tell us where you\'re from, your age, occupation, hobbies, or anything else about yourself.', array(), NULL, 'boinc:account-profile-edit'), |
|
66 | + 'type' => 'text_textarea', |
|
67 | + 'module' => 'text', |
|
68 | 68 | ), |
69 | - ); |
|
69 | + ); |
|
70 | 70 | |
71 | - // Exported field: field_country |
|
72 | - $fields['profile-field_country'] = array( |
|
71 | + // Exported field: field_country |
|
72 | + $fields['profile-field_country'] = array( |
|
73 | 73 | 'field_name' => 'field_country', |
74 | 74 | 'type_name' => 'profile', |
75 | 75 | 'display_settings' => array( |
76 | - 'label' => array( |
|
76 | + 'label' => array( |
|
77 | 77 | 'format' => 'above', |
78 | 78 | 'exclude' => 0, |
79 | - ), |
|
80 | - 'teaser' => array( |
|
79 | + ), |
|
80 | + 'teaser' => array( |
|
81 | 81 | 'format' => 'default', |
82 | 82 | 'exclude' => 0, |
83 | - ), |
|
84 | - 'full' => array( |
|
83 | + ), |
|
84 | + 'full' => array( |
|
85 | 85 | 'format' => 'default', |
86 | 86 | 'exclude' => 0, |
87 | - ), |
|
88 | - '4' => array( |
|
87 | + ), |
|
88 | + '4' => array( |
|
89 | 89 | 'format' => 'default', |
90 | 90 | 'exclude' => 0, |
91 | - ), |
|
92 | - '2' => array( |
|
91 | + ), |
|
92 | + '2' => array( |
|
93 | 93 | 'format' => 'default', |
94 | 94 | 'exclude' => 0, |
95 | - ), |
|
96 | - '3' => array( |
|
95 | + ), |
|
96 | + '3' => array( |
|
97 | 97 | 'format' => 'default', |
98 | 98 | 'exclude' => 0, |
99 | - ), |
|
100 | - 'token' => array( |
|
99 | + ), |
|
100 | + 'token' => array( |
|
101 | 101 | 'format' => 'default', |
102 | 102 | 'exclude' => 0, |
103 | - ), |
|
103 | + ), |
|
104 | 104 | ), |
105 | 105 | 'widget_active' => '1', |
106 | 106 | 'type' => 'text', |
@@ -345,53 +345,53 @@ discard block |
||
345 | 345 | Zimbabwe|Zimbabwe', |
346 | 346 | 'allowed_values_php' => 'return boinccore_get_country_list();', |
347 | 347 | 'widget' => array( |
348 | - 'default_value' => array( |
|
348 | + 'default_value' => array( |
|
349 | 349 | '0' => array( |
350 | - 'value' => '', |
|
351 | - ), |
|
352 | - ), |
|
353 | - 'default_value_php' => NULL, |
|
354 | - 'label' => 'Country', |
|
355 | - 'weight' => '5', |
|
356 | - 'description' => '', |
|
357 | - 'type' => 'optionwidgets_select', |
|
358 | - 'module' => 'optionwidgets', |
|
350 | + 'value' => '', |
|
351 | + ), |
|
352 | + ), |
|
353 | + 'default_value_php' => NULL, |
|
354 | + 'label' => 'Country', |
|
355 | + 'weight' => '5', |
|
356 | + 'description' => '', |
|
357 | + 'type' => 'optionwidgets_select', |
|
358 | + 'module' => 'optionwidgets', |
|
359 | 359 | ), |
360 | - ); |
|
360 | + ); |
|
361 | 361 | |
362 | - // Exported field: field_image |
|
363 | - $fields['profile-field_image'] = array( |
|
362 | + // Exported field: field_image |
|
363 | + $fields['profile-field_image'] = array( |
|
364 | 364 | 'field_name' => 'field_image', |
365 | 365 | 'type_name' => 'profile', |
366 | 366 | 'display_settings' => array( |
367 | - 'label' => array( |
|
367 | + 'label' => array( |
|
368 | 368 | 'format' => 'above', |
369 | 369 | 'exclude' => 0, |
370 | - ), |
|
371 | - 'teaser' => array( |
|
370 | + ), |
|
371 | + 'teaser' => array( |
|
372 | 372 | 'format' => 'image_plain', |
373 | 373 | 'exclude' => 0, |
374 | - ), |
|
375 | - 'full' => array( |
|
374 | + ), |
|
375 | + 'full' => array( |
|
376 | 376 | 'format' => 'image_plain', |
377 | 377 | 'exclude' => 0, |
378 | - ), |
|
379 | - '4' => array( |
|
378 | + ), |
|
379 | + '4' => array( |
|
380 | 380 | 'format' => 'image_plain', |
381 | 381 | 'exclude' => 0, |
382 | - ), |
|
383 | - '2' => array( |
|
382 | + ), |
|
383 | + '2' => array( |
|
384 | 384 | 'format' => 'image_plain', |
385 | 385 | 'exclude' => 0, |
386 | - ), |
|
387 | - '3' => array( |
|
386 | + ), |
|
387 | + '3' => array( |
|
388 | 388 | 'format' => 'image_plain', |
389 | 389 | 'exclude' => 0, |
390 | - ), |
|
391 | - 'token' => array( |
|
390 | + ), |
|
391 | + 'token' => array( |
|
392 | 392 | 'format' => 'image_plain', |
393 | 393 | 'exclude' => 0, |
394 | - ), |
|
394 | + ), |
|
395 | 395 | ), |
396 | 396 | 'widget_active' => '1', |
397 | 397 | 'type' => 'filefield', |
@@ -403,19 +403,19 @@ discard block |
||
403 | 403 | 'list_default' => 1, |
404 | 404 | 'description_field' => '0', |
405 | 405 | 'widget' => array( |
406 | - 'file_extensions' => 'png gif jpg jpeg', |
|
407 | - 'file_path' => 'profiles', |
|
408 | - 'progress_indicator' => 'bar', |
|
409 | - 'max_filesize_per_file' => '512K', |
|
410 | - 'max_filesize_per_node' => '', |
|
411 | - 'max_resolution' => '300x300', |
|
412 | - 'min_resolution' => '50x50', |
|
413 | - 'alt' => '', |
|
414 | - 'custom_alt' => 0, |
|
415 | - 'title' => '', |
|
416 | - 'custom_title' => 0, |
|
417 | - 'title_type' => 'textfield', |
|
418 | - 'default_image' => array( |
|
406 | + 'file_extensions' => 'png gif jpg jpeg', |
|
407 | + 'file_path' => 'profiles', |
|
408 | + 'progress_indicator' => 'bar', |
|
409 | + 'max_filesize_per_file' => '512K', |
|
410 | + 'max_filesize_per_node' => '', |
|
411 | + 'max_resolution' => '300x300', |
|
412 | + 'min_resolution' => '50x50', |
|
413 | + 'alt' => '', |
|
414 | + 'custom_alt' => 0, |
|
415 | + 'title' => '', |
|
416 | + 'custom_title' => 0, |
|
417 | + 'title_type' => 'textfield', |
|
418 | + 'default_image' => array( |
|
419 | 419 | 'filename' => 'default-avatar.png', |
420 | 420 | 'filepath' => 'sites/default/files/imagefield_default_images/default-avatar.png', |
421 | 421 | 'filemime' => 'image/png', |
@@ -426,49 +426,49 @@ discard block |
||
426 | 426 | 'status' => 1, |
427 | 427 | 'timestamp' => 1347855344, |
428 | 428 | 'fid' => '1', |
429 | - ), |
|
430 | - 'use_default_image' => 1, |
|
431 | - 'label' => 'Avatar', |
|
432 | - 'weight' => '7', |
|
433 | - 'description' => '', |
|
434 | - 'type' => 'imagefield_widget', |
|
435 | - 'module' => 'imagefield', |
|
429 | + ), |
|
430 | + 'use_default_image' => 1, |
|
431 | + 'label' => 'Avatar', |
|
432 | + 'weight' => '7', |
|
433 | + 'description' => '', |
|
434 | + 'type' => 'imagefield_widget', |
|
435 | + 'module' => 'imagefield', |
|
436 | 436 | ), |
437 | - ); |
|
437 | + ); |
|
438 | 438 | |
439 | - // Exported field: field_opinions |
|
440 | - $fields['profile-field_opinions'] = array( |
|
439 | + // Exported field: field_opinions |
|
440 | + $fields['profile-field_opinions'] = array( |
|
441 | 441 | 'field_name' => 'field_opinions', |
442 | 442 | 'type_name' => 'profile', |
443 | 443 | 'display_settings' => array( |
444 | - 'label' => array( |
|
444 | + 'label' => array( |
|
445 | 445 | 'format' => 'above', |
446 | 446 | 'exclude' => 0, |
447 | - ), |
|
448 | - 'teaser' => array( |
|
447 | + ), |
|
448 | + 'teaser' => array( |
|
449 | 449 | 'format' => 'default', |
450 | 450 | 'exclude' => 0, |
451 | - ), |
|
452 | - 'full' => array( |
|
451 | + ), |
|
452 | + 'full' => array( |
|
453 | 453 | 'format' => 'default', |
454 | 454 | 'exclude' => 0, |
455 | - ), |
|
456 | - '4' => array( |
|
455 | + ), |
|
456 | + '4' => array( |
|
457 | 457 | 'format' => 'default', |
458 | 458 | 'exclude' => 0, |
459 | - ), |
|
460 | - '2' => array( |
|
459 | + ), |
|
460 | + '2' => array( |
|
461 | 461 | 'format' => 'default', |
462 | 462 | 'exclude' => 0, |
463 | - ), |
|
464 | - '3' => array( |
|
463 | + ), |
|
464 | + '3' => array( |
|
465 | 465 | 'format' => 'default', |
466 | 466 | 'exclude' => 0, |
467 | - ), |
|
468 | - 'token' => array( |
|
467 | + ), |
|
468 | + 'token' => array( |
|
469 | 469 | 'format' => 'default', |
470 | 470 | 'exclude' => 0, |
471 | - ), |
|
471 | + ), |
|
472 | 472 | ), |
473 | 473 | 'widget_active' => '1', |
474 | 474 | 'type' => 'text', |
@@ -481,60 +481,60 @@ discard block |
||
481 | 481 | 'allowed_values' => '', |
482 | 482 | 'allowed_values_php' => '', |
483 | 483 | 'widget' => array( |
484 | - 'rows' => '10', |
|
485 | - 'size' => 60, |
|
486 | - 'default_value' => array( |
|
484 | + 'rows' => '10', |
|
485 | + 'size' => 60, |
|
486 | + 'default_value' => array( |
|
487 | 487 | '0' => array( |
488 | - 'value' => '', |
|
489 | - '_error_element' => 'default_value_widget][field_opinions][0][value', |
|
490 | - ), |
|
491 | - ), |
|
492 | - 'default_value_php' => NULL, |
|
493 | - 'label' => bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'), |
|
494 | - 'weight' => '4', |
|
495 | - 'description' => bts('Tell us your thoughts about @this_project |
|
488 | + 'value' => '', |
|
489 | + '_error_element' => 'default_value_widget][field_opinions][0][value', |
|
490 | + ), |
|
491 | + ), |
|
492 | + 'default_value_php' => NULL, |
|
493 | + 'label' => bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'), |
|
494 | + 'weight' => '4', |
|
495 | + 'description' => bts('Tell us your thoughts about @this_project |
|
496 | 496 | 1. Why do you run @this_project? |
497 | 497 | 2. What are your views about the project? |
498 | 498 | 3. Any suggestions?', |
499 | - array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:account-profile-edit'), |
|
500 | - 'type' => 'text_textarea', |
|
501 | - 'module' => 'text', |
|
499 | + array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:account-profile-edit'), |
|
500 | + 'type' => 'text_textarea', |
|
501 | + 'module' => 'text', |
|
502 | 502 | ), |
503 | - ); |
|
503 | + ); |
|
504 | 504 | |
505 | - // Exported field: field_profile_image |
|
506 | - $fields['profile-field_profile_image'] = array( |
|
505 | + // Exported field: field_profile_image |
|
506 | + $fields['profile-field_profile_image'] = array( |
|
507 | 507 | 'field_name' => 'field_profile_image', |
508 | 508 | 'type_name' => 'profile', |
509 | 509 | 'display_settings' => array( |
510 | - 'label' => array( |
|
510 | + 'label' => array( |
|
511 | 511 | 'format' => 'above', |
512 | 512 | 'exclude' => 0, |
513 | - ), |
|
514 | - 'teaser' => array( |
|
513 | + ), |
|
514 | + 'teaser' => array( |
|
515 | 515 | 'format' => 'image_plain', |
516 | 516 | 'exclude' => 0, |
517 | - ), |
|
518 | - 'full' => array( |
|
517 | + ), |
|
518 | + 'full' => array( |
|
519 | 519 | 'format' => 'image_plain', |
520 | 520 | 'exclude' => 0, |
521 | - ), |
|
522 | - '4' => array( |
|
521 | + ), |
|
522 | + '4' => array( |
|
523 | 523 | 'format' => 'image_plain', |
524 | 524 | 'exclude' => 0, |
525 | - ), |
|
526 | - '2' => array( |
|
525 | + ), |
|
526 | + '2' => array( |
|
527 | 527 | 'format' => 'image_plain', |
528 | 528 | 'exclude' => 0, |
529 | - ), |
|
530 | - '3' => array( |
|
529 | + ), |
|
530 | + '3' => array( |
|
531 | 531 | 'format' => 'image_plain', |
532 | 532 | 'exclude' => 0, |
533 | - ), |
|
534 | - 'token' => array( |
|
533 | + ), |
|
534 | + 'token' => array( |
|
535 | 535 | 'format' => 'image_plain', |
536 | 536 | 'exclude' => 0, |
537 | - ), |
|
537 | + ), |
|
538 | 538 | ), |
539 | 539 | 'widget_active' => '1', |
540 | 540 | 'type' => 'filefield', |
@@ -546,19 +546,19 @@ discard block |
||
546 | 546 | 'list_default' => 1, |
547 | 547 | 'description_field' => '0', |
548 | 548 | 'widget' => array( |
549 | - 'file_extensions' => 'png gif jpg jpeg', |
|
550 | - 'file_path' => 'profiles', |
|
551 | - 'progress_indicator' => 'bar', |
|
552 | - 'max_filesize_per_file' => '512K', |
|
553 | - 'max_filesize_per_node' => '', |
|
554 | - 'max_resolution' => '640x480', |
|
555 | - 'min_resolution' => '100x100', |
|
556 | - 'alt' => '', |
|
557 | - 'custom_alt' => 0, |
|
558 | - 'title' => '', |
|
559 | - 'custom_title' => 0, |
|
560 | - 'title_type' => 'textfield', |
|
561 | - 'default_image' => array( |
|
549 | + 'file_extensions' => 'png gif jpg jpeg', |
|
550 | + 'file_path' => 'profiles', |
|
551 | + 'progress_indicator' => 'bar', |
|
552 | + 'max_filesize_per_file' => '512K', |
|
553 | + 'max_filesize_per_node' => '', |
|
554 | + 'max_resolution' => '640x480', |
|
555 | + 'min_resolution' => '100x100', |
|
556 | + 'alt' => '', |
|
557 | + 'custom_alt' => 0, |
|
558 | + 'title' => '', |
|
559 | + 'custom_title' => 0, |
|
560 | + 'title_type' => 'textfield', |
|
561 | + 'default_image' => array( |
|
562 | 562 | 'filename' => 'default-user.png', |
563 | 563 | 'filepath' => 'sites/default/files/imagefield_default_images/default-user.png', |
564 | 564 | 'filemime' => 'image/png', |
@@ -569,49 +569,49 @@ discard block |
||
569 | 569 | 'status' => 1, |
570 | 570 | 'timestamp' => 1362770990, |
571 | 571 | 'fid' => '5', |
572 | - ), |
|
573 | - 'use_default_image' => 1, |
|
574 | - 'label' => 'Profile image', |
|
575 | - 'weight' => '8', |
|
576 | - 'description' => '', |
|
577 | - 'type' => 'imagefield_widget', |
|
578 | - 'module' => 'imagefield', |
|
572 | + ), |
|
573 | + 'use_default_image' => 1, |
|
574 | + 'label' => 'Profile image', |
|
575 | + 'weight' => '8', |
|
576 | + 'description' => '', |
|
577 | + 'type' => 'imagefield_widget', |
|
578 | + 'module' => 'imagefield', |
|
579 | 579 | ), |
580 | - ); |
|
580 | + ); |
|
581 | 581 | |
582 | - // Exported field: field_url |
|
583 | - $fields['profile-field_url'] = array( |
|
582 | + // Exported field: field_url |
|
583 | + $fields['profile-field_url'] = array( |
|
584 | 584 | 'field_name' => 'field_url', |
585 | 585 | 'type_name' => 'profile', |
586 | 586 | 'display_settings' => array( |
587 | - 'label' => array( |
|
587 | + 'label' => array( |
|
588 | 588 | 'format' => 'above', |
589 | 589 | 'exclude' => 0, |
590 | - ), |
|
591 | - 'teaser' => array( |
|
590 | + ), |
|
591 | + 'teaser' => array( |
|
592 | 592 | 'format' => 'default', |
593 | 593 | 'exclude' => 0, |
594 | - ), |
|
595 | - 'full' => array( |
|
594 | + ), |
|
595 | + 'full' => array( |
|
596 | 596 | 'format' => 'default', |
597 | 597 | 'exclude' => 0, |
598 | - ), |
|
599 | - '4' => array( |
|
598 | + ), |
|
599 | + '4' => array( |
|
600 | 600 | 'format' => 'default', |
601 | 601 | 'exclude' => 0, |
602 | - ), |
|
603 | - '2' => array( |
|
602 | + ), |
|
603 | + '2' => array( |
|
604 | 604 | 'format' => 'default', |
605 | 605 | 'exclude' => 0, |
606 | - ), |
|
607 | - '3' => array( |
|
606 | + ), |
|
607 | + '3' => array( |
|
608 | 608 | 'format' => 'default', |
609 | 609 | 'exclude' => 0, |
610 | - ), |
|
611 | - 'token' => array( |
|
610 | + ), |
|
611 | + 'token' => array( |
|
612 | 612 | 'format' => 'default', |
613 | 613 | 'exclude' => 0, |
614 | - ), |
|
614 | + ), |
|
615 | 615 | ), |
616 | 616 | 'widget_active' => '1', |
617 | 617 | 'type' => 'text', |
@@ -624,56 +624,56 @@ discard block |
||
624 | 624 | 'allowed_values' => '', |
625 | 625 | 'allowed_values_php' => '', |
626 | 626 | 'widget' => array( |
627 | - 'rows' => 5, |
|
628 | - 'size' => '42', |
|
629 | - 'default_value' => array( |
|
627 | + 'rows' => 5, |
|
628 | + 'size' => '42', |
|
629 | + 'default_value' => array( |
|
630 | 630 | '0' => array( |
631 | - 'value' => '', |
|
632 | - '_error_element' => 'default_value_widget][field_url][0][value', |
|
633 | - ), |
|
634 | - ), |
|
635 | - 'default_value_php' => NULL, |
|
636 | - 'label' => 'Website URL', |
|
637 | - 'weight' => '9', |
|
638 | - 'description' => '', |
|
639 | - 'type' => 'text_textfield', |
|
640 | - 'module' => 'text', |
|
631 | + 'value' => '', |
|
632 | + '_error_element' => 'default_value_widget][field_url][0][value', |
|
633 | + ), |
|
634 | + ), |
|
635 | + 'default_value_php' => NULL, |
|
636 | + 'label' => 'Website URL', |
|
637 | + 'weight' => '9', |
|
638 | + 'description' => '', |
|
639 | + 'type' => 'text_textfield', |
|
640 | + 'module' => 'text', |
|
641 | 641 | ), |
642 | - ); |
|
642 | + ); |
|
643 | 643 | |
644 | - // Exported field: field_zip |
|
645 | - $fields['profile-field_zip'] = array( |
|
644 | + // Exported field: field_zip |
|
645 | + $fields['profile-field_zip'] = array( |
|
646 | 646 | 'field_name' => 'field_zip', |
647 | 647 | 'type_name' => 'profile', |
648 | 648 | 'display_settings' => array( |
649 | - 'label' => array( |
|
649 | + 'label' => array( |
|
650 | 650 | 'format' => 'above', |
651 | 651 | 'exclude' => 0, |
652 | - ), |
|
653 | - 'teaser' => array( |
|
652 | + ), |
|
653 | + 'teaser' => array( |
|
654 | 654 | 'format' => 'default', |
655 | 655 | 'exclude' => 0, |
656 | - ), |
|
657 | - 'full' => array( |
|
656 | + ), |
|
657 | + 'full' => array( |
|
658 | 658 | 'format' => 'default', |
659 | 659 | 'exclude' => 0, |
660 | - ), |
|
661 | - '4' => array( |
|
660 | + ), |
|
661 | + '4' => array( |
|
662 | 662 | 'format' => 'default', |
663 | 663 | 'exclude' => 0, |
664 | - ), |
|
665 | - '2' => array( |
|
664 | + ), |
|
665 | + '2' => array( |
|
666 | 666 | 'format' => 'default', |
667 | 667 | 'exclude' => 0, |
668 | - ), |
|
669 | - '3' => array( |
|
668 | + ), |
|
669 | + '3' => array( |
|
670 | 670 | 'format' => 'default', |
671 | 671 | 'exclude' => 0, |
672 | - ), |
|
673 | - 'token' => array( |
|
672 | + ), |
|
673 | + 'token' => array( |
|
674 | 674 | 'format' => 'default', |
675 | 675 | 'exclude' => 0, |
676 | - ), |
|
676 | + ), |
|
677 | 677 | ), |
678 | 678 | 'widget_active' => '1', |
679 | 679 | 'type' => 'text', |
@@ -686,32 +686,32 @@ discard block |
||
686 | 686 | 'allowed_values' => '', |
687 | 687 | 'allowed_values_php' => '', |
688 | 688 | 'widget' => array( |
689 | - 'rows' => 5, |
|
690 | - 'size' => '10', |
|
691 | - 'default_value' => array( |
|
689 | + 'rows' => 5, |
|
690 | + 'size' => '10', |
|
691 | + 'default_value' => array( |
|
692 | 692 | '0' => array( |
693 | - 'value' => '', |
|
694 | - '_error_element' => 'default_value_widget][field_zip][0][value', |
|
695 | - ), |
|
696 | - ), |
|
697 | - 'default_value_php' => NULL, |
|
698 | - 'label' => bts('Postal code', array(), NULL, 'boinc:account-profile-edit'), |
|
699 | - 'weight' => '6', |
|
700 | - 'description' => '', |
|
701 | - 'type' => 'text_textfield', |
|
702 | - 'module' => 'text', |
|
693 | + 'value' => '', |
|
694 | + '_error_element' => 'default_value_widget][field_zip][0][value', |
|
695 | + ), |
|
696 | + ), |
|
697 | + 'default_value_php' => NULL, |
|
698 | + 'label' => bts('Postal code', array(), NULL, 'boinc:account-profile-edit'), |
|
699 | + 'weight' => '6', |
|
700 | + 'description' => '', |
|
701 | + 'type' => 'text_textfield', |
|
702 | + 'module' => 'text', |
|
703 | 703 | ), |
704 | - ); |
|
704 | + ); |
|
705 | 705 | |
706 | - // Translatables |
|
707 | - // Use bts() function to translate additional strings. |
|
708 | - bts('Avatar', array(), NULL, 'boinc:account-profile-edit'); |
|
709 | - bts('Country', array(), NULL, 'boinc:country-of-origin'); |
|
710 | - bts('Profile image', array(), NULL, 'boinc:account-profile-edit'); |
|
711 | - bts('Website URL', array(), NULL, 'boinc:account-profile-edit'); |
|
712 | - bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'); |
|
713 | - bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'); |
|
714 | - bts('Postal code', array(), NULL, 'boinc:account-profile-edit'); |
|
706 | + // Translatables |
|
707 | + // Use bts() function to translate additional strings. |
|
708 | + bts('Avatar', array(), NULL, 'boinc:account-profile-edit'); |
|
709 | + bts('Country', array(), NULL, 'boinc:country-of-origin'); |
|
710 | + bts('Profile image', array(), NULL, 'boinc:account-profile-edit'); |
|
711 | + bts('Website URL', array(), NULL, 'boinc:account-profile-edit'); |
|
712 | + bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'); |
|
713 | + bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'); |
|
714 | + bts('Postal code', array(), NULL, 'boinc:account-profile-edit'); |
|
715 | 715 | |
716 | - return $fields; |
|
716 | + return $fields; |
|
717 | 717 | } |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | '_error_element' => 'default_value_widget][field_background][0][value', |
60 | 60 | ), |
61 | 61 | ), |
62 | - 'default_value_php' => NULL, |
|
63 | - 'label' => bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'), |
|
62 | + 'default_value_php' => null, |
|
63 | + 'label' => bts('Your personal background', array(), null, 'boinc:account-profile-edit'), |
|
64 | 64 | 'weight' => '3', |
65 | - 'description' => bts('Tell us about yourself. You could tell us where you\'re from, your age, occupation, hobbies, or anything else about yourself.', array(), NULL, 'boinc:account-profile-edit'), |
|
65 | + 'description' => bts('Tell us about yourself. You could tell us where you\'re from, your age, occupation, hobbies, or anything else about yourself.', array(), null, 'boinc:account-profile-edit'), |
|
66 | 66 | 'type' => 'text_textarea', |
67 | 67 | 'module' => 'text', |
68 | 68 | ), |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | 'value' => '', |
351 | 351 | ), |
352 | 352 | ), |
353 | - 'default_value_php' => NULL, |
|
353 | + 'default_value_php' => null, |
|
354 | 354 | 'label' => 'Country', |
355 | 355 | 'weight' => '5', |
356 | 356 | 'description' => '', |
@@ -489,14 +489,14 @@ discard block |
||
489 | 489 | '_error_element' => 'default_value_widget][field_opinions][0][value', |
490 | 490 | ), |
491 | 491 | ), |
492 | - 'default_value_php' => NULL, |
|
493 | - 'label' => bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'), |
|
492 | + 'default_value_php' => null, |
|
493 | + 'label' => bts('Your opinions about this project', array(), null, 'boinc:account-profile-edit'), |
|
494 | 494 | 'weight' => '4', |
495 | 495 | 'description' => bts('Tell us your thoughts about @this_project |
496 | 496 | 1. Why do you run @this_project? |
497 | 497 | 2. What are your views about the project? |
498 | 498 | 3. Any suggestions?', |
499 | - array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:account-profile-edit'), |
|
499 | + array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), null, 'boinc:account-profile-edit'), |
|
500 | 500 | 'type' => 'text_textarea', |
501 | 501 | 'module' => 'text', |
502 | 502 | ), |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | '_error_element' => 'default_value_widget][field_url][0][value', |
633 | 633 | ), |
634 | 634 | ), |
635 | - 'default_value_php' => NULL, |
|
635 | + 'default_value_php' => null, |
|
636 | 636 | 'label' => 'Website URL', |
637 | 637 | 'weight' => '9', |
638 | 638 | 'description' => '', |
@@ -694,8 +694,8 @@ discard block |
||
694 | 694 | '_error_element' => 'default_value_widget][field_zip][0][value', |
695 | 695 | ), |
696 | 696 | ), |
697 | - 'default_value_php' => NULL, |
|
698 | - 'label' => bts('Postal code', array(), NULL, 'boinc:account-profile-edit'), |
|
697 | + 'default_value_php' => null, |
|
698 | + 'label' => bts('Postal code', array(), null, 'boinc:account-profile-edit'), |
|
699 | 699 | 'weight' => '6', |
700 | 700 | 'description' => '', |
701 | 701 | 'type' => 'text_textfield', |
@@ -705,13 +705,13 @@ discard block |
||
705 | 705 | |
706 | 706 | // Translatables |
707 | 707 | // Use bts() function to translate additional strings. |
708 | - bts('Avatar', array(), NULL, 'boinc:account-profile-edit'); |
|
709 | - bts('Country', array(), NULL, 'boinc:country-of-origin'); |
|
710 | - bts('Profile image', array(), NULL, 'boinc:account-profile-edit'); |
|
711 | - bts('Website URL', array(), NULL, 'boinc:account-profile-edit'); |
|
712 | - bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'); |
|
713 | - bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'); |
|
714 | - bts('Postal code', array(), NULL, 'boinc:account-profile-edit'); |
|
708 | + bts('Avatar', array(), null, 'boinc:account-profile-edit'); |
|
709 | + bts('Country', array(), null, 'boinc:country-of-origin'); |
|
710 | + bts('Profile image', array(), null, 'boinc:account-profile-edit'); |
|
711 | + bts('Website URL', array(), null, 'boinc:account-profile-edit'); |
|
712 | + bts('Your opinions about this project', array(), null, 'boinc:account-profile-edit'); |
|
713 | + bts('Your personal background', array(), null, 'boinc:account-profile-edit'); |
|
714 | + bts('Postal code', array(), null, 'boinc:account-profile-edit'); |
|
715 | 715 | |
716 | 716 | return $fields; |
717 | 717 | } |
@@ -4,33 +4,33 @@ discard block |
||
4 | 4 | * Implementation of hook_default_panels_mini(). |
5 | 5 | */ |
6 | 6 | function stats_charts_default_panels_mini() { |
7 | - $export = array(); |
|
7 | + $export = array(); |
|
8 | 8 | |
9 | - $mini = new stdClass; |
|
10 | - $mini->disabled = FALSE; /* Edit this to true to make a default mini disabled initially */ |
|
11 | - $mini->api_version = 1; |
|
12 | - $mini->name = 'project_stats_overview'; |
|
13 | - $mini->category = 'BOINC'; |
|
14 | - $mini->admin_title = 'Project stats overview'; |
|
15 | - $mini->admin_description = 'General statistical information for the project'; |
|
16 | - $mini->requiredcontexts = array(); |
|
17 | - $mini->contexts = array(); |
|
18 | - $mini->relationships = array(); |
|
19 | - $display = new panels_display; |
|
20 | - $display->layout = 'onecol'; |
|
21 | - $display->layout_settings = array(); |
|
22 | - $display->panel_settings = array( |
|
9 | + $mini = new stdClass; |
|
10 | + $mini->disabled = FALSE; /* Edit this to true to make a default mini disabled initially */ |
|
11 | + $mini->api_version = 1; |
|
12 | + $mini->name = 'project_stats_overview'; |
|
13 | + $mini->category = 'BOINC'; |
|
14 | + $mini->admin_title = 'Project stats overview'; |
|
15 | + $mini->admin_description = 'General statistical information for the project'; |
|
16 | + $mini->requiredcontexts = array(); |
|
17 | + $mini->contexts = array(); |
|
18 | + $mini->relationships = array(); |
|
19 | + $display = new panels_display; |
|
20 | + $display->layout = 'onecol'; |
|
21 | + $display->layout_settings = array(); |
|
22 | + $display->panel_settings = array( |
|
23 | 23 | 'style_settings' => array( |
24 | - 'default' => NULL, |
|
25 | - 'middle' => NULL, |
|
24 | + 'default' => NULL, |
|
25 | + 'middle' => NULL, |
|
26 | 26 | ), |
27 | - ); |
|
28 | - $display->cache = array(); |
|
29 | - $display->title = ''; |
|
30 | - $display->storage_type = 'panels_mini'; |
|
31 | - $display->storage_id = 'project_stats_overview'; |
|
32 | - $display->content = array(); |
|
33 | - $display->panels = array(); |
|
27 | + ); |
|
28 | + $display->cache = array(); |
|
29 | + $display->title = ''; |
|
30 | + $display->storage_type = 'panels_mini'; |
|
31 | + $display->storage_id = 'project_stats_overview'; |
|
32 | + $display->content = array(); |
|
33 | + $display->panels = array(); |
|
34 | 34 | $pane = new stdClass; |
35 | 35 | $pane->pid = 'new-1'; |
36 | 36 | $pane->panel = 'middle'; |
@@ -39,25 +39,25 @@ discard block |
||
39 | 39 | $pane->shown = TRUE; |
40 | 40 | $pane->access = array(); |
41 | 41 | $pane->configuration = array( |
42 | - 'admin_title' => 'Project stats overview', |
|
43 | - 'title' => bts('@this_project Progress', array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:frontpage'), |
|
44 | - 'body' => '<?php echo boincstats_get_project_stats_overview(); ?>', |
|
45 | - 'format' => '3', |
|
46 | - 'substitute' => TRUE, |
|
42 | + 'admin_title' => 'Project stats overview', |
|
43 | + 'title' => bts('@this_project Progress', array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:frontpage'), |
|
44 | + 'body' => '<?php echo boincstats_get_project_stats_overview(); ?>', |
|
45 | + 'format' => '3', |
|
46 | + 'substitute' => TRUE, |
|
47 | 47 | ); |
48 | 48 | $pane->cache = array(); |
49 | 49 | $pane->style = array( |
50 | - 'settings' => NULL, |
|
50 | + 'settings' => NULL, |
|
51 | 51 | ); |
52 | 52 | $pane->css = array(); |
53 | 53 | $pane->extras = array(); |
54 | 54 | $pane->position = 0; |
55 | 55 | $display->content['new-1'] = $pane; |
56 | 56 | $display->panels['middle'][0] = 'new-1'; |
57 | - $display->hide_title = PANELS_TITLE_FIXED; |
|
58 | - $display->title_pane = 'new-1'; |
|
59 | - $mini->display = $display; |
|
60 | - $export['project_stats_overview'] = $mini; |
|
57 | + $display->hide_title = PANELS_TITLE_FIXED; |
|
58 | + $display->title_pane = 'new-1'; |
|
59 | + $mini->display = $display; |
|
60 | + $export['project_stats_overview'] = $mini; |
|
61 | 61 | |
62 | - return $export; |
|
62 | + return $export; |
|
63 | 63 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $export = array(); |
8 | 8 | |
9 | 9 | $mini = new stdClass; |
10 | - $mini->disabled = FALSE; /* Edit this to true to make a default mini disabled initially */ |
|
10 | + $mini->disabled = false; /* Edit this to true to make a default mini disabled initially */ |
|
11 | 11 | $mini->api_version = 1; |
12 | 12 | $mini->name = 'project_stats_overview'; |
13 | 13 | $mini->category = 'BOINC'; |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | $display->layout_settings = array(); |
22 | 22 | $display->panel_settings = array( |
23 | 23 | 'style_settings' => array( |
24 | - 'default' => NULL, |
|
25 | - 'middle' => NULL, |
|
24 | + 'default' => null, |
|
25 | + 'middle' => null, |
|
26 | 26 | ), |
27 | 27 | ); |
28 | 28 | $display->cache = array(); |
@@ -36,18 +36,18 @@ discard block |
||
36 | 36 | $pane->panel = 'middle'; |
37 | 37 | $pane->type = 'custom'; |
38 | 38 | $pane->subtype = 'custom'; |
39 | - $pane->shown = TRUE; |
|
39 | + $pane->shown = true; |
|
40 | 40 | $pane->access = array(); |
41 | 41 | $pane->configuration = array( |
42 | 42 | 'admin_title' => 'Project stats overview', |
43 | - 'title' => bts('@this_project Progress', array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:frontpage'), |
|
43 | + 'title' => bts('@this_project Progress', array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), null, 'boinc:frontpage'), |
|
44 | 44 | 'body' => '<?php echo boincstats_get_project_stats_overview(); ?>', |
45 | 45 | 'format' => '3', |
46 | - 'substitute' => TRUE, |
|
46 | + 'substitute' => true, |
|
47 | 47 | ); |
48 | 48 | $pane->cache = array(); |
49 | 49 | $pane->style = array( |
50 | - 'settings' => NULL, |
|
50 | + 'settings' => null, |
|
51 | 51 | ); |
52 | 52 | $pane->css = array(); |
53 | 53 | $pane->extras = array(); |
@@ -76,7 +76,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -219,8 +219,8 @@ |
||
219 | 219 | echo "<p>".tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).")."</p> |
220 | 220 | <p>" |
221 | 221 | .tra("You can also %1 try the same search on Google. %2", |
222 | - "<a href=\"https://www.google.com/search?domains=".url_base()."&sitesearch=".url_base()."forum_thread.php&q=".htmlentities($search_keywords)."\">", |
|
223 | - "</a>") |
|
222 | + "<a href=\"https://www.google.com/search?domains=".url_base()."&sitesearch=".url_base()."forum_thread.php&q=".htmlentities($search_keywords)."\">", |
|
223 | + "</a>") |
|
224 | 224 | ."</p>"; |
225 | 225 | } |
226 | 226 | echo "<p><a href=\"forum_search.php\">".tra("Perform another search")."</a></p>"; |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | // Optionally filters by forum, user, time, or hidden if specified. |
32 | 32 | // |
33 | 33 | function search_thread_titles( |
34 | - $keyword_list, $forum="", $user="", $time="", $limit=200, |
|
35 | - $sort_style=CREATE_TIME_NEW, $show_hidden = false |
|
36 | -){ |
|
37 | - $search_string="%"; |
|
34 | + $keyword_list, $forum = "", $user = "", $time = "", $limit = 200, |
|
35 | + $sort_style = CREATE_TIME_NEW, $show_hidden = false |
|
36 | +) { |
|
37 | + $search_string = "%"; |
|
38 | 38 | foreach ($keyword_list as $key => $word) { |
39 | 39 | $search_string .= BoincDb::escape_string($word)."%"; |
40 | 40 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if (!$show_hidden) { |
52 | 52 | $query .= " and thread.hidden = 0"; |
53 | 53 | } |
54 | - switch($sort_style) { |
|
54 | + switch ($sort_style) { |
|
55 | 55 | case MODIFIED_NEW: |
56 | 56 | $query .= ' ORDER BY timestamp DESC'; |
57 | 57 | break; |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | // |
85 | 85 | function search_post_content( |
86 | 86 | $keyword_list, $forum, $user, $time, $limit, $sort_style, $show_hidden |
87 | -){ |
|
87 | +) { |
|
88 | 88 | $db = BoincDb::get(); |
89 | 89 | |
90 | - $search_string="%"; |
|
91 | - foreach ($keyword_list as $key => $word){ |
|
90 | + $search_string = "%"; |
|
91 | + foreach ($keyword_list as $key => $word) { |
|
92 | 92 | $search_string .= BoincDb::escape_string($word)."%"; |
93 | 93 | } |
94 | 94 | $optional_join = ""; |
@@ -100,20 +100,20 @@ discard block |
||
100 | 100 | } |
101 | 101 | $query = "select post.* from ".$db->db_name.".post".$optional_join." where content like '".$search_string."'"; |
102 | 102 | if ($forum) { |
103 | - $query.=" and forum = $forum->id"; |
|
103 | + $query .= " and forum = $forum->id"; |
|
104 | 104 | } |
105 | 105 | if ($user) { |
106 | - $query.=" and post.user = $user->id "; |
|
106 | + $query .= " and post.user = $user->id "; |
|
107 | 107 | } |
108 | 108 | if ($time) { |
109 | - $query.=" and post.timestamp > $time"; |
|
109 | + $query .= " and post.timestamp > $time"; |
|
110 | 110 | } |
111 | 111 | if (!$show_hidden) { |
112 | 112 | $query .= " AND post.hidden = 0"; |
113 | 113 | } |
114 | - switch($sort_style) { |
|
114 | + switch ($sort_style) { |
|
115 | 115 | case VIEWS_MOST: |
116 | - $query.= ' ORDER BY views DESC'; |
|
116 | + $query .= ' ORDER BY views DESC'; |
|
117 | 117 | break; |
118 | 118 | case CREATE_TIME_NEW: |
119 | 119 | $query .= ' ORDER by post.timestamp desc'; |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | $query .= ' ORDER BY post.timestamp DESC'; |
129 | 129 | break; |
130 | 130 | } |
131 | - $query.= " limit $limit"; |
|
131 | + $query .= " limit $limit"; |
|
132 | 132 | return BoincPost::enum_general($query); |
133 | 133 | } |
134 | 134 | |
135 | 135 | $logged_in_user = get_logged_in_user(false); |
136 | 136 | BoincForumPrefs::lookup($logged_in_user); |
137 | -if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)){ |
|
137 | +if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)) { |
|
138 | 138 | $show_hidden_posts = true; |
139 | 139 | } else { |
140 | 140 | $show_hidden_posts = false; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $search_max_time = post_int("search_max_time"); |
148 | 148 | $search_forum = post_int("search_forum"); |
149 | 149 | $search_sort = post_int("search_sort"); |
150 | -$search_list = explode(" ",$search_keywords); |
|
150 | +$search_list = explode(" ", $search_keywords); |
|
151 | 151 | if ($search_max_time) { |
152 | 152 | $min_timestamp = time() - ($search_max_time*3600*24); |
153 | 153 | } else { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | $limit = 100; |
158 | 158 | |
159 | -if ($search_forum==-1){ |
|
159 | +if ($search_forum == -1) { |
|
160 | 160 | $forum = null; |
161 | 161 | } else if ($search_forum) { |
162 | 162 | $forum = BoincForum::lookup_id($search_forum); |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | |
177 | 177 | // Display the threads |
178 | 178 | // |
179 | -if (count($threads)){ |
|
180 | - echo "<h3>" . tra("Thread titles matching your query:") . "</h3>"; |
|
179 | +if (count($threads)) { |
|
180 | + echo "<h3>".tra("Thread titles matching your query:")."</h3>"; |
|
181 | 181 | start_table('table-striped'); |
182 | 182 | thread_list_header(); |
183 | - foreach ($threads as $thread){ |
|
183 | + foreach ($threads as $thread) { |
|
184 | 184 | if (!$show_hidden_posts) { |
185 | 185 | $u = BoincUser::lookup_id($thread->owner); |
186 | 186 | if ($u && is_banished($u)) continue; |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | $show_hidden_posts |
201 | 201 | ); |
202 | 202 | |
203 | -if (count($posts)){ |
|
204 | - echo "<h3>" . tra("Messages matching your query:") . "</h3>"; |
|
203 | +if (count($posts)) { |
|
204 | + echo "<h3>".tra("Messages matching your query:")."</h3>"; |
|
205 | 205 | start_table('table-striped'); |
206 | 206 | row_heading_array(['Info', 'Post'], ['', 'width=70%']); |
207 | 207 | $n = 1; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | end_table(); |
229 | 229 | } |
230 | 230 | |
231 | -if (!count($threads) && !count($posts)){ |
|
231 | +if (!count($threads) && !count($posts)) { |
|
232 | 232 | echo "<p>".tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).")."</p> |
233 | 233 | <p>" |
234 | 234 | .tra("You can also %1 try the same search on Google. %2", |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | function search_thread_titles( |
34 | 34 | $keyword_list, $forum="", $user="", $time="", $limit=200, |
35 | 35 | $sort_style=CREATE_TIME_NEW, $show_hidden = false |
36 | -){ |
|
36 | +) { |
|
37 | 37 | $search_string="%"; |
38 | 38 | foreach ($keyword_list as $key => $word) { |
39 | 39 | $search_string .= BoincDb::escape_string($word)."%"; |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | // |
85 | 85 | function search_post_content( |
86 | 86 | $keyword_list, $forum, $user, $time, $limit, $sort_style, $show_hidden |
87 | -){ |
|
87 | +) { |
|
88 | 88 | $db = BoincDb::get(); |
89 | 89 | |
90 | 90 | $search_string="%"; |
91 | - foreach ($keyword_list as $key => $word){ |
|
91 | + foreach ($keyword_list as $key => $word) { |
|
92 | 92 | $search_string .= BoincDb::escape_string($word)."%"; |
93 | 93 | } |
94 | 94 | $optional_join = ""; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | $logged_in_user = get_logged_in_user(false); |
136 | 136 | BoincForumPrefs::lookup($logged_in_user); |
137 | -if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)){ |
|
137 | +if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)) { |
|
138 | 138 | $show_hidden_posts = true; |
139 | 139 | } else { |
140 | 140 | $show_hidden_posts = false; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | $limit = 100; |
158 | 158 | |
159 | -if ($search_forum==-1){ |
|
159 | +if ($search_forum==-1) { |
|
160 | 160 | $forum = null; |
161 | 161 | } else if ($search_forum) { |
162 | 162 | $forum = BoincForum::lookup_id($search_forum); |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | |
177 | 177 | // Display the threads |
178 | 178 | // |
179 | -if (count($threads)){ |
|
179 | +if (count($threads)) { |
|
180 | 180 | echo "<h3>" . tra("Thread titles matching your query:") . "</h3>"; |
181 | 181 | start_table('table-striped'); |
182 | 182 | thread_list_header(); |
183 | - foreach ($threads as $thread){ |
|
183 | + foreach ($threads as $thread) { |
|
184 | 184 | if (!$show_hidden_posts) { |
185 | 185 | $u = BoincUser::lookup_id($thread->owner); |
186 | 186 | if ($u && is_banished($u)) continue; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $show_hidden_posts |
201 | 201 | ); |
202 | 202 | |
203 | -if (count($posts)){ |
|
203 | +if (count($posts)) { |
|
204 | 204 | echo "<h3>" . tra("Messages matching your query:") . "</h3>"; |
205 | 205 | start_table('table-striped'); |
206 | 206 | row_heading_array(['Info', 'Post'], ['', 'width=70%']); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | end_table(); |
229 | 229 | } |
230 | 230 | |
231 | -if (!count($threads) && !count($posts)){ |
|
231 | +if (!count($threads) && !count($posts)) { |
|
232 | 232 | echo "<p>".tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).")."</p> |
233 | 233 | <p>" |
234 | 234 | .tra("You can also %1 try the same search on Google. %2", |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | ".tra("Your preferences have been updated, and |
34 | 34 | will take effect when your computer communicates with %1 |
35 | 35 | or you issue the %2 Update %3 command from the BOINC Manager.", |
36 | - PROJECT, "<strong>", "</strong>")." |
|
36 | + PROJECT, "<strong>", "</strong>")." |
|
37 | 37 | </p> |
38 | 38 | "; |
39 | 39 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ".tra("Your preferences have been reset to the defaults, and |
43 | 43 | will take effect when your computer communicates with %1 |
44 | 44 | or you issue the %2 Update %3 command from the BOINC Manager.", |
45 | - PROJECT, "<strong>", "</strong>")." |
|
45 | + PROJECT, "<strong>", "</strong>")." |
|
46 | 46 | </p> |
47 | 47 | "; |
48 | 48 | } |
@@ -387,8 +387,7 @@ |
||
387 | 387 | $team = node_load($nid); |
388 | 388 | $output .= '<p>' . bts('You may create a message board for use by @team', |
389 | 389 | array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>'; |
390 | - } |
|
391 | - else { |
|
390 | + } else { |
|
392 | 391 | $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>'; |
393 | 392 | } |
394 | 393 | $output .= '<ul>'; |
@@ -25,29 +25,29 @@ discard block |
||
25 | 25 | * Implementation of hook_menu() |
26 | 26 | */ |
27 | 27 | function boincteam_forum_menu() { |
28 | - $items = array(); |
|
28 | + $items = array(); |
|
29 | 29 | |
30 | - return $items; |
|
30 | + return $items; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Implementation of hook_form_alter() |
35 | 35 | */ |
36 | 36 | function boincteam_forum_form_alter(&$form, $form_state, $form_id) { |
37 | - switch ($form_id) { |
|
38 | - // Team forum node edit form |
|
39 | - case 'team_forum_node_form': |
|
37 | + switch ($form_id) { |
|
38 | + // Team forum node edit form |
|
39 | + case 'team_forum_node_form': |
|
40 | 40 | |
41 | 41 | // Internal fields to indicate where these changes are taking place |
42 | 42 | array_unshift($form, array( |
43 | - 'tfid' => array( |
|
43 | + 'tfid' => array( |
|
44 | 44 | '#type' => 'hidden', |
45 | 45 | '#value' => arg(3), |
46 | - ), |
|
46 | + ), |
|
47 | 47 | )); |
48 | 48 | break; |
49 | 49 | |
50 | - default: |
|
50 | + default: |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
@@ -56,26 +56,26 @@ discard block |
||
56 | 56 | * Obsolete in Drupal 7... |
57 | 57 | */ |
58 | 58 | function boincteam_forum_nodeapi(&$node, $op, $a3 = null, $a4 = null) { |
59 | - // In Drupal 7, these operation cases will all exist as their own hooks, |
|
60 | - // so let's approximate that here so that this function can simply be removed |
|
61 | - // upon migration to 7 |
|
62 | - switch($op) { |
|
63 | - case 'insert': |
|
59 | + // In Drupal 7, these operation cases will all exist as their own hooks, |
|
60 | + // so let's approximate that here so that this function can simply be removed |
|
61 | + // upon migration to 7 |
|
62 | + switch($op) { |
|
63 | + case 'insert': |
|
64 | 64 | boincteam_forum_node_insert($node); |
65 | 65 | break; |
66 | - case 'load': |
|
66 | + case 'load': |
|
67 | 67 | boincteam_forum_node_load($node); |
68 | 68 | break; |
69 | - case 'update': |
|
69 | + case 'update': |
|
70 | 70 | boincteam_forum_node_update($node); |
71 | 71 | break; |
72 | - case 'validate': |
|
72 | + case 'validate': |
|
73 | 73 | boincteam_forum_node_validate($node); |
74 | 74 | break; |
75 | - case 'view': |
|
75 | + case 'view': |
|
76 | 76 | boincteam_forum_node_view($node); |
77 | 77 | break; |
78 | - default: |
|
78 | + default: |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
@@ -84,21 +84,21 @@ discard block |
||
84 | 84 | * is inserted (forward compatible to Drupal 7) |
85 | 85 | */ |
86 | 86 | function boincteam_forum_node_insert($node) { |
87 | - switch($node->type) { |
|
88 | - case 'team_forum': |
|
87 | + switch($node->type) { |
|
88 | + case 'team_forum': |
|
89 | 89 | $account = user_load($node->uid); |
90 | 90 | $team_id = boincteam_forum_lookup_nid($node->tfid); |
91 | 91 | if ($account->team == $team_id) { |
92 | - db_query(" |
|
92 | + db_query(" |
|
93 | 93 | INSERT INTO {boincteam_forum_node} SET |
94 | 94 | nid = %d, |
95 | 95 | tfid = %d", |
96 | 96 | $node->nid, $node->tfid |
97 | - ); |
|
97 | + ); |
|
98 | 98 | } |
99 | 99 | unset($node->tfid); |
100 | 100 | break; |
101 | - default: |
|
101 | + default: |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
@@ -107,15 +107,15 @@ discard block |
||
107 | 107 | * is loaded (forward compatible to Drupal 7) |
108 | 108 | */ |
109 | 109 | function boincteam_forum_node_load($node) { |
110 | - switch($node->type) { |
|
111 | - case 'team_forum': |
|
110 | + switch($node->type) { |
|
111 | + case 'team_forum': |
|
112 | 112 | $node->tfid = db_result(db_query(" |
113 | 113 | SELECT tfid FROM {boincteam_forum_node} |
114 | 114 | WHERE nid = %d", $node->nid |
115 | 115 | )); |
116 | 116 | break; |
117 | 117 | |
118 | - default: |
|
118 | + default: |
|
119 | 119 | |
120 | 120 | } |
121 | 121 | } |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | * is updated (forward compatible to Drupal 7) |
126 | 126 | */ |
127 | 127 | function boincteam_forum_node_update($node) { |
128 | - switch($node->type) { |
|
129 | - case 'team_forum': |
|
128 | + switch($node->type) { |
|
129 | + case 'team_forum': |
|
130 | 130 | |
131 | 131 | break; |
132 | 132 | |
133 | - default: |
|
133 | + default: |
|
134 | 134 | |
135 | 135 | } |
136 | 136 | } |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | * is validated (forward compatible to Drupal 7) |
141 | 141 | */ |
142 | 142 | function boincteam_forum_node_validate($node) { |
143 | - switch($node->type) { |
|
144 | - case 'team_forum': |
|
143 | + switch($node->type) { |
|
144 | + case 'team_forum': |
|
145 | 145 | $account = user_load($node->uid); |
146 | 146 | // Get tfid from node, but if empty/null, get it from the database |
147 | 147 | if (!($node->tfid)) { |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | } |
155 | 155 | $team_id = boincteam_forum_lookup_nid($tfid); |
156 | 156 | if (!$account->team OR $account->team != $team_id) { |
157 | - drupal_set_message(t('Failed to add team forum topic.'), 'error'); |
|
158 | - drupal_goto('community/forum'); |
|
157 | + drupal_set_message(t('Failed to add team forum topic.'), 'error'); |
|
158 | + drupal_goto('community/forum'); |
|
159 | 159 | } |
160 | 160 | break; |
161 | - default: |
|
161 | + default: |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | |
@@ -167,19 +167,19 @@ discard block |
||
167 | 167 | * is viewed (forward compatible to Drupal 7) |
168 | 168 | */ |
169 | 169 | function boincteam_forum_node_view($node) { |
170 | - switch($node->type) { |
|
171 | - case 'team_forum': |
|
170 | + switch($node->type) { |
|
171 | + case 'team_forum': |
|
172 | 172 | $team_id = boincteam_forum_lookup_nid($node->tfid); |
173 | 173 | $public_forum = boincteam_forum_is_public($node->tfid); |
174 | 174 | $is_member = boincteam_is_member($team_id); |
175 | 175 | $is_global_moderator = boincteam_forum_is_global_moderator(); |
176 | 176 | if (!$public_forum AND !$is_member AND !$is_global_moderator) { |
177 | - drupal_not_found(); |
|
178 | - module_invoke_all('exit'); |
|
179 | - exit(); |
|
177 | + drupal_not_found(); |
|
178 | + module_invoke_all('exit'); |
|
179 | + exit(); |
|
180 | 180 | } |
181 | 181 | break; |
182 | - default: |
|
182 | + default: |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
@@ -187,17 +187,17 @@ discard block |
||
187 | 187 | * Implementation of hook_views_api(). |
188 | 188 | */ |
189 | 189 | function boincteam_forum_views_api() { |
190 | - return array( |
|
190 | + return array( |
|
191 | 191 | 'api' => 2.0, |
192 | 192 | 'path' => drupal_get_path('module', 'boincteam_forum') |
193 | - ); |
|
193 | + ); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Implementation of hook_perm() |
198 | 198 | */ |
199 | 199 | function boincteam_forum_perm() { |
200 | - return array('manage boincteam forum'); |
|
200 | + return array('manage boincteam forum'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -209,43 +209,43 @@ discard block |
||
209 | 209 | * Check if the user has global access to moderate team forums |
210 | 210 | */ |
211 | 211 | function boincteam_forum_is_global_moderator() { |
212 | - global $user; |
|
213 | - return user_access('manage boincteam forum'); |
|
212 | + global $user; |
|
213 | + return user_access('manage boincteam forum'); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /* |
217 | 217 | * Check if any forums for a team are public |
218 | 218 | */ |
219 | 219 | function boincteam_forum_is_any_public($team_id) { |
220 | - $forums = boincteam_forum_list($team_id); |
|
221 | - foreach ($forums as $forum) { |
|
220 | + $forums = boincteam_forum_list($team_id); |
|
221 | + foreach ($forums as $forum) { |
|
222 | 222 | if ($forum->public) { |
223 | - return TRUE; |
|
223 | + return TRUE; |
|
224 | 224 | } |
225 | - } |
|
226 | - return FALSE; |
|
225 | + } |
|
226 | + return FALSE; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /* |
230 | 230 | * Check if a team forum should be visible to everyone |
231 | 231 | */ |
232 | 232 | function boincteam_forum_is_public($tfid) { |
233 | - return db_result(db_query(" |
|
233 | + return db_result(db_query(" |
|
234 | 234 | SELECT public FROM {boincteam_forum} WHERE tfid=%d", $tfid |
235 | - )); |
|
235 | + )); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /* |
239 | 239 | * Load the forums for a team, if any exist |
240 | 240 | */ |
241 | 241 | function boincteam_forum_list($team_id = NULL) { |
242 | - if (!$team_id) { |
|
242 | + if (!$team_id) { |
|
243 | 243 | global $user; |
244 | 244 | $account = user_load($user->uid); |
245 | 245 | $team_id = $account->team; |
246 | - } |
|
247 | - $team_forums = array(); |
|
248 | - if ($team_id) { |
|
246 | + } |
|
247 | + $team_forums = array(); |
|
248 | + if ($team_id) { |
|
249 | 249 | // Load any team forum objects for the user's team |
250 | 250 | $result = db_query(" |
251 | 251 | SELECT tfid, nid, title, description, created, updated, public, |
@@ -255,26 +255,26 @@ discard block |
||
255 | 255 | $row = 0; |
256 | 256 | while ($team_forum = db_fetch_object($result)) { |
257 | 257 | |
258 | - $team_forum->link = url("community/teams/{$team_id}/forum/{$team_forum->tfid}"); |
|
259 | - $team_forum->zebra = $row % 2 ? 'even' : 'odd'; |
|
260 | - $team_forum->new_topics = 0; // TODO: Track user views of team topics |
|
261 | - $team_forum->new_text = ''; |
|
262 | - $team_forum->new_url = ''; |
|
263 | - $team_forum->num_topics = db_result(db_query(" |
|
258 | + $team_forum->link = url("community/teams/{$team_id}/forum/{$team_forum->tfid}"); |
|
259 | + $team_forum->zebra = $row % 2 ? 'even' : 'odd'; |
|
260 | + $team_forum->new_topics = 0; // TODO: Track user views of team topics |
|
261 | + $team_forum->new_text = ''; |
|
262 | + $team_forum->new_url = ''; |
|
263 | + $team_forum->num_topics = db_result(db_query(" |
|
264 | 264 | SELECT COUNT(nid) FROM {boincteam_forum_node} |
265 | 265 | WHERE tfid = %d", |
266 | 266 | $team_forum->tfid |
267 | - )); |
|
268 | - $team_forum->num_posts = db_result(db_query(" |
|
267 | + )); |
|
268 | + $team_forum->num_posts = db_result(db_query(" |
|
269 | 269 | SELECT COALESCE(SUM(ncs.comment_count),0) + COUNT(ncs.nid) |
270 | 270 | FROM {boincteam_forum_node} bfn |
271 | 271 | JOIN {node_comment_statistics} ncs ON ncs.nid = bfn.nid |
272 | 272 | JOIN {node} n ON n.nid = ncs.nid |
273 | 273 | WHERE bfn.tfid = %d AND n.status = 1", |
274 | 274 | $team_forum->tfid |
275 | - )); |
|
276 | - $last_post = new stdClass(); |
|
277 | - $last_post->timestamp = db_result(db_query(" |
|
275 | + )); |
|
276 | + $last_post = new stdClass(); |
|
277 | + $last_post->timestamp = db_result(db_query(" |
|
278 | 278 | SELECT ncs.last_comment_timestamp FROM {node} n |
279 | 279 | INNER JOIN {boincteam_forum_node} bfn |
280 | 280 | INNER JOIN {node_comment_statistics} ncs ON n.nid = bfn.nid AND n.nid = ncs.nid |
@@ -282,36 +282,36 @@ discard block |
||
282 | 282 | ORDER BY ncs.last_comment_timestamp DESC |
283 | 283 | LIMIT 1", |
284 | 284 | $team_forum->tfid |
285 | - )); |
|
286 | - $team_forum->last_reply = theme('forum_submitted', ($last_post->timestamp) ? $last_post : NULL); |
|
287 | - $team_forums[$team_forum->tfid] = $team_forum; |
|
288 | - $row++; |
|
285 | + )); |
|
286 | + $team_forum->last_reply = theme('forum_submitted', ($last_post->timestamp) ? $last_post : NULL); |
|
287 | + $team_forums[$team_forum->tfid] = $team_forum; |
|
288 | + $row++; |
|
289 | 289 | } |
290 | - } |
|
291 | - return $team_forums; |
|
290 | + } |
|
291 | + return $team_forums; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /* |
295 | 295 | * Load a team forum by ID |
296 | 296 | */ |
297 | 297 | function boincteam_forum_load($tfid) { |
298 | - // Load any team forum objects for the user's team |
|
299 | - $result = db_query(" |
|
298 | + // Load any team forum objects for the user's team |
|
299 | + $result = db_query(" |
|
300 | 300 | SELECT tfid, nid, title, description, created, updated, public, |
301 | 301 | min_time_between_posts, min_total_credit_to_post, min_avg_credit_to_post |
302 | 302 | FROM {boincteam_forum} WHERE tfid=%d", $tfid |
303 | - ); |
|
304 | - return db_fetch_object($result); |
|
303 | + ); |
|
304 | + return db_fetch_object($result); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /* |
308 | 308 | * Look up the team ID for a given team forum |
309 | 309 | */ |
310 | 310 | function boincteam_forum_lookup_nid($tfid) { |
311 | - return db_result(db_query(" |
|
311 | + return db_result(db_query(" |
|
312 | 312 | SELECT nid FROM {boincteam_forum} |
313 | 313 | WHERE tfid=%d", $tfid |
314 | - )); |
|
314 | + )); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | |
@@ -323,80 +323,80 @@ discard block |
||
323 | 323 | * Create team forum form |
324 | 324 | */ |
325 | 325 | function boincteam_forum_create_form_panel() { |
326 | - $output = ''; |
|
327 | - $output .= '<h2 class="pane-title">' . bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
326 | + $output = ''; |
|
327 | + $output .= '<h2 class="pane-title">' . bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
328 | 328 | . '</h2>'; |
329 | - $output .= drupal_get_form('boincteam_forum_create_form'); |
|
329 | + $output .= drupal_get_form('boincteam_forum_create_form'); |
|
330 | 330 | |
331 | - return $output; |
|
331 | + return $output; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
335 | 335 | * Edit team forum form |
336 | 336 | */ |
337 | 337 | function boincteam_forum_edit_form_panel($tfid) { |
338 | - $team_forum = boincteam_forum_load($tfid); |
|
339 | - $output = ''; |
|
340 | - $output .= '<h2 class="pane-title">' . bts('Edit message board', array(), NULL, 'boinc:team-forum') . ': ' . |
|
338 | + $team_forum = boincteam_forum_load($tfid); |
|
339 | + $output = ''; |
|
340 | + $output .= '<h2 class="pane-title">' . bts('Edit message board', array(), NULL, 'boinc:team-forum') . ': ' . |
|
341 | 341 | $team_forum->title . '</h2>'; |
342 | - $output .= drupal_get_form('boincteam_forum_edit_form', $tfid); |
|
342 | + $output .= drupal_get_form('boincteam_forum_edit_form', $tfid); |
|
343 | 343 | |
344 | - return $output; |
|
344 | + return $output; |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
348 | 348 | * Link to team forums |
349 | 349 | */ |
350 | 350 | function boincteam_forum_link_panel($team_id) { |
351 | - $show_public_only = ( |
|
351 | + $show_public_only = ( |
|
352 | 352 | !boincteam_is_member($team_id) AND |
353 | 353 | !boincteam_forum_is_global_moderator() |
354 | - ); |
|
355 | - $forums = boincteam_forum_list($team_id); |
|
356 | - $output = ''; |
|
357 | - $output .= '<h2 class="pane-title">' . bts('Team forum', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
358 | - $output .= '<p>' |
|
354 | + ); |
|
355 | + $forums = boincteam_forum_list($team_id); |
|
356 | + $output = ''; |
|
357 | + $output .= '<h2 class="pane-title">' . bts('Team forum', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
358 | + $output .= '<p>' |
|
359 | 359 | . bts('A discussion forum has been set up for team members.', array(), NULL, 'boinc:team-forum') |
360 | 360 | . '</p>'; |
361 | - $output .= '<ul class="tab-list action-list">'; |
|
362 | - foreach ($forums as $forum) { |
|
361 | + $output .= '<ul class="tab-list action-list">'; |
|
362 | + foreach ($forums as $forum) { |
|
363 | 363 | if (!$show_public_only OR $forum->public) { |
364 | - $output .= ' <li class="tab primary">' . |
|
364 | + $output .= ' <li class="tab primary">' . |
|
365 | 365 | l( |
366 | - //$forum->title, |
|
367 | - bts('Enter forum', array(), NULL, 'boinc:team-forum'), |
|
368 | - "community/teams/{$team_id}/forum/{$forum->tfid}" |
|
366 | + //$forum->title, |
|
367 | + bts('Enter forum', array(), NULL, 'boinc:team-forum'), |
|
368 | + "community/teams/{$team_id}/forum/{$forum->tfid}" |
|
369 | 369 | ) . '</li>'; |
370 | - // Since we're only supporting one team forum for now, we've labeled the |
|
371 | - // link in a generic way above and will now just break out of the loop |
|
372 | - break; |
|
370 | + // Since we're only supporting one team forum for now, we've labeled the |
|
371 | + // link in a generic way above and will now just break out of the loop |
|
372 | + break; |
|
373 | 373 | } |
374 | - } |
|
375 | - $output .= '</ul>'; |
|
376 | - return $output; |
|
374 | + } |
|
375 | + $output .= '</ul>'; |
|
376 | + return $output; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | /** |
380 | 380 | * General info about team forums |
381 | 381 | */ |
382 | 382 | function boincteam_forum_topic_overview_panel($nid = NULL) { |
383 | - $output = ''; |
|
384 | - $output .= '<h2 class="pane-title">' . bts('About message boards', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
385 | - $output .= '<div>'; |
|
386 | - if ($nid) { |
|
383 | + $output = ''; |
|
384 | + $output .= '<h2 class="pane-title">' . bts('About message boards', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
385 | + $output .= '<div>'; |
|
386 | + if ($nid) { |
|
387 | 387 | $team = node_load($nid); |
388 | 388 | $output .= '<p>' . bts('You may create a message board for use by @team', |
389 | - array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>'; |
|
390 | - } |
|
391 | - else { |
|
389 | + array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>'; |
|
390 | + } |
|
391 | + else { |
|
392 | 392 | $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>'; |
393 | - } |
|
394 | - $output .= '<ul>'; |
|
395 | - $output .= ' <li>' . bts('Only members may post', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
396 | - $output .= ' <li>' . bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
397 | - $output .= ' <li>' . bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum') . |
|
393 | + } |
|
394 | + $output .= '<ul>'; |
|
395 | + $output .= ' <li>' . bts('Only members may post', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
396 | + $output .= ' <li>' . bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
397 | + $output .= ' <li>' . bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum') . |
|
398 | 398 | '</li>'; |
399 | - $output .= '</ul>'; |
|
400 | - $output .= '</div>'; |
|
401 | - return $output; |
|
399 | + $output .= '</ul>'; |
|
400 | + $output .= '</div>'; |
|
401 | + return $output; |
|
402 | 402 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // In Drupal 7, these operation cases will all exist as their own hooks, |
60 | 60 | // so let's approximate that here so that this function can simply be removed |
61 | 61 | // upon migration to 7 |
62 | - switch($op) { |
|
62 | + switch ($op) { |
|
63 | 63 | case 'insert': |
64 | 64 | boincteam_forum_node_insert($node); |
65 | 65 | break; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * is inserted (forward compatible to Drupal 7) |
85 | 85 | */ |
86 | 86 | function boincteam_forum_node_insert($node) { |
87 | - switch($node->type) { |
|
87 | + switch ($node->type) { |
|
88 | 88 | case 'team_forum': |
89 | 89 | $account = user_load($node->uid); |
90 | 90 | $team_id = boincteam_forum_lookup_nid($node->tfid); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * is loaded (forward compatible to Drupal 7) |
108 | 108 | */ |
109 | 109 | function boincteam_forum_node_load($node) { |
110 | - switch($node->type) { |
|
110 | + switch ($node->type) { |
|
111 | 111 | case 'team_forum': |
112 | 112 | $node->tfid = db_result(db_query(" |
113 | 113 | SELECT tfid FROM {boincteam_forum_node} |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * is updated (forward compatible to Drupal 7) |
126 | 126 | */ |
127 | 127 | function boincteam_forum_node_update($node) { |
128 | - switch($node->type) { |
|
128 | + switch ($node->type) { |
|
129 | 129 | case 'team_forum': |
130 | 130 | |
131 | 131 | break; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * is validated (forward compatible to Drupal 7) |
141 | 141 | */ |
142 | 142 | function boincteam_forum_node_validate($node) { |
143 | - switch($node->type) { |
|
143 | + switch ($node->type) { |
|
144 | 144 | case 'team_forum': |
145 | 145 | $account = user_load($node->uid); |
146 | 146 | // Get tfid from node, but if empty/null, get it from the database |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * is viewed (forward compatible to Drupal 7) |
168 | 168 | */ |
169 | 169 | function boincteam_forum_node_view($node) { |
170 | - switch($node->type) { |
|
170 | + switch ($node->type) { |
|
171 | 171 | case 'team_forum': |
172 | 172 | $team_id = boincteam_forum_lookup_nid($node->tfid); |
173 | 173 | $public_forum = boincteam_forum_is_public($node->tfid); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | while ($team_forum = db_fetch_object($result)) { |
257 | 257 | |
258 | 258 | $team_forum->link = url("community/teams/{$team_id}/forum/{$team_forum->tfid}"); |
259 | - $team_forum->zebra = $row % 2 ? 'even' : 'odd'; |
|
259 | + $team_forum->zebra = $row%2 ? 'even' : 'odd'; |
|
260 | 260 | $team_forum->new_topics = 0; // TODO: Track user views of team topics |
261 | 261 | $team_forum->new_text = ''; |
262 | 262 | $team_forum->new_url = ''; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | function boincteam_forum_create_form_panel() { |
326 | 326 | $output = ''; |
327 | - $output .= '<h2 class="pane-title">' . bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
327 | + $output .= '<h2 class="pane-title">'.bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
328 | 328 | . '</h2>'; |
329 | 329 | $output .= drupal_get_form('boincteam_forum_create_form'); |
330 | 330 | |
@@ -337,8 +337,8 @@ discard block |
||
337 | 337 | function boincteam_forum_edit_form_panel($tfid) { |
338 | 338 | $team_forum = boincteam_forum_load($tfid); |
339 | 339 | $output = ''; |
340 | - $output .= '<h2 class="pane-title">' . bts('Edit message board', array(), NULL, 'boinc:team-forum') . ': ' . |
|
341 | - $team_forum->title . '</h2>'; |
|
340 | + $output .= '<h2 class="pane-title">'.bts('Edit message board', array(), NULL, 'boinc:team-forum').': '. |
|
341 | + $team_forum->title.'</h2>'; |
|
342 | 342 | $output .= drupal_get_form('boincteam_forum_edit_form', $tfid); |
343 | 343 | |
344 | 344 | return $output; |
@@ -354,19 +354,19 @@ discard block |
||
354 | 354 | ); |
355 | 355 | $forums = boincteam_forum_list($team_id); |
356 | 356 | $output = ''; |
357 | - $output .= '<h2 class="pane-title">' . bts('Team forum', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
357 | + $output .= '<h2 class="pane-title">'.bts('Team forum', array(), NULL, 'boinc:team-forum').'</h2>'; |
|
358 | 358 | $output .= '<p>' |
359 | 359 | . bts('A discussion forum has been set up for team members.', array(), NULL, 'boinc:team-forum') |
360 | 360 | . '</p>'; |
361 | 361 | $output .= '<ul class="tab-list action-list">'; |
362 | 362 | foreach ($forums as $forum) { |
363 | 363 | if (!$show_public_only OR $forum->public) { |
364 | - $output .= ' <li class="tab primary">' . |
|
364 | + $output .= ' <li class="tab primary">'. |
|
365 | 365 | l( |
366 | 366 | //$forum->title, |
367 | 367 | bts('Enter forum', array(), NULL, 'boinc:team-forum'), |
368 | 368 | "community/teams/{$team_id}/forum/{$forum->tfid}" |
369 | - ) . '</li>'; |
|
369 | + ).'</li>'; |
|
370 | 370 | // Since we're only supporting one team forum for now, we've labeled the |
371 | 371 | // link in a generic way above and will now just break out of the loop |
372 | 372 | break; |
@@ -381,20 +381,20 @@ discard block |
||
381 | 381 | */ |
382 | 382 | function boincteam_forum_topic_overview_panel($nid = NULL) { |
383 | 383 | $output = ''; |
384 | - $output .= '<h2 class="pane-title">' . bts('About message boards', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
384 | + $output .= '<h2 class="pane-title">'.bts('About message boards', array(), NULL, 'boinc:team-forum').'</h2>'; |
|
385 | 385 | $output .= '<div>'; |
386 | 386 | if ($nid) { |
387 | 387 | $team = node_load($nid); |
388 | - $output .= '<p>' . bts('You may create a message board for use by @team', |
|
389 | - array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>'; |
|
388 | + $output .= '<p>'.bts('You may create a message board for use by @team', |
|
389 | + array('@team' => $team->title), NULL, 'boinc:team-forum').':</p>'; |
|
390 | 390 | } |
391 | 391 | else { |
392 | - $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>'; |
|
392 | + $output .= '<p>'.bts('This is a team-only message board', array(), NULL, 'boinc:team-forum').':</p>'; |
|
393 | 393 | } |
394 | 394 | $output .= '<ul>'; |
395 | - $output .= ' <li>' . bts('Only members may post', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
396 | - $output .= ' <li>' . bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
397 | - $output .= ' <li>' . bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum') . |
|
395 | + $output .= ' <li>'.bts('Only members may post', array(), NULL, 'boinc:team-forum').'</li>'; |
|
396 | + $output .= ' <li>'.bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum').'</li>'; |
|
397 | + $output .= ' <li>'.bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum'). |
|
398 | 398 | '</li>'; |
399 | 399 | $output .= '</ul>'; |
400 | 400 | $output .= '</div>'; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $tfid = $node->tfid; |
154 | 154 | } |
155 | 155 | $team_id = boincteam_forum_lookup_nid($tfid); |
156 | - if (!$account->team OR $account->team != $team_id) { |
|
156 | + if (!$account->team or $account->team != $team_id) { |
|
157 | 157 | drupal_set_message(t('Failed to add team forum topic.'), 'error'); |
158 | 158 | drupal_goto('community/forum'); |
159 | 159 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $public_forum = boincteam_forum_is_public($node->tfid); |
174 | 174 | $is_member = boincteam_is_member($team_id); |
175 | 175 | $is_global_moderator = boincteam_forum_is_global_moderator(); |
176 | - if (!$public_forum AND !$is_member AND !$is_global_moderator) { |
|
176 | + if (!$public_forum and !$is_member and !$is_global_moderator) { |
|
177 | 177 | drupal_not_found(); |
178 | 178 | module_invoke_all('exit'); |
179 | 179 | exit(); |
@@ -220,10 +220,10 @@ discard block |
||
220 | 220 | $forums = boincteam_forum_list($team_id); |
221 | 221 | foreach ($forums as $forum) { |
222 | 222 | if ($forum->public) { |
223 | - return TRUE; |
|
223 | + return true; |
|
224 | 224 | } |
225 | 225 | } |
226 | - return FALSE; |
|
226 | + return false; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /* |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | /* |
239 | 239 | * Load the forums for a team, if any exist |
240 | 240 | */ |
241 | -function boincteam_forum_list($team_id = NULL) { |
|
241 | +function boincteam_forum_list($team_id = null) { |
|
242 | 242 | if (!$team_id) { |
243 | 243 | global $user; |
244 | 244 | $account = user_load($user->uid); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | LIMIT 1", |
284 | 284 | $team_forum->tfid |
285 | 285 | )); |
286 | - $team_forum->last_reply = theme('forum_submitted', ($last_post->timestamp) ? $last_post : NULL); |
|
286 | + $team_forum->last_reply = theme('forum_submitted', ($last_post->timestamp) ? $last_post : null); |
|
287 | 287 | $team_forums[$team_forum->tfid] = $team_forum; |
288 | 288 | $row++; |
289 | 289 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | function boincteam_forum_create_form_panel() { |
326 | 326 | $output = ''; |
327 | - $output .= '<h2 class="pane-title">' . bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
327 | + $output .= '<h2 class="pane-title">' . bts('Create team message board', array(), null, 'boinc:team-forum') |
|
328 | 328 | . '</h2>'; |
329 | 329 | $output .= drupal_get_form('boincteam_forum_create_form'); |
330 | 330 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | function boincteam_forum_edit_form_panel($tfid) { |
338 | 338 | $team_forum = boincteam_forum_load($tfid); |
339 | 339 | $output = ''; |
340 | - $output .= '<h2 class="pane-title">' . bts('Edit message board', array(), NULL, 'boinc:team-forum') . ': ' . |
|
340 | + $output .= '<h2 class="pane-title">' . bts('Edit message board', array(), null, 'boinc:team-forum') . ': ' . |
|
341 | 341 | $team_forum->title . '</h2>'; |
342 | 342 | $output .= drupal_get_form('boincteam_forum_edit_form', $tfid); |
343 | 343 | |
@@ -349,22 +349,22 @@ discard block |
||
349 | 349 | */ |
350 | 350 | function boincteam_forum_link_panel($team_id) { |
351 | 351 | $show_public_only = ( |
352 | - !boincteam_is_member($team_id) AND |
|
352 | + !boincteam_is_member($team_id) and |
|
353 | 353 | !boincteam_forum_is_global_moderator() |
354 | 354 | ); |
355 | 355 | $forums = boincteam_forum_list($team_id); |
356 | 356 | $output = ''; |
357 | - $output .= '<h2 class="pane-title">' . bts('Team forum', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
357 | + $output .= '<h2 class="pane-title">' . bts('Team forum', array(), null, 'boinc:team-forum') . '</h2>'; |
|
358 | 358 | $output .= '<p>' |
359 | - . bts('A discussion forum has been set up for team members.', array(), NULL, 'boinc:team-forum') |
|
359 | + . bts('A discussion forum has been set up for team members.', array(), null, 'boinc:team-forum') |
|
360 | 360 | . '</p>'; |
361 | 361 | $output .= '<ul class="tab-list action-list">'; |
362 | 362 | foreach ($forums as $forum) { |
363 | - if (!$show_public_only OR $forum->public) { |
|
363 | + if (!$show_public_only or $forum->public) { |
|
364 | 364 | $output .= ' <li class="tab primary">' . |
365 | 365 | l( |
366 | 366 | //$forum->title, |
367 | - bts('Enter forum', array(), NULL, 'boinc:team-forum'), |
|
367 | + bts('Enter forum', array(), null, 'boinc:team-forum'), |
|
368 | 368 | "community/teams/{$team_id}/forum/{$forum->tfid}" |
369 | 369 | ) . '</li>'; |
370 | 370 | // Since we're only supporting one team forum for now, we've labeled the |
@@ -379,22 +379,22 @@ discard block |
||
379 | 379 | /** |
380 | 380 | * General info about team forums |
381 | 381 | */ |
382 | -function boincteam_forum_topic_overview_panel($nid = NULL) { |
|
382 | +function boincteam_forum_topic_overview_panel($nid = null) { |
|
383 | 383 | $output = ''; |
384 | - $output .= '<h2 class="pane-title">' . bts('About message boards', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
384 | + $output .= '<h2 class="pane-title">' . bts('About message boards', array(), null, 'boinc:team-forum') . '</h2>'; |
|
385 | 385 | $output .= '<div>'; |
386 | 386 | if ($nid) { |
387 | 387 | $team = node_load($nid); |
388 | 388 | $output .= '<p>' . bts('You may create a message board for use by @team', |
389 | - array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>'; |
|
389 | + array('@team' => $team->title), null, 'boinc:team-forum') . ':</p>'; |
|
390 | 390 | } |
391 | 391 | else { |
392 | - $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>'; |
|
392 | + $output .= '<p>' . bts('This is a team-only message board', array(), null, 'boinc:team-forum') . ':</p>'; |
|
393 | 393 | } |
394 | 394 | $output .= '<ul>'; |
395 | - $output .= ' <li>' . bts('Only members may post', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
396 | - $output .= ' <li>' . bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
397 | - $output .= ' <li>' . bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum') . |
|
395 | + $output .= ' <li>' . bts('Only members may post', array(), null, 'boinc:team-forum') . '</li>'; |
|
396 | + $output .= ' <li>' . bts('Only members may read (optional)', array(), null, 'boinc:team-forum') . '</li>'; |
|
397 | + $output .= ' <li>' . bts('Founder & Team Admins have moderator privileges', array(), null, 'boinc:team-forum') . |
|
398 | 398 | '</li>'; |
399 | 399 | $output .= '</ul>'; |
400 | 400 | $output .= '</div>'; |