@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | - global $base_path; |
|
3 | - // If a host hasn't been active in 30 days, set class to inactive |
|
4 | - $inactive_threshold = time() - (30 * 24 * 60 * 60); |
|
2 | +global $base_path; |
|
3 | +// If a host hasn't been active in 30 days, set class to inactive |
|
4 | +$inactive_threshold = time() - (30 * 24 * 60 * 60); |
|
5 | 5 | ?> |
6 | 6 | |
7 | 7 | <script> |
@@ -83,21 +83,21 @@ discard block |
||
83 | 83 | <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix<?php echo ($first_page) ? '' : ' not-first-page'; ?>"> |
84 | 84 | |
85 | 85 | <?php |
86 | - if ($page) { |
|
87 | - // Set topic title as page title |
|
88 | - drupal_set_title($title); |
|
89 | - $subtitle = array(); |
|
90 | - // Get vocabulary name and taxonomy name for subtitle breadcrumbs |
|
91 | - $taxonomy = reset($node->taxonomy); |
|
92 | - if ($forum_vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
|
93 | - $subtitle[] = l($forum_vocab->name, 'community/forum'); |
|
94 | - } |
|
95 | - if (isset($taxonomy->name)) { |
|
96 | - $subtitle[] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
97 | - } |
|
98 | - $subtitle = implode(' › ', $subtitle); |
|
86 | + if ($page) { |
|
87 | + // Set topic title as page title |
|
88 | + drupal_set_title($title); |
|
89 | + $subtitle = array(); |
|
90 | + // Get vocabulary name and taxonomy name for subtitle breadcrumbs |
|
91 | + $taxonomy = reset($node->taxonomy); |
|
92 | + if ($forum_vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
|
93 | + $subtitle[] = l($forum_vocab->name, 'community/forum'); |
|
94 | + } |
|
95 | + if (isset($taxonomy->name)) { |
|
96 | + $subtitle[] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
99 | 97 | } |
100 | - ?> |
|
98 | + $subtitle = implode(' › ', $subtitle); |
|
99 | + } |
|
100 | +?> |
|
101 | 101 | |
102 | 102 | <h2 class="title"><?php print $subtitle; ?></h2> |
103 | 103 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | <?php endif; ?> |
107 | 107 | |
108 | 108 | <?php |
109 | - if (!$oldest_post_first) { |
|
110 | - print comment_render($node); |
|
111 | - } |
|
112 | - ?> |
|
109 | + if (!$oldest_post_first) { |
|
110 | + print comment_render($node); |
|
111 | + } |
|
112 | +?> |
|
113 | 113 | <?php // Only show this post on the first or last page, depending on sort ?> |
114 | 114 | <?php if (($oldest_post_first AND $first_page) OR (!$oldest_post_first AND $last_page)): ?> |
115 | 115 | |
@@ -125,23 +125,23 @@ discard block |
||
125 | 125 | |
126 | 126 | <div class="user"> |
127 | 127 | <?php |
128 | - $account = user_load(array('uid' => $uid)); |
|
129 | - $user_image = boincuser_get_user_profile_image($uid); |
|
130 | - if ($user_image) { |
|
131 | - print '<div class="picture">'; |
|
132 | - if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
133 | - //print theme('imagecache', 'thumbnail', $user_image['image']['filepath'], $user_image['alt'], $user_image['alt']); |
|
134 | - print theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
|
135 | - } |
|
136 | - elseif (is_string($user_image)) { |
|
137 | - print '<img src="' . $user_image . '"/>'; |
|
138 | - } |
|
139 | - print '</div>'; |
|
128 | + $account = user_load(array('uid' => $uid)); |
|
129 | + $user_image = boincuser_get_user_profile_image($uid); |
|
130 | + if ($user_image) { |
|
131 | + print '<div class="picture">'; |
|
132 | + if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
133 | + //print theme('imagecache', 'thumbnail', $user_image['image']['filepath'], $user_image['alt'], $user_image['alt']); |
|
134 | + print theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
|
135 | + } |
|
136 | + elseif (is_string($user_image)) { |
|
137 | + print '<img src="' . $user_image . '"/>'; |
|
140 | 138 | } |
141 | - // Generate ignore user link |
|
142 | - $ignore_link = ignore_user_link('node', $node); |
|
143 | - //echo '<pre>' . print_r($node->links, TRUE) . '</pre>'; |
|
144 | - ?> |
|
139 | + print '</div>'; |
|
140 | + } |
|
141 | + // Generate ignore user link |
|
142 | + $ignore_link = ignore_user_link('node', $node); |
|
143 | + //echo '<pre>' . print_r($node->links, TRUE) . '</pre>'; |
|
144 | + ?> |
|
145 | 145 | <div class="name"><?php print $name; ?></div> |
146 | 146 | <?php if ($account->uid): ?> |
147 | 147 | <div class="join-date">Joined: <?php print date('j M y', $account->created); ?></div> |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | |
152 | 152 | <div class="user-links"> |
153 | 153 | <div class="ignore-link"><?php print l($ignore_link['ignore_user']['title'], |
154 | - $ignore_link['ignore_user']['href'], |
|
155 | - array('query' => $ignore_link['ignore_user']['query'])); ?> |
|
154 | + $ignore_link['ignore_user']['href'], |
|
155 | + array('query' => $ignore_link['ignore_user']['query'])); ?> |
|
156 | 156 | </div> |
157 | 157 | <div class="pm-link"><?php |
158 | - if ($user->uid AND ($user->uid != $account->uid)) { |
|
159 | - print l(bts('Send message'), |
|
160 | - privatemsg_get_link(array($account)), |
|
161 | - array('query' => drupal_get_destination())); |
|
162 | - } ?> |
|
158 | + if ($user->uid AND ($user->uid != $account->uid)) { |
|
159 | + print l(bts('Send message'), |
|
160 | + privatemsg_get_link(array($account)), |
|
161 | + array('query' => drupal_get_destination())); |
|
162 | + } ?> |
|
163 | 163 | </div> |
164 | 164 | </div> |
165 | 165 | <?php endif; ?> |
@@ -205,9 +205,9 @@ discard block |
||
205 | 205 | <?php endif; // page with topic starter post ?> |
206 | 206 | |
207 | 207 | <?php |
208 | - if ($oldest_post_first) { |
|
209 | - print comment_render($node); |
|
210 | - } |
|
211 | - ?> |
|
208 | + if ($oldest_post_first) { |
|
209 | + print comment_render($node); |
|
210 | + } |
|
211 | +?> |
|
212 | 212 | |
213 | 213 | </div> <!-- /.node --> |
@@ -16,17 +16,17 @@ discard block |
||
16 | 16 | ?> |
17 | 17 | <?php |
18 | 18 | |
19 | - $sort_by = isset($_GET['order']) ? $_GET['order'] : NULL; |
|
20 | - $sort_order = isset($_GET['sort']) ? $_GET['sort'] : 'asc'; |
|
19 | +$sort_by = isset($_GET['order']) ? $_GET['order'] : NULL; |
|
20 | +$sort_order = isset($_GET['sort']) ? $_GET['sort'] : 'asc'; |
|
21 | 21 | |
22 | - $team_forum_id = arg(4); |
|
22 | +$team_forum_id = arg(4); |
|
23 | 23 | |
24 | - $topics = $rows; |
|
24 | +$topics = $rows; |
|
25 | 25 | |
26 | - // Get the count of topics on this page |
|
27 | - $topic_count = count($topics); |
|
28 | - $topic_index = 0; |
|
29 | - $first_non_sticky = FALSE; |
|
26 | +// Get the count of topics on this page |
|
27 | +$topic_count = count($topics); |
|
28 | +$topic_index = 0; |
|
29 | +$first_non_sticky = FALSE; |
|
30 | 30 | |
31 | 31 | ?> |
32 | 32 | |
@@ -44,27 +44,27 @@ discard block |
||
44 | 44 | <tbody> |
45 | 45 | <?php foreach ($topics as $topic): ?> |
46 | 46 | <?php |
47 | - $topic = (object) $topic; |
|
48 | - $author = user_load($topic->uid); |
|
49 | - $topic_index++; |
|
50 | - $row_class = 'topic ' . $topic->zebra; |
|
51 | - if ($topic_index == 1) { |
|
52 | - $row_class .= ' first'; |
|
53 | - } |
|
54 | - if ($topic->sticky=="True") { |
|
55 | - $row_class .= ' sticky'; |
|
56 | - } |
|
57 | - elseif (!$first_non_sticky AND !($topic->sticky=="True")) { |
|
58 | - $row_class .= ' first-non-sticky'; |
|
59 | - $first_non_sticky = TRUE; |
|
60 | - } |
|
61 | - if ($topic_index == $topic_count) { |
|
62 | - $row_class .= ' last'; |
|
63 | - } |
|
64 | - if ($topic->timestamp=="new" OR $topic->new_comments) { |
|
65 | - $row_class .= ' updated'; |
|
66 | - } |
|
67 | - ?> |
|
47 | + $topic = (object) $topic; |
|
48 | + $author = user_load($topic->uid); |
|
49 | + $topic_index++; |
|
50 | + $row_class = 'topic ' . $topic->zebra; |
|
51 | + if ($topic_index == 1) { |
|
52 | + $row_class .= ' first'; |
|
53 | + } |
|
54 | + if ($topic->sticky=="True") { |
|
55 | + $row_class .= ' sticky'; |
|
56 | + } |
|
57 | + elseif (!$first_non_sticky AND !($topic->sticky=="True")) { |
|
58 | + $row_class .= ' first-non-sticky'; |
|
59 | + $first_non_sticky = TRUE; |
|
60 | + } |
|
61 | + if ($topic_index == $topic_count) { |
|
62 | + $row_class .= ' last'; |
|
63 | + } |
|
64 | + if ($topic->timestamp=="new" OR $topic->new_comments) { |
|
65 | + $row_class .= ' updated'; |
|
66 | + } |
|
67 | + ?> |
|
68 | 68 | <tr class="<?php print $row_class;?>"> |
69 | 69 | <td class="icon"><?php //print $topic->icon; ?> |
70 | 70 | <?php if ($topic->sticky=="True"): ?> |
@@ -84,37 +84,37 @@ discard block |
||
84 | 84 | <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix<?php echo ($first_page) ? '' : ' not-first-page'; ?>"> |
85 | 85 | |
86 | 86 | <?php |
87 | - if ($page) { |
|
88 | - // Set topic title as page title |
|
89 | - drupal_set_title($title); |
|
90 | - $subtitle = array(); |
|
91 | - $team_forum_id = db_result(db_query(" |
|
87 | + if ($page) { |
|
88 | + // Set topic title as page title |
|
89 | + drupal_set_title($title); |
|
90 | + $subtitle = array(); |
|
91 | + $team_forum_id = db_result(db_query(" |
|
92 | 92 | SELECT tfid FROM {boincteam_forum_node} WHERE nid = %d", $node->nid |
93 | - )); |
|
94 | - $team_forum = boincteam_forum_load($team_forum_id); |
|
95 | - // Grab a sample forum topic node to get the forum vocabulary name |
|
96 | - $sample = db_result(db_query(" |
|
93 | + )); |
|
94 | + $team_forum = boincteam_forum_load($team_forum_id); |
|
95 | + // Grab a sample forum topic node to get the forum vocabulary name |
|
96 | + $sample = db_result(db_query(" |
|
97 | 97 | SELECT nid FROM {node} WHERE type = 'forum' LIMIT 1" |
98 | - )); |
|
99 | - $forum_node = node_load($sample); |
|
100 | - // Get vocabulary name and taxonomy name for subtitle breadcrumbs |
|
101 | - $taxonomy = taxonomy_get_term($forum_node->tid); |
|
98 | + )); |
|
99 | + $forum_node = node_load($sample); |
|
100 | + // Get vocabulary name and taxonomy name for subtitle breadcrumbs |
|
101 | + $taxonomy = taxonomy_get_term($forum_node->tid); |
|
102 | + if (module_exists('internationalization')) { |
|
103 | + $imv = i18ntaxonomy_localize_terms(array($taxonomy)); |
|
104 | + $taxonomy = reset($imv); |
|
105 | + } |
|
106 | + if ($forum_vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
|
102 | 107 | if (module_exists('internationalization')) { |
103 | - $imv = i18ntaxonomy_localize_terms(array($taxonomy)); |
|
104 | - $taxonomy = reset($imv); |
|
105 | - } |
|
106 | - if ($forum_vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
|
107 | - if (module_exists('internationalization')) { |
|
108 | - $forum_vocab->name = i18ntaxonomy_translate_vocabulary_name($forum_vocab); |
|
109 | - } |
|
110 | - $subtitle[] = l($forum_vocab->name, 'community/forum'); |
|
108 | + $forum_vocab->name = i18ntaxonomy_translate_vocabulary_name($forum_vocab); |
|
111 | 109 | } |
112 | - if ($team_forum) { |
|
113 | - $subtitle[] = l($team_forum->title, "community/teams/{$team_forum->nid}/forum/{$team_forum->tfid}"); |
|
114 | - } |
|
115 | - $subtitle = implode(' › ', $subtitle); |
|
110 | + $subtitle[] = l($forum_vocab->name, 'community/forum'); |
|
111 | + } |
|
112 | + if ($team_forum) { |
|
113 | + $subtitle[] = l($team_forum->title, "community/teams/{$team_forum->nid}/forum/{$team_forum->tfid}"); |
|
116 | 114 | } |
117 | - ?> |
|
115 | + $subtitle = implode(' › ', $subtitle); |
|
116 | + } |
|
117 | +?> |
|
118 | 118 | |
119 | 119 | <h2 class="title"><?php print $subtitle; ?></h2> |
120 | 120 | |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | <?php endif; ?> |
124 | 124 | |
125 | 125 | <?php |
126 | - if (!$oldest_post_first) { |
|
127 | - print comment_render($node); |
|
128 | - } |
|
129 | - ?> |
|
126 | + if (!$oldest_post_first) { |
|
127 | + print comment_render($node); |
|
128 | + } |
|
129 | +?> |
|
130 | 130 | <?php // Only show this post on the first or last page, depending on sort ?> |
131 | 131 | <?php if (($oldest_post_first AND $first_page) OR (!$oldest_post_first AND $last_page)): ?> |
132 | 132 | |
@@ -142,23 +142,23 @@ discard block |
||
142 | 142 | |
143 | 143 | <div class="user"> |
144 | 144 | <?php |
145 | - $account = user_load(array('uid' => $uid)); |
|
146 | - $user_image = boincuser_get_user_profile_image($uid); |
|
147 | - if ($user_image) { |
|
148 | - print '<div class="picture">'; |
|
149 | - if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
150 | - //print theme('imagecache', 'thumbnail', $user_image['image']['filepath'], $user_image['alt'], $user_image['alt']); |
|
151 | - print theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
|
152 | - } |
|
153 | - elseif (is_string($user_image)) { |
|
154 | - print '<img src="' . $user_image . '"/>'; |
|
155 | - } |
|
156 | - print '</div>'; |
|
145 | + $account = user_load(array('uid' => $uid)); |
|
146 | + $user_image = boincuser_get_user_profile_image($uid); |
|
147 | + if ($user_image) { |
|
148 | + print '<div class="picture">'; |
|
149 | + if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
150 | + //print theme('imagecache', 'thumbnail', $user_image['image']['filepath'], $user_image['alt'], $user_image['alt']); |
|
151 | + print theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
|
152 | + } |
|
153 | + elseif (is_string($user_image)) { |
|
154 | + print '<img src="' . $user_image . '"/>'; |
|
157 | 155 | } |
158 | - // Generate ignore user link |
|
159 | - $ignore_link = ignore_user_link('node', $node); |
|
160 | - //echo '<pre>' . print_r($node->links, TRUE) . '</pre>'; |
|
161 | - ?> |
|
156 | + print '</div>'; |
|
157 | + } |
|
158 | + // Generate ignore user link |
|
159 | + $ignore_link = ignore_user_link('node', $node); |
|
160 | + //echo '<pre>' . print_r($node->links, TRUE) . '</pre>'; |
|
161 | + ?> |
|
162 | 162 | <div class="name"><?php print $name; ?></div> |
163 | 163 | <?php if ($account->uid): ?> |
164 | 164 | <div class="join-date">Joined: <?php print date('j M y', $account->created); ?></div> |
@@ -168,15 +168,15 @@ discard block |
||
168 | 168 | |
169 | 169 | <div class="user-links"> |
170 | 170 | <div class="ignore-link"><?php print l($ignore_link['ignore_user']['title'], |
171 | - $ignore_link['ignore_user']['href'], |
|
172 | - array('query' => $ignore_link['ignore_user']['query'])); ?> |
|
171 | + $ignore_link['ignore_user']['href'], |
|
172 | + array('query' => $ignore_link['ignore_user']['query'])); ?> |
|
173 | 173 | </div> |
174 | 174 | <div class="pm-link"><?php |
175 | - if ($user->uid AND ($user->uid != $account->uid)) { |
|
176 | - print l(bts('Send message'), |
|
177 | - privatemsg_get_link(array($account)), |
|
178 | - array('query' => drupal_get_destination())); |
|
179 | - } ?> |
|
175 | + if ($user->uid AND ($user->uid != $account->uid)) { |
|
176 | + print l(bts('Send message'), |
|
177 | + privatemsg_get_link(array($account)), |
|
178 | + array('query' => drupal_get_destination())); |
|
179 | + } ?> |
|
180 | 180 | </div> |
181 | 181 | </div> |
182 | 182 | <?php endif; ?> |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | <?php endif; // page with topic starter post ?> |
223 | 223 | |
224 | 224 | <?php |
225 | - if ($oldest_post_first) { |
|
226 | - print comment_render($node); |
|
227 | - } |
|
228 | - ?> |
|
225 | + if ($oldest_post_first) { |
|
226 | + print comment_render($node); |
|
227 | + } |
|
228 | +?> |
|
229 | 229 | |
230 | 230 | </div> <!-- /.node --> |
@@ -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,43 +81,43 @@ 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 .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
85 | - $item_count = count($links); |
|
86 | - $i = 1; |
|
87 | - foreach ($links as $key => $link) { |
|
88 | - $classes = array($key); |
|
89 | - if (strpos($key, 'active-trail')) $classes[] = 'active'; |
|
90 | - if ($i == 1) $classes[] = 'first'; |
|
91 | - if ($i == $item_count) $classes[] = 'last'; |
|
92 | - $html .= '<li class="' . implode(' ', $classes) .'">'; |
|
93 | - if ($link['title'] == 'Home') { |
|
94 | - $link['title'] = bts('Home'); |
|
95 | - } |
|
96 | - if (module_exists('privatemsg')) { |
|
97 | - // Put a new mail notification next to the Account menu item |
|
98 | - if ($link['href'] == 'dashboard') { |
|
99 | - $item_count = privatemsg_unread_count(); |
|
100 | - if ($item_count) { |
|
101 | - $link['title'] .= '</a> <a href="/messages" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
102 | - $link['html'] = TRUE; |
|
103 | - $link['attributes']['class'] = 'compound'; |
|
104 | - } |
|
105 | - } |
|
106 | - } |
|
107 | - // Put a count of items on the Moderation menu item |
|
108 | - if ($link['href'] == 'moderate') { |
|
109 | - $item_count = boincuser_moderation_queue_count(); |
|
84 | +$html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
85 | +$item_count = count($links); |
|
86 | +$i = 1; |
|
87 | +foreach ($links as $key => $link) { |
|
88 | + $classes = array($key); |
|
89 | + if (strpos($key, 'active-trail')) $classes[] = 'active'; |
|
90 | + if ($i == 1) $classes[] = 'first'; |
|
91 | + if ($i == $item_count) $classes[] = 'last'; |
|
92 | + $html .= '<li class="' . implode(' ', $classes) .'">'; |
|
93 | + if ($link['title'] == 'Home') { |
|
94 | + $link['title'] = bts('Home'); |
|
95 | + } |
|
96 | + if (module_exists('privatemsg')) { |
|
97 | + // Put a new mail notification next to the Account menu item |
|
98 | + if ($link['href'] == 'dashboard') { |
|
99 | + $item_count = privatemsg_unread_count(); |
|
110 | 100 | if ($item_count) { |
111 | - $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
101 | + $link['title'] .= '</a> <a href="/messages" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
112 | 102 | $link['html'] = TRUE; |
103 | + $link['attributes']['class'] = 'compound'; |
|
113 | 104 | } |
114 | 105 | } |
115 | - $html .= l($link['title'], $link['href'], $link); |
|
116 | - $html .= '</li>'; |
|
117 | - $i++; |
|
118 | 106 | } |
119 | - $html .= '</ul>' . "\n"; |
|
120 | - return $html; |
|
107 | + // Put a count of items on the Moderation menu item |
|
108 | + if ($link['href'] == 'moderate') { |
|
109 | + $item_count = boincuser_moderation_queue_count(); |
|
110 | + if ($item_count) { |
|
111 | + $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
112 | + $link['html'] = TRUE; |
|
113 | + } |
|
114 | + } |
|
115 | + $html .= l($link['title'], $link['href'], $link); |
|
116 | + $html .= '</li>'; |
|
117 | + $i++; |
|
118 | +} |
|
119 | +$html .= '</ul>' . "\n"; |
|
120 | +return $html; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -125,14 +125,14 @@ discard block |
||
125 | 125 | * Remove undesired local task tabs |
126 | 126 | */ |
127 | 127 | function boinc_menu_local_task($link, $active = FALSE) { |
128 | - if (strpos($link, 'admin/build/pages') !== FALSE |
|
129 | - AND strpos($link, 'Edit Panel')) { |
|
130 | - // Remove Edit Panel tab |
|
131 | - return ''; |
|
132 | - } |
|
133 | - else { |
|
134 | - return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
|
135 | - } |
|
128 | +if (strpos($link, 'admin/build/pages') !== FALSE |
|
129 | +AND strpos($link, 'Edit Panel')) { |
|
130 | + // Remove Edit Panel tab |
|
131 | + return ''; |
|
132 | +} |
|
133 | +else { |
|
134 | + return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
|
135 | +} |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | |
@@ -168,83 +168,83 @@ discard block |
||
168 | 168 | * The name of the template being rendered ("page" in this case.) |
169 | 169 | */ |
170 | 170 | function boinc_preprocess_page(&$vars, $hook) { |
171 | - // Responsive Design: Add viewport meta tag to HTML head |
|
172 | - drupal_set_html_head('<meta name="viewport" content="width=device-width, initial-scale=1.0" />'); |
|
173 | - $vars['head'] = drupal_get_html_head(); |
|
174 | - //dpm($vars['head'], "preprocess (all) vars[head]"); |
|
175 | - |
|
176 | - // Expose comments to template files; this is needed so that comments can be |
|
177 | - // rendered in locations other than directly below the node content |
|
178 | - $vars['comments'] = $vars['comment_form'] = ''; |
|
179 | - if (module_exists('comment') && isset($vars['node'])) { |
|
180 | - $vars['comments'] = comment_render($vars['node']); |
|
181 | - $vars['comment_form'] = drupal_get_form('comment_form', array('nid' => $vars['node']->nid)); |
|
182 | - } |
|
171 | +// Responsive Design: Add viewport meta tag to HTML head |
|
172 | +drupal_set_html_head('<meta name="viewport" content="width=device-width, initial-scale=1.0" />'); |
|
173 | +$vars['head'] = drupal_get_html_head(); |
|
174 | +//dpm($vars['head'], "preprocess (all) vars[head]"); |
|
175 | + |
|
176 | +// Expose comments to template files; this is needed so that comments can be |
|
177 | +// rendered in locations other than directly below the node content |
|
178 | +$vars['comments'] = $vars['comment_form'] = ''; |
|
179 | +if (module_exists('comment') && isset($vars['node'])) { |
|
180 | + $vars['comments'] = comment_render($vars['node']); |
|
181 | + $vars['comment_form'] = drupal_get_form('comment_form', array('nid' => $vars['node']->nid)); |
|
182 | +} |
|
183 | 183 | |
184 | - // Determine locale region code so the correct flag is displayed in footer |
|
185 | - global $language; |
|
186 | - global $theme_path; |
|
187 | - $locality = $language->language; |
|
188 | - if (strpos($language->language, '-')) { |
|
189 | - $flag_icon = "{$theme_path}/images/flags/{$language->language}.png"; |
|
190 | - if (!file_exists($flag_icon)) { |
|
191 | - $lang_code = explode('-', $language->language); |
|
192 | - $locality = $lang_code[0]; |
|
193 | - } |
|
184 | +// Determine locale region code so the correct flag is displayed in footer |
|
185 | +global $language; |
|
186 | +global $theme_path; |
|
187 | +$locality = $language->language; |
|
188 | +if (strpos($language->language, '-')) { |
|
189 | + $flag_icon = "{$theme_path}/images/flags/{$language->language}.png"; |
|
190 | + if (!file_exists($flag_icon)) { |
|
191 | + $lang_code = explode('-', $language->language); |
|
192 | + $locality = $lang_code[0]; |
|
194 | 193 | } |
195 | - $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
194 | +} |
|
195 | +$vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
196 | 196 | |
197 | - $server_status_url = variable_get('boinc_server_status_url', ''); |
|
198 | - if (!$server_status_url) { |
|
199 | - $server_status_url = 'server_status.php'; |
|
200 | - } |
|
201 | - $vars['server_status_url'] = $server_status_url; |
|
197 | +$server_status_url = variable_get('boinc_server_status_url', ''); |
|
198 | +if (!$server_status_url) { |
|
199 | + $server_status_url = 'server_status.php'; |
|
200 | +} |
|
201 | +$vars['server_status_url'] = $server_status_url; |
|
202 | 202 | |
203 | - $app_list_url = variable_get('boinc_app_list_url', ''); |
|
204 | - if (!$app_list_url) { |
|
205 | - $app_list_url = 'apps.php'; |
|
206 | - } |
|
207 | - $vars['app_list_url'] = $app_list_url; |
|
203 | +$app_list_url = variable_get('boinc_app_list_url', ''); |
|
204 | +if (!$app_list_url) { |
|
205 | + $app_list_url = 'apps.php'; |
|
206 | +} |
|
207 | +$vars['app_list_url'] = $app_list_url; |
|
208 | 208 | |
209 | - // Remove title from search page |
|
210 | - if (arg(0) == 'search') { |
|
211 | - unset($vars['title']); |
|
212 | - } |
|
209 | +// Remove title from search page |
|
210 | +if (arg(0) == 'search') { |
|
211 | + unset($vars['title']); |
|
212 | +} |
|
213 | 213 | |
214 | - // Apply classes to tabs to allow for better styling options |
|
215 | - $tabs = explode("\n", $vars['tabs']); |
|
216 | - array_pop($tabs); |
|
217 | - end($tabs); |
|
218 | - $last_key = key($tabs); |
|
219 | - |
|
220 | - foreach ($tabs as $key => &$tab) { |
|
221 | - if (strpos($tab, 'li class=')) { |
|
222 | - if ($key == 0) { |
|
223 | - $tab = str_replace('li class="', 'li class="first ', $tab); |
|
224 | - } |
|
225 | - if ($key == $last_key) { |
|
226 | - $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
227 | - } |
|
228 | - } |
|
229 | - elseif (strpos($tab, 'li ')) { |
|
230 | - if ($key == 0) { |
|
231 | - $tab = str_replace('li ', 'li class="first" ', $tab); |
|
232 | - } |
|
233 | - if ($key == $last_key) { |
|
234 | - $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
235 | - } |
|
236 | - } |
|
237 | - } |
|
238 | - $vars['tabs'] = implode("\n", $tabs); |
|
214 | +// Apply classes to tabs to allow for better styling options |
|
215 | +$tabs = explode("\n", $vars['tabs']); |
|
216 | +array_pop($tabs); |
|
217 | +end($tabs); |
|
218 | +$last_key = key($tabs); |
|
219 | + |
|
220 | +foreach ($tabs as $key => &$tab) { |
|
221 | + if (strpos($tab, 'li class=')) { |
|
222 | + if ($key == 0) { |
|
223 | + $tab = str_replace('li class="', 'li class="first ', $tab); |
|
224 | + } |
|
225 | + if ($key == $last_key) { |
|
226 | + $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
227 | + } |
|
228 | + } |
|
229 | + elseif (strpos($tab, 'li ')) { |
|
230 | + if ($key == 0) { |
|
231 | + $tab = str_replace('li ', 'li class="first" ', $tab); |
|
232 | + } |
|
233 | + if ($key == $last_key) { |
|
234 | + $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
235 | + } |
|
236 | + } |
|
237 | +} |
|
238 | +$vars['tabs'] = implode("\n", $tabs); |
|
239 | 239 | |
240 | - // Get the main menu but only for the branch the page is on. |
|
241 | - $vars['menu_tree_onlyactive'] = menu_tree('primary-links'); |
|
240 | +// Get the main menu but only for the branch the page is on. |
|
241 | +$vars['menu_tree_onlyactive'] = menu_tree('primary-links'); |
|
242 | 242 | |
243 | - // Create tertiary menu |
|
244 | - $vars['tertiary_links'] = menu_navigation_links(variable_get('menu_primary_links_source', 'primary-links'), 2); |
|
243 | +// Create tertiary menu |
|
244 | +$vars['tertiary_links'] = menu_navigation_links(variable_get('menu_primary_links_source', 'primary-links'), 2); |
|
245 | 245 | |
246 | - // Create action links |
|
247 | - $vars['action_links'] = _boinc_action_links(); |
|
246 | +// Create action links |
|
247 | +$vars['action_links'] = _boinc_action_links(); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -257,72 +257,72 @@ discard block |
||
257 | 257 | */ |
258 | 258 | function boinc_preprocess_node(&$vars, $hook) { |
259 | 259 | |
260 | - //$vars['sample_variable'] = t('Lorem ipsum.'); |
|
260 | +//$vars['sample_variable'] = t('Lorem ipsum.'); |
|
261 | 261 | |
262 | - // Detach subscribe link from the links list. Subscribe link will be placed |
|
263 | - // on page separately from links. |
|
264 | - if (!empty($vars['node']->links['flag-subscriptions']['title'])) { |
|
265 | - $vars['subscribe_link'] = $vars['node']->links['flag-subscriptions']['title']; |
|
266 | - unset($vars['node']->links['flag-subscriptions']); |
|
267 | - } |
|
262 | +// Detach subscribe link from the links list. Subscribe link will be placed |
|
263 | +// on page separately from links. |
|
264 | +if (!empty($vars['node']->links['flag-subscriptions']['title'])) { |
|
265 | + $vars['subscribe_link'] = $vars['node']->links['flag-subscriptions']['title']; |
|
266 | + unset($vars['node']->links['flag-subscriptions']); |
|
267 | +} |
|
268 | 268 | |
269 | - // Optionally, run node-type-specific preprocess functions, like |
|
270 | - // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
|
271 | - $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
272 | - if (function_exists($function)) { |
|
273 | - $function($vars, $hook); |
|
274 | - } |
|
269 | +// Optionally, run node-type-specific preprocess functions, like |
|
270 | +// boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
|
271 | +$function = __FUNCTION__ . '_' . $vars['node']->type; |
|
272 | +if (function_exists($function)) { |
|
273 | + $function($vars, $hook); |
|
274 | +} |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
278 | 278 | * Preprocessing for forum lists |
279 | 279 | */ |
280 | 280 | function boinc_preprocess_forums(&$vars, $hook) { |
281 | - // Add a link to mark all forums as read |
|
282 | - module_load_include('inc', 'forum_tweaks', 'includes/mark-read'); |
|
283 | - forum_tweaks_get_mark_read_link($vars['tid'], $vars['links']); |
|
284 | - if (!$vars['parents']) { |
|
285 | - // Remove the "Post new forum topic" link from the top level forum list |
|
286 | - unset($vars['links']['forum']); |
|
287 | - // Add a link to manage subscriptions for the user |
|
288 | - $vars['links']['subscriptions'] = array( |
|
289 | - 'title' => bts('Manage subscriptions'), |
|
290 | - 'href' => 'account/prefs/subscriptions', |
|
291 | - ); |
|
292 | - } |
|
281 | +// Add a link to mark all forums as read |
|
282 | +module_load_include('inc', 'forum_tweaks', 'includes/mark-read'); |
|
283 | +forum_tweaks_get_mark_read_link($vars['tid'], $vars['links']); |
|
284 | +if (!$vars['parents']) { |
|
285 | + // Remove the "Post new forum topic" link from the top level forum list |
|
286 | + unset($vars['links']['forum']); |
|
287 | + // Add a link to manage subscriptions for the user |
|
288 | + $vars['links']['subscriptions'] = array( |
|
289 | + 'title' => bts('Manage subscriptions'), |
|
290 | + 'href' => 'account/prefs/subscriptions', |
|
291 | + ); |
|
292 | +} |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
296 | 296 | * Preprocessing for forum type nodes |
297 | 297 | */ |
298 | 298 | function boinc_preprocess_node_forum(&$vars, $hook) { |
299 | - global $user; |
|
299 | +global $user; |
|
300 | 300 | |
301 | - // Get the author of the node |
|
302 | - $account = user_load($vars['uid']); |
|
303 | - $comments_per_page = ($user->comments_per_page) ? $user->comments_per_page : variable_get("comment_default_per_page_{$vars['node']->type}", 50); |
|
301 | +// Get the author of the node |
|
302 | +$account = user_load($vars['uid']); |
|
303 | +$comments_per_page = ($user->comments_per_page) ? $user->comments_per_page : variable_get("comment_default_per_page_{$vars['node']->type}", 50); |
|
304 | 304 | |
305 | - // Add signature |
|
306 | - $vars['signature'] = check_markup($account->signature, $vars['node']->format); |
|
305 | +// Add signature |
|
306 | +$vars['signature'] = check_markup($account->signature, $vars['node']->format); |
|
307 | 307 | |
308 | - // Show signatures based on user preference |
|
309 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
308 | +// Show signatures based on user preference |
|
309 | +$vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
310 | 310 | |
311 | - // Expose comment sort order so that the template can put the topic node |
|
312 | - // content (i.e. initial post) at the very end if "Newest post first" is the |
|
313 | - // preference used by this user |
|
314 | - $vars['oldest_post_first'] = ($user->sort != 1) ? TRUE : FALSE; |
|
315 | - $vars['node']->comment = 0; |
|
311 | +// Expose comment sort order so that the template can put the topic node |
|
312 | +// content (i.e. initial post) at the very end if "Newest post first" is the |
|
313 | +// preference used by this user |
|
314 | +$vars['oldest_post_first'] = ($user->sort != 1) ? TRUE : FALSE; |
|
315 | +$vars['node']->comment = 0; |
|
316 | 316 | |
317 | - $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
|
318 | - $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
319 | - $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
|
320 | - |
|
321 | - $links = $vars['links']; |
|
322 | - $moderator_links = array(); |
|
323 | - _boinc_create_moderator_links($links, $moderator_links); |
|
324 | - $vars['links'] = $links; |
|
325 | - $vars['moderator_links'] = $moderator_links; |
|
317 | +$vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
|
318 | +$page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
319 | +$vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
|
320 | + |
|
321 | +$links = $vars['links']; |
|
322 | +$moderator_links = array(); |
|
323 | +_boinc_create_moderator_links($links, $moderator_links); |
|
324 | +$vars['links'] = $links; |
|
325 | +$vars['moderator_links'] = $moderator_links; |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | |
@@ -330,8 +330,8 @@ discard block |
||
330 | 330 | * Preprocessing for team_forum type nodes |
331 | 331 | */ |
332 | 332 | function boinc_preprocess_node_team_forum(&$vars, $hook) { |
333 | - // Process this node in the same way as node_forum |
|
334 | - boinc_preprocess_node_forum($vars, $hook); |
|
333 | + // Process this node in the same way as node_forum |
|
334 | + boinc_preprocess_node_forum($vars, $hook); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -343,36 +343,36 @@ discard block |
||
343 | 343 | * The name of the template being rendered ("comment" in this case.) |
344 | 344 | */ |
345 | 345 | function boinc_preprocess_comment(&$vars, $hook) { |
346 | - // Show signatures based on user preference |
|
347 | - global $user; |
|
348 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
346 | + // Show signatures based on user preference |
|
347 | + global $user; |
|
348 | + $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
349 | 349 | |
350 | - $links = $vars['links']; |
|
351 | - $moderator_links = array(); |
|
352 | - _boinc_create_moderator_links($links, $moderator_links); |
|
353 | - $vars['links'] = $links; |
|
354 | - $vars['moderator_links'] = $moderator_links; |
|
350 | + $links = $vars['links']; |
|
351 | + $moderator_links = array(); |
|
352 | + _boinc_create_moderator_links($links, $moderator_links); |
|
353 | + $vars['links'] = $links; |
|
354 | + $vars['moderator_links'] = $moderator_links; |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
358 | 358 | * |
359 | 359 | */ |
360 | 360 | function boinc_preprocess_forum_topic_list(&$variables) { |
361 | - if (!empty($variables['topics'])) { |
|
362 | - foreach ($variables['topics'] as $id => $topic) { |
|
363 | - if ($topic->new_replies) { |
|
364 | - $cid = boincuser_get_first_unread_comment_id($topic->nid); |
|
365 | - if ($cid) { |
|
366 | - $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); |
|
367 | - } |
|
368 | - else { |
|
369 | - // User hasn't visited this topic before, so all replies are new... |
|
370 | - $topic->new_replies = NULL; |
|
371 | - } |
|
361 | +if (!empty($variables['topics'])) { |
|
362 | + foreach ($variables['topics'] as $id => $topic) { |
|
363 | + if ($topic->new_replies) { |
|
364 | + $cid = boincuser_get_first_unread_comment_id($topic->nid); |
|
365 | + if ($cid) { |
|
366 | + $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); |
|
367 | + } |
|
368 | + else { |
|
369 | + // User hasn't visited this topic before, so all replies are new... |
|
370 | + $topic->new_replies = NULL; |
|
372 | 371 | } |
373 | 372 | } |
374 | 373 | } |
375 | 374 | } |
375 | +} |
|
376 | 376 | |
377 | 377 | /** |
378 | 378 | * Override or insert variables into the default view template. |
@@ -384,63 +384,63 @@ discard block |
||
384 | 384 | */ |
385 | 385 | ///* -- Delete this line if you want to use this function |
386 | 386 | function boinc_preprocess_views_view(&$vars, $hook) { |
387 | - switch ($vars['name']) { |
|
388 | - case 'boinc_account_computers': |
|
389 | - switch ($vars['display_id']) { |
|
390 | - case 'page_1': |
|
391 | - case 'panel_pane_1': |
|
392 | - $vars['empty'] = boincwork_views_host_list_empty_text(); |
|
393 | - break; |
|
394 | - case 'page_2': |
|
395 | - $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
|
396 | - break; |
|
397 | - case 'block_1': |
|
398 | - $vars['empty'] = boincwork_views_host_list_empty_text('preferences'); |
|
399 | - break; |
|
400 | - default: |
|
401 | - } |
|
402 | - break; |
|
403 | - case 'boinc_account_tasks_all': |
|
404 | - $vars['empty'] = boincwork_views_task_list_empty_text(); |
|
405 | - break; |
|
406 | - case 'boinc_friends': |
|
407 | - if ($vars['display_id'] == 'block_1') { |
|
408 | - $vars['header'] = boincuser_views_friends_block_header(); |
|
409 | - } |
|
410 | - break; |
|
411 | - case 'boinc_host_list': |
|
412 | - if ($vars['display_id'] == 'page_2') { |
|
413 | - $vars['empty'] = boincwork_views_host_list_empty_text(); |
|
414 | - } |
|
415 | - elseif ($vars['display_id'] == 'page_1') { |
|
416 | - $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
|
417 | - } |
|
418 | - break; |
|
419 | - case 'boinc_task': |
|
420 | - // Load view object (view data is not available in header / footer); execute view query |
|
421 | - $view = views_get_current_view(); |
|
422 | - $view->execute(); |
|
423 | - $result = reset($view->result); |
|
424 | - // Display the stderr output in the footer |
|
425 | - $vars['footer'] = '<h3>' . bts('Stderr output') .'</h3>'; |
|
426 | - $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
427 | - break; |
|
428 | - case 'boinc_teams': |
|
429 | - if ($vars['display_id'] == 'panel_pane_3') { |
|
430 | - $team_id = arg(2); |
|
431 | - $vars['header'] = boincteam_manage_admins_panel_header($team_id); |
|
432 | - } |
|
433 | - break; |
|
434 | - case 'boinc_workunit': |
|
435 | - ob_start(); |
|
436 | - // Get the workunit ID from the URL |
|
437 | - $result_id = arg(1); |
|
438 | - require_boinc(array('util','boinc_db')); |
|
439 | - $wu = BoincWorkunit::lookup_id($result_id); |
|
440 | - project_workunit($wu); |
|
441 | - // Output of project_workunit() gets caught in the buffer |
|
442 | - $vars['footer'] = ob_get_clean(); |
|
443 | - default: |
|
387 | +switch ($vars['name']) { |
|
388 | +case 'boinc_account_computers': |
|
389 | +switch ($vars['display_id']) { |
|
390 | +case 'page_1': |
|
391 | +case 'panel_pane_1': |
|
392 | +$vars['empty'] = boincwork_views_host_list_empty_text(); |
|
393 | +break; |
|
394 | +case 'page_2': |
|
395 | +$vars['empty'] = boincwork_views_host_list_empty_text('active'); |
|
396 | +break; |
|
397 | +case 'block_1': |
|
398 | +$vars['empty'] = boincwork_views_host_list_empty_text('preferences'); |
|
399 | +break; |
|
400 | +default: |
|
401 | +} |
|
402 | + break; |
|
403 | +case 'boinc_account_tasks_all': |
|
404 | + $vars['empty'] = boincwork_views_task_list_empty_text(); |
|
405 | + break; |
|
406 | +case 'boinc_friends': |
|
407 | + if ($vars['display_id'] == 'block_1') { |
|
408 | + $vars['header'] = boincuser_views_friends_block_header(); |
|
409 | + } |
|
410 | + break; |
|
411 | +case 'boinc_host_list': |
|
412 | + if ($vars['display_id'] == 'page_2') { |
|
413 | + $vars['empty'] = boincwork_views_host_list_empty_text(); |
|
414 | + } |
|
415 | + elseif ($vars['display_id'] == 'page_1') { |
|
416 | + $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
|
417 | + } |
|
418 | + break; |
|
419 | +case 'boinc_task': |
|
420 | + // Load view object (view data is not available in header / footer); execute view query |
|
421 | + $view = views_get_current_view(); |
|
422 | + $view->execute(); |
|
423 | + $result = reset($view->result); |
|
424 | + // Display the stderr output in the footer |
|
425 | + $vars['footer'] = '<h3>' . bts('Stderr output') .'</h3>'; |
|
426 | + $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
427 | + break; |
|
428 | +case 'boinc_teams': |
|
429 | + if ($vars['display_id'] == 'panel_pane_3') { |
|
430 | + $team_id = arg(2); |
|
431 | + $vars['header'] = boincteam_manage_admins_panel_header($team_id); |
|
432 | + } |
|
433 | + break; |
|
434 | +case 'boinc_workunit': |
|
435 | + ob_start(); |
|
436 | + // Get the workunit ID from the URL |
|
437 | + $result_id = arg(1); |
|
438 | + require_boinc(array('util','boinc_db')); |
|
439 | + $wu = BoincWorkunit::lookup_id($result_id); |
|
440 | + project_workunit($wu); |
|
441 | + // Output of project_workunit() gets caught in the buffer |
|
442 | + $vars['footer'] = ob_get_clean(); |
|
443 | +default: |
|
444 | 444 | } |
445 | 445 | } |
446 | 446 | // */ |
@@ -578,13 +578,13 @@ discard block |
||
578 | 578 | $sender = user_load($sender->uid); |
579 | 579 | |
580 | 580 | switch ($status) { |
581 | - case FLAG_FRIEND_FLAGGED: |
|
582 | - // Sender accepted recipient's friend request |
|
583 | - $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
584 | - '!name' => $sender->boincuser_name, |
|
585 | - '!site' => variable_get('site_name', ''), |
|
586 | - )); |
|
587 | - $email['body'] = bts('!name confirmed you as a friend on !site. |
|
581 | + case FLAG_FRIEND_FLAGGED: |
|
582 | + // Sender accepted recipient's friend request |
|
583 | + $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
584 | + '!name' => $sender->boincuser_name, |
|
585 | + '!site' => variable_get('site_name', ''), |
|
586 | + )); |
|
587 | + $email['body'] = bts('!name confirmed you as a friend on !site. |
|
588 | 588 | |
589 | 589 | Follow this link to view his or her profile: |
590 | 590 | !link |
@@ -593,17 +593,17 @@ discard block |
||
593 | 593 | |
594 | 594 | Thanks, |
595 | 595 | The !site team', array( |
596 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
597 | - '!site' => variable_get('site_name', ''), |
|
598 | - '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
599 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
600 | - )); |
|
601 | - break; |
|
602 | - |
|
603 | - case FLAG_FRIEND_PENDING: |
|
604 | - // Sender is requesting to be recipient's friend |
|
605 | - $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', ''))); |
|
606 | - $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. |
|
596 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
597 | + '!site' => variable_get('site_name', ''), |
|
598 | + '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
599 | + '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
600 | + )); |
|
601 | + break; |
|
602 | + |
|
603 | + case FLAG_FRIEND_PENDING: |
|
604 | + // Sender is requesting to be recipient's friend |
|
605 | + $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', ''))); |
|
606 | + $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. |
|
607 | 607 | |
608 | 608 | Follow the link below to view this request: |
609 | 609 | !link |
@@ -612,12 +612,12 @@ discard block |
||
612 | 612 | |
613 | 613 | Thanks, |
614 | 614 | The !site team', array( |
615 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
616 | - '!site' => variable_get('site_name', ''), |
|
617 | - '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
618 | - '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
619 | - )); |
|
620 | - break; |
|
615 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
616 | + '!site' => variable_get('site_name', ''), |
|
617 | + '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
618 | + '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
619 | + )); |
|
620 | + break; |
|
621 | 621 | } |
622 | 622 | return $email; |
623 | 623 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | <tr class="<?php print $count % 2 == 0 ? 'odd' : 'even'; ?> <?php print $row->class ?>"> |
22 | 22 | <?php |
23 | 23 | switch ($row->row_type): |
24 | - case 'field': ?> |
|
24 | + case 'field': ?> |
|
25 | 25 | <td> |
26 | 26 | <?php print $row->indentation; ?> |
27 | 27 | <span class="<?php print $row->label_class; ?>"><?php print $row->label; ?></span> |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <td><?php print $row->type; ?></td> |
32 | 32 | <td><?php print $row->configure; ?> <?php print $row->remove; ?></td> |
33 | 33 | <?php break; |
34 | - case 'group': ?> |
|
34 | + case 'group': ?> |
|
35 | 35 | <td> |
36 | 36 | <?php print $row->indentation; ?> |
37 | 37 | <span class="<?php print $row->label_class; ?>"><?php print $row->label; ?></span> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | <td><?php print $row->group_type; ?></td> |
42 | 42 | <td><?php print $row->configure; ?> <?php print $row->remove; ?></td> |
43 | 43 | <?php break; |
44 | - case 'extra': ?> |
|
44 | + case 'extra': ?> |
|
45 | 45 | <td> |
46 | 46 | <?php print $row->indentation; ?> |
47 | 47 | <span class="<?php print $row->label_class; ?>"><?php print $row->label; ?></span> |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | <td colspan="2"><?php print $row->description; ?></td> |
51 | 51 | <td><?php print $row->configure; ?> <?php print $row->remove; ?></td> |
52 | 52 | <?php break; |
53 | - case 'separator': ?> |
|
53 | + case 'separator': ?> |
|
54 | 54 | <td colspan="5" class="region"><?php print t('Add'); ?></td> |
55 | 55 | <?php break; |
56 | - case 'add_new_field': ?> |
|
56 | + case 'add_new_field': ?> |
|
57 | 57 | <td> |
58 | 58 | <?php print $row->indentation; ?> |
59 | 59 | <div class="<?php print $row->label_class; ?>"> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <td><div class="content-new"> </div><?php print $row->type; ?></td> |
67 | 67 | <td><div class="content-new"> </div><?php print $row->widget_type; ?></td> |
68 | 68 | <?php break; |
69 | - case 'add_existing_field': ?> |
|
69 | + case 'add_existing_field': ?> |
|
70 | 70 | <td> |
71 | 71 | <?php print $row->indentation; ?> |
72 | 72 | <div class="<?php print $row->label_class; ?>"> |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | <td colspan="2"><div class="content-new"> </div><?php print $row->field_name; ?></td> |
79 | 79 | <td><div class="content-new"> </div><?php print $row->widget_type; ?></td> |
80 | 80 | <?php break; |
81 | - case 'add_new_group': ?> |
|
81 | + case 'add_new_group': ?> |
|
82 | 82 | <td> |
83 | 83 | <?php print $row->indentation; ?> |
84 | 84 | <div class="<?php print $row->label_class; ?>"> |
@@ -19,18 +19,18 @@ |
||
19 | 19 | <tr class="<?php print $count % 2 == 0 ? 'odd' : 'even'; ?>"> |
20 | 20 | <?php |
21 | 21 | switch ($row->row_type): |
22 | - case 'field': ?> |
|
22 | + case 'field': ?> |
|
23 | 23 | <td><?php print $row->checkbox; ?></td> |
24 | 24 | <td><?php print $row->indentation; ?><span class="<?php print $row->label_class; ?>"><?php print $row->human_name; ?></span></td> |
25 | 25 | <td><?php print $row->field_name; ?></td> |
26 | 26 | <td><?php print $row->type; ?></td> |
27 | 27 | <?php break; |
28 | - case 'group': ?> |
|
28 | + case 'group': ?> |
|
29 | 29 | <td><?php print $row->checkbox; ?></td> |
30 | 30 | <td><?php print $row->indentation; ?><span class="<?php print $row->label_class; ?>"><?php print $row->human_name; ?></span></td> |
31 | 31 | <td colspan="2"><?php print $row->group_name; ?></td> |
32 | 32 | <?php break; |
33 | - endswitch; ?> |
|
33 | + endswitch; ?> |
|
34 | 34 | </tr> |
35 | 35 | <?php $count++; |
36 | 36 | endforeach; ?> |
@@ -216,12 +216,12 @@ |
||
216 | 216 | } // defer |
217 | 217 | switch ($contents) { |
218 | 218 | // check for shorthand content model forms |
219 | - case 'Empty': |
|
220 | - return array('empty', ''); |
|
221 | - case 'Inline': |
|
222 | - return array('optional', 'Inline | #PCDATA'); |
|
223 | - case 'Flow': |
|
224 | - return array('optional', 'Flow | #PCDATA'); |
|
219 | + case 'Empty': |
|
220 | + return array('empty', ''); |
|
221 | + case 'Inline': |
|
222 | + return array('optional', 'Inline | #PCDATA'); |
|
223 | + case 'Flow': |
|
224 | + return array('optional', 'Flow | #PCDATA'); |
|
225 | 225 | } |
226 | 226 | list($content_model_type, $content_model) = explode(':', $contents); |
227 | 227 | $content_model_type = strtolower(trim($content_model_type)); |
@@ -576,10 +576,10 @@ |
||
576 | 576 | } |
577 | 577 | $lenc = strtolower($encoding); |
578 | 578 | switch ($lenc) { |
579 | - case 'shift_jis': |
|
580 | - return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); |
|
581 | - case 'johab': |
|
582 | - return array("\xE2\x82\xA9" => '\\'); |
|
579 | + case 'shift_jis': |
|
580 | + return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); |
|
581 | + case 'johab': |
|
582 | + return array("\xE2\x82\xA9" => '\\'); |
|
583 | 583 | } |
584 | 584 | if (strpos($lenc, 'iso-8859-') === 0) { |
585 | 585 | return array(); |