@@ -2,9 +2,9 @@ discard block |
||
| 2 | 2 | // $Id$ |
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | - * @file |
|
| 6 | - * Enable BOINC charting features for statistics |
|
| 7 | - */ |
|
| 5 | + * @file |
|
| 6 | + * Enable BOINC charting features for statistics |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * Implementation of hook_menu(). |
|
| 22 | - */ |
|
| 21 | + * Implementation of hook_menu(). |
|
| 22 | + */ |
|
| 23 | 23 | function boincstats_menu() { |
| 24 | - $items['admin/boinc/stats'] = array( |
|
| 24 | + $items['admin/boinc/stats'] = array( |
|
| 25 | 25 | 'title' => 'Environment: Statistics setup', |
| 26 | 26 | 'description' => 'Configure the stats system for generating charts and |
| 27 | 27 | providing cross project data.', |
@@ -30,18 +30,18 @@ discard block |
||
| 30 | 30 | 'access arguments' => array('administer site configuration'), |
| 31 | 31 | 'type' => MENU_NORMAL_ITEM, |
| 32 | 32 | 'file' => 'boincstats.admin.inc' |
| 33 | - ); |
|
| 34 | - $items['charts/user'] = array( |
|
| 33 | + ); |
|
| 34 | + $items['charts/user'] = array( |
|
| 35 | 35 | 'page callback' => 'boincstats_get_user_stats_chart', |
| 36 | 36 | 'access arguments' => array('access content'), |
| 37 | 37 | 'type' => MENU_CALLBACK |
| 38 | - ); |
|
| 39 | - $items['charts/project'] = array( |
|
| 38 | + ); |
|
| 39 | + $items['charts/project'] = array( |
|
| 40 | 40 | 'page callback' => 'boincstats_get_project_stats_chart', |
| 41 | 41 | 'access arguments' => array('access content'), |
| 42 | 42 | 'type' => MENU_CALLBACK |
| 43 | - ); |
|
| 44 | - return $items; |
|
| 43 | + ); |
|
| 44 | + return $items; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -50,31 +50,31 @@ discard block |
||
| 50 | 50 | * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * User stats chart menu callback |
|
| 54 | - * Called to generate the daily credit status chart for a user (dashboard) |
|
| 55 | - */ |
|
| 53 | + * User stats chart menu callback |
|
| 54 | + * Called to generate the daily credit status chart for a user (dashboard) |
|
| 55 | + */ |
|
| 56 | 56 | function boincstats_get_user_stats_chart($cpid = null, $chart_size = 'medium') { |
| 57 | 57 | |
| 58 | - // pChart library inclusions |
|
| 59 | - module_load_include('php', 'boincstats', 'includes/pchart/class/pData.class'); |
|
| 60 | - module_load_include('php', 'boincstats', 'includes/pchart/class/pDraw.class'); |
|
| 61 | - module_load_include('php', 'boincstats', 'includes/pchart/class/pImage.class'); |
|
| 62 | - module_load_include('php', 'boincstats', 'includes/pchart/class/pCache.class'); |
|
| 58 | + // pChart library inclusions |
|
| 59 | + module_load_include('php', 'boincstats', 'includes/pchart/class/pData.class'); |
|
| 60 | + module_load_include('php', 'boincstats', 'includes/pchart/class/pDraw.class'); |
|
| 61 | + module_load_include('php', 'boincstats', 'includes/pchart/class/pImage.class'); |
|
| 62 | + module_load_include('php', 'boincstats', 'includes/pchart/class/pCache.class'); |
|
| 63 | 63 | |
| 64 | - init_theme(); |
|
| 65 | - global $theme_key; |
|
| 66 | - $cache_name = "{$theme_key}_"; |
|
| 64 | + init_theme(); |
|
| 65 | + global $theme_key; |
|
| 66 | + $cache_name = "{$theme_key}_"; |
|
| 67 | 67 | |
| 68 | - $dataset_size = 0; |
|
| 69 | - $chart_height = 0; |
|
| 70 | - $chart_width = 0; |
|
| 71 | - $draw_x_lines = FALSE; |
|
| 72 | - $label_x_axis = FALSE; |
|
| 68 | + $dataset_size = 0; |
|
| 69 | + $chart_height = 0; |
|
| 70 | + $chart_width = 0; |
|
| 71 | + $draw_x_lines = FALSE; |
|
| 72 | + $label_x_axis = FALSE; |
|
| 73 | 73 | |
| 74 | - $stats_xml = NULL; |
|
| 74 | + $stats_xml = NULL; |
|
| 75 | 75 | |
| 76 | - switch($chart_size) { |
|
| 77 | - case 'small': |
|
| 76 | + switch($chart_size) { |
|
| 77 | + case 'small': |
|
| 78 | 78 | $cache_name .= "{$cpid}_small"; |
| 79 | 79 | $dataset_size = 30; |
| 80 | 80 | $chart_height = 80; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $draw_x_lines = FALSE; |
| 84 | 84 | $label_x_axis = FALSE; |
| 85 | 85 | break; |
| 86 | - case 'medium': |
|
| 86 | + case 'medium': |
|
| 87 | 87 | default: |
| 88 | 88 | $cache_name .= $cpid; |
| 89 | 89 | $dataset_size = 60; |
@@ -91,32 +91,32 @@ discard block |
||
| 91 | 91 | $chart_width = 589; |
| 92 | 92 | $draw_x_lines = TRUE; |
| 93 | 93 | $label_x_axis = TRUE; |
| 94 | - } |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - // Sanity check for cache directory |
|
| 97 | - if (!boincstats_check_cache_dir()) { |
|
| 96 | + // Sanity check for cache directory |
|
| 97 | + if (!boincstats_check_cache_dir()) { |
|
| 98 | 98 | return; |
| 99 | - } |
|
| 99 | + } |
|
| 100 | 100 | |
| 101 | - // Initialize the cache object and flush stale images |
|
| 102 | - $myCache = new pCache(array('CacheFolder' => realpath('.') . '/' . conf_path() . '/files/cache')); |
|
| 103 | - $myCache->removeOlderThan(60*60*24); |
|
| 101 | + // Initialize the cache object and flush stale images |
|
| 102 | + $myCache = new pCache(array('CacheFolder' => realpath('.') . '/' . conf_path() . '/files/cache')); |
|
| 103 | + $myCache->removeOlderThan(60*60*24); |
|
| 104 | 104 | |
| 105 | - if ($myCache->isInCache($cache_name)) { |
|
| 105 | + if ($myCache->isInCache($cache_name)) { |
|
| 106 | 106 | $myCache->strokeFromCache($cache_name); |
| 107 | - } |
|
| 108 | - else { |
|
| 107 | + } |
|
| 108 | + else { |
|
| 109 | 109 | // Initialize dataset |
| 110 | 110 | $dataset = array(); |
| 111 | 111 | $stats_xml = boincstats_get_project_stats('daily', $cpid); |
| 112 | 112 | if ($stats_xml) { |
| 113 | - // Get the last 60 days of stats for the chart |
|
| 114 | - for ($j = 30; $j < 90; $j++) { |
|
| 113 | + // Get the last 60 days of stats for the chart |
|
| 114 | + for ($j = 30; $j < 90; $j++) { |
|
| 115 | 115 | $dataset[] = (int) $stats_xml->records->record[$j]; |
| 116 | - } |
|
| 116 | + } |
|
| 117 | 117 | } |
| 118 | 118 | else { |
| 119 | - for ($i = 0; $i <= $dataset_size; $i++) $dataset[] = 0; |
|
| 119 | + for ($i = 0; $i <= $dataset_size; $i++) $dataset[] = 0; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | // Get color configuration |
@@ -145,39 +145,39 @@ discard block |
||
| 145 | 145 | // Define the chart area |
| 146 | 146 | $myPicture->setGraphArea(0, 3, $chart_width, $chart_height); |
| 147 | 147 | if ($backdrop_color) { |
| 148 | - $myPicture->drawFilledRectangle(0, 0, $chart_width, $chart_height, $backdrop_color); |
|
| 148 | + $myPicture->drawFilledRectangle(0, 0, $chart_width, $chart_height, $backdrop_color); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Draw the scale |
| 152 | 152 | $scaleSettings = array( |
| 153 | - 'Mode' => SCALE_MODE_START0, |
|
| 154 | - 'DrawYLines' => false, |
|
| 155 | - 'DrawXLines' => $draw_x_lines, |
|
| 156 | - 'GridTicks' => 2, |
|
| 157 | - 'LabelSkip' => 9, |
|
| 158 | - 'SkippedAxisAlpha' => 0, |
|
| 159 | - 'SkippedInnerTickWidth' => 0, |
|
| 160 | - 'SkippedOuterTickWidth' => 0, |
|
| 161 | - 'AxisAlpha' => 0, |
|
| 162 | - 'InnerTickWidth' => 0, |
|
| 163 | - 'OuterTickWidth' => 0, |
|
| 164 | - 'XMargin' => 1, |
|
| 165 | - 'YMargin' => 0, |
|
| 166 | - 'Floating' => TRUE, |
|
| 167 | - 'GridR' => 200, |
|
| 168 | - 'GridG' => 200, |
|
| 169 | - 'GridB' => 200, |
|
| 170 | - 'DrawSubTicks' => false, |
|
| 171 | - 'CycleBackground' => false |
|
| 153 | + 'Mode' => SCALE_MODE_START0, |
|
| 154 | + 'DrawYLines' => false, |
|
| 155 | + 'DrawXLines' => $draw_x_lines, |
|
| 156 | + 'GridTicks' => 2, |
|
| 157 | + 'LabelSkip' => 9, |
|
| 158 | + 'SkippedAxisAlpha' => 0, |
|
| 159 | + 'SkippedInnerTickWidth' => 0, |
|
| 160 | + 'SkippedOuterTickWidth' => 0, |
|
| 161 | + 'AxisAlpha' => 0, |
|
| 162 | + 'InnerTickWidth' => 0, |
|
| 163 | + 'OuterTickWidth' => 0, |
|
| 164 | + 'XMargin' => 1, |
|
| 165 | + 'YMargin' => 0, |
|
| 166 | + 'Floating' => TRUE, |
|
| 167 | + 'GridR' => 200, |
|
| 168 | + 'GridG' => 200, |
|
| 169 | + 'GridB' => 200, |
|
| 170 | + 'DrawSubTicks' => false, |
|
| 171 | + 'CycleBackground' => false |
|
| 172 | 172 | ); |
| 173 | 173 | $myPicture->setFontProperties(array('FontSize' => 10)); |
| 174 | 174 | $myPicture->drawScale($scaleSettings); |
| 175 | 175 | |
| 176 | 176 | if ($label_x_axis) { |
| 177 | - for ($i = 5; $i >= 0; $i--) { |
|
| 177 | + for ($i = 5; $i >= 0; $i--) { |
|
| 178 | 178 | $label = ($i) ? -10*$i : 'Today'; |
| 179 | 179 | $myPicture->drawText(589-587*($i/6)-5, 2, $label, array('Align' => TEXT_ALIGN_TOPRIGHT)); |
| 180 | - } |
|
| 180 | + } |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | // Draw the area chart |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | // Render the picture (choose the best way) |
| 190 | 190 | //$myPicture->autoOutput('pictures/example.drawAreaChart.simple.png'); |
| 191 | 191 | $myPicture->stroke(); |
| 192 | - } |
|
| 192 | + } |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -197,48 +197,48 @@ discard block |
||
| 197 | 197 | * Called to generate the daily credit status chart for the whole project |
| 198 | 198 | */ |
| 199 | 199 | function boincstats_get_project_stats_chart() { |
| 200 | - // pChart library inclusions |
|
| 201 | - module_load_include('php', 'boincstats', 'includes/pchart/class/pData.class'); |
|
| 202 | - module_load_include('php', 'boincstats', 'includes/pchart/class/pDraw.class'); |
|
| 203 | - module_load_include('php', 'boincstats', 'includes/pchart/class/pImage.class'); |
|
| 204 | - module_load_include('php', 'boincstats', 'includes/pchart/class/pCache.class'); |
|
| 205 | - |
|
| 206 | - init_theme(); |
|
| 207 | - global $theme_key; |
|
| 208 | - $cache_name = "{$theme_key}_project_chart"; |
|
| 209 | - |
|
| 210 | - $color_keys = array('R', 'G', 'B'); |
|
| 211 | - |
|
| 212 | - // Get color configuration |
|
| 213 | - $palette_color_hex = theme_get_setting('boinc_stats_chart_color'); |
|
| 214 | - $palette_color = array_combine($color_keys, sscanf($palette_color_hex, "#%02x%02x%02x")); |
|
| 215 | - $backdrop_color_hex = theme_get_setting('boinc_stats_chart_bcolor'); |
|
| 216 | - $backdrop_color = array_combine($color_keys, sscanf($backdrop_color_hex, "#%02x%02x%02x")); |
|
| 217 | - |
|
| 218 | - // Sanity check for cache directory |
|
| 219 | - if (!boincstats_check_cache_dir()) { |
|
| 200 | + // pChart library inclusions |
|
| 201 | + module_load_include('php', 'boincstats', 'includes/pchart/class/pData.class'); |
|
| 202 | + module_load_include('php', 'boincstats', 'includes/pchart/class/pDraw.class'); |
|
| 203 | + module_load_include('php', 'boincstats', 'includes/pchart/class/pImage.class'); |
|
| 204 | + module_load_include('php', 'boincstats', 'includes/pchart/class/pCache.class'); |
|
| 205 | + |
|
| 206 | + init_theme(); |
|
| 207 | + global $theme_key; |
|
| 208 | + $cache_name = "{$theme_key}_project_chart"; |
|
| 209 | + |
|
| 210 | + $color_keys = array('R', 'G', 'B'); |
|
| 211 | + |
|
| 212 | + // Get color configuration |
|
| 213 | + $palette_color_hex = theme_get_setting('boinc_stats_chart_color'); |
|
| 214 | + $palette_color = array_combine($color_keys, sscanf($palette_color_hex, "#%02x%02x%02x")); |
|
| 215 | + $backdrop_color_hex = theme_get_setting('boinc_stats_chart_bcolor'); |
|
| 216 | + $backdrop_color = array_combine($color_keys, sscanf($backdrop_color_hex, "#%02x%02x%02x")); |
|
| 217 | + |
|
| 218 | + // Sanity check for cache directory |
|
| 219 | + if (!boincstats_check_cache_dir()) { |
|
| 220 | 220 | return; |
| 221 | - } |
|
| 221 | + } |
|
| 222 | 222 | |
| 223 | - // Initialize the cache object and flush stale images |
|
| 224 | - $myCache = new pCache(array('CacheFolder' => realpath('.') . '/' . conf_path() . '/files/cache')); |
|
| 225 | - $myCache->removeOlderThan(60*60*24); |
|
| 223 | + // Initialize the cache object and flush stale images |
|
| 224 | + $myCache = new pCache(array('CacheFolder' => realpath('.') . '/' . conf_path() . '/files/cache')); |
|
| 225 | + $myCache->removeOlderThan(60*60*24); |
|
| 226 | 226 | |
| 227 | - if ($myCache->isInCache($cache_name)) { |
|
| 227 | + if ($myCache->isInCache($cache_name)) { |
|
| 228 | 228 | $myCache->strokeFromCache($cache_name); |
| 229 | - } |
|
| 230 | - else { |
|
| 229 | + } |
|
| 230 | + else { |
|
| 231 | 231 | // Initialize dataset |
| 232 | 232 | $dataset = array(); |
| 233 | 233 | $stats_xml = boincstats_get_project_stats('daily'); |
| 234 | 234 | if ($stats_xml) { |
| 235 | - // Get the last 60 days of stats for the chart |
|
| 236 | - for ($j = 30; $j < 90; $j++) { |
|
| 235 | + // Get the last 60 days of stats for the chart |
|
| 236 | + for ($j = 30; $j < 90; $j++) { |
|
| 237 | 237 | $dataset[] = (int) $stats_xml->records->record[$j]; |
| 238 | - } |
|
| 238 | + } |
|
| 239 | 239 | } |
| 240 | 240 | else { |
| 241 | - for ($i = 0; $i <= 30; $i++) $dataset[] = 0; |
|
| 241 | + for ($i = 0; $i <= 30; $i++) $dataset[] = 0; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // Create and populate the pData object |
@@ -263,25 +263,25 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | // Draw the scale |
| 265 | 265 | $scaleSettings = array( |
| 266 | - 'Mode' => SCALE_MODE_START0, |
|
| 267 | - 'DrawYLines' => false, |
|
| 268 | - 'DrawXLines' => false, |
|
| 269 | - 'GridTicks' => 2, |
|
| 270 | - 'LabelSkip' => 9, |
|
| 271 | - 'SkippedAxisAlpha' => 0, |
|
| 272 | - 'SkippedInnerTickWidth' => 0, |
|
| 273 | - 'SkippedOuterTickWidth' => 0, |
|
| 274 | - 'AxisAlpha' => 0, |
|
| 275 | - 'InnerTickWidth' => 0, |
|
| 276 | - 'OuterTickWidth' => 0, |
|
| 277 | - 'XMargin' => 1, |
|
| 278 | - 'YMargin' => 0, |
|
| 279 | - 'Floating' => TRUE, |
|
| 280 | - 'GridR' => 200, |
|
| 281 | - 'GridG' => 200, |
|
| 282 | - 'GridB' => 200, |
|
| 283 | - 'DrawSubTicks' => false, |
|
| 284 | - 'CycleBackground' => false |
|
| 266 | + 'Mode' => SCALE_MODE_START0, |
|
| 267 | + 'DrawYLines' => false, |
|
| 268 | + 'DrawXLines' => false, |
|
| 269 | + 'GridTicks' => 2, |
|
| 270 | + 'LabelSkip' => 9, |
|
| 271 | + 'SkippedAxisAlpha' => 0, |
|
| 272 | + 'SkippedInnerTickWidth' => 0, |
|
| 273 | + 'SkippedOuterTickWidth' => 0, |
|
| 274 | + 'AxisAlpha' => 0, |
|
| 275 | + 'InnerTickWidth' => 0, |
|
| 276 | + 'OuterTickWidth' => 0, |
|
| 277 | + 'XMargin' => 1, |
|
| 278 | + 'YMargin' => 0, |
|
| 279 | + 'Floating' => TRUE, |
|
| 280 | + 'GridR' => 200, |
|
| 281 | + 'GridG' => 200, |
|
| 282 | + 'GridB' => 200, |
|
| 283 | + 'DrawSubTicks' => false, |
|
| 284 | + 'CycleBackground' => false |
|
| 285 | 285 | ); |
| 286 | 286 | $myPicture->setFontProperties(array('FontSize' => 10)); |
| 287 | 287 | $myPicture->drawScale($scaleSettings); |
@@ -300,41 +300,41 @@ discard block |
||
| 300 | 300 | // Render the picture (choose the best way) |
| 301 | 301 | //$myPicture->autoOutput('pictures/example.drawAreaChart.simple.png'); |
| 302 | 302 | $myPicture->stroke(); |
| 303 | - } |
|
| 303 | + } |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /* |
| 307 | 307 | * |
| 308 | 308 | */ |
| 309 | 309 | function boincstats_check_cache_dir($cache_path = 'files/cache') { |
| 310 | - $cache_dir = realpath('.') . '/' . conf_path() . '/' . $cache_path; |
|
| 311 | - if (!is_writeable($cache_dir)) { |
|
| 310 | + $cache_dir = realpath('.') . '/' . conf_path() . '/' . $cache_path; |
|
| 311 | + if (!is_writeable($cache_dir)) { |
|
| 312 | 312 | if (!is_dir($cache_dir)) { |
| 313 | - if (!is_writeable(dirname($cache_dir))) { |
|
| 313 | + if (!is_writeable(dirname($cache_dir))) { |
|
| 314 | 314 | // If the parent "files" dir isn't even writeable... |
| 315 | 315 | watchdog('boincstats', '@parent_dir directory is not writeable. This |
| 316 | 316 | directory must be writeable by the web server.', |
| 317 | - array('@parent_dir' => dirname($cache_dir)), WATCHDOG_ERROR); |
|
| 317 | + array('@parent_dir' => dirname($cache_dir)), WATCHDOG_ERROR); |
|
| 318 | 318 | return FALSE; |
| 319 | - } |
|
| 320 | - else { |
|
| 319 | + } |
|
| 320 | + else { |
|
| 321 | 321 | // Create the cache dir |
| 322 | 322 | if (!mkdir($cache_dir, 0775)) { |
| 323 | - watchdog('boincstats', 'Failed to create @cache_dir directory. Check |
|
| 323 | + watchdog('boincstats', 'Failed to create @cache_dir directory. Check |
|
| 324 | 324 | filesystem permissions...?', |
| 325 | 325 | array('@cache_dir' => $cache_dir), WATCHDOG_ERROR); |
| 326 | - return FALSE; |
|
| 326 | + return FALSE; |
|
| 327 | + } |
|
| 327 | 328 | } |
| 328 | - } |
|
| 329 | 329 | } |
| 330 | 330 | else { |
| 331 | - watchdog('boincstats', 'Cache directory at @cache_dir is not writeable. |
|
| 331 | + watchdog('boincstats', 'Cache directory at @cache_dir is not writeable. |
|
| 332 | 332 | Please allow webserver write access.', |
| 333 | 333 | array('@cache_dir' => $cache_dir), WATCHDOG_ERROR); |
| 334 | - return FALSE; |
|
| 334 | + return FALSE; |
|
| 335 | 335 | } |
| 336 | - } |
|
| 337 | - return TRUE; |
|
| 336 | + } |
|
| 337 | + return TRUE; |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /* |
@@ -342,87 +342,87 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | function boincstats_get_project_stats($type = 'total', $cpid = NULL) { |
| 344 | 344 | |
| 345 | - // Determine the stats environment |
|
| 346 | - boincstats_check_configuration(); |
|
| 347 | - $stats_server = variable_get('boinc_stats_server', ''); |
|
| 348 | - $stats_rpc = variable_get('boinc_stats_project_credit_history_rpc', ''); |
|
| 349 | - $project_id = variable_get('boinc_stats_remote_project_id', ''); |
|
| 345 | + // Determine the stats environment |
|
| 346 | + boincstats_check_configuration(); |
|
| 347 | + $stats_server = variable_get('boinc_stats_server', ''); |
|
| 348 | + $stats_rpc = variable_get('boinc_stats_project_credit_history_rpc', ''); |
|
| 349 | + $project_id = variable_get('boinc_stats_remote_project_id', ''); |
|
| 350 | 350 | |
| 351 | - $get = array( |
|
| 351 | + $get = array( |
|
| 352 | 352 | 'id' => $project_id |
| 353 | - ); |
|
| 354 | - switch ($type) { |
|
| 355 | - case 'daily': |
|
| 353 | + ); |
|
| 354 | + switch ($type) { |
|
| 355 | + case 'daily': |
|
| 356 | 356 | $get['daily'] = NULL; |
| 357 | 357 | break; |
| 358 | - case 'total': |
|
| 358 | + case 'total': |
|
| 359 | 359 | default: |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | - if ($cpid) { |
|
| 362 | + if ($cpid) { |
|
| 363 | 363 | // If a user CPID has been provided, limit scope to that user |
| 364 | 364 | $stats_rpc = variable_get('boinc_stats_user_credit_history_rpc', ''); |
| 365 | 365 | $get['cpid'] = $cpid; |
| 366 | - } |
|
| 366 | + } |
|
| 367 | 367 | |
| 368 | - // Construct query string |
|
| 369 | - $args = array(); |
|
| 370 | - foreach ($get as $arg => $value) { |
|
| 368 | + // Construct query string |
|
| 369 | + $args = array(); |
|
| 370 | + foreach ($get as $arg => $value) { |
|
| 371 | 371 | if ($value !== NULL) { |
| 372 | - $args[] = "{$arg}=" . rawurlencode($value); |
|
| 372 | + $args[] = "{$arg}=" . rawurlencode($value); |
|
| 373 | 373 | } |
| 374 | 374 | else { |
| 375 | - $args[] = $arg; |
|
| 375 | + $args[] = $arg; |
|
| 376 | 376 | } |
| 377 | - } |
|
| 378 | - $query = '?' . implode('&', $args); |
|
| 377 | + } |
|
| 378 | + $query = '?' . implode('&', $args); |
|
| 379 | 379 | |
| 380 | - // Load XML from RPC |
|
| 381 | - $stats_xml = NULL; |
|
| 382 | - $target_url = "http://{$stats_server}/{$stats_rpc}{$query}"; |
|
| 383 | - $result = drupal_http_request($target_url); |
|
| 384 | - if (in_array($result->code, array(200, 304)) || in_array($result->redirect_code, array(200, 304))) { |
|
| 380 | + // Load XML from RPC |
|
| 381 | + $stats_xml = NULL; |
|
| 382 | + $target_url = "http://{$stats_server}/{$stats_rpc}{$query}"; |
|
| 383 | + $result = drupal_http_request($target_url); |
|
| 384 | + if (in_array($result->code, array(200, 304)) || in_array($result->redirect_code, array(200, 304))) { |
|
| 385 | 385 | $stats_xml = simplexml_load_string($result->data); |
| 386 | - } |
|
| 387 | - watchdog('boincstats', $target_url); |
|
| 388 | - return $stats_xml; |
|
| 386 | + } |
|
| 387 | + watchdog('boincstats', $target_url); |
|
| 388 | + return $stats_xml; |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /* |
| 392 | 392 | * |
| 393 | 393 | */ |
| 394 | 394 | function boincstats_get_project_total_credit() { |
| 395 | - $stats_xml = boincstats_get_project_stats(); |
|
| 396 | - $last_record = end($stats_xml->records->record); |
|
| 397 | - return ($last_record) ? (int) $last_record : 0; |
|
| 395 | + $stats_xml = boincstats_get_project_stats(); |
|
| 396 | + $last_record = end($stats_xml->records->record); |
|
| 397 | + return ($last_record) ? (int) $last_record : 0; |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /* |
| 401 | 401 | * |
| 402 | 402 | */ |
| 403 | 403 | function boincstats_get_project_avg_credit() { |
| 404 | - $stats_xml = boincstats_get_project_stats(); |
|
| 405 | - return (isset($stats_xml->recent_avg)) ? $stats_xml->recent_avg : 0; |
|
| 404 | + $stats_xml = boincstats_get_project_stats(); |
|
| 405 | + return (isset($stats_xml->recent_avg)) ? $stats_xml->recent_avg : 0; |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | /* |
| 409 | 409 | * |
| 410 | 410 | */ |
| 411 | 411 | function boincstats_credit_to_ghours($credit) { |
| 412 | - return $credit / (100 * 365); |
|
| 412 | + return $credit / (100 * 365); |
|
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /* |
| 416 | 416 | * |
| 417 | 417 | */ |
| 418 | 418 | function boincstats_credit_to_flops($credit, $prefix = 0) { |
| 419 | - $factor = array( |
|
| 419 | + $factor = array( |
|
| 420 | 420 | '0' => 0, |
| 421 | 421 | 'g' => 3, |
| 422 | 422 | 't' => 6, |
| 423 | 423 | 'p' => 9 |
| 424 | - ); |
|
| 425 | - return $credit / (pow(10, (int) $factor[$prefix]) / 10); |
|
| 424 | + ); |
|
| 425 | + return $credit / (pow(10, (int) $factor[$prefix]) / 10); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | |
@@ -431,22 +431,22 @@ discard block |
||
| 431 | 431 | * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
| 432 | 432 | |
| 433 | 433 | function boincstats_get_project_stats_overview($type = 'basic') { |
| 434 | - global $base_path; |
|
| 435 | - $output = ''; |
|
| 436 | - switch ($type) { |
|
| 437 | - case 'basic': |
|
| 434 | + global $base_path; |
|
| 435 | + $output = ''; |
|
| 436 | + switch ($type) { |
|
| 437 | + case 'basic': |
|
| 438 | 438 | $output .= '<div class="overlay"><span>(' . bts('Credits per day', array(), NULL, 'boinc:front-page') . ')</span></div>' . "\n"; |
| 439 | 439 | $output .= '<div class="chart"><img src="' . $base_path . 'charts/project" /></div>' . "\n"; |
| 440 | 440 | break; |
| 441 | - case 'detailed': |
|
| 441 | + case 'detailed': |
|
| 442 | 442 | $output .= '<div class="stats"><label>' . bts('Total G-hours', array(), NULL, 'boinc:front-page') . ': </label><span>' . number_format(boincstats_credit_to_ghours(boincstats_get_project_total_credit())) . '</span></div>' . "\n"; |
| 443 | 443 | $output .= '<div class="stats"><label>' . bts('Avg TFlops', array(), NULL, 'boinc:front-page') . ': </label><span>' . number_format(boincstats_credit_to_flops(boincstats_get_project_avg_credit(), 't')) . '</span></div>' . "\n"; |
| 444 | 444 | //$output .= '<div class="stats"><a href="#">' . bts('Pending credits', array(), NULL, 'boinc:front-page') . '</a></div>' . "\n"; |
| 445 | 445 | $output .= '<div class="chart"><img src="' . $base_path . 'charts/project" /></div>' . "\n"; |
| 446 | 446 | break; |
| 447 | - default: |
|
| 447 | + default: |
|
| 448 | 448 | } |
| 449 | - return $output; |
|
| 449 | + return $output; |
|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | |
@@ -458,19 +458,19 @@ discard block |
||
| 458 | 458 | * Check that the stats system is configured, report if it isn't |
| 459 | 459 | */ |
| 460 | 460 | function boincstats_check_configuration() { |
| 461 | - $project_id = variable_get('boinc_stats_remote_project_id', ''); |
|
| 462 | - if (!$project_id) { |
|
| 461 | + $project_id = variable_get('boinc_stats_remote_project_id', ''); |
|
| 462 | + if (!$project_id) { |
|
| 463 | 463 | watchdog('boincstats', 'The BOINC stats system is not configured. Please |
| 464 | 464 | !configure_it', array('!configure_it' => l(t('configure it now'), |
| 465 | - 'admin/boinc/stats')), WATCHDOG_ERROR); |
|
| 465 | + 'admin/boinc/stats')), WATCHDOG_ERROR); |
|
| 466 | 466 | if (user_access('administer site configuration')) { |
| 467 | - drupal_set_message(t('The BOINC stats system is not configured. Please |
|
| 467 | + drupal_set_message(t('The BOINC stats system is not configured. Please |
|
| 468 | 468 | !configure_it', array('!configure_it' => l(t('configure it now'), |
| 469 | - 'admin/boinc/stats'))), 'error', FALSE); |
|
| 469 | + 'admin/boinc/stats'))), 'error', FALSE); |
|
| 470 | 470 | } |
| 471 | 471 | else { |
| 472 | - drupal_set_message(t('There is a problem with the site. Please contact |
|
| 472 | + drupal_set_message(t('There is a problem with the site. Please contact |
|
| 473 | 473 | the system administrator.'), 'error', FALSE); |
| 474 | 474 | } |
| 475 | - } |
|
| 475 | + } |
|
| 476 | 476 | } |
@@ -8,38 +8,38 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | - * The BOINC stats configuration determines where statistics are sourced |
|
| 12 | - */ |
|
| 11 | + * The BOINC stats configuration determines where statistics are sourced |
|
| 12 | + */ |
|
| 13 | 13 | function boincstats_admin_stats_system(&$form_state) { |
| 14 | - $form = array(); |
|
| 15 | - $default = array( |
|
| 14 | + $form = array(); |
|
| 15 | + $default = array( |
|
| 16 | 16 | 'boinc_stats_server' => variable_get('boinc_stats_server', 'stats.gridrepublic.org'), |
| 17 | 17 | 'boinc_stats_project_list_rpc' => variable_get('boinc_stats_project_list_rpc', 'rpc/get_projects.php'), |
| 18 | 18 | 'boinc_stats_project_credit_history_rpc' => variable_get('boinc_stats_project_credit_history_rpc', 'rpc2/get_project_tc_history.php'), |
| 19 | 19 | 'boinc_stats_user_credit_history_rpc' => variable_get('boinc_stats_user_credit_history_rpc', 'rpc2/get_user_credit_history.php'), |
| 20 | 20 | 'boinc_stats_remote_project_id' => variable_get('boinc_stats_remote_project_id', ''), |
| 21 | - ); |
|
| 22 | - // Define the form |
|
| 23 | - $form['boinc_stats_server'] = array( |
|
| 21 | + ); |
|
| 22 | + // Define the form |
|
| 23 | + $form['boinc_stats_server'] = array( |
|
| 24 | 24 | '#type' => 'value', |
| 25 | 25 | '#value' => $default['boinc_stats_server'] |
| 26 | - ); |
|
| 27 | - $form['boinc_stats_project_list_rpc'] = array( |
|
| 26 | + ); |
|
| 27 | + $form['boinc_stats_project_list_rpc'] = array( |
|
| 28 | 28 | '#type' => 'value', |
| 29 | 29 | '#value' => $default['boinc_stats_project_list_rpc'] |
| 30 | - ); |
|
| 31 | - $form['boinc_stats_project_credit_history_rpc'] = array( |
|
| 30 | + ); |
|
| 31 | + $form['boinc_stats_project_credit_history_rpc'] = array( |
|
| 32 | 32 | '#type' => 'value', |
| 33 | 33 | '#value' => $default['boinc_stats_project_credit_history_rpc'] |
| 34 | - ); |
|
| 35 | - $form['boinc_stats_user_credit_history_rpc'] = array( |
|
| 34 | + ); |
|
| 35 | + $form['boinc_stats_user_credit_history_rpc'] = array( |
|
| 36 | 36 | '#type' => 'value', |
| 37 | 37 | '#value' => $default['boinc_stats_user_credit_history_rpc'] |
| 38 | - ); |
|
| 39 | - $form['boinc_stats_remote_project_id'] = array( |
|
| 38 | + ); |
|
| 39 | + $form['boinc_stats_remote_project_id'] = array( |
|
| 40 | 40 | '#type' => 'textfield', |
| 41 | 41 | '#title' => t('Stats ID for @project', array( |
| 42 | - '@project' => variable_get('site_name', 'Drupal-BOINC'))), |
|
| 42 | + '@project' => variable_get('site_name', 'Drupal-BOINC'))), |
|
| 43 | 43 | '#default_value' => $default['boinc_stats_remote_project_id'], |
| 44 | 44 | '#description' => t('This project must be registered with a stats system in |
| 45 | 45 | order for some statistics to be available. Currently only one system is |
@@ -47,26 +47,26 @@ discard block |
||
| 47 | 47 | '!find_project_id' => l(t('Find your project ID'), |
| 48 | 48 | "http://{$default['boinc_stats_server']}/{$default['boinc_stats_project_list_rpc']}", |
| 49 | 49 | array('attributes' => array('target' => 'external'))) |
| 50 | - ) |
|
| 50 | + ) |
|
| 51 | 51 | ) |
| 52 | - ); |
|
| 53 | - return system_settings_form($form); |
|
| 52 | + ); |
|
| 53 | + return system_settings_form($form); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Validate the BOINC stats form. |
|
| 58 | - */ |
|
| 57 | + * Validate the BOINC stats form. |
|
| 58 | + */ |
|
| 59 | 59 | function boincstats_admin_stats_system_validate($form, &$form_state) { |
| 60 | - $values = $form_state['values']; |
|
| 61 | - if (!$values['boinc_stats_remote_project_id']) { |
|
| 60 | + $values = $form_state['values']; |
|
| 61 | + if (!$values['boinc_stats_remote_project_id']) { |
|
| 62 | 62 | form_set_error('boinc_stats_remote_project_id', |
| 63 | - t('Stats may not work without a valid stats ID configured!')); |
|
| 64 | - } |
|
| 63 | + t('Stats may not work without a valid stats ID configured!')); |
|
| 64 | + } |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | - * Handle post-validation submission of BOINC stats form. |
|
| 69 | - */ |
|
| 68 | + * Handle post-validation submission of BOINC stats form. |
|
| 69 | + */ |
|
| 70 | 70 | function boincstats_admin_stats_system_submit($form, &$form_state) { |
| 71 | - drupal_set_message(t('Stats system configuration has been updated.')); |
|
| 71 | + drupal_set_message(t('Stats system configuration has been updated.')); |
|
| 72 | 72 | } |
@@ -15,30 +15,30 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | function boinctranslate_initialize_languages() { |
| 17 | 17 | |
| 18 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 18 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 19 | 19 | |
| 20 | - $api_base_url = 'https://www.transifex.com/api/2'; |
|
| 21 | - $project_name = variable_get( |
|
| 20 | + $api_base_url = 'https://www.transifex.com/api/2'; |
|
| 21 | + $project_name = variable_get( |
|
| 22 | 22 | 'boinc_translate_transifex_project_name', '' |
| 23 | - ); |
|
| 24 | - $operations = array(); |
|
| 23 | + ); |
|
| 24 | + $operations = array(); |
|
| 25 | 25 | |
| 26 | - if ($project_name) { |
|
| 26 | + if ($project_name) { |
|
| 27 | 27 | // Get all languages configured for this project at Transifex |
| 28 | 28 | $path = "project/{$project_name}/languages"; |
| 29 | 29 | $response = boinctranslate_transifex_request($path); |
| 30 | 30 | |
| 31 | 31 | if ($response == '404 NOT FOUND') { |
| 32 | - drupal_set_message( |
|
| 32 | + drupal_set_message( |
|
| 33 | 33 | t('Unable to get languages for %project.', |
| 34 | - array( |
|
| 34 | + array( |
|
| 35 | 35 | '%project' => $project_name, |
| 36 | - ) |
|
| 36 | + ) |
|
| 37 | 37 | ), 'warning' |
| 38 | - ); |
|
| 38 | + ); |
|
| 39 | 39 | } |
| 40 | 40 | elseif ($response) { |
| 41 | - if (is_array($response)) { |
|
| 41 | + if (is_array($response)) { |
|
| 42 | 42 | |
| 43 | 43 | $installed_languages = language_list(); |
| 44 | 44 | $available_languages = _locale_get_predefined_list(); |
@@ -48,13 +48,13 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | // Set up Transifex languages in Drupal |
| 50 | 50 | foreach ($response as $language) { |
| 51 | - $posix_code = $language['language_code']; |
|
| 52 | - $rfc_code = strtolower(str_replace('_', '-', $posix_code)); |
|
| 53 | - $transifex_languages[$rfc_code] = $language; |
|
| 54 | - if (!isset($installed_languages[$rfc_code])) { |
|
| 51 | + $posix_code = $language['language_code']; |
|
| 52 | + $rfc_code = strtolower(str_replace('_', '-', $posix_code)); |
|
| 53 | + $transifex_languages[$rfc_code] = $language; |
|
| 54 | + if (!isset($installed_languages[$rfc_code])) { |
|
| 55 | 55 | // See if this language can be installed from a predefined list |
| 56 | 56 | if (isset($available_languages[$rfc_code])) { |
| 57 | - locale_add_language( |
|
| 57 | + locale_add_language( |
|
| 58 | 58 | $rfc_code, |
| 59 | 59 | NULL, |
| 60 | 60 | NULL, |
@@ -62,30 +62,30 @@ discard block |
||
| 62 | 62 | NULL, |
| 63 | 63 | NULL, |
| 64 | 64 | FALSE |
| 65 | - ); |
|
| 66 | - drupal_set_message( |
|
| 65 | + ); |
|
| 66 | + drupal_set_message( |
|
| 67 | 67 | 'Added predefined language: '.$available_languages[$rfc_code][0] |
| 68 | - ); |
|
| 69 | - db_query("UPDATE {languages} SET enabled = 1 WHERE language = '%s'", $rfc_code); |
|
| 68 | + ); |
|
| 69 | + db_query("UPDATE {languages} SET enabled = 1 WHERE language = '%s'", $rfc_code); |
|
| 70 | 70 | } |
| 71 | 71 | else { |
| 72 | - // Retrieve language details from Transifex |
|
| 73 | - $path = "language/{$posix_code}"; |
|
| 74 | - $response = boinctranslate_transifex_request($path); |
|
| 72 | + // Retrieve language details from Transifex |
|
| 73 | + $path = "language/{$posix_code}"; |
|
| 74 | + $response = boinctranslate_transifex_request($path); |
|
| 75 | 75 | |
| 76 | - if ($response == '404 NOT FOUND') { |
|
| 76 | + if ($response == '404 NOT FOUND') { |
|
| 77 | 77 | drupal_set_message( |
| 78 | - t('Unable to get details for language %code.', |
|
| 78 | + t('Unable to get details for language %code.', |
|
| 79 | 79 | array( |
| 80 | - '%code' => $posix_code, |
|
| 80 | + '%code' => $posix_code, |
|
| 81 | 81 | ) |
| 82 | - ), 'warning' |
|
| 82 | + ), 'warning' |
|
| 83 | 83 | ); |
| 84 | - } |
|
| 85 | - elseif ($response) { |
|
| 84 | + } |
|
| 85 | + elseif ($response) { |
|
| 86 | 86 | if (!empty($response['name'])) { |
| 87 | - // Add a custom language to Drupal and enable |
|
| 88 | - locale_add_language( |
|
| 87 | + // Add a custom language to Drupal and enable |
|
| 88 | + locale_add_language( |
|
| 89 | 89 | $rfc_code, |
| 90 | 90 | $response['name'], |
| 91 | 91 | $response['name'], |
@@ -93,362 +93,362 @@ discard block |
||
| 93 | 93 | NULL, |
| 94 | 94 | NULL, |
| 95 | 95 | TRUE |
| 96 | - ); |
|
| 97 | - drupal_set_message( |
|
| 96 | + ); |
|
| 97 | + drupal_set_message( |
|
| 98 | 98 | 'Added new language: '.$response['name'] |
| 99 | - ); |
|
| 99 | + ); |
|
| 100 | 100 | } |
| 101 | 101 | else { |
| 102 | - $variables = array( |
|
| 102 | + $variables = array( |
|
| 103 | 103 | '%code' => $posix_code, |
| 104 | - ); |
|
| 105 | - drupal_set_message( |
|
| 104 | + ); |
|
| 105 | + drupal_set_message( |
|
| 106 | 106 | t('Unable to get details for language %code.', $variables), |
| 107 | 107 | 'error' |
| 108 | - ); |
|
| 109 | - watchdog( |
|
| 108 | + ); |
|
| 109 | + watchdog( |
|
| 110 | 110 | 'boinctranslate', |
| 111 | 111 | 'Unable to get details for language %code.', |
| 112 | 112 | $variables, |
| 113 | 113 | WATCHDOG_ERROR |
| 114 | - ); |
|
| 114 | + ); |
|
| 115 | + } |
|
| 115 | 116 | } |
| 116 | - } |
|
| 117 | - else { |
|
| 118 | - $variables = array( |
|
| 119 | - '%code' => $posix_code, |
|
| 117 | + else { |
|
| 118 | + $variables = array( |
|
| 119 | + '%code' => $posix_code, |
|
| 120 | 120 | ); |
| 121 | 121 | drupal_set_message( |
| 122 | - t('Invalid response while getting details for language %code.', $variables), |
|
| 123 | - 'error' |
|
| 122 | + t('Invalid response while getting details for language %code.', $variables), |
|
| 123 | + 'error' |
|
| 124 | 124 | ); |
| 125 | 125 | watchdog( |
| 126 | - 'boinctranslate', |
|
| 127 | - 'Invalid response while getting details for language %code.', |
|
| 128 | - $variables, |
|
| 129 | - WATCHDOG_ERROR |
|
| 126 | + 'boinctranslate', |
|
| 127 | + 'Invalid response while getting details for language %code.', |
|
| 128 | + $variables, |
|
| 129 | + WATCHDOG_ERROR |
|
| 130 | 130 | ); |
| 131 | - } |
|
| 131 | + } |
|
| 132 | 132 | } |
| 133 | 133 | // Import any language files for the newly added language |
| 134 | 134 | if ($batch = locale_batch_by_language($rfc_code, '_locale_batch_language_finished')) { |
| 135 | - $operations = array_merge($operations, $batch['operations']); |
|
| 136 | - $process_batches = TRUE; |
|
| 135 | + $operations = array_merge($operations, $batch['operations']); |
|
| 136 | + $process_batches = TRUE; |
|
| 137 | + } |
|
| 137 | 138 | } |
| 138 | - } |
|
| 139 | 139 | } |
| 140 | 140 | drupal_set_message('Finished installing official BOINC languages.'); |
| 141 | 141 | // Disable languages that are not in Transifex |
| 142 | 142 | foreach ($installed_languages as $langcode => $language) { |
| 143 | - if (!isset($transifex_languages[$langcode])) { |
|
| 143 | + if (!isset($transifex_languages[$langcode])) { |
|
| 144 | 144 | $disabled_languages[$langcode] = $langcode; |
| 145 | 145 | db_query("UPDATE {languages} SET enabled = 0 WHERE language = '%s'", $langcode); |
| 146 | - } |
|
| 146 | + } |
|
| 147 | 147 | } |
| 148 | 148 | if ($disabled_languages) { |
| 149 | - drupal_set_message('The following languages were not found in Transifex and were disabled: ' . implode(' ', $disabled_languages)); |
|
| 149 | + drupal_set_message('The following languages were not found in Transifex and were disabled: ' . implode(' ', $disabled_languages)); |
|
| 150 | 150 | } |
| 151 | 151 | if ($process_batches) { |
| 152 | - $batch = array( |
|
| 152 | + $batch = array( |
|
| 153 | 153 | 'operations' => $operations, |
| 154 | - ); |
|
| 155 | - batch_set($batch); |
|
| 156 | - batch_process('admin/boinc/translation'); |
|
| 154 | + ); |
|
| 155 | + batch_set($batch); |
|
| 156 | + batch_process('admin/boinc/translation'); |
|
| 157 | + } |
|
| 157 | 158 | } |
| 158 | - } |
|
| 159 | - else { |
|
| 159 | + else { |
|
| 160 | 160 | $variables = array( |
| 161 | - '%project' => $project_name, |
|
| 161 | + '%project' => $project_name, |
|
| 162 | 162 | ); |
| 163 | 163 | drupal_set_message( |
| 164 | - t('No languages found for %project. (Does the configured account have sufficient privileges at Transifex?)', $variables), |
|
| 165 | - 'error' |
|
| 164 | + t('No languages found for %project. (Does the configured account have sufficient privileges at Transifex?)', $variables), |
|
| 165 | + 'error' |
|
| 166 | 166 | ); |
| 167 | 167 | watchdog( |
| 168 | - 'boinctranslate', |
|
| 169 | - 'No languages found for %project. (Does the configured account have sufficient privileges at Transifex?)', |
|
| 170 | - $variables, |
|
| 171 | - WATCHDOG_ERROR |
|
| 168 | + 'boinctranslate', |
|
| 169 | + 'No languages found for %project. (Does the configured account have sufficient privileges at Transifex?)', |
|
| 170 | + $variables, |
|
| 171 | + WATCHDOG_ERROR |
|
| 172 | 172 | ); |
| 173 | - } |
|
| 173 | + } |
|
| 174 | 174 | } |
| 175 | 175 | else { |
| 176 | - $variables = array( |
|
| 176 | + $variables = array( |
|
| 177 | 177 | '%project' => $project_name, |
| 178 | - ); |
|
| 179 | - drupal_set_message( |
|
| 178 | + ); |
|
| 179 | + drupal_set_message( |
|
| 180 | 180 | t('Invalid response while getting languages for %project.', $variables), |
| 181 | 181 | 'error' |
| 182 | - ); |
|
| 183 | - watchdog( |
|
| 182 | + ); |
|
| 183 | + watchdog( |
|
| 184 | 184 | 'boinctranslate', |
| 185 | 185 | 'Invalid response while getting languages for %project.', |
| 186 | 186 | $variables, |
| 187 | 187 | WATCHDOG_ERROR |
| 188 | - ); |
|
| 188 | + ); |
|
| 189 | 189 | } |
| 190 | - } |
|
| 191 | - drupal_goto('admin/boinc/translation'); |
|
| 190 | + } |
|
| 191 | + drupal_goto('admin/boinc/translation'); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * |
| 196 | 196 | */ |
| 197 | 197 | function boinctranslate_export_translations() { |
| 198 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 199 | - $project_name = variable_get( |
|
| 198 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 199 | + $project_name = variable_get( |
|
| 200 | 200 | 'boinc_translate_transifex_project_name', '' |
| 201 | - ); |
|
| 202 | - // Get resource names from local config |
|
| 203 | - $resource_config = (variable_get( |
|
| 201 | + ); |
|
| 202 | + // Get resource names from local config |
|
| 203 | + $resource_config = (variable_get( |
|
| 204 | 204 | 'boinc_translate_transifex_project_resources', '' |
| 205 | - )); |
|
| 206 | - $resource_names = boinctranslate_parse_resources($resource_config); |
|
| 207 | - $primary_resource = reset($resource_names); |
|
| 205 | + )); |
|
| 206 | + $resource_names = boinctranslate_parse_resources($resource_config); |
|
| 207 | + $primary_resource = reset($resource_names); |
|
| 208 | 208 | |
| 209 | - if ($project_name AND $primary_resource) { |
|
| 209 | + if ($project_name AND $primary_resource) { |
|
| 210 | 210 | // Create or update the translation source, if needed |
| 211 | 211 | $source_exists = FALSE; |
| 212 | 212 | $path = "project/{$project_name}/resources"; |
| 213 | 213 | $resources = boinctranslate_transifex_request($path); |
| 214 | 214 | if ($resources AND is_array($resources)) { |
| 215 | - foreach ($resources as $resource) { |
|
| 215 | + foreach ($resources as $resource) { |
|
| 216 | 216 | if ($resource['slug'] == $primary_resource) { |
| 217 | - $source_exists = TRUE; |
|
| 218 | - break; |
|
| 217 | + $source_exists = TRUE; |
|
| 218 | + break; |
|
| 219 | 219 | } |
| 220 | - } |
|
| 221 | - if (!$source_exists) { |
|
| 220 | + } |
|
| 221 | + if (!$source_exists) { |
|
| 222 | 222 | // Create the source |
| 223 | 223 | $path = "project/{$project_name}/resources"; |
| 224 | 224 | $post = array( |
| 225 | - 'slug' => $primary_resource, |
|
| 226 | - 'name' => 'Drupal-Project', |
|
| 227 | - 'i18n_type' => 'PO', |
|
| 228 | - 'category' => 'Drupal', |
|
| 229 | - 'content' => boinctranslate_get_po('en', 'project'), |
|
| 225 | + 'slug' => $primary_resource, |
|
| 226 | + 'name' => 'Drupal-Project', |
|
| 227 | + 'i18n_type' => 'PO', |
|
| 228 | + 'category' => 'Drupal', |
|
| 229 | + 'content' => boinctranslate_get_po('en', 'project'), |
|
| 230 | 230 | ); |
| 231 | 231 | $result = boinctranslate_transifex_request($path, $post); |
| 232 | - } |
|
| 233 | - else { |
|
| 232 | + } |
|
| 233 | + else { |
|
| 234 | 234 | // Update the source |
| 235 | 235 | $path = "project/{$project_name}/resource/{$primary_resource}/content"; |
| 236 | 236 | $post = array( |
| 237 | - 'content' => boinctranslate_get_po('en', 'project') |
|
| 237 | + 'content' => boinctranslate_get_po('en', 'project') |
|
| 238 | 238 | ); |
| 239 | 239 | $result = boinctranslate_transifex_request($path, $post, TRUE, TRUE); |
| 240 | - } |
|
| 240 | + } |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | if (is_array($result) OR substr($result, 0, 6) != 'ERROR:') { |
| 244 | - $enabled_languages = locale_language_list(); |
|
| 245 | - if ($source_exists) { |
|
| 244 | + $enabled_languages = locale_language_list(); |
|
| 245 | + if ($source_exists) { |
|
| 246 | 246 | drupal_set_message('Updated source translation strings at Transifex'); |
| 247 | - } |
|
| 248 | - else { |
|
| 247 | + } |
|
| 248 | + else { |
|
| 249 | 249 | drupal_set_message('Established new translation resource at Transifex'); |
| 250 | - } |
|
| 251 | - // Try to export translations for all enabled languages |
|
| 252 | - foreach ($enabled_languages as $langcode => $language_name) { |
|
| 250 | + } |
|
| 251 | + // Try to export translations for all enabled languages |
|
| 252 | + foreach ($enabled_languages as $langcode => $language_name) { |
|
| 253 | 253 | if ($langcode == 'en') { |
| 254 | - continue; |
|
| 254 | + continue; |
|
| 255 | 255 | } |
| 256 | 256 | $po_file = boinctranslate_get_po($langcode, 'project'); |
| 257 | 257 | if ($po_file) { |
| 258 | - $path = "project/{$project_name}/resource/{$primary_resource}/translation/{$langcode}"; |
|
| 259 | - $post = array( |
|
| 258 | + $path = "project/{$project_name}/resource/{$primary_resource}/translation/{$langcode}"; |
|
| 259 | + $post = array( |
|
| 260 | 260 | 'content' => $po_file, |
| 261 | - ); |
|
| 262 | - $result = boinctranslate_transifex_request($path, $post, TRUE, TRUE); |
|
| 263 | - if (!is_array($result) |
|
| 261 | + ); |
|
| 262 | + $result = boinctranslate_transifex_request($path, $post, TRUE, TRUE); |
|
| 263 | + if (!is_array($result) |
|
| 264 | 264 | AND substr($result, 0, 6) == 'ERROR:') { |
| 265 | 265 | drupal_set_message( |
| 266 | - "Unable to update {$language_name} translations: {$result}", |
|
| 267 | - 'warning' |
|
| 266 | + "Unable to update {$language_name} translations: {$result}", |
|
| 267 | + 'warning' |
|
| 268 | 268 | ); |
| 269 | - } |
|
| 270 | - else { |
|
| 269 | + } |
|
| 270 | + else { |
|
| 271 | 271 | drupal_set_message("Updated {$language_name} translations"); |
| 272 | 272 | //drupal_set_message('DEBUG: <pre>'.print_r($result,1).'</pre>'); |
| 273 | - } |
|
| 273 | + } |
|
| 274 | 274 | } |
| 275 | 275 | else { |
| 276 | - drupal_set_message("No translations to export for {$language_name}"); |
|
| 276 | + drupal_set_message("No translations to export for {$language_name}"); |
|
| 277 | + } |
|
| 277 | 278 | } |
| 278 | - } |
|
| 279 | 279 | } |
| 280 | 280 | else { |
| 281 | - drupal_set_message( |
|
| 281 | + drupal_set_message( |
|
| 282 | 282 | "Unable to update the translation source: {$result}", |
| 283 | 283 | 'warning' |
| 284 | - ); |
|
| 284 | + ); |
|
| 285 | 285 | } |
| 286 | - } |
|
| 287 | - else { |
|
| 286 | + } |
|
| 287 | + else { |
|
| 288 | 288 | drupal_set_message( |
| 289 | - 'Failed to export translations: Transifex settings are not intiailized.', |
|
| 290 | - 'error' |
|
| 289 | + 'Failed to export translations: Transifex settings are not intiailized.', |
|
| 290 | + 'error' |
|
| 291 | 291 | ); |
| 292 | - } |
|
| 293 | - drupal_goto('admin/boinc/translation'); |
|
| 292 | + } |
|
| 293 | + drupal_goto('admin/boinc/translation'); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /** |
| 297 | 297 | * |
| 298 | 298 | */ |
| 299 | 299 | function boinctranslate_update_official_boinc_translations() { |
| 300 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 301 | - $project_name = variable_get( |
|
| 300 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 301 | + $project_name = variable_get( |
|
| 302 | 302 | 'boinc_translate_transifex_standard_name', '' |
| 303 | - ); |
|
| 304 | - $drupal_resource = variable_get( |
|
| 303 | + ); |
|
| 304 | + $drupal_resource = variable_get( |
|
| 305 | 305 | 'boinc_translate_transifex_boinc_drupal_resource', '' |
| 306 | - ); |
|
| 306 | + ); |
|
| 307 | 307 | |
| 308 | - if ($project_name AND $drupal_resource) { |
|
| 308 | + if ($project_name AND $drupal_resource) { |
|
| 309 | 309 | // Create or update the translation source, if needed |
| 310 | 310 | $source_exists = FALSE; |
| 311 | 311 | $path = "project/{$project_name}/resources"; |
| 312 | 312 | $resources = boinctranslate_transifex_request($path); |
| 313 | 313 | if ($resources AND is_array($resources)) { |
| 314 | - foreach ($resources as $resource) { |
|
| 314 | + foreach ($resources as $resource) { |
|
| 315 | 315 | if ($resource['slug'] == $drupal_resource) { |
| 316 | - $source_exists = TRUE; |
|
| 317 | - break; |
|
| 316 | + $source_exists = TRUE; |
|
| 317 | + break; |
|
| 318 | + } |
|
| 318 | 319 | } |
| 319 | - } |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | if ($source_exists) { |
| 323 | - $enabled_languages = locale_language_list(); |
|
| 324 | - // Try to export translations for all enabled languages |
|
| 325 | - foreach ($enabled_languages as $langcode => $language_name) { |
|
| 323 | + $enabled_languages = locale_language_list(); |
|
| 324 | + // Try to export translations for all enabled languages |
|
| 325 | + foreach ($enabled_languages as $langcode => $language_name) { |
|
| 326 | 326 | if ($langcode == 'en') { |
| 327 | - continue; |
|
| 327 | + continue; |
|
| 328 | 328 | } |
| 329 | 329 | $po_file = boinctranslate_get_po($langcode, 'boinc'); |
| 330 | 330 | if ($po_file) { |
| 331 | - $path = "project/{$project_name}/resource/{$drupal_resource}/translation/{$langcode}"; |
|
| 332 | - $post = array( |
|
| 331 | + $path = "project/{$project_name}/resource/{$drupal_resource}/translation/{$langcode}"; |
|
| 332 | + $post = array( |
|
| 333 | 333 | 'content' => $po_file, |
| 334 | - ); |
|
| 335 | - $result = boinctranslate_transifex_request($path, $post, TRUE, TRUE); |
|
| 334 | + ); |
|
| 335 | + $result = boinctranslate_transifex_request($path, $post, TRUE, TRUE); |
|
| 336 | 336 | |
| 337 | - if (!is_array($result)) { |
|
| 337 | + if (!is_array($result)) { |
|
| 338 | 338 | if (substr($result, 0, 6) == 'ERROR:') { |
| 339 | - drupal_set_message( |
|
| 339 | + drupal_set_message( |
|
| 340 | 340 | "Unable to update {$language_name} official BOINC translations: {$result}", |
| 341 | 341 | 'warning' |
| 342 | - ); |
|
| 342 | + ); |
|
| 343 | 343 | } |
| 344 | 344 | elseif ($result == '401 UNAUTHORIZED') { |
| 345 | - drupal_set_message( |
|
| 345 | + drupal_set_message( |
|
| 346 | 346 | 'Not authorized to update official BOINC translations', |
| 347 | 347 | 'warning' |
| 348 | - ); |
|
| 349 | - break; |
|
| 348 | + ); |
|
| 349 | + break; |
|
| 350 | 350 | } |
| 351 | 351 | elseif ($result == 'success') { |
| 352 | - drupal_set_message("Updated {$language_name} official BOINC translations"); |
|
| 352 | + drupal_set_message("Updated {$language_name} official BOINC translations"); |
|
| 353 | 353 | } |
| 354 | 354 | else { |
| 355 | - drupal_set_message( |
|
| 355 | + drupal_set_message( |
|
| 356 | 356 | "Unexpected response for {$language_name}: {$result}", |
| 357 | 357 | 'warning' |
| 358 | - ); |
|
| 358 | + ); |
|
| 359 | 359 | } |
| 360 | - } |
|
| 361 | - else { |
|
| 360 | + } |
|
| 361 | + else { |
|
| 362 | 362 | drupal_set_message("Updated {$language_name} official BOINC translations"); |
| 363 | 363 | //drupal_set_message('DEBUG: <pre>'.print_r($result,1).'</pre>'); |
| 364 | - } |
|
| 364 | + } |
|
| 365 | 365 | } |
| 366 | 366 | else { |
| 367 | - drupal_set_message("No official BOINC translations to export for {$language_name}"); |
|
| 367 | + drupal_set_message("No official BOINC translations to export for {$language_name}"); |
|
| 368 | + } |
|
| 368 | 369 | } |
| 369 | - } |
|
| 370 | 370 | } |
| 371 | 371 | else { |
| 372 | - drupal_set_message( |
|
| 372 | + drupal_set_message( |
|
| 373 | 373 | "The {$drupal_resource} resource does not exist in the {$project_name} project at Transifex", |
| 374 | 374 | 'warning' |
| 375 | - ); |
|
| 375 | + ); |
|
| 376 | 376 | } |
| 377 | - } |
|
| 378 | - else { |
|
| 377 | + } |
|
| 378 | + else { |
|
| 379 | 379 | drupal_set_message( |
| 380 | - 'Failed to export official BOINC translations: Transifex settings are not intiailized.', |
|
| 381 | - 'error' |
|
| 380 | + 'Failed to export official BOINC translations: Transifex settings are not intiailized.', |
|
| 381 | + 'error' |
|
| 382 | 382 | ); |
| 383 | - } |
|
| 384 | - drupal_goto('admin/boinc/translation'); |
|
| 383 | + } |
|
| 384 | + drupal_goto('admin/boinc/translation'); |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | /** |
| 388 | 388 | * |
| 389 | 389 | */ |
| 390 | 390 | function boinctranslate_download_pot($type = 'boinc') { |
| 391 | - $po = boinctranslate_get_po(NULL, $type); |
|
| 392 | - _locale_export_po(NULL, $po); |
|
| 391 | + $po = boinctranslate_get_po(NULL, $type); |
|
| 392 | + _locale_export_po(NULL, $po); |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | /** |
| 396 | 396 | * |
| 397 | 397 | */ |
| 398 | 398 | function boinctranslate_transifex_request($path, $post = NULL, $json = TRUE, $use_put = FALSE, $username = '', $password = '') { |
| 399 | - $debug_mode = variable_get('boinc_debug_mode', 0); |
|
| 399 | + $debug_mode = variable_get('boinc_debug_mode', 0); |
|
| 400 | 400 | |
| 401 | - // Transifex details |
|
| 402 | - $api_base_url = 'https://www.transifex.com/api/2'; |
|
| 403 | - if (!$username) $username = variable_get('boinc_translate_transifex_user', ''); |
|
| 404 | - if (!$password) $password = variable_get('boinc_translate_transifex_pass', ''); |
|
| 401 | + // Transifex details |
|
| 402 | + $api_base_url = 'https://www.transifex.com/api/2'; |
|
| 403 | + if (!$username) $username = variable_get('boinc_translate_transifex_user', ''); |
|
| 404 | + if (!$password) $password = variable_get('boinc_translate_transifex_pass', ''); |
|
| 405 | 405 | |
| 406 | - $url = "{$api_base_url}/{$path}"; |
|
| 407 | - $headers = array( |
|
| 406 | + $url = "{$api_base_url}/{$path}"; |
|
| 407 | + $headers = array( |
|
| 408 | 408 | 'Authorization' => 'Basic ' . base64_encode($username . ":" . $password), |
| 409 | - ); |
|
| 410 | - $data = NULL; |
|
| 409 | + ); |
|
| 410 | + $data = NULL; |
|
| 411 | 411 | |
| 412 | - if ($post) { |
|
| 412 | + if ($post) { |
|
| 413 | 413 | if ($json) { |
| 414 | - $headers['Content-Type'] = 'application/json'; |
|
| 415 | - $data = json_encode($post); |
|
| 414 | + $headers['Content-Type'] = 'application/json'; |
|
| 415 | + $data = json_encode($post); |
|
| 416 | 416 | } |
| 417 | 417 | else { |
| 418 | - $data = drupal_query_string_encode($post); |
|
| 418 | + $data = drupal_query_string_encode($post); |
|
| 419 | 419 | } |
| 420 | 420 | $method = ($use_put) ? 'PUT' : 'POST'; |
| 421 | - } |
|
| 422 | - else { |
|
| 421 | + } |
|
| 422 | + else { |
|
| 423 | 423 | $method = 'GET'; |
| 424 | - } |
|
| 424 | + } |
|
| 425 | 425 | |
| 426 | - $response = drupal_http_request($url, $headers, $method, $data, 1, 10); |
|
| 426 | + $response = drupal_http_request($url, $headers, $method, $data, 1, 10); |
|
| 427 | 427 | |
| 428 | - switch ($response->code) { |
|
| 429 | - case 200: |
|
| 428 | + switch ($response->code) { |
|
| 429 | + case 200: |
|
| 430 | 430 | case 304: |
| 431 | 431 | if ($json) { |
| 432 | - // Process as JSON |
|
| 433 | - return json_decode($response->data, TRUE); |
|
| 432 | + // Process as JSON |
|
| 433 | + return json_decode($response->data, TRUE); |
|
| 434 | 434 | } |
| 435 | 435 | else { |
| 436 | - return (string) $response->data; |
|
| 436 | + return (string) $response->data; |
|
| 437 | 437 | } |
| 438 | 438 | break; |
| 439 | - case 404: |
|
| 439 | + case 404: |
|
| 440 | 440 | return '404 NOT FOUND'; |
| 441 | - case 401: |
|
| 441 | + case 401: |
|
| 442 | 442 | return '401 UNAUTHORIZED'; |
| 443 | - case 400: |
|
| 443 | + case 400: |
|
| 444 | 444 | if ($debug_mode) watchdog('boinctranslate', "The following response was received when trying to communicate with the Transifex system: \n{$response}", array(), WATCHDOG_WARNING); |
| 445 | 445 | return "ERROR: {$response->data}"; |
| 446 | - case 405: |
|
| 446 | + case 405: |
|
| 447 | 447 | if ($debug_mode) watchdog('boinctranslate', "The following response was received when trying to communicate with the Transifex system: \n{$response}", array(), WATCHDOG_WARNING); |
| 448 | 448 | return "ERROR: User not allowed to perform this action"; |
| 449 | - } |
|
| 449 | + } |
|
| 450 | 450 | |
| 451 | - return NULL; |
|
| 451 | + return NULL; |
|
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | /** |
@@ -456,58 +456,58 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | function boinctranslate_get_po($langcode, $type = 'standard') { |
| 458 | 458 | |
| 459 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 459 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 460 | 460 | |
| 461 | - $all_languages = language_list(); |
|
| 462 | - $language = $langcode ? $all_languages[$langcode] : NULL; |
|
| 463 | - $textgroups = array(); |
|
| 464 | - $strings = array(); |
|
| 461 | + $all_languages = language_list(); |
|
| 462 | + $language = $langcode ? $all_languages[$langcode] : NULL; |
|
| 463 | + $textgroups = array(); |
|
| 464 | + $strings = array(); |
|
| 465 | 465 | |
| 466 | - switch ($type) { |
|
| 467 | - case 'standard': |
|
| 466 | + switch ($type) { |
|
| 467 | + case 'standard': |
|
| 468 | 468 | $textgroups = array( |
| 469 | - 'default', |
|
| 470 | - 'taxonomy', |
|
| 471 | - 'views', |
|
| 469 | + 'default', |
|
| 470 | + 'taxonomy', |
|
| 471 | + 'views', |
|
| 472 | 472 | ); |
| 473 | 473 | break; |
| 474 | - case 'boinc': |
|
| 474 | + case 'boinc': |
|
| 475 | 475 | $textgroups = array( |
| 476 | - 'boinc', |
|
| 476 | + 'boinc', |
|
| 477 | 477 | ); |
| 478 | 478 | break; |
| 479 | - case 'project': |
|
| 479 | + case 'project': |
|
| 480 | 480 | $textgroups = array( |
| 481 | - 'blocks', |
|
| 482 | - 'menu', |
|
| 483 | - 'project', |
|
| 481 | + 'blocks', |
|
| 482 | + 'menu', |
|
| 483 | + 'project', |
|
| 484 | 484 | ); |
| 485 | 485 | break; |
| 486 | - default: |
|
| 486 | + default: |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | - // Merge textgroup strings together for export as one file |
|
| 490 | - foreach ($textgroups as $textgroup) { |
|
| 489 | + // Merge textgroup strings together for export as one file |
|
| 490 | + foreach ($textgroups as $textgroup) { |
|
| 491 | 491 | $strings += _locale_export_get_strings($language, $textgroup); |
| 492 | - } |
|
| 493 | - ksort($strings); |
|
| 494 | - foreach ($strings as $id => $string) { |
|
| 492 | + } |
|
| 493 | + ksort($strings); |
|
| 494 | + foreach ($strings as $id => $string) { |
|
| 495 | 495 | // Set the string context |
| 496 | 496 | $strings[$id]['context'] = trim($string['comment']); |
| 497 | - } |
|
| 498 | - if ($langcode AND $langcode != 'en') { |
|
| 497 | + } |
|
| 498 | + if ($langcode AND $langcode != 'en') { |
|
| 499 | 499 | // If not the source language, remove untranslated strings from the ouput |
| 500 | 500 | foreach ($strings as $i => $string) { |
| 501 | - if (!$string['translation']) { |
|
| 501 | + if (!$string['translation']) { |
|
| 502 | 502 | unset($strings[$i]); |
| 503 | - } |
|
| 503 | + } |
|
| 504 | 504 | } |
| 505 | - } |
|
| 506 | - if ($strings) { |
|
| 505 | + } |
|
| 506 | + if ($strings) { |
|
| 507 | 507 | return boinctranslate_export_po_generate($language, $strings, NULL, $type); |
| 508 | - } |
|
| 508 | + } |
|
| 509 | 509 | |
| 510 | - return NULL; |
|
| 510 | + return NULL; |
|
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | /** |
@@ -515,21 +515,21 @@ discard block |
||
| 515 | 515 | */ |
| 516 | 516 | function boinctranslate_export_po_generate($language = NULL, $strings = array(), $header = NULL, $type = NULL) { |
| 517 | 517 | |
| 518 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 519 | - global $user; |
|
| 518 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 519 | + global $user; |
|
| 520 | 520 | |
| 521 | - // unset $language to indicate template creation |
|
| 522 | - if (isset($language) && $language->language == "en") { |
|
| 521 | + // unset $language to indicate template creation |
|
| 522 | + if (isset($language) && $language->language == "en") { |
|
| 523 | 523 | $language = NULL; |
| 524 | - } |
|
| 524 | + } |
|
| 525 | 525 | |
| 526 | - if (!isset($header)) { |
|
| 526 | + if (!isset($header)) { |
|
| 527 | 527 | if (isset($type) && $type == "project") { |
| 528 | - $header = "# ".variable_get('site_name', 'Drupal-BOINC')." drupal localization template\n"; |
|
| 529 | - $header .= "# Copyright (C) ".date("Y")." ".variable_get('site_name', 'Drupal-BOINC')."\n"; |
|
| 528 | + $header = "# ".variable_get('site_name', 'Drupal-BOINC')." drupal localization template\n"; |
|
| 529 | + $header .= "# Copyright (C) ".date("Y")." ".variable_get('site_name', 'Drupal-BOINC')."\n"; |
|
| 530 | 530 | } else { |
| 531 | - $header = "# BOINC drupal localization template\n"; |
|
| 532 | - $header .= "# Copyright (C) ".date("Y")." University of California\n"; |
|
| 531 | + $header = "# BOINC drupal localization template\n"; |
|
| 532 | + $header .= "# Copyright (C) ".date("Y")." University of California\n"; |
|
| 533 | 533 | } |
| 534 | 534 | $header .= '# Generated by ' . $user->name . ' <' . $user->mail . ">\n"; |
| 535 | 535 | $header .= "#\n"; |
@@ -538,201 +538,201 @@ discard block |
||
| 538 | 538 | $header .= "msgid \"\"\n"; |
| 539 | 539 | $header .= "msgstr \"\"\n"; |
| 540 | 540 | if (isset($type) && $type == "project") { |
| 541 | - $header .= "\"Project-Id-Version: ".variable_get('site_name', 'Drupal-BOINC')." ".date("Y-m-d-H:iO")."\\n\"\n"; |
|
| 541 | + $header .= "\"Project-Id-Version: ".variable_get('site_name', 'Drupal-BOINC')." ".date("Y-m-d-H:iO")."\\n\"\n"; |
|
| 542 | 542 | } else { |
| 543 | - $header .= "\"Project-Id-Version: BOINC unknown\\n\"\n"; // TODO: add SHA1 of source checkout here |
|
| 543 | + $header .= "\"Project-Id-Version: BOINC unknown\\n\"\n"; // TODO: add SHA1 of source checkout here |
|
| 544 | 544 | } |
| 545 | 545 | $header .= "\"Report-Msgid-Bugs-To: BOINC translation team <[email protected]>\\n\"\n"; |
| 546 | 546 | $header .= "\"POT-Creation-Date: " . date("Y-m-d H:iO") . "\\n\"\n"; |
| 547 | 547 | if (isset($language)) { |
| 548 | - $header .= "\"PO-Revision-Date: " . date("Y-m-d H:iO") . "\\n\"\n"; |
|
| 548 | + $header .= "\"PO-Revision-Date: " . date("Y-m-d H:iO") . "\\n\"\n"; |
|
| 549 | 549 | } |
| 550 | 550 | $header .= "\"Last-Translator: Generated automatically from Drupal translate interface\\n\"\n"; |
| 551 | 551 | $header .= "\"MIME-Version: 1.0\\n\"\n"; |
| 552 | 552 | $header .= "\"Content-Type: text/plain; charset=utf-8\\n\"\n"; |
| 553 | 553 | $header .= "\"Content-Transfer-Encoding: 8bit\\n\"\n"; |
| 554 | 554 | if (isset($language)) { |
| 555 | - $header .= "\"Language: ".$language->language."\\n\""; |
|
| 556 | - if ($language->formula && $language->plurals) { |
|
| 555 | + $header .= "\"Language: ".$language->language."\\n\""; |
|
| 556 | + if ($language->formula && $language->plurals) { |
|
| 557 | 557 | $header .= "\"Plural-Forms: nplurals=" . $language->plurals . "; plural=" . strtr($language->formula, array('$' => '')) . ";\\n\"\n"; |
| 558 | - } |
|
| 558 | + } |
|
| 559 | 559 | } |
| 560 | 560 | $header .= "\"X-Poedit-SourceCharset: utf-8\\n\"\n"; |
| 561 | - } |
|
| 561 | + } |
|
| 562 | 562 | |
| 563 | - $output = $header . "\n"; |
|
| 563 | + $output = $header . "\n"; |
|
| 564 | 564 | |
| 565 | - foreach ($strings as $lid => $string) { |
|
| 565 | + foreach ($strings as $lid => $string) { |
|
| 566 | 566 | // Only process non-children, children are output below their parent. |
| 567 | 567 | if (!isset($string['child'])) { |
| 568 | - if ($string['comment']) { |
|
| 568 | + if ($string['comment']) { |
|
| 569 | 569 | $output .= '#: ' . $string['comment'] . "\n"; |
| 570 | - } |
|
| 571 | - if ($string['context']) { |
|
| 570 | + } |
|
| 571 | + if ($string['context']) { |
|
| 572 | 572 | $output .= 'msgctxt "' . $string['context'] . "\"\n"; |
| 573 | - } |
|
| 574 | - $output .= 'msgid ' . _locale_export_string($string['source']); |
|
| 575 | - if (!empty($string['plural'])) { |
|
| 573 | + } |
|
| 574 | + $output .= 'msgid ' . _locale_export_string($string['source']); |
|
| 575 | + if (!empty($string['plural'])) { |
|
| 576 | 576 | $plural = $string['plural']; |
| 577 | 577 | $output .= 'msgid_plural ' . _locale_export_string($strings[$plural]['source']); |
| 578 | 578 | if (isset($language)) { |
| 579 | - $translation = $string['translation']; |
|
| 580 | - for ($i = 0; $i < $language->plurals; $i++) { |
|
| 579 | + $translation = $string['translation']; |
|
| 580 | + for ($i = 0; $i < $language->plurals; $i++) { |
|
| 581 | 581 | $output .= 'msgstr[' . $i . '] ' . _locale_export_string($translation); |
| 582 | 582 | if ($plural) { |
| 583 | - $translation = _locale_export_remove_plural($strings[$plural]['translation']); |
|
| 584 | - $plural = isset($strings[$plural]['plural']) ? $strings[$plural]['plural'] : 0; |
|
| 583 | + $translation = _locale_export_remove_plural($strings[$plural]['translation']); |
|
| 584 | + $plural = isset($strings[$plural]['plural']) ? $strings[$plural]['plural'] : 0; |
|
| 585 | 585 | } |
| 586 | 586 | else { |
| 587 | - $translation = ''; |
|
| 587 | + $translation = ''; |
|
| 588 | + } |
|
| 588 | 589 | } |
| 589 | - } |
|
| 590 | 590 | } |
| 591 | 591 | else { |
| 592 | - $output .= 'msgstr[0] ""' . "\n"; |
|
| 593 | - $output .= 'msgstr[1] ""' . "\n"; |
|
| 592 | + $output .= 'msgstr[0] ""' . "\n"; |
|
| 593 | + $output .= 'msgstr[1] ""' . "\n"; |
|
| 594 | + } |
|
| 594 | 595 | } |
| 595 | - } |
|
| 596 | - else { |
|
| 596 | + else { |
|
| 597 | 597 | $output .= 'msgstr ' . _locale_export_string($string['translation']); |
| 598 | - } |
|
| 599 | - $output .= "\n"; |
|
| 598 | + } |
|
| 599 | + $output .= "\n"; |
|
| 600 | 600 | } |
| 601 | - } |
|
| 602 | - return $output; |
|
| 601 | + } |
|
| 602 | + return $output; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | /** |
| 606 | 606 | * |
| 607 | 607 | */ |
| 608 | 608 | function boinctranslate_refresh_translations() { |
| 609 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 610 | - $errors = array(); |
|
| 611 | - $languages = locale_language_list(); |
|
| 612 | - $translation_resources = array(); |
|
| 613 | - $operations = array(); |
|
| 614 | - $debug_mode = variable_get('boinc_debug_mode', 0); |
|
| 615 | - |
|
| 616 | - $boinc_name = variable_get( |
|
| 609 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 610 | + $errors = array(); |
|
| 611 | + $languages = locale_language_list(); |
|
| 612 | + $translation_resources = array(); |
|
| 613 | + $operations = array(); |
|
| 614 | + $debug_mode = variable_get('boinc_debug_mode', 0); |
|
| 615 | + |
|
| 616 | + $boinc_name = variable_get( |
|
| 617 | 617 | 'boinc_translate_transifex_standard_name', '' |
| 618 | - ); |
|
| 619 | - $boinc_resources = boinctranslate_parse_resources( |
|
| 618 | + ); |
|
| 619 | + $boinc_resources = boinctranslate_parse_resources( |
|
| 620 | 620 | variable_get('boinc_translate_transifex_standard_resources', array()) |
| 621 | - ); |
|
| 622 | - // Add the Official BOINC resource to the list of BOINC resources; |
|
| 623 | - // The official resource overrides any additional resources provided, so it |
|
| 624 | - // should be added to the end so as to be processed last |
|
| 625 | - $drupal_resource = variable_get( |
|
| 621 | + ); |
|
| 622 | + // Add the Official BOINC resource to the list of BOINC resources; |
|
| 623 | + // The official resource overrides any additional resources provided, so it |
|
| 624 | + // should be added to the end so as to be processed last |
|
| 625 | + $drupal_resource = variable_get( |
|
| 626 | 626 | 'boinc_translate_transifex_boinc_drupal_resource', '' |
| 627 | - ); |
|
| 628 | - $boinc_resources[] = $drupal_resource; |
|
| 629 | - if ($boinc_name AND $boinc_resources) { |
|
| 627 | + ); |
|
| 628 | + $boinc_resources[] = $drupal_resource; |
|
| 629 | + if ($boinc_name AND $boinc_resources) { |
|
| 630 | 630 | $translation_resources[$boinc_name] = array( |
| 631 | - 'resources' => $boinc_resources, |
|
| 632 | - 'textgroups' => array( |
|
| 631 | + 'resources' => $boinc_resources, |
|
| 632 | + 'textgroups' => array( |
|
| 633 | 633 | 'boinc', |
| 634 | 634 | 'default', |
| 635 | 635 | 'taxonomy', |
| 636 | 636 | 'views', |
| 637 | - ), |
|
| 637 | + ), |
|
| 638 | 638 | ); |
| 639 | - } |
|
| 640 | - $project_name = variable_get( |
|
| 639 | + } |
|
| 640 | + $project_name = variable_get( |
|
| 641 | 641 | 'boinc_translate_transifex_project_name', '' |
| 642 | - ); |
|
| 643 | - $project_resources = boinctranslate_parse_resources( |
|
| 642 | + ); |
|
| 643 | + $project_resources = boinctranslate_parse_resources( |
|
| 644 | 644 | variable_get('boinc_translate_transifex_project_resources', array()) |
| 645 | - ); |
|
| 646 | - if ($project_name AND $project_resources) { |
|
| 645 | + ); |
|
| 646 | + if ($project_name AND $project_resources) { |
|
| 647 | 647 | $translation_resources[$project_name] = array( |
| 648 | - 'resources' => $project_resources, |
|
| 649 | - 'textgroups' => array( |
|
| 648 | + 'resources' => $project_resources, |
|
| 649 | + 'textgroups' => array( |
|
| 650 | 650 | 'blocks', |
| 651 | 651 | 'menu', |
| 652 | 652 | 'project', |
| 653 | - ), |
|
| 653 | + ), |
|
| 654 | 654 | ); |
| 655 | 655 | // Be sure any strings from the override file are added to the boinc group |
| 656 | 656 | $override_file = './' . drupal_get_path('module', 'boinctranslate') . '/includes/other-boinc-translation-strings.txt'; |
| 657 | 657 | $other_strings = file($override_file); |
| 658 | 658 | if ($other_strings) { |
| 659 | - foreach ($other_strings as $string) { |
|
| 659 | + foreach ($other_strings as $string) { |
|
| 660 | 660 | $string = trim($string); |
| 661 | 661 | if ($string) { |
| 662 | - // Ignore lines starting with '#' i.e., comments. |
|
| 663 | - if ($string[0] === "#") |
|
| 662 | + // Ignore lines starting with '#' i.e., comments. |
|
| 663 | + if ($string[0] === "#") |
|
| 664 | 664 | continue; |
| 665 | 665 | |
| 666 | - // Use '|' as delimiter to split string and context info. |
|
| 667 | - $line = explode("|", $string); |
|
| 668 | - if ($line) { |
|
| 666 | + // Use '|' as delimiter to split string and context info. |
|
| 667 | + $line = explode("|", $string); |
|
| 668 | + if ($line) { |
|
| 669 | 669 | if (count($line)==1) { |
| 670 | - $tl0 = trim($line[0]); |
|
| 671 | - if ($tl0) { |
|
| 670 | + $tl0 = trim($line[0]); |
|
| 671 | + if ($tl0) { |
|
| 672 | 672 | bts($tl0); |
| 673 | - } |
|
| 673 | + } |
|
| 674 | 674 | } |
| 675 | 675 | elseif (count($line)>1) { |
| 676 | - $tl0 = trim($line[0]); |
|
| 677 | - $tl1 = trim($line[1]); |
|
| 678 | - if ($tl0 and $tl1) { |
|
| 676 | + $tl0 = trim($line[0]); |
|
| 677 | + $tl1 = trim($line[1]); |
|
| 678 | + if ($tl0 and $tl1) { |
|
| 679 | 679 | bts($tl0, array(), NULL, $tl1); |
| 680 | - } |
|
| 680 | + } |
|
| 681 | 681 | } |
| 682 | - }// if ($line) |
|
| 682 | + }// if ($line) |
|
| 683 | 683 | |
| 684 | 684 | }// if ($string) |
| 685 | - }// foreach |
|
| 685 | + }// foreach |
|
| 686 | 686 | }// if ($other_strings) |
| 687 | - } |
|
| 687 | + } |
|
| 688 | 688 | |
| 689 | - foreach ($languages as $langcode => $language) { |
|
| 689 | + foreach ($languages as $langcode => $language) { |
|
| 690 | 690 | if ($langcode == 'en') { |
| 691 | - continue; |
|
| 691 | + continue; |
|
| 692 | 692 | } |
| 693 | 693 | |
| 694 | 694 | $import_stats = array( |
| 695 | - 'new' => 0, |
|
| 696 | - 'updated' => 0, |
|
| 697 | - 'deleted' => 0, |
|
| 698 | - 'skipped' => 0, |
|
| 695 | + 'new' => 0, |
|
| 696 | + 'updated' => 0, |
|
| 697 | + 'deleted' => 0, |
|
| 698 | + 'skipped' => 0, |
|
| 699 | 699 | ); |
| 700 | 700 | |
| 701 | 701 | foreach ($translation_resources as $project => $translation) { |
| 702 | - foreach ($translation['resources'] as $resource) { |
|
| 702 | + foreach ($translation['resources'] as $resource) { |
|
| 703 | 703 | |
| 704 | 704 | // Add this language to the batch operations |
| 705 | 705 | $operations[] = array( |
| 706 | - 'boinctranslate_refresh_translations_op', |
|
| 707 | - array( |
|
| 706 | + 'boinctranslate_refresh_translations_op', |
|
| 707 | + array( |
|
| 708 | 708 | $project, $resource, $langcode, $language, $translation['textgroups'], $debug_mode |
| 709 | - ), |
|
| 709 | + ), |
|
| 710 | 710 | ); |
| 711 | - } |
|
| 711 | + } |
|
| 712 | 712 | } |
| 713 | 713 | if ($batch = locale_batch_by_language($langcode)) { |
| 714 | - foreach ($batch['operations'] as $op) { |
|
| 714 | + foreach ($batch['operations'] as $op) { |
|
| 715 | 715 | $operations[] = array( |
| 716 | - 'boinctranslate_refresh_translations_op', |
|
| 717 | - array( |
|
| 716 | + 'boinctranslate_refresh_translations_op', |
|
| 717 | + array( |
|
| 718 | 718 | NULL, $op[1][0], $langcode, $language, array('default'), $debug_mode |
| 719 | - ), |
|
| 719 | + ), |
|
| 720 | 720 | ); |
| 721 | - } |
|
| 721 | + } |
|
| 722 | + } |
|
| 722 | 723 | } |
| 723 | - } |
|
| 724 | 724 | |
| 725 | - $batch = array( |
|
| 725 | + $batch = array( |
|
| 726 | 726 | 'operations' => $operations, |
| 727 | 727 | 'finished' => 'boinctranslate_refresh_translations_finished', |
| 728 | 728 | 'title' => t('Importing translations'), |
| 729 | 729 | 'init_message' => t('Beginning translation import...'), |
| 730 | 730 | 'progress_message' => t('Applied @current out of @total translation updates.'), |
| 731 | 731 | 'error_message' => t('Translation import has encountered an error.'), |
| 732 | - ); |
|
| 732 | + ); |
|
| 733 | 733 | |
| 734 | - batch_set($batch); |
|
| 735 | - batch_process(); |
|
| 734 | + batch_set($batch); |
|
| 735 | + batch_process(); |
|
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | |
@@ -741,18 +741,18 @@ discard block |
||
| 741 | 741 | */ |
| 742 | 742 | function boinctranslate_refresh_translations_op($project, $resource, $langcode, $language, $textgroups, $debug_mode, &$context) { |
| 743 | 743 | |
| 744 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 744 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 745 | 745 | |
| 746 | - if ($debug_mode) { |
|
| 746 | + if ($debug_mode) { |
|
| 747 | 747 | watchdog( |
| 748 | - 'boinctranslate', |
|
| 749 | - 'Checking for @language updates in @project:@resource', |
|
| 750 | - array('@language' => $language, '@project' => $project, '@resource' => $resource), |
|
| 751 | - WATCHDOG_INFO |
|
| 748 | + 'boinctranslate', |
|
| 749 | + 'Checking for @language updates in @project:@resource', |
|
| 750 | + array('@language' => $language, '@project' => $project, '@resource' => $resource), |
|
| 751 | + WATCHDOG_INFO |
|
| 752 | 752 | ); |
| 753 | - } |
|
| 753 | + } |
|
| 754 | 754 | |
| 755 | - if ($project) { |
|
| 755 | + if ($project) { |
|
| 756 | 756 | // Import the configured resources |
| 757 | 757 | $success = FALSE; |
| 758 | 758 | $message = ''; |
@@ -760,10 +760,10 @@ discard block |
||
| 760 | 760 | $response = boinctranslate_transifex_request($path); |
| 761 | 761 | |
| 762 | 762 | if ($response == '404 NOT FOUND') { |
| 763 | - $message = "Project resource {$project}:{$resource} not found in {$language}."; |
|
| 763 | + $message = "Project resource {$project}:{$resource} not found in {$language}."; |
|
| 764 | 764 | } |
| 765 | 765 | elseif ($response) { |
| 766 | - if (!empty($response['content'])) { |
|
| 766 | + if (!empty($response['content'])) { |
|
| 767 | 767 | $po_text = $response['content']; |
| 768 | 768 | |
| 769 | 769 | // Write the translation file to a temporary location |
@@ -771,163 +771,163 @@ discard block |
||
| 771 | 771 | $file->filepath = file_save_data($po_text, NULL); |
| 772 | 772 | $file->filename = basename($file->filepath); |
| 773 | 773 | if (!$file->filepath) { |
| 774 | - $message = 'Unable to create temporary file in ' |
|
| 774 | + $message = 'Unable to create temporary file in ' |
|
| 775 | 775 | . file_directory_temp() . " for {$language} translation " |
| 776 | 776 | . "resource {$project}:{$resource}"; |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | 779 | foreach ($textgroups as $textgroup) { |
| 780 | - // Import the translations from the file to each related textgroup |
|
| 781 | - if (!$results = _boinctranslate_locale_import_po($file, $langcode, LOCALE_IMPORT_OVERWRITE, $textgroup)) { |
|
| 780 | + // Import the translations from the file to each related textgroup |
|
| 781 | + if (!$results = _boinctranslate_locale_import_po($file, $langcode, LOCALE_IMPORT_OVERWRITE, $textgroup)) { |
|
| 782 | 782 | $message = "The {$language} translation import of" |
| 783 | - . " {$project}:{$resource} failed."; |
|
| 783 | + . " {$project}:{$resource} failed."; |
|
| 784 | 784 | $success = FALSE; |
| 785 | 785 | break; |
| 786 | - } |
|
| 787 | - else { |
|
| 786 | + } |
|
| 787 | + else { |
|
| 788 | 788 | $success = TRUE; |
| 789 | - } |
|
| 789 | + } |
|
| 790 | + } |
|
| 790 | 791 | } |
| 791 | - } |
|
| 792 | - else { |
|
| 792 | + else { |
|
| 793 | 793 | $message = "Unable to read response for {$language} translation import" |
| 794 | - . " of {$project}:{$resource}."; |
|
| 795 | - } |
|
| 794 | + . " of {$project}:{$resource}."; |
|
| 795 | + } |
|
| 796 | 796 | } |
| 797 | 797 | else { |
| 798 | - $message = "Translation data not found in response for {$language}" |
|
| 798 | + $message = "Translation data not found in response for {$language}" |
|
| 799 | 799 | . " translation import of {$project}:{$resource}."; |
| 800 | 800 | } |
| 801 | - } |
|
| 802 | - else { |
|
| 801 | + } |
|
| 802 | + else { |
|
| 803 | 803 | // If project isn't specified, import as a local Drupal resource |
| 804 | 804 | $project = 'drupal.local'; |
| 805 | 805 | $file = new stdClass(); |
| 806 | 806 | $file->filepath = $resource; |
| 807 | 807 | $file->filename = basename($file->filepath); |
| 808 | 808 | if (!$results = _boinctranslate_locale_import_po($file, $langcode, LOCALE_IMPORT_OVERWRITE, $textgroup)) { |
| 809 | - $message = "The {$language} translation import of" |
|
| 809 | + $message = "The {$language} translation import of" |
|
| 810 | 810 | . " local file {$resource} failed."; |
| 811 | - $success = FALSE; |
|
| 811 | + $success = FALSE; |
|
| 812 | 812 | } |
| 813 | 813 | else { |
| 814 | - $success = TRUE; |
|
| 814 | + $success = TRUE; |
|
| 815 | + } |
|
| 815 | 816 | } |
| 816 | - } |
|
| 817 | 817 | |
| 818 | - if ($success) { |
|
| 818 | + if ($success) { |
|
| 819 | 819 | // Store some result for post-processing in the finished callback. |
| 820 | 820 | $context['results']['success'][] = "{$langcode}:{$textgroup}"; |
| 821 | 821 | $message = "Imported {$language} translations in {$project}:{$resource} ({$results['new']} added, {$results['updated']} refreshed, {$results['deleted']} removed)"; |
| 822 | 822 | |
| 823 | 823 | if ($debug_mode) { |
| 824 | - watchdog( |
|
| 824 | + watchdog( |
|
| 825 | 825 | 'boinctranslate', |
| 826 | 826 | $message, |
| 827 | 827 | array(), |
| 828 | 828 | WATCHDOG_INFO |
| 829 | - ); |
|
| 829 | + ); |
|
| 830 | 830 | } |
| 831 | - } |
|
| 832 | - else { |
|
| 831 | + } |
|
| 832 | + else { |
|
| 833 | 833 | $context['results']['failure'][] = "{$langcode}:{$textgroup}"; |
| 834 | 834 | watchdog( |
| 835 | - 'boinctranslate', |
|
| 836 | - $message, |
|
| 837 | - array(), |
|
| 838 | - WATCHDOG_WARNING |
|
| 835 | + 'boinctranslate', |
|
| 836 | + $message, |
|
| 837 | + array(), |
|
| 838 | + WATCHDOG_WARNING |
|
| 839 | 839 | ); |
| 840 | - } |
|
| 840 | + } |
|
| 841 | 841 | |
| 842 | - // Update our progress information. |
|
| 843 | - $context['sandbox']['progress']++; |
|
| 844 | - $context['sandbox']['language'] = $langcode; |
|
| 845 | - $context['message'] = $message; |
|
| 842 | + // Update our progress information. |
|
| 843 | + $context['sandbox']['progress']++; |
|
| 844 | + $context['sandbox']['language'] = $langcode; |
|
| 845 | + $context['message'] = $message; |
|
| 846 | 846 | |
| 847 | - // Update the progress for the batch engine |
|
| 848 | - if ($context['sandbox']['progress'] >= $context['sandbox']['max']) { |
|
| 847 | + // Update the progress for the batch engine |
|
| 848 | + if ($context['sandbox']['progress'] >= $context['sandbox']['max']) { |
|
| 849 | 849 | $context['finished'] = 1; |
| 850 | - } |
|
| 851 | - else { |
|
| 850 | + } |
|
| 851 | + else { |
|
| 852 | 852 | $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max']; |
| 853 | - } |
|
| 853 | + } |
|
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | /** |
| 857 | 857 | * Batch 'finished' callback |
| 858 | 858 | */ |
| 859 | 859 | function boinctranslate_refresh_translations_finished($success, $results, $operations) { |
| 860 | - if ($success) { |
|
| 860 | + if ($success) { |
|
| 861 | 861 | // Let's count our successes |
| 862 | 862 | $count = count($results['success']); |
| 863 | 863 | $message = "Successfully completed {$count} import operations"; |
| 864 | 864 | watchdog( |
| 865 | - 'boinctranslate', |
|
| 866 | - 'Successfully completed @count import operations.', |
|
| 867 | - array('@count' => $count), |
|
| 868 | - WATCHDOG_INFO |
|
| 865 | + 'boinctranslate', |
|
| 866 | + 'Successfully completed @count import operations.', |
|
| 867 | + array('@count' => $count), |
|
| 868 | + WATCHDOG_INFO |
|
| 869 | 869 | ); |
| 870 | - } |
|
| 871 | - else { |
|
| 870 | + } |
|
| 871 | + else { |
|
| 872 | 872 | // An error occurred. |
| 873 | 873 | // $operations contains the operations that remained unprocessed. |
| 874 | 874 | $error_operation = reset($operations); |
| 875 | 875 | $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE); |
| 876 | 876 | watchdog( |
| 877 | - 'boinctranslate', |
|
| 878 | - $message, |
|
| 879 | - array(), |
|
| 880 | - WATCHDOG_WARNING |
|
| 877 | + 'boinctranslate', |
|
| 878 | + $message, |
|
| 879 | + array(), |
|
| 880 | + WATCHDOG_WARNING |
|
| 881 | 881 | ); |
| 882 | - } |
|
| 883 | - drupal_set_message($message); |
|
| 884 | - drupal_goto('admin/boinc/translation'); |
|
| 882 | + } |
|
| 883 | + drupal_set_message($message); |
|
| 884 | + drupal_goto('admin/boinc/translation'); |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | /** |
| 888 | 888 | * |
| 889 | 889 | */ |
| 890 | 890 | function _boinctranslate_locale_import_po($file, $langcode, $mode, $group = NULL) { |
| 891 | - // Try to allocate enough time to parse and import the data. |
|
| 892 | - if (function_exists('set_time_limit')) { |
|
| 891 | + // Try to allocate enough time to parse and import the data. |
|
| 892 | + if (function_exists('set_time_limit')) { |
|
| 893 | 893 | @set_time_limit(240); |
| 894 | - } |
|
| 894 | + } |
|
| 895 | 895 | |
| 896 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 896 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 897 | 897 | |
| 898 | - // Check if we have the language already in the database. |
|
| 899 | - if (!db_fetch_object(db_query("SELECT language FROM {languages} WHERE language = '%s'", $langcode))) { |
|
| 898 | + // Check if we have the language already in the database. |
|
| 899 | + if (!db_fetch_object(db_query("SELECT language FROM {languages} WHERE language = '%s'", $langcode))) { |
|
| 900 | 900 | drupal_set_message(t('The language selected for import is not supported.'), 'error'); |
| 901 | 901 | return FALSE; |
| 902 | - } |
|
| 902 | + } |
|
| 903 | 903 | |
| 904 | - // Get strings from file (returns on failure after a partial import, or on success) |
|
| 905 | - $status = _boinctranslate_locale_import_read_po('db-store', $file, $mode, $langcode, $group); |
|
| 906 | - if ($status === FALSE) { |
|
| 904 | + // Get strings from file (returns on failure after a partial import, or on success) |
|
| 905 | + $status = _boinctranslate_locale_import_read_po('db-store', $file, $mode, $langcode, $group); |
|
| 906 | + if ($status === FALSE) { |
|
| 907 | 907 | // Error messages are set in _locale_import_read_po(). |
| 908 | 908 | return FALSE; |
| 909 | - } |
|
| 909 | + } |
|
| 910 | 910 | |
| 911 | - // Get status information on import process. |
|
| 912 | - list($headerdone, $additions, $updates, $deletes, $skips) = _boinctranslate_locale_import_one_string('db-report'); |
|
| 911 | + // Get status information on import process. |
|
| 912 | + list($headerdone, $additions, $updates, $deletes, $skips) = _boinctranslate_locale_import_one_string('db-report'); |
|
| 913 | 913 | |
| 914 | - if (!$headerdone) { |
|
| 914 | + if (!$headerdone) { |
|
| 915 | 915 | drupal_set_message(t('The translation file %filename appears to have a missing or malformed header.', array('%filename' => $file->filename)), 'error'); |
| 916 | - } |
|
| 916 | + } |
|
| 917 | 917 | |
| 918 | - // Clear cache and force refresh of JavaScript translations. |
|
| 919 | - _locale_invalidate_js($langcode); |
|
| 920 | - cache_clear_all('locale:', 'cache', TRUE); |
|
| 918 | + // Clear cache and force refresh of JavaScript translations. |
|
| 919 | + _locale_invalidate_js($langcode); |
|
| 920 | + cache_clear_all('locale:', 'cache', TRUE); |
|
| 921 | 921 | |
| 922 | - // Rebuild the menu, strings may have changed. |
|
| 923 | - menu_rebuild(); |
|
| 922 | + // Rebuild the menu, strings may have changed. |
|
| 923 | + menu_rebuild(); |
|
| 924 | 924 | |
| 925 | - return array( |
|
| 925 | + return array( |
|
| 926 | 926 | 'new' => $additions, |
| 927 | 927 | 'updated' => $updates, |
| 928 | 928 | 'deleted' => $deletes, |
| 929 | 929 | 'skipped' => $skips, |
| 930 | - ); |
|
| 930 | + ); |
|
| 931 | 931 | } |
| 932 | 932 | |
| 933 | 933 | /** |
@@ -935,253 +935,253 @@ discard block |
||
| 935 | 935 | */ |
| 936 | 936 | function _boinctranslate_locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = 'default') { |
| 937 | 937 | |
| 938 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 938 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 939 | 939 | |
| 940 | - $fd = fopen($file->filepath, "rb"); // File will get closed by PHP on return |
|
| 941 | - if (!$fd) { |
|
| 940 | + $fd = fopen($file->filepath, "rb"); // File will get closed by PHP on return |
|
| 941 | + if (!$fd) { |
|
| 942 | 942 | watchdog( |
| 943 | - 'boinctranslate', |
|
| 944 | - 'The translation import for %lang failed, because %filename could not be read.', |
|
| 945 | - array('%lang' => $lang, '%filename' => $file->filename), |
|
| 946 | - WATCHDOG_WARNING |
|
| 943 | + 'boinctranslate', |
|
| 944 | + 'The translation import for %lang failed, because %filename could not be read.', |
|
| 945 | + array('%lang' => $lang, '%filename' => $file->filename), |
|
| 946 | + WATCHDOG_WARNING |
|
| 947 | 947 | ); |
| 948 | 948 | _locale_import_message('The translation import failed, because the file %filename could not be read.', $file); |
| 949 | 949 | return FALSE; |
| 950 | - } |
|
| 950 | + } |
|
| 951 | 951 | |
| 952 | - $context = "COMMENT"; // Parser context: COMMENT, MSGID, MSGID_PLURAL, MSGSTR and MSGSTR_ARR |
|
| 953 | - $current = array(); // Current entry being read |
|
| 954 | - $plural = 0; // Current plural form |
|
| 955 | - $lineno = 0; // Current line |
|
| 952 | + $context = "COMMENT"; // Parser context: COMMENT, MSGID, MSGID_PLURAL, MSGSTR and MSGSTR_ARR |
|
| 953 | + $current = array(); // Current entry being read |
|
| 954 | + $plural = 0; // Current plural form |
|
| 955 | + $lineno = 0; // Current line |
|
| 956 | 956 | |
| 957 | - while (!feof($fd)) { |
|
| 957 | + while (!feof($fd)) { |
|
| 958 | 958 | $line = fgets($fd, 10 * 1024); // A line should not be this long |
| 959 | 959 | if ($lineno == 0) { |
| 960 | - // The first line might come with a UTF-8 BOM, which should be removed. |
|
| 961 | - $line = str_replace("\xEF\xBB\xBF", '', $line); |
|
| 960 | + // The first line might come with a UTF-8 BOM, which should be removed. |
|
| 961 | + $line = str_replace("\xEF\xBB\xBF", '', $line); |
|
| 962 | 962 | } |
| 963 | 963 | $lineno++; |
| 964 | 964 | $line = trim(strtr($line, array("\\\n" => ""))); |
| 965 | 965 | |
| 966 | 966 | if (!strncmp("#", $line, 1)) { // A comment |
| 967 | - if ($context == "COMMENT") { // Already in comment context: add |
|
| 967 | + if ($context == "COMMENT") { // Already in comment context: add |
|
| 968 | 968 | $current["#"][] = substr($line, 1); |
| 969 | - } |
|
| 970 | - elseif (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one |
|
| 969 | + } |
|
| 970 | + elseif (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one |
|
| 971 | 971 | _boinctranslate_locale_import_one_string($op, $current, $mode, $lang, $file, $group); |
| 972 | 972 | $current = array(); |
| 973 | 973 | $current["#"][] = substr($line, 1); |
| 974 | 974 | $context = "COMMENT"; |
| 975 | - } |
|
| 976 | - else { // Parse error |
|
| 975 | + } |
|
| 976 | + else { // Parse error |
|
| 977 | 977 | watchdog( |
| 978 | - 'boinctranslate', |
|
| 979 | - 'The translation file %filename for %lang contains an error: "msgstr" was expected but not found on line %line.', |
|
| 980 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 981 | - WATCHDOG_WARNING |
|
| 978 | + 'boinctranslate', |
|
| 979 | + 'The translation file %filename for %lang contains an error: "msgstr" was expected but not found on line %line.', |
|
| 980 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 981 | + WATCHDOG_WARNING |
|
| 982 | 982 | ); |
| 983 | 983 | _locale_import_message('The translation file %filename contains an error: "msgstr" was expected but not found on line %line.', $file, $lineno); |
| 984 | 984 | return FALSE; |
| 985 | - } |
|
| 985 | + } |
|
| 986 | 986 | } |
| 987 | 987 | elseif (!strncmp("msgctxt", $line, 7)) { |
| 988 | - if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one |
|
| 988 | + if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one |
|
| 989 | 989 | _boinctranslate_locale_import_one_string($op, $current, $mode, $lang, $file, $group); |
| 990 | 990 | $current = array(); |
| 991 | - } |
|
| 992 | - elseif (($context == "MSGID") || ($context == "MSGCTXT")) { // Already in this context? Parse error |
|
| 991 | + } |
|
| 992 | + elseif (($context == "MSGID") || ($context == "MSGCTXT")) { // Already in this context? Parse error |
|
| 993 | 993 | watchdog( |
| 994 | - 'boinctranslate', |
|
| 995 | - 'The translation file %filename for %lang contains an error: "msgctxt" is unexpected on line %line.', |
|
| 996 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 997 | - WATCHDOG_WARNING |
|
| 994 | + 'boinctranslate', |
|
| 995 | + 'The translation file %filename for %lang contains an error: "msgctxt" is unexpected on line %line.', |
|
| 996 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 997 | + WATCHDOG_WARNING |
|
| 998 | 998 | ); |
| 999 | 999 | _locale_import_message('The translation file %filename contains an error: "msgid" is unexpected on line %line.', $file, $lineno); |
| 1000 | 1000 | return FALSE; |
| 1001 | - } |
|
| 1002 | - $line = trim(substr($line, 7)); |
|
| 1003 | - $quoted = _locale_import_parse_quoted($line); |
|
| 1004 | - if ($quoted === FALSE) { |
|
| 1001 | + } |
|
| 1002 | + $line = trim(substr($line, 7)); |
|
| 1003 | + $quoted = _locale_import_parse_quoted($line); |
|
| 1004 | + if ($quoted === FALSE) { |
|
| 1005 | 1005 | watchdog( |
| 1006 | - 'boinctranslate', |
|
| 1007 | - 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1008 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1009 | - WATCHDOG_WARNING |
|
| 1006 | + 'boinctranslate', |
|
| 1007 | + 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1008 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1009 | + WATCHDOG_WARNING |
|
| 1010 | 1010 | ); |
| 1011 | 1011 | _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); |
| 1012 | 1012 | return FALSE; |
| 1013 | - } |
|
| 1014 | - $current["msgctxt"] = $quoted; |
|
| 1015 | - $context = "MSGCTXT"; |
|
| 1013 | + } |
|
| 1014 | + $current["msgctxt"] = $quoted; |
|
| 1015 | + $context = "MSGCTXT"; |
|
| 1016 | 1016 | } |
| 1017 | 1017 | elseif (!strncmp("msgid_plural", $line, 12)) { |
| 1018 | - if ($context != "MSGID") { // Must be plural form for current entry |
|
| 1018 | + if ($context != "MSGID") { // Must be plural form for current entry |
|
| 1019 | 1019 | watchdog( |
| 1020 | - 'boinctranslate', |
|
| 1021 | - 'The translation file %filename for %lang contains an error: "msgid_plural" was expected but not found on line %line.', |
|
| 1022 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1023 | - WATCHDOG_WARNING |
|
| 1020 | + 'boinctranslate', |
|
| 1021 | + 'The translation file %filename for %lang contains an error: "msgid_plural" was expected but not found on line %line.', |
|
| 1022 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1023 | + WATCHDOG_WARNING |
|
| 1024 | 1024 | ); |
| 1025 | 1025 | _locale_import_message('The translation file %filename contains an error: "msgid_plural" was expected but not found on line %line.', $file, $lineno); |
| 1026 | 1026 | return FALSE; |
| 1027 | - } |
|
| 1028 | - $line = trim(substr($line, 12)); |
|
| 1029 | - $quoted = _locale_import_parse_quoted($line); |
|
| 1030 | - if ($quoted === FALSE) { |
|
| 1027 | + } |
|
| 1028 | + $line = trim(substr($line, 12)); |
|
| 1029 | + $quoted = _locale_import_parse_quoted($line); |
|
| 1030 | + if ($quoted === FALSE) { |
|
| 1031 | 1031 | watchdog( |
| 1032 | - 'boinctranslate', |
|
| 1033 | - 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1034 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1035 | - WATCHDOG_WARNING |
|
| 1032 | + 'boinctranslate', |
|
| 1033 | + 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1034 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1035 | + WATCHDOG_WARNING |
|
| 1036 | 1036 | ); |
| 1037 | 1037 | _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); |
| 1038 | 1038 | return FALSE; |
| 1039 | - } |
|
| 1040 | - $current["msgid"] = $current["msgid"] . "\0" . $quoted; |
|
| 1041 | - $context = "MSGID_PLURAL"; |
|
| 1039 | + } |
|
| 1040 | + $current["msgid"] = $current["msgid"] . "\0" . $quoted; |
|
| 1041 | + $context = "MSGID_PLURAL"; |
|
| 1042 | 1042 | } |
| 1043 | 1043 | elseif (!strncmp("msgid", $line, 5)) { |
| 1044 | - if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one |
|
| 1044 | + if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one |
|
| 1045 | 1045 | _boinctranslate_locale_import_one_string($op, $current, $mode, $lang, $file, $group); |
| 1046 | 1046 | $current = array(); |
| 1047 | - } |
|
| 1048 | - elseif ($context == "MSGID") { // Already in this context? Parse error |
|
| 1047 | + } |
|
| 1048 | + elseif ($context == "MSGID") { // Already in this context? Parse error |
|
| 1049 | 1049 | watchdog( |
| 1050 | - 'boinctranslate', |
|
| 1051 | - 'The translation file %filename for %lang contains an error: "msgid" is unexpected on line %line.', |
|
| 1052 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1053 | - WATCHDOG_WARNING |
|
| 1050 | + 'boinctranslate', |
|
| 1051 | + 'The translation file %filename for %lang contains an error: "msgid" is unexpected on line %line.', |
|
| 1052 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1053 | + WATCHDOG_WARNING |
|
| 1054 | 1054 | ); |
| 1055 | 1055 | _locale_import_message('The translation file %filename contains an error: "msgid" is unexpected on line %line.', $file, $lineno); |
| 1056 | 1056 | return FALSE; |
| 1057 | - } |
|
| 1058 | - $line = trim(substr($line, 5)); |
|
| 1059 | - $quoted = _locale_import_parse_quoted($line); |
|
| 1060 | - if ($quoted === FALSE) { |
|
| 1057 | + } |
|
| 1058 | + $line = trim(substr($line, 5)); |
|
| 1059 | + $quoted = _locale_import_parse_quoted($line); |
|
| 1060 | + if ($quoted === FALSE) { |
|
| 1061 | 1061 | watchdog( |
| 1062 | - 'boinctranslate', |
|
| 1063 | - 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1064 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1065 | - WATCHDOG_WARNING |
|
| 1062 | + 'boinctranslate', |
|
| 1063 | + 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1064 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1065 | + WATCHDOG_WARNING |
|
| 1066 | 1066 | ); |
| 1067 | 1067 | _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); |
| 1068 | 1068 | return FALSE; |
| 1069 | - } |
|
| 1070 | - $current["msgid"] = $quoted; |
|
| 1071 | - $context = "MSGID"; |
|
| 1069 | + } |
|
| 1070 | + $current["msgid"] = $quoted; |
|
| 1071 | + $context = "MSGID"; |
|
| 1072 | 1072 | } |
| 1073 | 1073 | elseif (!strncmp("msgstr[", $line, 7)) { |
| 1074 | - if (($context != "MSGID") && ($context != "MSGID_PLURAL") && ($context != "MSGSTR_ARR")) { // Must come after msgid, msgid_plural, or msgstr[] |
|
| 1074 | + if (($context != "MSGID") && ($context != "MSGID_PLURAL") && ($context != "MSGSTR_ARR")) { // Must come after msgid, msgid_plural, or msgstr[] |
|
| 1075 | 1075 | watchdog( |
| 1076 | - 'boinctranslate', |
|
| 1077 | - 'The translation file %filename for %lang contains an error: "msgstr[]" is unexpected on line %line.', |
|
| 1078 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1079 | - WATCHDOG_WARNING |
|
| 1076 | + 'boinctranslate', |
|
| 1077 | + 'The translation file %filename for %lang contains an error: "msgstr[]" is unexpected on line %line.', |
|
| 1078 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1079 | + WATCHDOG_WARNING |
|
| 1080 | 1080 | ); |
| 1081 | 1081 | _locale_import_message('The translation file %filename contains an error: "msgstr[]" is unexpected on line %line.', $file, $lineno); |
| 1082 | 1082 | return FALSE; |
| 1083 | - } |
|
| 1084 | - if (strpos($line, "]") === FALSE) { |
|
| 1083 | + } |
|
| 1084 | + if (strpos($line, "]") === FALSE) { |
|
| 1085 | 1085 | watchdog( |
| 1086 | - 'boinctranslate', |
|
| 1087 | - 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1088 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1089 | - WATCHDOG_WARNING |
|
| 1086 | + 'boinctranslate', |
|
| 1087 | + 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1088 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1089 | + WATCHDOG_WARNING |
|
| 1090 | 1090 | ); |
| 1091 | 1091 | _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); |
| 1092 | 1092 | return FALSE; |
| 1093 | - } |
|
| 1094 | - $frombracket = strstr($line, "["); |
|
| 1095 | - $plural = substr($frombracket, 1, strpos($frombracket, "]") - 1); |
|
| 1096 | - $line = trim(strstr($line, " ")); |
|
| 1097 | - $quoted = _locale_import_parse_quoted($line); |
|
| 1098 | - if ($quoted === FALSE) { |
|
| 1093 | + } |
|
| 1094 | + $frombracket = strstr($line, "["); |
|
| 1095 | + $plural = substr($frombracket, 1, strpos($frombracket, "]") - 1); |
|
| 1096 | + $line = trim(strstr($line, " ")); |
|
| 1097 | + $quoted = _locale_import_parse_quoted($line); |
|
| 1098 | + if ($quoted === FALSE) { |
|
| 1099 | 1099 | watchdog( |
| 1100 | - 'boinctranslate', |
|
| 1101 | - 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1102 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1103 | - WATCHDOG_WARNING |
|
| 1100 | + 'boinctranslate', |
|
| 1101 | + 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1102 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1103 | + WATCHDOG_WARNING |
|
| 1104 | 1104 | ); |
| 1105 | 1105 | _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); |
| 1106 | 1106 | return FALSE; |
| 1107 | - } |
|
| 1108 | - $current["msgstr"][$plural] = $quoted; |
|
| 1109 | - $context = "MSGSTR_ARR"; |
|
| 1107 | + } |
|
| 1108 | + $current["msgstr"][$plural] = $quoted; |
|
| 1109 | + $context = "MSGSTR_ARR"; |
|
| 1110 | 1110 | } |
| 1111 | 1111 | elseif (!strncmp("msgstr", $line, 6)) { |
| 1112 | - if ($context != "MSGID") { // Should come just after a msgid block |
|
| 1112 | + if ($context != "MSGID") { // Should come just after a msgid block |
|
| 1113 | 1113 | watchdog( |
| 1114 | - 'boinctranslate', |
|
| 1115 | - 'The translation file %filename for %lang contains an error: "msgstr" is unexpected on line %line.', |
|
| 1116 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1117 | - WATCHDOG_WARNING |
|
| 1114 | + 'boinctranslate', |
|
| 1115 | + 'The translation file %filename for %lang contains an error: "msgstr" is unexpected on line %line.', |
|
| 1116 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1117 | + WATCHDOG_WARNING |
|
| 1118 | 1118 | ); |
| 1119 | 1119 | _locale_import_message('The translation file %filename contains an error: "msgstr" is unexpected on line %line.', $file, $lineno); |
| 1120 | 1120 | return FALSE; |
| 1121 | - } |
|
| 1122 | - $line = trim(substr($line, 6)); |
|
| 1123 | - $quoted = _locale_import_parse_quoted($line); |
|
| 1124 | - if ($quoted === FALSE) { |
|
| 1121 | + } |
|
| 1122 | + $line = trim(substr($line, 6)); |
|
| 1123 | + $quoted = _locale_import_parse_quoted($line); |
|
| 1124 | + if ($quoted === FALSE) { |
|
| 1125 | 1125 | watchdog( |
| 1126 | - 'boinctranslate', |
|
| 1127 | - 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1128 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1129 | - WATCHDOG_WARNING |
|
| 1126 | + 'boinctranslate', |
|
| 1127 | + 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1128 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1129 | + WATCHDOG_WARNING |
|
| 1130 | 1130 | ); |
| 1131 | 1131 | _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); |
| 1132 | 1132 | return FALSE; |
| 1133 | - } |
|
| 1134 | - $current["msgstr"] = $quoted; |
|
| 1135 | - $context = "MSGSTR"; |
|
| 1133 | + } |
|
| 1134 | + $current["msgstr"] = $quoted; |
|
| 1135 | + $context = "MSGSTR"; |
|
| 1136 | 1136 | } |
| 1137 | 1137 | elseif ($line != "") { |
| 1138 | - $quoted = _locale_import_parse_quoted($line); |
|
| 1139 | - if ($quoted === FALSE) { |
|
| 1138 | + $quoted = _locale_import_parse_quoted($line); |
|
| 1139 | + if ($quoted === FALSE) { |
|
| 1140 | 1140 | watchdog( |
| 1141 | - 'boinctranslate', |
|
| 1142 | - 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1143 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1144 | - WATCHDOG_WARNING |
|
| 1141 | + 'boinctranslate', |
|
| 1142 | + 'The translation file %filename for language %lang contains a syntax error on line %line.', |
|
| 1143 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1144 | + WATCHDOG_WARNING |
|
| 1145 | 1145 | ); |
| 1146 | 1146 | _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); |
| 1147 | 1147 | return FALSE; |
| 1148 | - } |
|
| 1149 | - if (($context == "MSGID") || ($context == "MSGID_PLURAL")) { |
|
| 1148 | + } |
|
| 1149 | + if (($context == "MSGID") || ($context == "MSGID_PLURAL")) { |
|
| 1150 | 1150 | $current["msgid"] .= $quoted; |
| 1151 | - } |
|
| 1152 | - elseif ($context == "MSGSTR") { |
|
| 1151 | + } |
|
| 1152 | + elseif ($context == "MSGSTR") { |
|
| 1153 | 1153 | $current["msgstr"] .= $quoted; |
| 1154 | - } |
|
| 1155 | - elseif ($context == "MSGSTR_ARR") { |
|
| 1154 | + } |
|
| 1155 | + elseif ($context == "MSGSTR_ARR") { |
|
| 1156 | 1156 | $current["msgstr"][$plural] .= $quoted; |
| 1157 | - } |
|
| 1158 | - else { |
|
| 1157 | + } |
|
| 1158 | + else { |
|
| 1159 | 1159 | watchdog( |
| 1160 | - 'boinctranslate', |
|
| 1161 | - 'The translation file %filename for %lang contains an error: there is an unexpected string on line %line.', |
|
| 1162 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1163 | - WATCHDOG_WARNING |
|
| 1160 | + 'boinctranslate', |
|
| 1161 | + 'The translation file %filename for %lang contains an error: there is an unexpected string on line %line.', |
|
| 1162 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1163 | + WATCHDOG_WARNING |
|
| 1164 | 1164 | ); |
| 1165 | 1165 | _locale_import_message('The translation file %filename contains an error: there is an unexpected string on line %line.', $file, $lineno); |
| 1166 | 1166 | return FALSE; |
| 1167 | - } |
|
| 1167 | + } |
|
| 1168 | + } |
|
| 1168 | 1169 | } |
| 1169 | - } |
|
| 1170 | 1170 | |
| 1171 | - // End of PO file, flush last entry |
|
| 1172 | - if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { |
|
| 1171 | + // End of PO file, flush last entry |
|
| 1172 | + if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { |
|
| 1173 | 1173 | _boinctranslate_locale_import_one_string($op, $current, $mode, $lang, $file, $group); |
| 1174 | - } |
|
| 1175 | - elseif ($context != "COMMENT") { |
|
| 1174 | + } |
|
| 1175 | + elseif ($context != "COMMENT") { |
|
| 1176 | 1176 | watchdog( |
| 1177 | - 'boinctranslate', |
|
| 1178 | - 'The translation file %filename for %lang ended unexpectedly at line %line.', |
|
| 1179 | - array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1180 | - WATCHDOG_WARNING |
|
| 1177 | + 'boinctranslate', |
|
| 1178 | + 'The translation file %filename for %lang ended unexpectedly at line %line.', |
|
| 1179 | + array('%filename' => $file->filename, '%lang' => $lang, '%line' => $lineno), |
|
| 1180 | + WATCHDOG_WARNING |
|
| 1181 | 1181 | ); |
| 1182 | 1182 | _locale_import_message('The translation file %filename ended unexpectedly at line %line.', $file, $lineno); |
| 1183 | 1183 | return FALSE; |
| 1184 | - } |
|
| 1184 | + } |
|
| 1185 | 1185 | |
| 1186 | 1186 | } |
| 1187 | 1187 | |
@@ -1190,28 +1190,28 @@ discard block |
||
| 1190 | 1190 | */ |
| 1191 | 1191 | function _boinctranslate_locale_import_one_string($op, $value = NULL, $mode = NULL, $lang = NULL, $file = NULL, $group = 'default') { |
| 1192 | 1192 | |
| 1193 | - require_once(getcwd() . '/includes/locale.inc'); |
|
| 1193 | + require_once(getcwd() . '/includes/locale.inc'); |
|
| 1194 | 1194 | |
| 1195 | - static $report = array( |
|
| 1195 | + static $report = array( |
|
| 1196 | 1196 | 'additions' => 0, |
| 1197 | 1197 | 'updates' => 0, |
| 1198 | 1198 | 'deletes' => 0, |
| 1199 | 1199 | 'skips' => 0, |
| 1200 | - ); |
|
| 1201 | - static $headerdone = FALSE; |
|
| 1202 | - static $strings = array(); |
|
| 1200 | + ); |
|
| 1201 | + static $headerdone = FALSE; |
|
| 1202 | + static $strings = array(); |
|
| 1203 | 1203 | |
| 1204 | - switch ($op) { |
|
| 1204 | + switch ($op) { |
|
| 1205 | 1205 | // Return stored strings |
| 1206 | 1206 | case 'mem-report': |
| 1207 | 1207 | return $strings; |
| 1208 | 1208 | |
| 1209 | - // Store string in memory (only supports single strings) |
|
| 1209 | + // Store string in memory (only supports single strings) |
|
| 1210 | 1210 | case 'mem-store': |
| 1211 | 1211 | $strings[$value['msgid']] = $value['msgstr']; |
| 1212 | - return; |
|
| 1212 | + return; |
|
| 1213 | 1213 | |
| 1214 | - // Called at end of import to inform the user |
|
| 1214 | + // Called at end of import to inform the user |
|
| 1215 | 1215 | case 'db-report': |
| 1216 | 1216 | return array( |
| 1217 | 1217 | $headerdone, |
@@ -1219,57 +1219,57 @@ discard block |
||
| 1219 | 1219 | $report['updates'], |
| 1220 | 1220 | $report['deletes'], |
| 1221 | 1221 | $report['skips'], |
| 1222 | - ); |
|
| 1222 | + ); |
|
| 1223 | 1223 | |
| 1224 | - // Store the string we got in the database. |
|
| 1224 | + // Store the string we got in the database. |
|
| 1225 | 1225 | case 'db-store': |
| 1226 | 1226 | // We got header information. |
| 1227 | 1227 | if ($value['msgid'] == '') { |
| 1228 | 1228 | $languages = language_list(); |
| 1229 | 1229 | if (($mode != LOCALE_IMPORT_KEEP) || empty($languages[$lang]->plurals)) { |
| 1230 | - // Since we only need to parse the header if we ought to update the |
|
| 1231 | - // plural formula, only run this if we don't need to keep existing |
|
| 1232 | - // data untouched or if we don't have an existing plural formula. |
|
| 1233 | - $header = _locale_import_parse_header($value['msgstr']); |
|
| 1230 | + // Since we only need to parse the header if we ought to update the |
|
| 1231 | + // plural formula, only run this if we don't need to keep existing |
|
| 1232 | + // data untouched or if we don't have an existing plural formula. |
|
| 1233 | + $header = _locale_import_parse_header($value['msgstr']); |
|
| 1234 | 1234 | |
| 1235 | - // Get and store the plural formula if available. |
|
| 1236 | - if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) { |
|
| 1235 | + // Get and store the plural formula if available. |
|
| 1236 | + if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) { |
|
| 1237 | 1237 | list($nplurals, $plural) = $p; |
| 1238 | 1238 | db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang); |
| 1239 | - } |
|
| 1239 | + } |
|
| 1240 | 1240 | } |
| 1241 | 1241 | $headerdone = TRUE; |
| 1242 | - } |
|
| 1242 | + } |
|
| 1243 | 1243 | |
| 1244 | - else { |
|
| 1244 | + else { |
|
| 1245 | 1245 | // Some real string to import. |
| 1246 | 1246 | $comments = _locale_import_shorten_comments(empty($value['#']) ? array() : $value['#']); |
| 1247 | 1247 | |
| 1248 | 1248 | if (strpos($value['msgid'], "\0")) { |
| 1249 | - // This string has plural versions. |
|
| 1250 | - $english = explode("\0", $value['msgid'], 2); |
|
| 1251 | - $entries = array_keys($value['msgstr']); |
|
| 1252 | - for ($i = 3; $i <= count($entries); $i++) { |
|
| 1249 | + // This string has plural versions. |
|
| 1250 | + $english = explode("\0", $value['msgid'], 2); |
|
| 1251 | + $entries = array_keys($value['msgstr']); |
|
| 1252 | + for ($i = 3; $i <= count($entries); $i++) { |
|
| 1253 | 1253 | $english[] = $english[1]; |
| 1254 | - } |
|
| 1255 | - $translation = array_map('_locale_import_append_plural', $value['msgstr'], $entries); |
|
| 1256 | - $english = array_map('_locale_import_append_plural', $english, $entries); |
|
| 1257 | - foreach ($translation as $key => $trans) { |
|
| 1254 | + } |
|
| 1255 | + $translation = array_map('_locale_import_append_plural', $value['msgstr'], $entries); |
|
| 1256 | + $english = array_map('_locale_import_append_plural', $english, $entries); |
|
| 1257 | + foreach ($translation as $key => $trans) { |
|
| 1258 | 1258 | if ($key == 0) { |
| 1259 | - $plid = 0; |
|
| 1259 | + $plid = 0; |
|
| 1260 | 1260 | } |
| 1261 | 1261 | $plid = _boinctranslate_locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $comments, $mode, $plid, $key); |
| 1262 | - } |
|
| 1262 | + } |
|
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | else { |
| 1266 | - // A simple string to import. |
|
| 1267 | - $english = $value['msgid']; |
|
| 1268 | - $translation = $value['msgstr']; |
|
| 1269 | - _boinctranslate_locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode); |
|
| 1266 | + // A simple string to import. |
|
| 1267 | + $english = $value['msgid']; |
|
| 1268 | + $translation = $value['msgstr']; |
|
| 1269 | + _boinctranslate_locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode); |
|
| 1270 | 1270 | } |
| 1271 | - } |
|
| 1272 | - } // end of db-store operation |
|
| 1271 | + } |
|
| 1272 | + } // end of db-store operation |
|
| 1273 | 1273 | } |
| 1274 | 1274 | |
| 1275 | 1275 | /** |
@@ -1286,15 +1286,15 @@ discard block |
||
| 1286 | 1286 | */ |
| 1287 | 1287 | function _boinctranslate_locale_import_one_string_db(&$report, $langcode, $source, $translation, $textgroup, $location, $mode, $plid = NULL, $plural = NULL) { |
| 1288 | 1288 | |
| 1289 | - $ignoreoverwrite = FALSE; |
|
| 1290 | - $lid = 0; |
|
| 1289 | + $ignoreoverwrite = FALSE; |
|
| 1290 | + $lid = 0; |
|
| 1291 | 1291 | |
| 1292 | - // Use different DB query depending on the textgroup. |
|
| 1293 | - $uselocation = array("boinc", "project"); |
|
| 1294 | - if (in_array($textgroup, $uselocation)) { |
|
| 1292 | + // Use different DB query depending on the textgroup. |
|
| 1293 | + $uselocation = array("boinc", "project"); |
|
| 1294 | + if (in_array($textgroup, $uselocation)) { |
|
| 1295 | 1295 | $resource = db_query("SELECT lid FROM {locales_source} WHERE location = '%s' AND source = '%s' AND textgroup = '%s'", $location, $source, $textgroup); |
| 1296 | - } |
|
| 1297 | - else { |
|
| 1296 | + } |
|
| 1297 | + else { |
|
| 1298 | 1298 | $resource = db_query("SELECT lid FROM {locales_source} WHERE source = '%s' AND textgroup = '%s'", $source, $textgroup); |
| 1299 | 1299 | |
| 1300 | 1300 | // Parse the location string for the string ignoreoverwrite, which |
@@ -1303,61 +1303,61 @@ discard block |
||
| 1303 | 1303 | // location string. |
| 1304 | 1304 | $parts = explode(':', $location); |
| 1305 | 1305 | if (!empty($parts[2])) { |
| 1306 | - if (preg_match('/(ignoreoverwrite)/', $parts[2])) { |
|
| 1306 | + if (preg_match('/(ignoreoverwrite)/', $parts[2])) { |
|
| 1307 | 1307 | $ignoreoverwrite = TRUE; |
| 1308 | - } |
|
| 1308 | + } |
|
| 1309 | 1309 | } |
| 1310 | - }// if (in_array($textgroup, $uselocation)) |
|
| 1310 | + }// if (in_array($textgroup, $uselocation)) |
|
| 1311 | 1311 | |
| 1312 | - if (!empty($translation)) { |
|
| 1312 | + if (!empty($translation)) { |
|
| 1313 | 1313 | // Skip this string unless it passes a check for dangerous code. |
| 1314 | 1314 | // Text groups other than default still can contain HTML tags |
| 1315 | 1315 | // (i.e. translatable blocks). |
| 1316 | 1316 | if ($textgroup == "default" && !locale_string_is_safe($translation)) { |
| 1317 | - $report['skips']++; |
|
| 1318 | - $lid = 0; |
|
| 1317 | + $report['skips']++; |
|
| 1318 | + $lid = 0; |
|
| 1319 | 1319 | } |
| 1320 | 1320 | elseif ($resource) { |
| 1321 | - // We have this source string saved already. Loop over the db results from locales_source table. |
|
| 1322 | - while ($row = db_fetch_array($resource)) { |
|
| 1321 | + // We have this source string saved already. Loop over the db results from locales_source table. |
|
| 1322 | + while ($row = db_fetch_array($resource)) { |
|
| 1323 | 1323 | |
| 1324 | 1324 | $lid = $row['lid']; |
| 1325 | 1325 | // Check of if one or more translations exist for this lid in locales_target table. |
| 1326 | 1326 | $exists = (bool) db_result(db_query("SELECT lid FROM {locales_target} WHERE lid = %d AND language = '%s'", $lid, $langcode)); |
| 1327 | 1327 | if (!$exists) { |
| 1328 | - // No translation in this language, insert translation into locales_target table. |
|
| 1329 | - db_query("INSERT INTO {locales_target} (lid, language, translation, plid, plural) VALUES (%d, '%s', '%s', %d, %d)", $lid, $langcode, $translation, $plid, $plural); |
|
| 1330 | - $report['additions']++; |
|
| 1328 | + // No translation in this language, insert translation into locales_target table. |
|
| 1329 | + db_query("INSERT INTO {locales_target} (lid, language, translation, plid, plural) VALUES (%d, '%s', '%s', %d, %d)", $lid, $langcode, $translation, $plid, $plural); |
|
| 1330 | + $report['additions']++; |
|
| 1331 | 1331 | } |
| 1332 | 1332 | else if ( ($mode == LOCALE_IMPORT_OVERWRITE) and (!$ignoreoverwrite) ) { |
| 1333 | - // Translation exists, only overwrite if instructed. |
|
| 1334 | - db_query("UPDATE {locales_target} SET translation = '%s', plid = %d, plural = %d WHERE language = '%s' AND lid = %d", $translation, $plid, $plural, $langcode, $lid); |
|
| 1335 | - $report['updates']++; |
|
| 1333 | + // Translation exists, only overwrite if instructed. |
|
| 1334 | + db_query("UPDATE {locales_target} SET translation = '%s', plid = %d, plural = %d WHERE language = '%s' AND lid = %d", $translation, $plid, $plural, $langcode, $lid); |
|
| 1335 | + $report['updates']++; |
|
| 1336 | 1336 | } |
| 1337 | 1337 | else { |
| 1338 | - $report['skips']++; |
|
| 1338 | + $report['skips']++; |
|
| 1339 | 1339 | }// end if !$exists |
| 1340 | 1340 | |
| 1341 | - }// while |
|
| 1341 | + }// while |
|
| 1342 | 1342 | } |
| 1343 | - } |
|
| 1344 | - elseif ($mode == LOCALE_IMPORT_OVERWRITE AND $resource) { |
|
| 1343 | + } |
|
| 1344 | + elseif ($mode == LOCALE_IMPORT_OVERWRITE AND $resource) { |
|
| 1345 | 1345 | // Loop over db results from locales_source table. |
| 1346 | 1346 | while ($row = db_fetch_array($resource)) { |
| 1347 | - $lid = $row['lid']; |
|
| 1348 | - $exists = (bool) db_result(db_query("SELECT lid FROM {locales_target} WHERE lid = %d AND language = '%s'", $lid, $langcode)); |
|
| 1349 | - if ($exists) { |
|
| 1347 | + $lid = $row['lid']; |
|
| 1348 | + $exists = (bool) db_result(db_query("SELECT lid FROM {locales_target} WHERE lid = %d AND language = '%s'", $lid, $langcode)); |
|
| 1349 | + if ($exists) { |
|
| 1350 | 1350 | // Empty translation, remove existing if instructed. |
| 1351 | 1351 | db_query("DELETE FROM {locales_target} WHERE language = '%s' AND lid = %d AND plid = %d AND plural = %d", $langcode, $lid, $plid, $plural); |
| 1352 | 1352 | $report['deletes']++; |
| 1353 | - }// if $exists |
|
| 1353 | + }// if $exists |
|
| 1354 | 1354 | }// while |
| 1355 | - } |
|
| 1356 | - else { |
|
| 1355 | + } |
|
| 1356 | + else { |
|
| 1357 | 1357 | $report['skips']++; |
| 1358 | - } |
|
| 1358 | + } |
|
| 1359 | 1359 | |
| 1360 | - return $lid; |
|
| 1360 | + return $lid; |
|
| 1361 | 1361 | } |
| 1362 | 1362 | |
| 1363 | 1363 | |
@@ -1366,17 +1366,17 @@ discard block |
||
| 1366 | 1366 | * Parse valid resources out of configuration |
| 1367 | 1367 | */ |
| 1368 | 1368 | function boinctranslate_parse_resources($resource_text) { |
| 1369 | - $resources = array(); |
|
| 1370 | - $resource_array = explode( |
|
| 1369 | + $resources = array(); |
|
| 1370 | + $resource_array = explode( |
|
| 1371 | 1371 | "\n", $resource_text |
| 1372 | - ); |
|
| 1373 | - foreach ($resource_array as $resource) { |
|
| 1372 | + ); |
|
| 1373 | + foreach ($resource_array as $resource) { |
|
| 1374 | 1374 | $resource = trim($resource); |
| 1375 | 1375 | if ($resource AND $resource[0] != '#') { |
| 1376 | - $resources[] = $resource; |
|
| 1376 | + $resources[] = $resource; |
|
| 1377 | 1377 | } |
| 1378 | - } |
|
| 1379 | - return $resources; |
|
| 1378 | + } |
|
| 1379 | + return $resources; |
|
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * |
@@ -1403,5 +1403,5 @@ discard block |
||
| 1403 | 1403 | * database. |
| 1404 | 1404 | */ |
| 1405 | 1405 | function _boinctranslate_supertrim($instr) { |
| 1406 | - return implode("\n", array_map('trim', preg_split('/\r\n|\r|\n/', $instr) ) ); |
|
| 1406 | + return implode("\n", array_map('trim', preg_split('/\r\n|\r|\n/', $instr) ) ); |
|
| 1407 | 1407 | } |
@@ -7,85 +7,85 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | - * The BOINC translation settings form allows configuration of BTS integration |
|
| 11 | - * (and other translation related settings) |
|
| 12 | - */ |
|
| 10 | + * The BOINC translation settings form allows configuration of BTS integration |
|
| 11 | + * (and other translation related settings) |
|
| 12 | + */ |
|
| 13 | 13 | function boinctranslate_admin_settings(&$form_state) { |
| 14 | - $form = array(); |
|
| 15 | - $initialized = FALSE; |
|
| 16 | - $import_enabled = FALSE; |
|
| 17 | - $default = array( |
|
| 14 | + $form = array(); |
|
| 15 | + $initialized = FALSE; |
|
| 16 | + $import_enabled = FALSE; |
|
| 17 | + $default = array( |
|
| 18 | 18 | 'transifex_user' => variable_get('boinc_translate_transifex_user', ''), |
| 19 | 19 | 'transifex_pass' => variable_get('boinc_translate_transifex_pass', ''), |
| 20 | 20 | 'transifex_boinc_name' => variable_get( |
| 21 | - 'boinc_translate_transifex_standard_name', 'boinc' |
|
| 21 | + 'boinc_translate_transifex_standard_name', 'boinc' |
|
| 22 | 22 | ), |
| 23 | 23 | 'transifex_boinc_resources' => variable_get( |
| 24 | - 'boinc_translate_transifex_standard_resources', |
|
| 25 | - "project-generic\nweb" |
|
| 24 | + 'boinc_translate_transifex_standard_resources', |
|
| 25 | + "project-generic\nweb" |
|
| 26 | 26 | ), |
| 27 | 27 | 'transifex_boinc_drupal_resource' => variable_get( |
| 28 | - 'boinc_translate_transifex_boinc_drupal_resource', |
|
| 29 | - 'drupal' |
|
| 28 | + 'boinc_translate_transifex_boinc_drupal_resource', |
|
| 29 | + 'drupal' |
|
| 30 | 30 | ), |
| 31 | 31 | 'transifex_project_name' => variable_get( |
| 32 | - 'boinc_translate_transifex_project_name', '' |
|
| 32 | + 'boinc_translate_transifex_project_name', '' |
|
| 33 | 33 | ), |
| 34 | 34 | 'transifex_project_resources' => variable_get( |
| 35 | - 'boinc_translate_transifex_project_resources', '' |
|
| 35 | + 'boinc_translate_transifex_project_resources', '' |
|
| 36 | 36 | ), |
| 37 | - ); |
|
| 37 | + ); |
|
| 38 | 38 | |
| 39 | - if ($default['transifex_user'] AND $default['transifex_pass']) { |
|
| 39 | + if ($default['transifex_user'] AND $default['transifex_pass']) { |
|
| 40 | 40 | if (trim($default['transifex_boinc_resources']) |
| 41 | 41 | OR trim($default['transifex_project_resources'])) { |
| 42 | - $import_enabled = TRUE; |
|
| 42 | + $import_enabled = TRUE; |
|
| 43 | 43 | } |
| 44 | 44 | if ($default['transifex_boinc_name'] |
| 45 | 45 | AND $default['transifex_project_name'] |
| 46 | 46 | AND trim($default['transifex_boinc_resources']) |
| 47 | 47 | AND trim($default['transifex_project_resources'])) { |
| 48 | - $initialized = TRUE; |
|
| 48 | + $initialized = TRUE; |
|
| 49 | + } |
|
| 49 | 50 | } |
| 50 | - } |
|
| 51 | 51 | |
| 52 | - // Define the form |
|
| 52 | + // Define the form |
|
| 53 | 53 | |
| 54 | - $form['transifex'] = array( |
|
| 54 | + $form['transifex'] = array( |
|
| 55 | 55 | '#title' => t('Transifex settings'), |
| 56 | 56 | '#type' => 'fieldset', |
| 57 | 57 | '#description' => '', |
| 58 | 58 | '#collapsible' => TRUE, |
| 59 | 59 | '#collapsed' => $initialized, |
| 60 | 60 | '#attributes' => array('class' => '') |
| 61 | - ); |
|
| 62 | - $form['transifex']['boinc_translate_transifex_user'] = array( |
|
| 61 | + ); |
|
| 62 | + $form['transifex']['boinc_translate_transifex_user'] = array( |
|
| 63 | 63 | '#type' => 'textfield', |
| 64 | 64 | '#title' => t('User name'), |
| 65 | 65 | '#default_value' => $default['transifex_user'], |
| 66 | - ); |
|
| 67 | - $form['transifex']['boinc_translate_transifex_pass'] = array( |
|
| 66 | + ); |
|
| 67 | + $form['transifex']['boinc_translate_transifex_pass'] = array( |
|
| 68 | 68 | '#type' => 'password', |
| 69 | 69 | '#title' => t('Password'), |
| 70 | 70 | '#attributes' => array( |
| 71 | - 'placeholder' => $default['transifex_pass'] ? '********' : '', |
|
| 71 | + 'placeholder' => $default['transifex_pass'] ? '********' : '', |
|
| 72 | 72 | ), |
| 73 | - ); |
|
| 74 | - $form['transifex']['boinc_translate_transifex_standard_name'] = array( |
|
| 73 | + ); |
|
| 74 | + $form['transifex']['boinc_translate_transifex_standard_name'] = array( |
|
| 75 | 75 | '#type' => 'textfield', |
| 76 | 76 | '#title' => t('BOINC Transifex project'), |
| 77 | 77 | '#default_value' => $default['transifex_boinc_name'], |
| 78 | 78 | '#description' => t('The portion of the Transifex URL that identifies BOINC.'), |
| 79 | - ); |
|
| 80 | - $form['transifex']['boinc_translate_transifex_boinc_drupal_resource'] = array( |
|
| 79 | + ); |
|
| 80 | + $form['transifex']['boinc_translate_transifex_boinc_drupal_resource'] = array( |
|
| 81 | 81 | '#type' => 'textfield', |
| 82 | 82 | '#title' => t('Official BOINC Drupal Resource'), |
| 83 | 83 | '#default_value' => $default['transifex_boinc_drupal_resource'], |
| 84 | 84 | '#description' => t('The portion of the Transifex URL that identifies |
| 85 | 85 | the standard BOINC Resource to use for translation of the public |
| 86 | 86 | content defined in the Drupal system.'), |
| 87 | - ); |
|
| 88 | - $form['transifex']['boinc_translate_transifex_standard_resources'] = array( |
|
| 87 | + ); |
|
| 88 | + $form['transifex']['boinc_translate_transifex_standard_resources'] = array( |
|
| 89 | 89 | '#type' => 'textarea', |
| 90 | 90 | '#title' => t('Additional BOINC Resources'), |
| 91 | 91 | '#default_value' => $default['transifex_boinc_resources'], |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | by any matching translations found in Resources further down the list. |
| 97 | 97 | Note that strings from the Official BOINC Drupal Resource will override |
| 98 | 98 | any strings from these additional Resources.'), |
| 99 | - ); |
|
| 100 | - $form['transifex']['boinc_translate_transifex_project_name'] = array( |
|
| 99 | + ); |
|
| 100 | + $form['transifex']['boinc_translate_transifex_project_name'] = array( |
|
| 101 | 101 | '#type' => 'textfield', |
| 102 | 102 | '#title' => t('Project-specific Transifex project'), |
| 103 | 103 | '#default_value' => $default['transifex_project_name'], |
| 104 | 104 | '#description' => t('The portion of the Transifex URL that identifies this project.'), |
| 105 | - ); |
|
| 106 | - $form['transifex']['boinc_translate_transifex_project_resources'] = array( |
|
| 105 | + ); |
|
| 106 | + $form['transifex']['boinc_translate_transifex_project_resources'] = array( |
|
| 107 | 107 | '#type' => 'textarea', |
| 108 | 108 | '#title' => t('Project-specific Resources'), |
| 109 | 109 | '#default_value' => $default['transifex_project_resources'], |
@@ -116,241 +116,241 @@ discard block |
||
| 116 | 116 | NOTE: The first Resource listed here is considered the primary Resource |
| 117 | 117 | for project-specific translations and will be updated by the "Update |
| 118 | 118 | project-specific Resources" button below!'), |
| 119 | - ); |
|
| 120 | - $form['transifex']['buttons']['submit'] = array( |
|
| 119 | + ); |
|
| 120 | + $form['transifex']['buttons']['submit'] = array( |
|
| 121 | 121 | '#type' => 'submit', |
| 122 | 122 | '#value' => t('Save configuration'), |
| 123 | - ); |
|
| 123 | + ); |
|
| 124 | 124 | |
| 125 | - $form['tools'] = array( |
|
| 125 | + $form['tools'] = array( |
|
| 126 | 126 | '#title' => t('Tools'), |
| 127 | 127 | '#type' => 'fieldset', |
| 128 | 128 | '#description' => '', |
| 129 | 129 | '#collapsible' => TRUE, |
| 130 | 130 | '#collapsed' => FALSE, |
| 131 | 131 | '#attributes' => array('class' => '') |
| 132 | - ); |
|
| 133 | - $form['tools']['initialize_languages_text'] = array( |
|
| 132 | + ); |
|
| 133 | + $form['tools']['initialize_languages_text'] = array( |
|
| 134 | 134 | '#type' => 'item', |
| 135 | 135 | '#title' => t('Install official BOINC languages'), |
| 136 | 136 | '#value' => t('Installs all languages from the BOINC Transifex project. Also installs missing languages in Drupal. <br>Languages must be enabled manually in Administer > Site configuration > Languages.'), |
| 137 | - ); |
|
| 138 | - $form['tools']['initialize_languages'] = array( |
|
| 137 | + ); |
|
| 138 | + $form['tools']['initialize_languages'] = array( |
|
| 139 | 139 | '#type' => 'button', |
| 140 | 140 | '#value' => t('Install official BOINC languages'), |
| 141 | 141 | '#executes_submit_callback' => TRUE, |
| 142 | 142 | '#submit' => array('boinctranslate_admin_settings_initialize_languages'), |
| 143 | 143 | '#disabled' => !$initialized, |
| 144 | - ); |
|
| 145 | - $form['tools']['import_now_text'] = array( |
|
| 144 | + ); |
|
| 145 | + $form['tools']['import_now_text'] = array( |
|
| 146 | 146 | '#type' => 'item', |
| 147 | 147 | '#title' => t('Import all translations'), |
| 148 | 148 | '#value' => t('Imports from Tranifex all configured Resources into their respective text groups.'), |
| 149 | - ); |
|
| 150 | - $form['tools']['import_now'] = array( |
|
| 149 | + ); |
|
| 150 | + $form['tools']['import_now'] = array( |
|
| 151 | 151 | '#type' => 'button', |
| 152 | 152 | '#value' => t('Import all translations'), |
| 153 | 153 | '#executes_submit_callback' => TRUE, |
| 154 | 154 | '#submit' => array('boinctranslate_admin_settings_import_now'), |
| 155 | 155 | '#disabled' => !$import_enabled, |
| 156 | - ); |
|
| 157 | - $form['tools']['download_boinc_pot_text'] = array( |
|
| 156 | + ); |
|
| 157 | + $form['tools']['download_boinc_pot_text'] = array( |
|
| 158 | 158 | '#type' => 'item', |
| 159 | 159 | '#title' => t('Download official BOINC-Drupal .pot'), |
| 160 | 160 | '#value' => t('Downloads the generic BOINC-Drupal .pot file. This is the template file for the boinc text group.'), |
| 161 | - ); |
|
| 162 | - $form['tools']['download_boinc_pot'] = array( |
|
| 161 | + ); |
|
| 162 | + $form['tools']['download_boinc_pot'] = array( |
|
| 163 | 163 | '#type' => 'button', |
| 164 | 164 | '#value' => t('Download official BOINC-Drupal .pot'), |
| 165 | 165 | '#executes_submit_callback' => TRUE, |
| 166 | 166 | '#submit' => array('boinctranslate_admin_settings_download_boinc_pot'), |
| 167 | 167 | '#disabled' => !$import_enabled, |
| 168 | - ); |
|
| 169 | - $form['tools']['download_project_pot_text'] = array( |
|
| 168 | + ); |
|
| 169 | + $form['tools']['download_project_pot_text'] = array( |
|
| 170 | 170 | '#type' => 'item', |
| 171 | 171 | '#title' => t('Download project-specific .pot'), |
| 172 | 172 | '#value' => t('Downloads the project-specific .pot file. This is the template file for the project text group.'), |
| 173 | - ); |
|
| 174 | - $form['tools']['download_project_pot'] = array( |
|
| 173 | + ); |
|
| 174 | + $form['tools']['download_project_pot'] = array( |
|
| 175 | 175 | '#type' => 'button', |
| 176 | 176 | '#value' => t('Download project-specific .pot'), |
| 177 | 177 | '#executes_submit_callback' => TRUE, |
| 178 | 178 | '#submit' => array('boinctranslate_admin_settings_download_project_pot'), |
| 179 | 179 | '#disabled' => !$import_enabled, |
| 180 | - ); |
|
| 181 | - if (user_access('update official BOINC translations')) { |
|
| 180 | + ); |
|
| 181 | + if (user_access('update official BOINC translations')) { |
|
| 182 | 182 | $form['tools']['update_official_boinc_text'] = array( |
| 183 | - '#type' => 'item', |
|
| 184 | - '#title' => t('Update official BOINC translations'), |
|
| 185 | - '#value' => t('Updates the official BOINC-Drupal Resource (translatable strings templates) to the BOINC Transifex project, based on the consolidated imported translations.<br><b>WARNING: Do not use unless you have write-access to the BOINC Transifex project.</b>'), |
|
| 183 | + '#type' => 'item', |
|
| 184 | + '#title' => t('Update official BOINC translations'), |
|
| 185 | + '#value' => t('Updates the official BOINC-Drupal Resource (translatable strings templates) to the BOINC Transifex project, based on the consolidated imported translations.<br><b>WARNING: Do not use unless you have write-access to the BOINC Transifex project.</b>'), |
|
| 186 | 186 | ); |
| 187 | 187 | $form['tools']['update_official_boinc'] = array( |
| 188 | - '#type' => 'button', |
|
| 189 | - '#value' => t('Update official BOINC translations'), |
|
| 190 | - '#executes_submit_callback' => TRUE, |
|
| 191 | - '#submit' => array('boinctranslate_admin_settings_update_official_boinc'), |
|
| 192 | - '#disabled' => !$import_enabled, |
|
| 188 | + '#type' => 'button', |
|
| 189 | + '#value' => t('Update official BOINC translations'), |
|
| 190 | + '#executes_submit_callback' => TRUE, |
|
| 191 | + '#submit' => array('boinctranslate_admin_settings_update_official_boinc'), |
|
| 192 | + '#disabled' => !$import_enabled, |
|
| 193 | 193 | ); |
| 194 | - } |
|
| 195 | - $form['tools']['export_now_text'] = array( |
|
| 194 | + } |
|
| 195 | + $form['tools']['export_now_text'] = array( |
|
| 196 | 196 | '#type' => 'item', |
| 197 | 197 | '#title' => t('Update project-specific Resources'), |
| 198 | 198 | '#value' => t('Updates the configured Resources (translatable strings templates) to the project\'s Transifex project.<br><b>WARNING: Do not use unless you have write-access to your project\'s Transifex project.</b>'), |
| 199 | - ); |
|
| 200 | - $form['tools']['export_now'] = array( |
|
| 199 | + ); |
|
| 200 | + $form['tools']['export_now'] = array( |
|
| 201 | 201 | '#type' => 'button', |
| 202 | 202 | '#value' => t('Update project-specific Resources'), |
| 203 | 203 | '#executes_submit_callback' => TRUE, |
| 204 | 204 | '#submit' => array('boinctranslate_admin_settings_export_now'), |
| 205 | 205 | '#disabled' => !$import_enabled, |
| 206 | - ); |
|
| 206 | + ); |
|
| 207 | 207 | |
| 208 | - $form['#submit'][] = 'system_settings_form_submit'; |
|
| 209 | - $form['#theme'] = 'system_settings_form'; |
|
| 208 | + $form['#submit'][] = 'system_settings_form_submit'; |
|
| 209 | + $form['#theme'] = 'system_settings_form'; |
|
| 210 | 210 | |
| 211 | - return $form; |
|
| 211 | + return $form; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | function boinctranslate_admin_settings_export_now() { |
| 215 | - drupal_goto('admin/boinc/translation/export'); |
|
| 215 | + drupal_goto('admin/boinc/translation/export'); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | function boinctranslate_admin_settings_import_now() { |
| 219 | - drupal_goto('admin/boinc/translation/import'); |
|
| 219 | + drupal_goto('admin/boinc/translation/import'); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | function boinctranslate_admin_settings_initialize_languages() { |
| 223 | - drupal_goto('admin/boinc/translation/initialize-languages'); |
|
| 223 | + drupal_goto('admin/boinc/translation/initialize-languages'); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | function boinctranslate_admin_settings_update_official_boinc() { |
| 227 | - drupal_goto('admin/boinc/translation/update-official-boinc'); |
|
| 227 | + drupal_goto('admin/boinc/translation/update-official-boinc'); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | function boinctranslate_admin_settings_download_boinc_pot() { |
| 231 | - drupal_goto('admin/boinc/translation/download-pot/boinc'); |
|
| 231 | + drupal_goto('admin/boinc/translation/download-pot/boinc'); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | function boinctranslate_admin_settings_download_project_pot() { |
| 235 | - drupal_goto('admin/boinc/translation/download-pot/project'); |
|
| 235 | + drupal_goto('admin/boinc/translation/download-pot/project'); |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | |
| 239 | 239 | /** |
| 240 | - * Validate the BOINC translation settings form. |
|
| 241 | - */ |
|
| 240 | + * Validate the BOINC translation settings form. |
|
| 241 | + */ |
|
| 242 | 242 | function boinctranslate_admin_settings_validate($form, &$form_state) { |
| 243 | - $values = $form_state['values']; |
|
| 244 | - $errors = array(); |
|
| 245 | - $api_base_url = 'https://www.transifex.com/api/2'; |
|
| 243 | + $values = $form_state['values']; |
|
| 244 | + $errors = array(); |
|
| 245 | + $api_base_url = 'https://www.transifex.com/api/2'; |
|
| 246 | 246 | |
| 247 | - if (!$values['boinc_translate_transifex_user']) { |
|
| 247 | + if (!$values['boinc_translate_transifex_user']) { |
|
| 248 | 248 | form_set_error('boinc_translate_transifex_user', t('User name is required.')); |
| 249 | - } |
|
| 250 | - if (!$values['boinc_translate_transifex_pass']) { |
|
| 249 | + } |
|
| 250 | + if (!$values['boinc_translate_transifex_pass']) { |
|
| 251 | 251 | if (!variable_get('boinc_translate_transifex_pass', '')) { |
| 252 | - form_set_error('boinc_translate_transifex_pass', t('Password is required.')); |
|
| 252 | + form_set_error('boinc_translate_transifex_pass', t('Password is required.')); |
|
| 253 | 253 | } |
| 254 | 254 | else { |
| 255 | - unset($form_state['values']['boinc_translate_transifex_pass']); |
|
| 255 | + unset($form_state['values']['boinc_translate_transifex_pass']); |
|
| 256 | + } |
|
| 256 | 257 | } |
| 257 | - } |
|
| 258 | - if (!$values['boinc_translate_transifex_standard_name']) { |
|
| 258 | + if (!$values['boinc_translate_transifex_standard_name']) { |
|
| 259 | 259 | form_set_error('boinc_translate_transifex_standard_name', |
| 260 | - t('BOINC Transifex project name is required.') |
|
| 260 | + t('BOINC Transifex project name is required.') |
|
| 261 | 261 | ); |
| 262 | - } |
|
| 263 | - if (!$values['boinc_translate_transifex_standard_resources']) { |
|
| 262 | + } |
|
| 263 | + if (!$values['boinc_translate_transifex_standard_resources']) { |
|
| 264 | 264 | form_set_error('boinc_translate_transifex_standard_resources', |
| 265 | - t('At least one BOINC Transifex project Resource is required.') |
|
| 265 | + t('At least one BOINC Transifex project Resource is required.') |
|
| 266 | 266 | ); |
| 267 | - } |
|
| 268 | - if (!$values['boinc_translate_transifex_project_resources']) { |
|
| 267 | + } |
|
| 268 | + if (!$values['boinc_translate_transifex_project_resources']) { |
|
| 269 | 269 | form_set_error('boinc_translate_transifex_project_resources', |
| 270 | - t('At least one project-specific Transifex Resource is required.') |
|
| 270 | + t('At least one project-specific Transifex Resource is required.') |
|
| 271 | 271 | ); |
| 272 | - } |
|
| 272 | + } |
|
| 273 | 273 | |
| 274 | - $username = $values['boinc_translate_transifex_user']; |
|
| 275 | - $password = ($values['boinc_translate_transifex_pass']) ? $values['boinc_translate_transifex_pass'] : variable_get('boinc_translate_transifex_pass', ''); |
|
| 276 | - $boinc_name = $values['boinc_translate_transifex_standard_name']; |
|
| 277 | - $boinc_resources = boinctranslate_parse_resources( |
|
| 274 | + $username = $values['boinc_translate_transifex_user']; |
|
| 275 | + $password = ($values['boinc_translate_transifex_pass']) ? $values['boinc_translate_transifex_pass'] : variable_get('boinc_translate_transifex_pass', ''); |
|
| 276 | + $boinc_name = $values['boinc_translate_transifex_standard_name']; |
|
| 277 | + $boinc_resources = boinctranslate_parse_resources( |
|
| 278 | 278 | $values['boinc_translate_transifex_standard_resources'] |
| 279 | - ); |
|
| 279 | + ); |
|
| 280 | 280 | |
| 281 | - if ($username AND $password AND $boinc_name AND $boinc_resources) { |
|
| 281 | + if ($username AND $password AND $boinc_name AND $boinc_resources) { |
|
| 282 | 282 | // Test authentication |
| 283 | 283 | $authenticated = FALSE; |
| 284 | 284 | $path = "project/{$boinc_name}/resource/{$boinc_resources[0]}/translation/en"; |
| 285 | 285 | $response = boinctranslate_transifex_request($path, NULL, TRUE, FALSE, $username, $password); |
| 286 | 286 | |
| 287 | 287 | if ($response) { |
| 288 | - if ($response == '401 UNAUTHORIZED') { |
|
| 288 | + if ($response == '401 UNAUTHORIZED') { |
|
| 289 | 289 | form_set_error( |
| 290 | - 'boinc_translate_transifex_pass', |
|
| 291 | - t('Transifex authentication failed.') |
|
| 290 | + 'boinc_translate_transifex_pass', |
|
| 291 | + t('Transifex authentication failed.') |
|
| 292 | 292 | ); |
| 293 | - } |
|
| 294 | - else { |
|
| 293 | + } |
|
| 294 | + else { |
|
| 295 | 295 | $authenticated = TRUE; |
| 296 | - } |
|
| 296 | + } |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | if ($authenticated) { |
| 300 | - // Prepare list of resources to validate |
|
| 301 | - $transifex_resources = array( |
|
| 300 | + // Prepare list of resources to validate |
|
| 301 | + $transifex_resources = array( |
|
| 302 | 302 | 'boinc' => $boinc_resources, |
| 303 | - ); |
|
| 304 | - // Parse project-specific resources |
|
| 305 | - $project_name = trim($values['boinc_translate_transifex_project_name']); |
|
| 306 | - $project_resources = boinctranslate_parse_resources( |
|
| 303 | + ); |
|
| 304 | + // Parse project-specific resources |
|
| 305 | + $project_name = trim($values['boinc_translate_transifex_project_name']); |
|
| 306 | + $project_resources = boinctranslate_parse_resources( |
|
| 307 | 307 | $values['boinc_translate_transifex_project_resources'] |
| 308 | - ); |
|
| 309 | - if ($project_name AND $project_resources) { |
|
| 308 | + ); |
|
| 309 | + if ($project_name AND $project_resources) { |
|
| 310 | 310 | $transifex_resources[$project_name] = $project_resources; |
| 311 | - } |
|
| 312 | - elseif ($project_name AND !$project_resources) { |
|
| 311 | + } |
|
| 312 | + elseif ($project_name AND !$project_resources) { |
|
| 313 | 313 | drupal_set_message( |
| 314 | - t('No project-specific resources were provided'), |
|
| 315 | - 'warning' |
|
| 314 | + t('No project-specific resources were provided'), |
|
| 315 | + 'warning' |
|
| 316 | 316 | ); |
| 317 | - } |
|
| 318 | - elseif ($project_resources AND !$project_name) { |
|
| 317 | + } |
|
| 318 | + elseif ($project_resources AND !$project_name) { |
|
| 319 | 319 | drupal_set_message( |
| 320 | - t('No project-specific Transifex project name was provided'), |
|
| 321 | - 'warning' |
|
| 320 | + t('No project-specific Transifex project name was provided'), |
|
| 321 | + 'warning' |
|
| 322 | 322 | ); |
| 323 | - } |
|
| 323 | + } |
|
| 324 | 324 | |
| 325 | - // Try to access the given resources |
|
| 326 | - foreach ($transifex_resources as $project => $resources) { |
|
| 325 | + // Try to access the given resources |
|
| 326 | + foreach ($transifex_resources as $project => $resources) { |
|
| 327 | 327 | foreach ($resources as $resource) { |
| 328 | 328 | |
| 329 | - $path = "project/{$project}/resource/{$resource}/translation/en"; |
|
| 330 | - $response = boinctranslate_transifex_request($path); |
|
| 329 | + $path = "project/{$project}/resource/{$resource}/translation/en"; |
|
| 330 | + $response = boinctranslate_transifex_request($path); |
|
| 331 | 331 | |
| 332 | - if ($response == '404 NOT FOUND') { |
|
| 332 | + if ($response == '404 NOT FOUND') { |
|
| 333 | 333 | form_set_error( |
| 334 | - 'boinc_translate_transifex_' . ($project == $boinc_name ? 'standard' : 'project') . '_resources', |
|
| 335 | - t('Resource %name not found in %project.', |
|
| 334 | + 'boinc_translate_transifex_' . ($project == $boinc_name ? 'standard' : 'project') . '_resources', |
|
| 335 | + t('Resource %name not found in %project.', |
|
| 336 | 336 | array( |
| 337 | - '%name' => $resource, |
|
| 338 | - '%project' => $project, |
|
| 337 | + '%name' => $resource, |
|
| 338 | + '%project' => $project, |
|
| 339 | + ) |
|
| 339 | 340 | ) |
| 340 | - ) |
|
| 341 | 341 | ); |
| 342 | - } |
|
| 342 | + } |
|
| 343 | 343 | } |
| 344 | - } |
|
| 344 | + } |
|
| 345 | + } |
|
| 345 | 346 | } |
| 346 | - } |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | /** |
| 350 | - * Handle post-validation submission of BOINC translation settings form. |
|
| 351 | - */ |
|
| 350 | + * Handle post-validation submission of BOINC translation settings form. |
|
| 351 | + */ |
|
| 352 | 352 | function boinctranslate_admin_settings_submit($form, &$form_state) { |
| 353 | - drupal_set_message(t('BOINC translation settings have been updated.')); |
|
| 353 | + drupal_set_message(t('BOINC translation settings have been updated.')); |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | |
@@ -7,191 +7,191 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | - * The BOINC community form allows the setting of requirements for interaction |
|
| 11 | - * in the community sections of the site. |
|
| 12 | - */ |
|
| 10 | + * The BOINC community form allows the setting of requirements for interaction |
|
| 11 | + * in the community sections of the site. |
|
| 12 | + */ |
|
| 13 | 13 | function boinccore_admin_community(&$form_state) { |
| 14 | - $form = array(); |
|
| 15 | - $default = array( |
|
| 14 | + $form = array(); |
|
| 15 | + $default = array( |
|
| 16 | 16 | 'min_credit_to_post' => variable_get('boinc_comment_min_credit', 0), |
| 17 | 17 | 'penalty_period' => variable_get('boinc_penalty_period', 7*24*60*60), |
| 18 | 18 | 'moderator_mailing_list' => variable_get('boinc_moderator_mailing_list', ''), |
| 19 | 19 | 'moderator_force_individual_notifications' => variable_get('boinc_moderator_force_individual_notifications', 0), |
| 20 | - ); |
|
| 20 | + ); |
|
| 21 | 21 | |
| 22 | - // Define the form |
|
| 23 | - $form['boinc_comment_min_credit'] = array( |
|
| 22 | + // Define the form |
|
| 23 | + $form['boinc_comment_min_credit'] = array( |
|
| 24 | 24 | '#type' => 'textfield', |
| 25 | 25 | '#title' => t('Credit required for community participation'), |
| 26 | 26 | '#default_value' => $default['min_credit_to_post'], |
| 27 | 27 | '#description' => t('Set a minimum threshold of credit a user must have |
| 28 | 28 | earned before being allowed to create a profile, post comments or participate in forums.'), |
| 29 | - ); |
|
| 30 | - $form['boinc_penalty_period'] = array( |
|
| 29 | + ); |
|
| 30 | + $form['boinc_penalty_period'] = array( |
|
| 31 | 31 | '#type' => 'textfield', |
| 32 | 32 | '#title' => t('Penalty period'), |
| 33 | 33 | '#default_value' => $default['penalty_period'], |
| 34 | 34 | '#description' => t('The amount of time (in seconds) that user privileges |
| 35 | 35 | are revoked when a user is banned from community participation.'), |
| 36 | - ); |
|
| 37 | - $form['boinc_moderator_mailing_list'] = array( |
|
| 36 | + ); |
|
| 37 | + $form['boinc_moderator_mailing_list'] = array( |
|
| 38 | 38 | '#type' => 'textfield', |
| 39 | 39 | '#title' => t('Moderator mailing list'), |
| 40 | 40 | '#default_value' => $default['moderator_mailing_list'], |
| 41 | 41 | '#description' => t('As an alternative to sending moderator notifications |
| 42 | 42 | to individual users with the moderator role, enter a mailing list address |
| 43 | 43 | here to be the only target of the notification emails.'), |
| 44 | - ); |
|
| 45 | - $form['boinc_moderator_force_individual_notifications'] = array( |
|
| 44 | + ); |
|
| 45 | + $form['boinc_moderator_force_individual_notifications'] = array( |
|
| 46 | 46 | '#type' => 'checkbox', |
| 47 | 47 | '#title' => t('Always send individual notifications'), |
| 48 | 48 | '#default_value' => $default['moderator_force_individual_notifications'], |
| 49 | 49 | '#description' => t('Continue to send individual moderator notification |
| 50 | 50 | emails even when a mailing list is provided.'), |
| 51 | - ); |
|
| 51 | + ); |
|
| 52 | 52 | |
| 53 | - $form['tools'] = array( |
|
| 53 | + $form['tools'] = array( |
|
| 54 | 54 | '#title' => t('Tools'), |
| 55 | 55 | '#type' => 'fieldset', |
| 56 | 56 | '#description' => '', |
| 57 | 57 | '#collapsible' => TRUE, |
| 58 | 58 | '#collapsed' => FALSE, |
| 59 | 59 | '#attributes' => array('class' => '') |
| 60 | - ); |
|
| 61 | - $form['tools']['reset_uotd'] = array( |
|
| 60 | + ); |
|
| 61 | + $form['tools']['reset_uotd'] = array( |
|
| 62 | 62 | '#type' => 'submit', |
| 63 | 63 | '#value' => t('Force new UOTD'), |
| 64 | 64 | '#submit' => array('boinccore_reset_user_of_the_day'), |
| 65 | - ); |
|
| 65 | + ); |
|
| 66 | 66 | |
| 67 | - return system_settings_form($form); |
|
| 67 | + return system_settings_form($form); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * Validate the BOINC community form. |
|
| 72 | - */ |
|
| 71 | + * Validate the BOINC community form. |
|
| 72 | + */ |
|
| 73 | 73 | function boinccore_admin_community_validate($form, &$form_state) { |
| 74 | - $values = $form_state['values']; |
|
| 75 | - if (!is_numeric($values['boinc_comment_min_credit'])) { |
|
| 74 | + $values = $form_state['values']; |
|
| 75 | + if (!is_numeric($values['boinc_comment_min_credit'])) { |
|
| 76 | 76 | form_set_error('boinc_comment_min_credit', t('The minimum credit value must be a number.')); |
| 77 | - } |
|
| 77 | + } |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | - * Handle post-validation submission of BOINC community form. |
|
| 82 | - */ |
|
| 81 | + * Handle post-validation submission of BOINC community form. |
|
| 82 | + */ |
|
| 83 | 83 | function boinccore_admin_community_submit($form, &$form_state) { |
| 84 | - drupal_set_message(t('BOINC community settings have been updated.')); |
|
| 84 | + drupal_set_message(t('BOINC community settings have been updated.')); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Force a reset of the user of the day |
| 89 | 89 | */ |
| 90 | 90 | function boinccore_reset_user_of_the_day() { |
| 91 | - if (boincuser_select_user_of_the_day()) { |
|
| 91 | + if (boincuser_select_user_of_the_day()) { |
|
| 92 | 92 | drupal_set_message(t('The user of the day has been reset.')); |
| 93 | - } |
|
| 93 | + } |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | - * The standard page generator form provides an interface to create standard |
|
| 98 | - * pages, such as a Help or About page. |
|
| 99 | - */ |
|
| 97 | + * The standard page generator form provides an interface to create standard |
|
| 98 | + * pages, such as a Help or About page. |
|
| 99 | + */ |
|
| 100 | 100 | function boinccore_admin_default_content(&$form_state) { |
| 101 | - $form = array(); |
|
| 101 | + $form = array(); |
|
| 102 | 102 | |
| 103 | - // Define the form |
|
| 104 | - $form['page'] = array( |
|
| 103 | + // Define the form |
|
| 104 | + $form['page'] = array( |
|
| 105 | 105 | '#type' => 'select', |
| 106 | 106 | '#title' => t('Generate default content for'), |
| 107 | 107 | '#description' => t('Generate some standard pages for a Drupal-BOINC Web site. You may generate all pages or specific pages. If a page already exists, it will <b>not</b> be overwritten. Pages will be generated with the path \'/page\', e.g., \'/help\'. Note the absense of \'content/\'.<p>The pages generated here will have very limited content. Most will have content such as \'Add a link to your FAQ here.\', and it is the admin or editors responsibility to add the necessary content.'), |
| 108 | 108 | '#options' => array( |
| 109 | - 0 => t('All standard pages'), |
|
| 109 | + 0 => t('All standard pages'), |
|
| 110 | 110 | // 'about' => t('About page'), |
| 111 | - 'help' => t('Help page'), |
|
| 112 | - 'rules' => t('Rules and Policies page'), |
|
| 113 | - 'moderation' => t('Moderation information page'), |
|
| 111 | + 'help' => t('Help page'), |
|
| 112 | + 'rules' => t('Rules and Policies page'), |
|
| 113 | + 'moderation' => t('Moderation information page'), |
|
| 114 | 114 | ), |
| 115 | - ); |
|
| 116 | - $form['submit'] = array( |
|
| 115 | + ); |
|
| 116 | + $form['submit'] = array( |
|
| 117 | 117 | '#type' => 'submit', |
| 118 | 118 | '#value' => 'Generate content', |
| 119 | - ); |
|
| 119 | + ); |
|
| 120 | 120 | |
| 121 | - return $form; |
|
| 121 | + return $form; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | - * Generate content based on the selection made on the form |
|
| 126 | - */ |
|
| 125 | + * Generate content based on the selection made on the form |
|
| 126 | + */ |
|
| 127 | 127 | function boinccore_admin_default_content_submit($form, &$form_state) { |
| 128 | - $option = $form_state['values']['page']; |
|
| 129 | - $page_list = boinccore_admin_default_content_generate($option); |
|
| 130 | - $pages_generated = count($page_list); |
|
| 131 | - if ($pages_generated > 0) { |
|
| 128 | + $option = $form_state['values']['page']; |
|
| 129 | + $page_list = boinccore_admin_default_content_generate($option); |
|
| 130 | + $pages_generated = count($page_list); |
|
| 131 | + if ($pages_generated > 0) { |
|
| 132 | 132 | switch ($pages_generated) { |
| 133 | 133 | case 1: |
| 134 | 134 | $page_list = reset($page_list); |
| 135 | - break; |
|
| 135 | + break; |
|
| 136 | 136 | case 2: |
| 137 | 137 | $page_list = implode(' and ', $page_list); |
| 138 | - break; |
|
| 138 | + break; |
|
| 139 | 139 | default: |
| 140 | 140 | end($page_list); |
| 141 | - $page_list[key($page_list)] = 'and ' . $page_list[key($page_list)]; |
|
| 142 | - $page_list = implode(', ', $page_list); |
|
| 141 | + $page_list[key($page_list)] = 'and ' . $page_list[key($page_list)]; |
|
| 142 | + $page_list = implode(', ', $page_list); |
|
| 143 | 143 | } |
| 144 | 144 | drupal_set_message(t('Default content has been generated for the @listed |
| 145 | 145 | @pages.', array( |
| 146 | 146 | '@listed' => $page_list, |
| 147 | 147 | '@pages' => format_plural($pages_generated, 'page', 'pages'), |
| 148 | - ) |
|
| 148 | + ) |
|
| 149 | 149 | )); |
| 150 | - } |
|
| 151 | - else { |
|
| 150 | + } |
|
| 151 | + else { |
|
| 152 | 152 | if ($option) { |
| 153 | - drupal_set_message(t('The @specified page already exists.', |
|
| 153 | + drupal_set_message(t('The @specified page already exists.', |
|
| 154 | 154 | array('@specified' => $option)), 'warning'); |
| 155 | 155 | } |
| 156 | 156 | else { |
| 157 | - drupal_set_message(t('All pages already exist, so none can be recreated |
|
| 157 | + drupal_set_message(t('All pages already exist, so none can be recreated |
|
| 158 | 158 | automatically.'), 'warning'); |
| 159 | 159 | } |
| 160 | 160 | drupal_set_message(t('To recreate a page, first delete the existing page (or |
| 161 | 161 | remove its URL alias), then try this function again.'), 'warning'); |
| 162 | - } |
|
| 162 | + } |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | - * |
|
| 167 | - */ |
|
| 166 | + * |
|
| 167 | + */ |
|
| 168 | 168 | function boinccore_admin_default_content_generate($pages = array()) { |
| 169 | - if (!$pages) { |
|
| 169 | + if (!$pages) { |
|
| 170 | 170 | // If not specified, attempt to generate all pages by default |
| 171 | 171 | $pages = array( |
| 172 | - 'help', |
|
| 172 | + 'help', |
|
| 173 | 173 | // 'about', |
| 174 | - 'rules', |
|
| 175 | - 'moderation', |
|
| 174 | + 'rules', |
|
| 175 | + 'moderation', |
|
| 176 | 176 | ); |
| 177 | - } |
|
| 178 | - elseif (!is_array($pages)) { |
|
| 177 | + } |
|
| 178 | + elseif (!is_array($pages)) { |
|
| 179 | 179 | $pages = array($pages); |
| 180 | - } |
|
| 180 | + } |
|
| 181 | 181 | |
| 182 | - $pages_generated = array(); |
|
| 183 | - if (in_array('about', $pages)) { |
|
| 182 | + $pages_generated = array(); |
|
| 183 | + if (in_array('about', $pages)) { |
|
| 184 | 184 | // Create the default About page, if it doesn't exist |
| 185 | 185 | // TODO: what is the default About page...? |
| 186 | 186 | if (!drupal_lookup_path('source', 'about')) { |
| 187 | - drupal_set_message('The about page doesn\'t yet have a definition...', 'warning'); |
|
| 188 | - //$pages_generated[] = 'about'; |
|
| 187 | + drupal_set_message('The about page doesn\'t yet have a definition...', 'warning'); |
|
| 188 | + //$pages_generated[] = 'about'; |
|
| 189 | + } |
|
| 189 | 190 | } |
| 190 | - } |
|
| 191 | - if (in_array('help', $pages)) { |
|
| 191 | + if (in_array('help', $pages)) { |
|
| 192 | 192 | // Create the default Help page, if it doesn't exist |
| 193 | 193 | if (!drupal_lookup_path('source', 'help')) { |
| 194 | - $node = array( |
|
| 194 | + $node = array( |
|
| 195 | 195 | 'type' => 'page', |
| 196 | 196 | 'title' => t('Help'), |
| 197 | 197 | 'uid' => 1, |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | 'comment' => 0, // disable comments |
| 205 | 205 | 'moderate' => 0, |
| 206 | 206 | 'body' => preg_replace('/>\s+</', '><', |
| 207 | - '<p>Use this page to provide help and support for your site\'s |
|
| 207 | + '<p>Use this page to provide help and support for your site\'s |
|
| 208 | 208 | visitors:</p> |
| 209 | 209 | <ul> |
| 210 | 210 | <li>Add a link to your primary forum for getting help</li> |
@@ -215,25 +215,25 @@ discard block |
||
| 215 | 215 | 'sticky' => 0, |
| 216 | 216 | 'format' => 4, |
| 217 | 217 | //'teaser' => $teaser, |
| 218 | - ); |
|
| 219 | - $node = (object) $node; // node_save requires an object |
|
| 220 | - node_save($node); |
|
| 218 | + ); |
|
| 219 | + $node = (object) $node; // node_save requires an object |
|
| 220 | + node_save($node); |
|
| 221 | 221 | |
| 222 | - $item = array( |
|
| 222 | + $item = array( |
|
| 223 | 223 | 'link_path' => drupal_get_normal_path('help'), |
| 224 | 224 | 'link_title' => t('Help'), |
| 225 | 225 | 'menu_name' => 'primary-links', |
| 226 | 226 | 'weight' => 50, |
| 227 | - ); |
|
| 228 | - menu_link_save($item); |
|
| 229 | - $pages_generated[] = 'help'; |
|
| 227 | + ); |
|
| 228 | + menu_link_save($item); |
|
| 229 | + $pages_generated[] = 'help'; |
|
| 230 | 230 | } |
| 231 | - } |
|
| 232 | - if (in_array('rules', $pages)) { |
|
| 231 | + } |
|
| 232 | + if (in_array('rules', $pages)) { |
|
| 233 | 233 | // Create the default Rules page, if it doesn't exist |
| 234 | 234 | if (!drupal_lookup_path('source', 'rules-and-policies')) { |
| 235 | - // Create node |
|
| 236 | - $node = array( |
|
| 235 | + // Create node |
|
| 236 | + $node = array( |
|
| 237 | 237 | 'type' => 'page', |
| 238 | 238 | 'title' => t('Rules and Policies'), |
| 239 | 239 | 'uid' => 1, |
@@ -246,30 +246,30 @@ discard block |
||
| 246 | 246 | 'comment' => 0, // disable comments |
| 247 | 247 | 'moderate' => 0, |
| 248 | 248 | 'body' => preg_replace('/>\s+</', '><', |
| 249 | - '<p>Use this page to list your sites rules and policies.</p>'), |
|
| 249 | + '<p>Use this page to list your sites rules and policies.</p>'), |
|
| 250 | 250 | 'sticky' => 0, |
| 251 | 251 | 'format' => 4, |
| 252 | 252 | //'teaser' => $teaser, |
| 253 | - ); |
|
| 254 | - $node = (object) $node; // node_save requires an object |
|
| 255 | - node_save($node); |
|
| 253 | + ); |
|
| 254 | + $node = (object) $node; // node_save requires an object |
|
| 255 | + node_save($node); |
|
| 256 | 256 | |
| 257 | - // Create menu item to node |
|
| 258 | - $item = array( |
|
| 257 | + // Create menu item to node |
|
| 258 | + $item = array( |
|
| 259 | 259 | 'link_path' => drupal_get_normal_path('rules-and-policies'), |
| 260 | 260 | 'link_title' => t('Rules and Policies'), |
| 261 | 261 | 'menu_name' => 'menu-footer-links', |
| 262 | 262 | 'weight' => 0, |
| 263 | - ); |
|
| 264 | - menu_link_save($item); |
|
| 265 | - $pages_generated[] = 'rules-and-policies'; |
|
| 263 | + ); |
|
| 264 | + menu_link_save($item); |
|
| 265 | + $pages_generated[] = 'rules-and-policies'; |
|
| 266 | + } |
|
| 266 | 267 | } |
| 267 | - } |
|
| 268 | - if (in_array('moderation', $pages)) { |
|
| 268 | + if (in_array('moderation', $pages)) { |
|
| 269 | 269 | // Create the default Moderation page, if it doesn't exist |
| 270 | 270 | if (!drupal_lookup_path('source', 'moderation')) { |
| 271 | - // Create node |
|
| 272 | - $node = array( |
|
| 271 | + // Create node |
|
| 272 | + $node = array( |
|
| 273 | 273 | 'type' => 'page', |
| 274 | 274 | 'title' => t('Moderation'), |
| 275 | 275 | 'uid' => 1, |
@@ -282,27 +282,27 @@ discard block |
||
| 282 | 282 | 'comment' => 0, // disable comments |
| 283 | 283 | 'moderate' => 0, |
| 284 | 284 | 'body' => preg_replace('/>\s+</', '><', |
| 285 | - '<p>Use this page to describe your sites moderation policy.</p>'), |
|
| 285 | + '<p>Use this page to describe your sites moderation policy.</p>'), |
|
| 286 | 286 | 'sticky' => 0, |
| 287 | 287 | 'format' => 4, |
| 288 | 288 | //'teaser' => $teaser, |
| 289 | - ); |
|
| 290 | - $node = (object) $node; // node_save requires an object |
|
| 291 | - node_save($node); |
|
| 289 | + ); |
|
| 290 | + $node = (object) $node; // node_save requires an object |
|
| 291 | + node_save($node); |
|
| 292 | 292 | |
| 293 | - // Create menu item to node |
|
| 294 | - $item = array( |
|
| 293 | + // Create menu item to node |
|
| 294 | + $item = array( |
|
| 295 | 295 | 'link_path' => drupal_get_normal_path('moderation'), |
| 296 | 296 | 'link_title' => t('Moderation'), |
| 297 | 297 | 'menu_name' => 'menu-footer-links', |
| 298 | 298 | 'weight' => 0, |
| 299 | - ); |
|
| 300 | - menu_link_save($item); |
|
| 301 | - $pages_generated[] = 'moderation'; |
|
| 299 | + ); |
|
| 300 | + menu_link_save($item); |
|
| 301 | + $pages_generated[] = 'moderation'; |
|
| 302 | + } |
|
| 302 | 303 | } |
| 303 | - } |
|
| 304 | 304 | |
| 305 | - // Rebuild drupal menus |
|
| 306 | - menu_rebuild(); |
|
| 307 | - return $pages_generated; |
|
| 305 | + // Rebuild drupal menus |
|
| 306 | + menu_rebuild(); |
|
| 307 | + return $pages_generated; |
|
| 308 | 308 | } |
@@ -29,22 +29,22 @@ discard block |
||
| 29 | 29 | * with defined URL paths |
| 30 | 30 | */ |
| 31 | 31 | function boinccore_menu() { |
| 32 | - $items['node_control'] = array( |
|
| 32 | + $items['node_control'] = array( |
|
| 33 | 33 | 'page callback' => 'boinccore_node_control', |
| 34 | 34 | 'access arguments' => array('access content'), |
| 35 | 35 | 'type' => MENU_CALLBACK |
| 36 | - ); |
|
| 37 | - $items['comment_control'] = array( |
|
| 36 | + ); |
|
| 37 | + $items['comment_control'] = array( |
|
| 38 | 38 | 'page callback' => 'boinccore_comment_control', |
| 39 | 39 | 'access arguments' => array('administer comments'), |
| 40 | 40 | 'type' => MENU_CALLBACK |
| 41 | - ); |
|
| 42 | - $items['goto'] = array( |
|
| 41 | + ); |
|
| 42 | + $items['goto'] = array( |
|
| 43 | 43 | 'page callback' => 'boinccore_url_pagination_handler', |
| 44 | 44 | 'access arguments' => array('access content'), |
| 45 | 45 | 'type' => MENU_CALLBACK |
| 46 | - ); |
|
| 47 | - $items['admin/boinc/community'] = array( |
|
| 46 | + ); |
|
| 47 | + $items['admin/boinc/community'] = array( |
|
| 48 | 48 | 'title' => 'Community', |
| 49 | 49 | 'description' => 'Global settings for community interaction.', |
| 50 | 50 | 'page callback' => 'drupal_get_form', |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | 'access arguments' => array('administer site configuration'), |
| 53 | 53 | 'type' => MENU_NORMAL_ITEM, |
| 54 | 54 | 'file' => 'boinccore.admin.inc' |
| 55 | - ); |
|
| 56 | - $items['admin/boinc/standard-content-generator'] = array( |
|
| 55 | + ); |
|
| 56 | + $items['admin/boinc/standard-content-generator'] = array( |
|
| 57 | 57 | 'title' => 'Standard page generator', |
| 58 | 58 | 'description' => 'Regenerate standard site content (e.g. Help and About Us |
| 59 | 59 | pages).', |
@@ -62,172 +62,172 @@ discard block |
||
| 62 | 62 | 'access arguments' => array('administer site configuration'), |
| 63 | 63 | 'type' => MENU_NORMAL_ITEM, |
| 64 | 64 | 'file' => 'boinccore.admin.inc' |
| 65 | - ); |
|
| 65 | + ); |
|
| 66 | 66 | |
| 67 | - // BOINC RPC wrappers |
|
| 68 | - $items['lookup_account.php'] = array( |
|
| 67 | + // BOINC RPC wrappers |
|
| 68 | + $items['lookup_account.php'] = array( |
|
| 69 | 69 | 'title' => 'Look up account RPC', |
| 70 | 70 | 'description' => 'RPC for getting the authenticator for a user account.', |
| 71 | 71 | 'page callback' => 'boinccore_lookup_account', |
| 72 | 72 | 'access callback' => TRUE, |
| 73 | 73 | 'type' => MENU_CALLBACK |
| 74 | - ); |
|
| 75 | - $items['am_get_info.php'] = array( |
|
| 74 | + ); |
|
| 75 | + $items['am_get_info.php'] = array( |
|
| 76 | 76 | 'title' => 'Account manager get info RPC', |
| 77 | 77 | 'description' => 'RPC for getting assorted details of a user account.', |
| 78 | 78 | 'page callback' => 'boinccore_am_get_info', |
| 79 | 79 | 'access callback' => TRUE, |
| 80 | 80 | 'type' => MENU_CALLBACK |
| 81 | - ); |
|
| 82 | - $items['am_set_info.php'] = array( |
|
| 81 | + ); |
|
| 82 | + $items['am_set_info.php'] = array( |
|
| 83 | 83 | 'title' => 'Account manager set info RPC', |
| 84 | 84 | 'description' => 'RPC for updating assorted details of a user account.', |
| 85 | 85 | 'page callback' => 'boinccore_am_set_info', |
| 86 | 86 | 'access callback' => TRUE, |
| 87 | 87 | 'type' => MENU_CALLBACK |
| 88 | - ); |
|
| 89 | - $items['am_set_host_info.php'] = array( |
|
| 88 | + ); |
|
| 89 | + $items['am_set_host_info.php'] = array( |
|
| 90 | 90 | 'title' => 'Account manager set host info RPC', |
| 91 | 91 | 'description' => 'RPC for updating the venue for a given host.', |
| 92 | 92 | 'page callback' => 'boinccore_am_set_host_info', |
| 93 | 93 | 'access callback' => TRUE, |
| 94 | 94 | 'type' => MENU_CALLBACK |
| 95 | - ); |
|
| 96 | - $items['show_user.php'] = array( |
|
| 95 | + ); |
|
| 96 | + $items['show_user.php'] = array( |
|
| 97 | 97 | 'title' => 'Show user RPC', |
| 98 | 98 | 'description' => 'RPC for getting assorted details of a user account.', |
| 99 | 99 | 'page callback' => 'boinccore_show_user', |
| 100 | 100 | 'access callback' => TRUE, |
| 101 | 101 | 'type' => MENU_CALLBACK |
| 102 | - ); |
|
| 103 | - $items['pending.php'] = array( |
|
| 102 | + ); |
|
| 103 | + $items['pending.php'] = array( |
|
| 104 | 104 | 'title' => 'Pending credit RPC', |
| 105 | 105 | 'description' => 'RPC for getting pending credit for a given account.', |
| 106 | 106 | 'page callback' => 'boinccore_pending_credit', |
| 107 | 107 | 'access callback' => TRUE, |
| 108 | 108 | 'type' => MENU_CALLBACK |
| 109 | - ); |
|
| 110 | - $items['create_team.php'] = array( |
|
| 109 | + ); |
|
| 110 | + $items['create_team.php'] = array( |
|
| 111 | 111 | 'title' => 'Create team RPC', |
| 112 | 112 | 'description' => 'RPC for creating a new team.', |
| 113 | 113 | 'page callback' => 'boinccore_create_team', |
| 114 | 114 | 'access callback' => TRUE, |
| 115 | 115 | 'type' => MENU_CALLBACK |
| 116 | - ); |
|
| 117 | - $items['team_lookup.php'] = array( |
|
| 116 | + ); |
|
| 117 | + $items['team_lookup.php'] = array( |
|
| 118 | 118 | 'title' => 'Team lookup RPC', |
| 119 | 119 | 'description' => 'RPC for getting info on a team or matching teams.', |
| 120 | 120 | 'page callback' => 'boinccore_team_lookup', |
| 121 | 121 | 'access callback' => TRUE, |
| 122 | 122 | 'type' => MENU_CALLBACK |
| 123 | - ); |
|
| 124 | - $items['team_email_list.php'] = array( |
|
| 123 | + ); |
|
| 124 | + $items['team_email_list.php'] = array( |
|
| 125 | 125 | 'title' => 'Get team member list RPC', |
| 126 | 126 | 'description' => 'RPC for getting a list of members of a given team.', |
| 127 | 127 | 'page callback' => 'boinccore_team_email_list', |
| 128 | 128 | 'access callback' => TRUE, |
| 129 | 129 | 'type' => MENU_CALLBACK |
| 130 | - ); |
|
| 131 | - $items['edit_forum_preferences_action.php'] = array( |
|
| 130 | + ); |
|
| 131 | + $items['edit_forum_preferences_action.php'] = array( |
|
| 132 | 132 | 'title' => 'Forum preferences RPC', |
| 133 | 133 | 'description' => 'RPC for setting forum preferences for a given user.', |
| 134 | 134 | 'page callback' => 'boinccore_edit_forum_preferences', |
| 135 | 135 | 'access callback' => TRUE, |
| 136 | 136 | 'type' => MENU_CALLBACK |
| 137 | - ); |
|
| 138 | - $items['forum_get_data.php'] = array( |
|
| 137 | + ); |
|
| 138 | + $items['forum_get_data.php'] = array( |
|
| 139 | 139 | 'title' => 'Forum get data RPC', |
| 140 | 140 | 'description' => 'RPC for getting recent forum activity for a given user.', |
| 141 | 141 | 'page callback' => 'boinccore_forum_get_data', |
| 142 | 142 | 'access callback' => TRUE, |
| 143 | 143 | 'type' => MENU_CALLBACK |
| 144 | - ); |
|
| 145 | - $items['apps.php'] = array( |
|
| 144 | + ); |
|
| 145 | + $items['apps.php'] = array( |
|
| 146 | 146 | 'title' => 'Apps RPC', |
| 147 | 147 | 'description' => 'RPC for getting the applications in the system.', |
| 148 | 148 | 'page callback' => 'boinccore_apps', |
| 149 | 149 | 'access callback' => TRUE, |
| 150 | 150 | 'type' => MENU_CALLBACK |
| 151 | - ); |
|
| 151 | + ); |
|
| 152 | 152 | |
| 153 | - return $items; |
|
| 153 | + return $items; |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | 157 | * Implementation of hook_menu_alter() |
| 158 | 158 | */ |
| 159 | 159 | function boinccore_menu_alter(&$items) { |
| 160 | - // If using Solr search and not core Drupal search, disable core search! |
|
| 161 | - if (module_exists('global_search_solr') AND !module_exists('global_search')) { |
|
| 160 | + // If using Solr search and not core Drupal search, disable core search! |
|
| 161 | + if (module_exists('global_search_solr') AND !module_exists('global_search')) { |
|
| 162 | 162 | // Add permission to user search. |
| 163 | 163 | $check = array( |
| 164 | - 'search/node/%menu_tail', |
|
| 165 | - 'search/user/%menu_tail', |
|
| 166 | - 'user/autocomplete' |
|
| 164 | + 'search/node/%menu_tail', |
|
| 165 | + 'search/user/%menu_tail', |
|
| 166 | + 'user/autocomplete' |
|
| 167 | 167 | ); |
| 168 | 168 | foreach ($check as $path) { |
| 169 | - if (isset($items[$path])) { |
|
| 169 | + if (isset($items[$path])) { |
|
| 170 | 170 | $items[$path]['access callback'] = FALSE; |
| 171 | - } |
|
| 171 | + } |
|
| 172 | 172 | } |
| 173 | - } |
|
| 174 | - // If using content profile module (for user profiles) setup special |
|
| 175 | - // delete page. |
|
| 176 | - if (module_exists('content_profile')) { |
|
| 173 | + } |
|
| 174 | + // If using content profile module (for user profiles) setup special |
|
| 175 | + // delete page. |
|
| 176 | + if (module_exists('content_profile')) { |
|
| 177 | 177 | $items['node/%node/delete'] = array( |
| 178 | - 'title' => 'Delete', |
|
| 179 | - 'page callback' => 'drupal_get_form', |
|
| 180 | - 'page arguments' => array('boinccore_delete_confirm', 1), |
|
| 181 | - 'access callback' => 'node_access', |
|
| 182 | - 'access arguments' => array('delete', 1), |
|
| 183 | - 'module' => 'boinccore', |
|
| 184 | - 'file' => 'includes/boinccore.forms.inc', |
|
| 185 | - 'weight' => 1, |
|
| 186 | - 'type' => MENU_CALLBACK, |
|
| 178 | + 'title' => 'Delete', |
|
| 179 | + 'page callback' => 'drupal_get_form', |
|
| 180 | + 'page arguments' => array('boinccore_delete_confirm', 1), |
|
| 181 | + 'access callback' => 'node_access', |
|
| 182 | + 'access arguments' => array('delete', 1), |
|
| 183 | + 'module' => 'boinccore', |
|
| 184 | + 'file' => 'includes/boinccore.forms.inc', |
|
| 185 | + 'weight' => 1, |
|
| 186 | + 'type' => MENU_CALLBACK, |
|
| 187 | 187 | ); |
| 188 | - } |
|
| 188 | + } |
|
| 189 | 189 | |
| 190 | - // 'Remove' menu paths for ignore_user and privatemsg |
|
| 191 | - // (pm_block_user) module which we have 'overridden' with |
|
| 192 | - // boincwork's own functions. |
|
| 193 | - if (module_exists('ignore_user')) { |
|
| 190 | + // 'Remove' menu paths for ignore_user and privatemsg |
|
| 191 | + // (pm_block_user) module which we have 'overridden' with |
|
| 192 | + // boincwork's own functions. |
|
| 193 | + if (module_exists('ignore_user')) { |
|
| 194 | 194 | $check = array( |
| 195 | - 'ignore_user/add', |
|
| 196 | - 'ignore_user/remove', |
|
| 195 | + 'ignore_user/add', |
|
| 196 | + 'ignore_user/remove', |
|
| 197 | 197 | ); |
| 198 | 198 | foreach ($check as $path) { |
| 199 | - if (isset($items[$path])) { |
|
| 199 | + if (isset($items[$path])) { |
|
| 200 | 200 | $items[$path]['access callback'] = FALSE; |
| 201 | - } |
|
| 201 | + } |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | // Redirect user to privacy prefs page. |
| 205 | 205 | $path1 = 'ignore_user/list'; |
| 206 | 206 | if (isset($items[$path1])) { |
| 207 | - $items[$path1]['page callback'] = 'drupal_goto'; |
|
| 208 | - $items[$path1]['page arguments'] = array('account/prefs/privacy'); |
|
| 207 | + $items[$path1]['page callback'] = 'drupal_goto'; |
|
| 208 | + $items[$path1]['page arguments'] = array('account/prefs/privacy'); |
|
| 209 | + } |
|
| 209 | 210 | } |
| 210 | - } |
|
| 211 | 211 | |
| 212 | - if (module_exists('pm_block_user')) { |
|
| 212 | + if (module_exists('pm_block_user')) { |
|
| 213 | 213 | $check = array( |
| 214 | - 'messages/block/%user', |
|
| 214 | + 'messages/block/%user', |
|
| 215 | 215 | ); |
| 216 | 216 | foreach ($check as $path) { |
| 217 | - if (isset($items[$path])) { |
|
| 217 | + if (isset($items[$path])) { |
|
| 218 | 218 | $items[$path]['access callback'] = FALSE; |
| 219 | - } |
|
| 219 | + } |
|
| 220 | + } |
|
| 220 | 221 | } |
| 221 | - } |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
| 225 | 225 | * Implementation of hook_enable() |
| 226 | 226 | */ |
| 227 | 227 | function boinccore_enable() { |
| 228 | - // Automatically try to establish standard site content when this module is |
|
| 229 | - // enabled (e.g. Help and About Us pages) |
|
| 230 | - boinccore_admin_default_content_generate(); |
|
| 228 | + // Automatically try to establish standard site content when this module is |
|
| 229 | + // enabled (e.g. Help and About Us pages) |
|
| 230 | + boinccore_admin_default_content_generate(); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -240,14 +240,14 @@ discard block |
||
| 240 | 240 | * See: https://www.drupal.org/node/339958#comment-3012662 |
| 241 | 241 | */ |
| 242 | 242 | function boinccore_boot() { |
| 243 | - global $user, $language; |
|
| 244 | - $cache = variable_get('cache', CACHE_DISABLED); |
|
| 245 | - $language_negotiation = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE); |
|
| 246 | - |
|
| 247 | - // If we have an anonymous user, page cache is enabled, the URL has no prefix |
|
| 248 | - // and browser language negotiation is set, we perform a redirect to the |
|
| 249 | - // prefixed URL. |
|
| 250 | - if (empty($user->uid) && $cache != CACHE_DISABLED && $language_negotiation == LANGUAGE_NEGOTIATION_PATH) { |
|
| 243 | + global $user, $language; |
|
| 244 | + $cache = variable_get('cache', CACHE_DISABLED); |
|
| 245 | + $language_negotiation = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE); |
|
| 246 | + |
|
| 247 | + // If we have an anonymous user, page cache is enabled, the URL has no prefix |
|
| 248 | + // and browser language negotiation is set, we perform a redirect to the |
|
| 249 | + // prefixed URL. |
|
| 250 | + if (empty($user->uid) && $cache != CACHE_DISABLED && $language_negotiation == LANGUAGE_NEGOTIATION_PATH) { |
|
| 251 | 251 | $args = isset($_GET['q']) ? explode('/', $_GET['q']) : array(); |
| 252 | 252 | $prefix = array_shift($args); |
| 253 | 253 | |
@@ -259,24 +259,24 @@ discard block |
||
| 259 | 259 | // so call this backported Drupal 7 language negotation function, which |
| 260 | 260 | // does both case insensitive and longest prefix matching |
| 261 | 261 | if (function_exists('locale_language_from_browser')) { |
| 262 | - $language = locale_language_from_browser(); |
|
| 262 | + $language = locale_language_from_browser(); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | if (!empty($language->prefix) && $prefix != $language->prefix) { |
| 266 | - // We need full path support to perform the redirect. |
|
| 267 | - drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH); |
|
| 268 | - |
|
| 269 | - require_once './includes/common.inc'; |
|
| 270 | - $url = url($_GET['q'], array('query' => drupal_query_string_encode($_GET, array('q')))); |
|
| 271 | - $code = variable_get('locale_redirect_http_code', 302); |
|
| 272 | - |
|
| 273 | - // Since we are in a hook_boot() implementation cache mode is normal, so |
|
| 274 | - // we can safely call hook_exit(). |
|
| 275 | - bootstrap_invoke_all('exit'); |
|
| 276 | - header("Location: $url", TRUE, $code); |
|
| 277 | - exit; |
|
| 266 | + // We need full path support to perform the redirect. |
|
| 267 | + drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH); |
|
| 268 | + |
|
| 269 | + require_once './includes/common.inc'; |
|
| 270 | + $url = url($_GET['q'], array('query' => drupal_query_string_encode($_GET, array('q')))); |
|
| 271 | + $code = variable_get('locale_redirect_http_code', 302); |
|
| 272 | + |
|
| 273 | + // Since we are in a hook_boot() implementation cache mode is normal, so |
|
| 274 | + // we can safely call hook_exit(). |
|
| 275 | + bootstrap_invoke_all('exit'); |
|
| 276 | + header("Location: $url", TRUE, $code); |
|
| 277 | + exit; |
|
| 278 | + } |
|
| 278 | 279 | } |
| 279 | - } |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | * |
| 290 | 290 | * Obsolete in Drupal 7... |
| 291 | 291 | */ |
| 292 | - function locale_language_from_browser() { |
|
| 292 | + function locale_language_from_browser() { |
|
| 293 | 293 | if (empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
| 294 | - return FALSE; |
|
| 294 | + return FALSE; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | $languages = language_list('enabled'); |
@@ -306,14 +306,14 @@ discard block |
||
| 306 | 306 | // Samples: "hu, en-us;q=0.66, en;q=0.33", "hu,en-us;q=0.5" |
| 307 | 307 | $browser_langcodes = array(); |
| 308 | 308 | if (preg_match_all('@(?<=[, ]|^)([a-zA-Z-]+|\*)(?:;q=([0-9.]+))?(?:$|\s*,\s*)@', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches, PREG_SET_ORDER)) { |
| 309 | - foreach ($matches as $match) { |
|
| 309 | + foreach ($matches as $match) { |
|
| 310 | 310 | // We can safely use strtolower() here, tags are ASCII. |
| 311 | 311 | // RFC2616 mandates that the decimal part is no more than three digits, |
| 312 | 312 | // so we multiply the qvalue by 1000 to avoid floating point comparisons. |
| 313 | 313 | $langcode = strtolower($match[1]); |
| 314 | 314 | $qvalue = isset($match[2]) ? (float) $match[2] : 1; |
| 315 | 315 | $browser_langcodes[$langcode] = (int) ($qvalue * 1000); |
| 316 | - } |
|
| 316 | + } |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | // We should take pristine values from the HTTP headers, but Internet Explorer |
@@ -325,10 +325,10 @@ discard block |
||
| 325 | 325 | // http://blogs.msdn.com/b/ie/archive/2006/10/17/accept-language-header-for-internet-explorer-7.aspx |
| 326 | 326 | asort($browser_langcodes); |
| 327 | 327 | foreach ($browser_langcodes as $langcode => $qvalue) { |
| 328 | - $generic_tag = strtok($langcode, '-'); |
|
| 329 | - if (!isset($browser_langcodes[$generic_tag])) { |
|
| 328 | + $generic_tag = strtok($langcode, '-'); |
|
| 329 | + if (!isset($browser_langcodes[$generic_tag])) { |
|
| 330 | 330 | $browser_langcodes[$generic_tag] = $qvalue; |
| 331 | - } |
|
| 331 | + } |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | // Find the enabled language with the greatest qvalue, following the rules |
@@ -337,156 +337,156 @@ discard block |
||
| 337 | 337 | $best_match_language = FALSE; |
| 338 | 338 | $max_qvalue = 0; |
| 339 | 339 | foreach ($languages as $langcode => $language) { |
| 340 | - // Language tags are case insensitive (RFC2616, sec 3.10). |
|
| 341 | - $langcode = strtolower($langcode); |
|
| 340 | + // Language tags are case insensitive (RFC2616, sec 3.10). |
|
| 341 | + $langcode = strtolower($langcode); |
|
| 342 | 342 | |
| 343 | - // If nothing matches below, the default qvalue is the one of the wildcard |
|
| 344 | - // language, if set, or is 0 (which will never match). |
|
| 345 | - $qvalue = isset($browser_langcodes['*']) ? $browser_langcodes['*'] : 0; |
|
| 343 | + // If nothing matches below, the default qvalue is the one of the wildcard |
|
| 344 | + // language, if set, or is 0 (which will never match). |
|
| 345 | + $qvalue = isset($browser_langcodes['*']) ? $browser_langcodes['*'] : 0; |
|
| 346 | 346 | |
| 347 | - // Find the longest possible prefix of the browser-supplied language |
|
| 348 | - // ('the language-range') that matches this site language ('the language tag'). |
|
| 349 | - $prefix = $langcode; |
|
| 350 | - do { |
|
| 347 | + // Find the longest possible prefix of the browser-supplied language |
|
| 348 | + // ('the language-range') that matches this site language ('the language tag'). |
|
| 349 | + $prefix = $langcode; |
|
| 350 | + do { |
|
| 351 | 351 | if (isset($browser_langcodes[$prefix])) { |
| 352 | - $qvalue = $browser_langcodes[$prefix]; |
|
| 353 | - break; |
|
| 352 | + $qvalue = $browser_langcodes[$prefix]; |
|
| 353 | + break; |
|
| 354 | 354 | } |
| 355 | - } |
|
| 356 | - while ($prefix = substr($prefix, 0, strrpos($prefix, '-'))); |
|
| 355 | + } |
|
| 356 | + while ($prefix = substr($prefix, 0, strrpos($prefix, '-'))); |
|
| 357 | 357 | |
| 358 | - // Find the best match. |
|
| 359 | - if ($qvalue > $max_qvalue) { |
|
| 358 | + // Find the best match. |
|
| 359 | + if ($qvalue > $max_qvalue) { |
|
| 360 | 360 | $best_match_language = $language; |
| 361 | 361 | $max_qvalue = $qvalue; |
| 362 | - } |
|
| 362 | + } |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | return $best_match_language; |
| 366 | - } |
|
| 366 | + } |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | /** |
| 370 | 370 | * Implementation of hook_cron() |
| 371 | 371 | */ |
| 372 | 372 | function boinccore_cron() { |
| 373 | - // Notify moderators if there is site content that requires moderator action |
|
| 374 | - $items_in_queue = boincuser_moderation_queue_count('cron'); |
|
| 375 | - $last_notification = variable_get('boinccore_last_content_moderation_reminder', 0); |
|
| 376 | - if ($items_in_queue AND $last_notification < time() - 24*60*60) { |
|
| 373 | + // Notify moderators if there is site content that requires moderator action |
|
| 374 | + $items_in_queue = boincuser_moderation_queue_count('cron'); |
|
| 375 | + $last_notification = variable_get('boinccore_last_content_moderation_reminder', 0); |
|
| 376 | + if ($items_in_queue AND $last_notification < time() - 24*60*60) { |
|
| 377 | 377 | global $base_url; |
| 378 | 378 | global $base_path; |
| 379 | 379 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
| 380 | 380 | $site_url = $base_url . $base_path; |
| 381 | 381 | $settings = array( |
| 382 | - 'from' => '', |
|
| 383 | - 'subject' => "Content at {$site_name} is awaiting moderation", |
|
| 384 | - 'message' => '' |
|
| 385 | - . "Please visit the moderation queue page to review content that " |
|
| 386 | - . "requires moderator action: \n" |
|
| 387 | - . "\n" |
|
| 388 | - . "{$site_url}moderate", |
|
| 382 | + 'from' => '', |
|
| 383 | + 'subject' => "Content at {$site_name} is awaiting moderation", |
|
| 384 | + 'message' => '' |
|
| 385 | + . "Please visit the moderation queue page to review content that " |
|
| 386 | + . "requires moderator action: \n" |
|
| 387 | + . "\n" |
|
| 388 | + . "{$site_url}moderate", |
|
| 389 | 389 | ); |
| 390 | 390 | boinccore_rules_action_mail_to_moderators($settings); |
| 391 | 391 | variable_set('boinccore_last_content_moderation_reminder', time()); |
| 392 | - } |
|
| 392 | + } |
|
| 393 | 393 | |
| 394 | - // Delete expired tokens in BOINC DB |
|
| 395 | - _boinccore_delete_expired_tokens(); |
|
| 394 | + // Delete expired tokens in BOINC DB |
|
| 395 | + _boinccore_delete_expired_tokens(); |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | /** |
| 399 | 399 | * Implementation of hook_rules_action_info(). |
| 400 | 400 | */ |
| 401 | 401 | function boinccore_rules_action_info() { |
| 402 | - return array( |
|
| 402 | + return array( |
|
| 403 | 403 | 'boinccore_rules_action_mail_to_moderators' => array( |
| 404 | - 'label' => t('Notify moderators via email'), |
|
| 405 | - 'module' => 'BOINC core', |
|
| 406 | - 'eval input' => array('subject', 'message', 'from'), |
|
| 404 | + 'label' => t('Notify moderators via email'), |
|
| 405 | + 'module' => 'BOINC core', |
|
| 406 | + 'eval input' => array('subject', 'message', 'from'), |
|
| 407 | 407 | ), |
| 408 | 408 | 'boinccore_rules_action_mark_content_for_moderation' => array( |
| 409 | - 'label' => t('Mark content for moderation'), |
|
| 410 | - 'arguments' => array( |
|
| 409 | + 'label' => t('Mark content for moderation'), |
|
| 410 | + 'arguments' => array( |
|
| 411 | 411 | 'node' => array('type' => 'node', 'label' => t('Content')), |
| 412 | - ), |
|
| 413 | - 'module' => 'BOINC core', |
|
| 412 | + ), |
|
| 413 | + 'module' => 'BOINC core', |
|
| 414 | 414 | ), |
| 415 | 415 | 'boinccore_rules_action_mail_to_admins' => array( |
| 416 | - 'label' => t('Notify admins via email'), |
|
| 417 | - 'module' => 'BOINC core', |
|
| 418 | - 'eval input' => array('subject', 'message', 'from'), |
|
| 416 | + 'label' => t('Notify admins via email'), |
|
| 417 | + 'module' => 'BOINC core', |
|
| 418 | + 'eval input' => array('subject', 'message', 'from'), |
|
| 419 | 419 | ), |
| 420 | - ); |
|
| 420 | + ); |
|
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | /** |
| 424 | 424 | * Implementation of hook_form_alter() |
| 425 | 425 | */ |
| 426 | 426 | function boinccore_form_alter(&$form, $form_state, $form_id) { |
| 427 | - global $user; |
|
| 428 | - $account = user_load($user->uid); |
|
| 429 | - switch ($form_id) { |
|
| 430 | - // Comment form |
|
| 431 | - case 'comment_form': |
|
| 427 | + global $user; |
|
| 428 | + $account = user_load($user->uid); |
|
| 429 | + switch ($form_id) { |
|
| 430 | + // Comment form |
|
| 431 | + case 'comment_form': |
|
| 432 | 432 | $user_image = boincuser_get_user_profile_image($user->uid); |
| 433 | 433 | $user_info = '<div class="user">'; |
| 434 | 434 | if ($user_image) { |
| 435 | - $user_info .= ' <div class="picture">'; |
|
| 436 | - if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
| 435 | + $user_info .= ' <div class="picture">'; |
|
| 436 | + if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
| 437 | 437 | $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 438 | - } |
|
| 439 | - elseif (is_string($user_image)) { |
|
| 438 | + } |
|
| 439 | + elseif (is_string($user_image)) { |
|
| 440 | 440 | $user_info .= '<img src="' . $user_image . '"/>'; |
| 441 | - } |
|
| 442 | - $user_info .= ' </div>'; |
|
| 441 | + } |
|
| 442 | + $user_info .= ' </div>'; |
|
| 443 | 443 | } |
| 444 | 444 | $user_info .= ' <div class="name">' . theme('username', $account) . '</div>'; |
| 445 | 445 | if ($account->uid) { |
| 446 | - //$user_info .= ' <div class="join-date">Joined: ' . date('j M y', $account->created) . '</div>'; |
|
| 447 | - //$user_info .= ' <div class="post-count">Posts: ' . $account->post_count . '</div>'; |
|
| 448 | - //$user_info .= ' <div class="credit">Credit: ' . $account->boincuser_total_credit . '</div>'; |
|
| 449 | - //$user_info .= ' <div class="rac">RAC: ' . $account->boincuser_expavg_credit . '</div>'; |
|
| 446 | + //$user_info .= ' <div class="join-date">Joined: ' . date('j M y', $account->created) . '</div>'; |
|
| 447 | + //$user_info .= ' <div class="post-count">Posts: ' . $account->post_count . '</div>'; |
|
| 448 | + //$user_info .= ' <div class="credit">Credit: ' . $account->boincuser_total_credit . '</div>'; |
|
| 449 | + //$user_info .= ' <div class="rac">RAC: ' . $account->boincuser_expavg_credit . '</div>'; |
|
| 450 | 450 | } |
| 451 | 451 | $user_info .= '</div>'; |
| 452 | 452 | array_unshift($form, array( |
| 453 | - 'user_info' => array( |
|
| 453 | + 'user_info' => array( |
|
| 454 | 454 | '#value' => $user_info, |
| 455 | - ), |
|
| 456 | - 'comment_form_prefix' => array( |
|
| 455 | + ), |
|
| 456 | + 'comment_form_prefix' => array( |
|
| 457 | 457 | '#value' => '<div class="form-body">', |
| 458 | - ), |
|
| 458 | + ), |
|
| 459 | 459 | )); |
| 460 | 460 | $form['comment_form_suffix'] = array( |
| 461 | - '#value' => '</div>', |
|
| 461 | + '#value' => '</div>', |
|
| 462 | 462 | ); |
| 463 | 463 | |
| 464 | 464 | module_load_include('inc', 'bbcode', 'bbcode-help'); |
| 465 | 465 | $form['bbcode_help'] = array( |
| 466 | - '#title' => bts('BBcode help', array(), NULL, 'boinc:help-with-user-input-with-BBCode'), |
|
| 467 | - '#type' => 'fieldset', |
|
| 468 | - '#attributes' => array( |
|
| 466 | + '#title' => bts('BBcode help', array(), NULL, 'boinc:help-with-user-input-with-BBCode'), |
|
| 467 | + '#type' => 'fieldset', |
|
| 468 | + '#attributes' => array( |
|
| 469 | 469 | 'class' => 'bbcode_help', |
| 470 | - ), |
|
| 471 | - '#collapsible' => TRUE, |
|
| 472 | - '#collapsed' => TRUE, |
|
| 473 | - 'content' => array( |
|
| 470 | + ), |
|
| 471 | + '#collapsible' => TRUE, |
|
| 472 | + '#collapsed' => TRUE, |
|
| 473 | + 'content' => array( |
|
| 474 | 474 | '#value' => _bbcode_filter_tip(), |
| 475 | - ), |
|
| 475 | + ), |
|
| 476 | 476 | ); |
| 477 | 477 | |
| 478 | 478 | // If a specific comment is being referenced, go back to it on cancel |
| 479 | 479 | if ($comment_ref = $form['pid']['#value']) { |
| 480 | - $cancel_url = "goto/comment/{$comment_ref}"; |
|
| 480 | + $cancel_url = "goto/comment/{$comment_ref}"; |
|
| 481 | 481 | } |
| 482 | 482 | else { |
| 483 | - $cancel_url = "node/{$form['nid']['#value']}"; |
|
| 483 | + $cancel_url = "node/{$form['nid']['#value']}"; |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | // Wrap action buttons for styling consistency |
| 487 | 487 | $form['buttons']['form control tabs prefix'] = array( |
| 488 | - '#value' => '<ul class="form-control tab-list">', |
|
| 489 | - '#weight' => 1001, |
|
| 488 | + '#value' => '<ul class="form-control tab-list">', |
|
| 489 | + '#weight' => 1001, |
|
| 490 | 490 | ); |
| 491 | 491 | $form['buttons']['submit'] = $form['submit']; |
| 492 | 492 | unset($form['submit']); |
@@ -505,12 +505,12 @@ discard block |
||
| 505 | 505 | $form['buttons']['preview']['#suffix'] = '</li>'; |
| 506 | 506 | $form['buttons']['preview']['#weight'] = 1003; |
| 507 | 507 | $form['buttons']['cancel'] = array( |
| 508 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 509 | - '#weight' => 1004, |
|
| 508 | + '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 509 | + '#weight' => 1004, |
|
| 510 | 510 | ); |
| 511 | 511 | $form['buttons']['form control tabs suffix'] = array( |
| 512 | - '#value' => '</ul>', |
|
| 513 | - '#weight' => 1010, |
|
| 512 | + '#value' => '</ul>', |
|
| 513 | + '#weight' => 1010, |
|
| 514 | 514 | ); |
| 515 | 515 | |
| 516 | 516 | // Remove redundant name field |
@@ -526,38 +526,38 @@ discard block |
||
| 526 | 526 | $community_role = array_search('community member', user_roles(true)); |
| 527 | 527 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 528 | 528 | if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
| 529 | - if ($node->type == 'forum') { |
|
| 529 | + if ($node->type == 'forum') { |
|
| 530 | 530 | if (module_exists('captcha')) { |
| 531 | - $form['comment_captcha'] = array( |
|
| 531 | + $form['comment_captcha'] = array( |
|
| 532 | 532 | '#type' => 'captcha', |
| 533 | 533 | '#weight' => 1000, |
| 534 | - ); |
|
| 534 | + ); |
|
| 535 | 535 | } |
| 536 | - } |
|
| 537 | - else { |
|
| 536 | + } |
|
| 537 | + else { |
|
| 538 | 538 | $form = NULL; |
| 539 | 539 | $form['from'] = array( |
| 540 | - '#type' => 'item', |
|
| 541 | - '#value' => 'You do not have permission to post comments in this forum.', |
|
| 540 | + '#type' => 'item', |
|
| 541 | + '#value' => 'You do not have permission to post comments in this forum.', |
|
| 542 | 542 | ); |
| 543 | - } |
|
| 543 | + } |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | break; |
| 547 | 547 | |
| 548 | - // Forum node form |
|
| 549 | - case 'forum_node_form': |
|
| 548 | + // Forum node form |
|
| 549 | + case 'forum_node_form': |
|
| 550 | 550 | case 'team_forum_node_form': |
| 551 | 551 | $forum_id = key($form['#node']->taxonomy); |
| 552 | 552 | $form['buttons']['separator_bottom'] = array( |
| 553 | - '#value' => '<div class="separator buttons"></div>', |
|
| 554 | - '#weight' => 999, |
|
| 553 | + '#value' => '<div class="separator buttons"></div>', |
|
| 554 | + '#weight' => 999, |
|
| 555 | 555 | ); |
| 556 | 556 | |
| 557 | 557 | // Wrap action buttons for styling consistency |
| 558 | 558 | $form['buttons']['form control tabs prefix'] = array( |
| 559 | - '#value' => '<ul class="form-control tab-list">', |
|
| 560 | - '#weight' => 1001, |
|
| 559 | + '#value' => '<ul class="form-control tab-list">', |
|
| 560 | + '#weight' => 1001, |
|
| 561 | 561 | ); |
| 562 | 562 | $form['buttons']['submit']['#prefix'] = '<li class="first tab">'; |
| 563 | 563 | $form['buttons']['submit']['#value'] = bts('Post topic', array(), NULL, 'boinc:post-forum-comment'); |
@@ -570,28 +570,28 @@ discard block |
||
| 570 | 570 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
| 571 | 571 | $form['buttons']['preview_changes']['#weight'] = 1004; |
| 572 | 572 | $form['buttons']['cancel'] = array( |
| 573 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 574 | - '#weight' => 1005, |
|
| 573 | + '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 574 | + '#weight' => 1005, |
|
| 575 | 575 | ); |
| 576 | 576 | $form['buttons']['form control tabs suffix'] = array( |
| 577 | - '#value' => '</ul>', |
|
| 578 | - '#weight' => 1010, |
|
| 577 | + '#value' => '</ul>', |
|
| 578 | + '#weight' => 1010, |
|
| 579 | 579 | ); |
| 580 | 580 | |
| 581 | 581 | // Add captcha for role='community member' |
| 582 | 582 | $community_role = array_search('community member', user_roles(true)); |
| 583 | 583 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 584 | 584 | if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
| 585 | - if (module_exists('captcha')) { |
|
| 585 | + if (module_exists('captcha')) { |
|
| 586 | 586 | $form['comment_captcha'] = array( |
| 587 | - '#type' => 'captcha', |
|
| 588 | - '#weight' => 1000, |
|
| 587 | + '#type' => 'captcha', |
|
| 588 | + '#weight' => 1000, |
|
| 589 | 589 | ); |
| 590 | - } |
|
| 590 | + } |
|
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | break; |
| 594 | - case 'boinccore_delete_confirm': |
|
| 594 | + case 'boinccore_delete_confirm': |
|
| 595 | 595 | // Wrap action buttons for styling consistency |
| 596 | 596 | $form['actions']['#prefix'] = '<ul class="form-control tab-list">'; |
| 597 | 597 | $form['actions']['#suffix'] = '</ul>'; |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | $form['actions']['cancel']['#prefix'] = '<li class="tab">'; |
| 602 | 602 | $form['actions']['cancel']['#suffix'] = '</li>'; |
| 603 | 603 | break; |
| 604 | - default: |
|
| 604 | + default: |
|
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | |
@@ -609,61 +609,61 @@ discard block |
||
| 609 | 609 | * Implementation of hook_link_alter() |
| 610 | 610 | */ |
| 611 | 611 | function boinccore_link_alter(&$links, $node, $comment = NULL) { |
| 612 | - //echo '<pre>' . print_r($links, true) . '</pre>'; |
|
| 613 | - foreach ($links as $module => $link) { |
|
| 612 | + //echo '<pre>' . print_r($links, true) . '</pre>'; |
|
| 613 | + foreach ($links as $module => $link) { |
|
| 614 | 614 | // Remove the ignore user link |
| 615 | 615 | if (strstr($module, 'ignore_user')) { |
| 616 | - unset($links[$module]); |
|
| 616 | + unset($links[$module]); |
|
| 617 | 617 | } |
| 618 | - } |
|
| 619 | - // Node first, then comment: to be consistent with boinccore_link() function |
|
| 620 | - if (!($comment)) { |
|
| 618 | + } |
|
| 619 | + // Node first, then comment: to be consistent with boinccore_link() function |
|
| 620 | + if (!($comment)) { |
|
| 621 | 621 | // modify the comment_add link |
| 622 | 622 | if (isset($links['comment_add'])) { |
| 623 | - $links['comment_add']['title'] = bts('reply', array(), NULL, 'boinc:forum-reply-to-comment'); |
|
| 624 | - $links['comment_add']['attributes'] = array( |
|
| 625 | - 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 626 | - ); |
|
| 623 | + $links['comment_add']['title'] = bts('reply', array(), NULL, 'boinc:forum-reply-to-comment'); |
|
| 624 | + $links['comment_add']['attributes'] = array( |
|
| 625 | + 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 626 | + ); |
|
| 627 | 627 | } |
| 628 | 628 | // modify quote link |
| 629 | 629 | if (isset($links['quote'])) { |
| 630 | - $links['quote']['attributes'] = array( |
|
| 631 | - 'title' => bts('Reply to this topic with a quote', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 632 | - ); |
|
| 630 | + $links['quote']['attributes'] = array( |
|
| 631 | + 'title' => bts('Reply to this topic with a quote', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 632 | + ); |
|
| 633 | 633 | } |
| 634 | - } |
|
| 635 | - else { |
|
| 634 | + } |
|
| 635 | + else { |
|
| 636 | 636 | // Standard EDIT, DELETE, and REPLY links are created by Drupal, but we want to alter them |
| 637 | 637 | if (isset($links['comment_delete'])) { |
| 638 | - $links['comment_delete']['attributes'] = array( |
|
| 639 | - 'title' => bts('Delete this comment', array(), NULL, 'boinc:forum-delete-comment') |
|
| 640 | - ); |
|
| 638 | + $links['comment_delete']['attributes'] = array( |
|
| 639 | + 'title' => bts('Delete this comment', array(), NULL, 'boinc:forum-delete-comment') |
|
| 640 | + ); |
|
| 641 | 641 | } |
| 642 | 642 | if (isset($links['comment_edit'])) { |
| 643 | - $links['comment_edit']['attributes'] = array( |
|
| 644 | - 'title' => bts('Edit this comment', array(), NULL, 'boinc:forum-edit-comment') |
|
| 645 | - ); |
|
| 643 | + $links['comment_edit']['attributes'] = array( |
|
| 644 | + 'title' => bts('Edit this comment', array(), NULL, 'boinc:forum-edit-comment') |
|
| 645 | + ); |
|
| 646 | 646 | } |
| 647 | 647 | if (isset($links['comment_reply'])) { |
| 648 | - $links['comment_reply']['attributes'] = array( |
|
| 649 | - 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 650 | - ); |
|
| 648 | + $links['comment_reply']['attributes'] = array( |
|
| 649 | + 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 650 | + ); |
|
| 651 | 651 | } |
| 652 | - }// if !$comment |
|
| 652 | + }// if !$comment |
|
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | /** |
| 656 | 656 | * Implementation of hook_locale(). |
| 657 | 657 | */ |
| 658 | 658 | function boinccore_locale($op = 'groups', $group = NULL) { |
| 659 | - switch ($op) { |
|
| 659 | + switch ($op) { |
|
| 660 | 660 | case 'groups': |
| 661 | 661 | return array('boinc' => 'BOINC'); |
| 662 | 662 | case 'info': |
| 663 | 663 | //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
| 664 | 664 | $info['boinc']['format'] = FALSE; |
| 665 | - return $info; |
|
| 666 | - } |
|
| 665 | + return $info; |
|
| 666 | + } |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | |
@@ -671,71 +671,71 @@ discard block |
||
| 671 | 671 | * Implementation of hook_link() |
| 672 | 672 | */ |
| 673 | 673 | function boinccore_link($type, $object, $teaser = FALSE) { |
| 674 | - // Add custom links with this hook |
|
| 674 | + // Add custom links with this hook |
|
| 675 | 675 | |
| 676 | - if ($type=='node') { |
|
| 676 | + if ($type=='node') { |
|
| 677 | 677 | if ( ($object->type=='forum') OR ($object->type=='team_forum') ) { |
| 678 | - // Add topic moderator controls |
|
| 679 | - if (user_access('edit any forum topic')) { |
|
| 678 | + // Add topic moderator controls |
|
| 679 | + if (user_access('edit any forum topic')) { |
|
| 680 | 680 | $node_control = "node_control/{$object->nid}"; |
| 681 | 681 | if ($object->sticky) { |
| 682 | - $links['make_unsticky'] = array( |
|
| 683 | - 'title' => bts('Make unsticky', array(), NULL, 'boinc:forum-unsticky-comment'), |
|
| 684 | - 'href' => "{$node_control}/unsticky", |
|
| 685 | - 'attributes' => array( |
|
| 686 | - 'title' => bts('Remove sticky status from this topic', array(), NULL, 'boinc:forum-unsticky-comment') |
|
| 687 | - ) |
|
| 688 | - ); |
|
| 682 | + $links['make_unsticky'] = array( |
|
| 683 | + 'title' => bts('Make unsticky', array(), NULL, 'boinc:forum-unsticky-comment'), |
|
| 684 | + 'href' => "{$node_control}/unsticky", |
|
| 685 | + 'attributes' => array( |
|
| 686 | + 'title' => bts('Remove sticky status from this topic', array(), NULL, 'boinc:forum-unsticky-comment') |
|
| 687 | + ) |
|
| 688 | + ); |
|
| 689 | 689 | } |
| 690 | 690 | else { |
| 691 | - $links['make_sticky'] = array( |
|
| 692 | - 'title' => bts('Make sticky', array(), NULL, 'boinc:forum-sticky-comment'), |
|
| 693 | - 'href' => "{$node_control}/sticky", |
|
| 694 | - 'attributes' => array( |
|
| 695 | - 'title' => bts('Make this topic sticky', array(), NULL, 'boinc:forum-sticky-comment') |
|
| 696 | - ) |
|
| 697 | - ); |
|
| 691 | + $links['make_sticky'] = array( |
|
| 692 | + 'title' => bts('Make sticky', array(), NULL, 'boinc:forum-sticky-comment'), |
|
| 693 | + 'href' => "{$node_control}/sticky", |
|
| 694 | + 'attributes' => array( |
|
| 695 | + 'title' => bts('Make this topic sticky', array(), NULL, 'boinc:forum-sticky-comment') |
|
| 696 | + ) |
|
| 697 | + ); |
|
| 698 | 698 | } |
| 699 | 699 | if ($object->comment == COMMENT_NODE_READ_WRITE) { |
| 700 | - $links['lock'] = array( |
|
| 701 | - 'title' => bts('Lock', array(), NULL, 'boinc:forum-lock-comment'), |
|
| 702 | - 'href' => "{$node_control}/lock", |
|
| 703 | - 'attributes' => array( |
|
| 704 | - 'title' => bts('Lock this thread for comments', array(), NULL, 'boinc:forum-lock-comment') |
|
| 705 | - ) |
|
| 706 | - ); |
|
| 700 | + $links['lock'] = array( |
|
| 701 | + 'title' => bts('Lock', array(), NULL, 'boinc:forum-lock-comment'), |
|
| 702 | + 'href' => "{$node_control}/lock", |
|
| 703 | + 'attributes' => array( |
|
| 704 | + 'title' => bts('Lock this thread for comments', array(), NULL, 'boinc:forum-lock-comment') |
|
| 705 | + ) |
|
| 706 | + ); |
|
| 707 | 707 | } |
| 708 | 708 | else { |
| 709 | - $links['unlock'] = array( |
|
| 710 | - 'title' => bts('Unlock', array(), NULL, 'boinc:forum-unlock-comment'), |
|
| 711 | - 'href' => "{$node_control}/unlock", |
|
| 712 | - 'attributes' => array( |
|
| 713 | - 'title' => bts('Unlock this thread for comments', array(), NULL, 'boinc:forum-unlock-comment') |
|
| 714 | - ) |
|
| 715 | - ); |
|
| 709 | + $links['unlock'] = array( |
|
| 710 | + 'title' => bts('Unlock', array(), NULL, 'boinc:forum-unlock-comment'), |
|
| 711 | + 'href' => "{$node_control}/unlock", |
|
| 712 | + 'attributes' => array( |
|
| 713 | + 'title' => bts('Unlock this thread for comments', array(), NULL, 'boinc:forum-unlock-comment') |
|
| 714 | + ) |
|
| 715 | + ); |
|
| 716 | 716 | } |
| 717 | 717 | if ($object->status) { |
| 718 | - $links['hide'] = array( |
|
| 719 | - 'title' => bts('Hide', array(), NULL, 'boinc:forum-hide-comment'), |
|
| 720 | - 'href' => "{$node_control}/hide", |
|
| 721 | - 'attributes' => array( |
|
| 722 | - 'title' => bts('Hide this topic', array(), NULL, 'boinc:forum-hide-comment') |
|
| 723 | - ) |
|
| 724 | - ); |
|
| 718 | + $links['hide'] = array( |
|
| 719 | + 'title' => bts('Hide', array(), NULL, 'boinc:forum-hide-comment'), |
|
| 720 | + 'href' => "{$node_control}/hide", |
|
| 721 | + 'attributes' => array( |
|
| 722 | + 'title' => bts('Hide this topic', array(), NULL, 'boinc:forum-hide-comment') |
|
| 723 | + ) |
|
| 724 | + ); |
|
| 725 | 725 | } |
| 726 | 726 | else { |
| 727 | - $links['unhide'] = array( |
|
| 728 | - 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
|
| 729 | - 'href' => "{$node_control}/unhide", |
|
| 730 | - 'attributes' => array( |
|
| 731 | - 'title' => bts('Unhide this topic', array(), NULL, 'boinc:forum-unhide-comment') |
|
| 732 | - ) |
|
| 733 | - ); |
|
| 727 | + $links['unhide'] = array( |
|
| 728 | + 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
|
| 729 | + 'href' => "{$node_control}/unhide", |
|
| 730 | + 'attributes' => array( |
|
| 731 | + 'title' => bts('Unhide this topic', array(), NULL, 'boinc:forum-unhide-comment') |
|
| 732 | + ) |
|
| 733 | + ); |
|
| 734 | 734 | } |
| 735 | - }// if user_access('edit any forum topic') |
|
| 735 | + }// if user_access('edit any forum topic') |
|
| 736 | 736 | } |
| 737 | - } |
|
| 738 | - else if ($type=='comment') { |
|
| 737 | + } |
|
| 738 | + else if ($type=='comment') { |
|
| 739 | 739 | $node = node_load($object->nid); |
| 740 | 740 | $nid = $object->nid; |
| 741 | 741 | $cid = $object->cid; |
@@ -755,10 +755,10 @@ discard block |
||
| 755 | 755 | // HIDE and COVERT comment |
| 756 | 756 | // The following are moderator only links |
| 757 | 757 | if (user_access('administer comments')) { |
| 758 | - $comment_control = "comment_control/{$cid}"; |
|
| 759 | - // Add link to convert comment into a new topic |
|
| 760 | - $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid )); |
|
| 761 | - if ($reply_count == 0) { |
|
| 758 | + $comment_control = "comment_control/{$cid}"; |
|
| 759 | + // Add link to convert comment into a new topic |
|
| 760 | + $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid )); |
|
| 761 | + if ($reply_count == 0) { |
|
| 762 | 762 | $links['convert'] = array( |
| 763 | 763 | 'title' => bts('Convert', array(), NULL, 'boinc:forum-convert-comment-to-topic'), |
| 764 | 764 | 'href' => "{$comment_control}/convert", |
@@ -766,9 +766,9 @@ discard block |
||
| 766 | 766 | 'title' => bts('Convert this comment to a new topic', array(), NULL, 'boinc:forum-convert-comment-to-topic') |
| 767 | 767 | ) |
| 768 | 768 | ); |
| 769 | - } |
|
| 770 | - // Add hide link |
|
| 771 | - if ($object->status == 0) { |
|
| 769 | + } |
|
| 770 | + // Add hide link |
|
| 771 | + if ($object->status == 0) { |
|
| 772 | 772 | $links['hide'] = array( |
| 773 | 773 | 'title' => bts('Hide', array(), NULL, 'boinc:forum-hide-comment'), |
| 774 | 774 | 'href' => "{$comment_control}/hide", |
@@ -776,8 +776,8 @@ discard block |
||
| 776 | 776 | 'title' => bts('Hide this comment', array(), NULL, 'boinc:forum-hide-comment') |
| 777 | 777 | ) |
| 778 | 778 | ); |
| 779 | - } |
|
| 780 | - else { |
|
| 779 | + } |
|
| 780 | + else { |
|
| 781 | 781 | $links['unhide'] = array( |
| 782 | 782 | 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
| 783 | 783 | 'href' => "{$comment_control}/unhide", |
@@ -785,27 +785,27 @@ discard block |
||
| 785 | 785 | 'title' => bts('Unhide this comment', array(), NULL, 'boinc:forum-unhide-comment') |
| 786 | 786 | ) |
| 787 | 787 | ); |
| 788 | - } |
|
| 788 | + } |
|
| 789 | 789 | }// if user_access('administer comments') |
| 790 | - }//if $type |
|
| 790 | + }//if $type |
|
| 791 | 791 | |
| 792 | - return $links; |
|
| 792 | + return $links; |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | /** |
| 796 | 796 | * Implementation of hook_mail_alter() |
| 797 | 797 | */ |
| 798 | 798 | function boinccore_mail_alter(&$message) { |
| 799 | - /* This code alters the headers for all emails sent by the Drupal Web site to use |
|
| 799 | + /* This code alters the headers for all emails sent by the Drupal Web site to use |
|
| 800 | 800 | 'Quote-Printable' as the encoding, both altering the header and modifies the body to the |
| 801 | 801 | new encoding. |
| 802 | 802 | */ |
| 803 | - $message['headers']['Content-Transfer-Encoding'] = 'Quoted-Printable'; |
|
| 804 | - if (is_array($message['body'])) { |
|
| 803 | + $message['headers']['Content-Transfer-Encoding'] = 'Quoted-Printable'; |
|
| 804 | + if (is_array($message['body'])) { |
|
| 805 | 805 | $message['body'] = array_map( "quoted_printable_encode", $message['body'] ); |
| 806 | - } else { |
|
| 806 | + } else { |
|
| 807 | 807 | $message['body'] = quoted_printable_encode($message['body']); |
| 808 | - } |
|
| 808 | + } |
|
| 809 | 809 | } |
| 810 | 810 | |
| 811 | 811 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * |
@@ -818,45 +818,45 @@ discard block |
||
| 818 | 818 | * link rather than through the node form. |
| 819 | 819 | */ |
| 820 | 820 | function boinccore_node_control($nid = NULL, $action = NULL) { |
| 821 | - if ((!$nid OR !$node = node_load($nid)) OR |
|
| 821 | + if ((!$nid OR !$node = node_load($nid)) OR |
|
| 822 | 822 | ($node->type == 'forum' AND !user_access('edit any forum topic')) OR |
| 823 | 823 | ($node->type != 'forum' AND !user_access('administer nodes'))) { |
| 824 | 824 | // What are you even doing here... |
| 825 | 825 | return FALSE; |
| 826 | - } |
|
| 827 | - switch ($action) { |
|
| 828 | - case 'unhide': |
|
| 826 | + } |
|
| 827 | + switch ($action) { |
|
| 828 | + case 'unhide': |
|
| 829 | 829 | node_publish_action($node); |
| 830 | 830 | break; |
| 831 | - case 'hide': |
|
| 831 | + case 'hide': |
|
| 832 | 832 | node_unpublish_action($node); |
| 833 | 833 | break; |
| 834 | - case 'sticky': |
|
| 834 | + case 'sticky': |
|
| 835 | 835 | node_make_sticky_action($node); |
| 836 | 836 | break; |
| 837 | - case 'unsticky': |
|
| 837 | + case 'unsticky': |
|
| 838 | 838 | node_make_unsticky_action($node); |
| 839 | 839 | break; |
| 840 | - case 'lock': |
|
| 840 | + case 'lock': |
|
| 841 | 841 | $node->comment = 1; |
| 842 | 842 | watchdog('action', 'Locked comments on @type %title.', array( |
| 843 | - '@type' => node_get_types('name', $node), '%title' => $node->title)); |
|
| 843 | + '@type' => node_get_types('name', $node), '%title' => $node->title)); |
|
| 844 | 844 | break; |
| 845 | - case 'unlock': |
|
| 845 | + case 'unlock': |
|
| 846 | 846 | $node->comment = 2; |
| 847 | 847 | watchdog('action', 'Unlocked comments on @type %title.', array( |
| 848 | - '@type' => node_get_types('name', $node), '%title' => $node->title)); |
|
| 848 | + '@type' => node_get_types('name', $node), '%title' => $node->title)); |
|
| 849 | 849 | break; |
| 850 | - default: |
|
| 850 | + default: |
|
| 851 | 851 | } |
| 852 | - node_save($node); |
|
| 853 | - // If hiding a forum topic (node) and not an administrator, go to |
|
| 854 | - // the forum page. Otherwise the user will reach an access-denied |
|
| 855 | - // page. |
|
| 856 | - if (($action=="hide") and (!user_access('administer forums'))) { |
|
| 852 | + node_save($node); |
|
| 853 | + // If hiding a forum topic (node) and not an administrator, go to |
|
| 854 | + // the forum page. Otherwise the user will reach an access-denied |
|
| 855 | + // page. |
|
| 856 | + if (($action=="hide") and (!user_access('administer forums'))) { |
|
| 857 | 857 | drupal_goto("community/forum/{$node->tid}"); |
| 858 | - } |
|
| 859 | - drupal_goto("node/{$nid}"); |
|
| 858 | + } |
|
| 859 | + drupal_goto("node/{$nid}"); |
|
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | /** |
@@ -865,28 +865,28 @@ discard block |
||
| 865 | 865 | * through the comment edit form. |
| 866 | 866 | */ |
| 867 | 867 | function boinccore_comment_control($cid = NULL, $action = NULL) { |
| 868 | - if (!$cid OR !$comment = _comment_load($cid)) { |
|
| 868 | + if (!$cid OR !$comment = _comment_load($cid)) { |
|
| 869 | 869 | // What are you even doing here... |
| 870 | 870 | return FALSE; |
| 871 | - } |
|
| 872 | - $return_path = "node/{$comment->nid}"; |
|
| 873 | - $return_anchor = "comment-{$cid}"; |
|
| 874 | - switch ($action) { |
|
| 875 | - case 'unhide': |
|
| 871 | + } |
|
| 872 | + $return_path = "node/{$comment->nid}"; |
|
| 873 | + $return_anchor = "comment-{$cid}"; |
|
| 874 | + switch ($action) { |
|
| 875 | + case 'unhide': |
|
| 876 | 876 | comment_publish_action($comment); |
| 877 | 877 | rules_invoke_event('boinccore_comment_unhidden', $comment); |
| 878 | 878 | if (module_exists("boinc_solr_comments")) { |
| 879 | - boinc_solr_comments_publish($comment); |
|
| 879 | + boinc_solr_comments_publish($comment); |
|
| 880 | 880 | } |
| 881 | 881 | break; |
| 882 | - case 'hide': |
|
| 882 | + case 'hide': |
|
| 883 | 883 | comment_unpublish_action($comment); |
| 884 | 884 | rules_invoke_event('comment_unpublish', $comment); |
| 885 | 885 | if (module_exists("boinc_solr_comments")) { |
| 886 | - boinc_solr_comments_unpublish($comment); |
|
| 886 | + boinc_solr_comments_unpublish($comment); |
|
| 887 | 887 | } |
| 888 | 888 | break; |
| 889 | - case 'convert': |
|
| 889 | + case 'convert': |
|
| 890 | 890 | $node = new stdClass(); |
| 891 | 891 | $node->name = $comment->subject; |
| 892 | 892 | $node->title = $node->name; |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | $node->tid = $parent_node->tid; |
| 907 | 907 | |
| 908 | 908 | if (filter_access($comment->format)) { |
| 909 | - $node->format = $comment->format; |
|
| 909 | + $node->format = $comment->format; |
|
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | // Save the new node |
@@ -922,9 +922,9 @@ discard block |
||
| 922 | 922 | $return_path = "node/{$node->nid}"; |
| 923 | 923 | $return_anchor = NULL; |
| 924 | 924 | break; |
| 925 | - default: |
|
| 925 | + default: |
|
| 926 | 926 | } |
| 927 | - drupal_goto($return_path, NULL, $return_anchor); |
|
| 927 | + drupal_goto($return_path, NULL, $return_anchor); |
|
| 928 | 928 | } |
| 929 | 929 | |
| 930 | 930 | /** |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | * Get the authenticator for a given account |
| 933 | 933 | */ |
| 934 | 934 | function boinccore_lookup_account() { |
| 935 | - include_boinc('user/lookup_account.php'); |
|
| 935 | + include_boinc('user/lookup_account.php'); |
|
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | /** |
@@ -940,29 +940,29 @@ discard block |
||
| 940 | 940 | * Get assorted details for a given account |
| 941 | 941 | */ |
| 942 | 942 | function boinccore_am_get_info() { |
| 943 | - // Remove q from the GET request or BOINC will panic |
|
| 944 | - unset($_GET['q']); |
|
| 945 | - // Capture the XML output of the RPC so we can override things |
|
| 946 | - ob_start(); |
|
| 947 | - include_boinc('user/am_get_info.php'); |
|
| 948 | - $xml = ob_get_clean(); |
|
| 949 | - $xml = load_configuration($xml); |
|
| 950 | - // See if the account has an approved profile in Drupal |
|
| 951 | - $uid = !empty($xml['am_get_info_reply']['id']) ? boincuser_lookup_uid($xml['am_get_info_reply']['id']) : 0; |
|
| 952 | - if ($uid) { |
|
| 943 | + // Remove q from the GET request or BOINC will panic |
|
| 944 | + unset($_GET['q']); |
|
| 945 | + // Capture the XML output of the RPC so we can override things |
|
| 946 | + ob_start(); |
|
| 947 | + include_boinc('user/am_get_info.php'); |
|
| 948 | + $xml = ob_get_clean(); |
|
| 949 | + $xml = load_configuration($xml); |
|
| 950 | + // See if the account has an approved profile in Drupal |
|
| 951 | + $uid = !empty($xml['am_get_info_reply']['id']) ? boincuser_lookup_uid($xml['am_get_info_reply']['id']) : 0; |
|
| 952 | + if ($uid) { |
|
| 953 | 953 | $content_profile = content_profile_load('profile', $uid); |
| 954 | 954 | $profile_is_approved = ($content_profile->status AND !$content_profile->moderate); |
| 955 | 955 | $country = check_plain($content_profile->field_country[0]['value']); |
| 956 | 956 | $website = ''; |
| 957 | 957 | if ($profile_is_approved) { |
| 958 | - $website = check_plain($content_profile->field_url[0]['value']); |
|
| 958 | + $website = check_plain($content_profile->field_url[0]['value']); |
|
| 959 | 959 | } |
| 960 | 960 | // Override BOINC values with Drupal values as needed |
| 961 | 961 | $xml['am_get_info_reply']['has_profile']['@value'] = ($profile_is_approved) ? 1 : 0; |
| 962 | 962 | $xml['am_get_info_reply']['country']['@value'] = $country; |
| 963 | 963 | $xml['am_get_info_reply']['url']['@value'] = $website; |
| 964 | - } |
|
| 965 | - print save_configuration($xml); |
|
| 964 | + } |
|
| 965 | + print save_configuration($xml); |
|
| 966 | 966 | } |
| 967 | 967 | |
| 968 | 968 | /** |
@@ -970,75 +970,75 @@ discard block |
||
| 970 | 970 | * Update assorted details for a given account |
| 971 | 971 | */ |
| 972 | 972 | function boinccore_am_set_info() { |
| 973 | - // Remove q from the GET request or BOINC will panic |
|
| 974 | - unset($_GET['q']); |
|
| 975 | - // Validate the XML prefs (in case BOINC does not) |
|
| 976 | - $global_prefs = !empty($_POST['global_prefs']) ? $_POST['global_prefs'] : (!empty($_GET['global_prefs']) ? $_GET['global_prefs'] : NULL); |
|
| 977 | - $project_prefs = !empty($_POST['project_prefs']) ? $_POST['project_prefs'] : (!empty($_GET['project_prefs']) ? $_GET['project_prefs'] : NULL); |
|
| 978 | - libxml_use_internal_errors(true); |
|
| 979 | - $xml = new DomDocument(); |
|
| 980 | - if ($global_prefs) { |
|
| 973 | + // Remove q from the GET request or BOINC will panic |
|
| 974 | + unset($_GET['q']); |
|
| 975 | + // Validate the XML prefs (in case BOINC does not) |
|
| 976 | + $global_prefs = !empty($_POST['global_prefs']) ? $_POST['global_prefs'] : (!empty($_GET['global_prefs']) ? $_GET['global_prefs'] : NULL); |
|
| 977 | + $project_prefs = !empty($_POST['project_prefs']) ? $_POST['project_prefs'] : (!empty($_GET['project_prefs']) ? $_GET['project_prefs'] : NULL); |
|
| 978 | + libxml_use_internal_errors(true); |
|
| 979 | + $xml = new DomDocument(); |
|
| 980 | + if ($global_prefs) { |
|
| 981 | 981 | $xml->loadXML($global_prefs, LIBXML_NOBLANKS); |
| 982 | 982 | if ($errors = libxml_get_errors($xml)) { |
| 983 | - $lines = explode("\r", $global_prefs); |
|
| 984 | - watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 983 | + $lines = explode("\r", $global_prefs); |
|
| 984 | + watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 985 | 985 | ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
| 986 | 986 | } |
| 987 | - } |
|
| 988 | - elseif ($project_prefs) { |
|
| 987 | + } |
|
| 988 | + elseif ($project_prefs) { |
|
| 989 | 989 | $xml->loadXML($project_prefs, LIBXML_NOBLANKS); |
| 990 | 990 | if ($errors = libxml_get_errors($xml)) { |
| 991 | - $lines = explode("\r", $project_prefs); |
|
| 992 | - watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 991 | + $lines = explode("\r", $project_prefs); |
|
| 992 | + watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 993 | 993 | ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
| 994 | 994 | } |
| 995 | - } |
|
| 996 | - if (!$errors) { |
|
| 995 | + } |
|
| 996 | + if (!$errors) { |
|
| 997 | 997 | // Capture the XML output of the RPC so we can override things |
| 998 | 998 | ob_start(); |
| 999 | 999 | include_boinc('user/am_set_info.php'); |
| 1000 | 1000 | $xml = ob_get_clean(); |
| 1001 | 1001 | $xml = load_configuration($xml); |
| 1002 | 1002 | if (isset($xml['am_set_info_reply']['success'])) { |
| 1003 | - // Find the account in Drupal |
|
| 1004 | - $boinc_auth = !empty($_POST['account_key']) ? $_POST['account_key'] : $_GET['account_key']; |
|
| 1005 | - db_set_active('boinc_rw'); |
|
| 1006 | - $boinc_id = db_result(db_query(" |
|
| 1003 | + // Find the account in Drupal |
|
| 1004 | + $boinc_auth = !empty($_POST['account_key']) ? $_POST['account_key'] : $_GET['account_key']; |
|
| 1005 | + db_set_active('boinc_rw'); |
|
| 1006 | + $boinc_id = db_result(db_query(" |
|
| 1007 | 1007 | SELECT id |
| 1008 | 1008 | FROM {user} |
| 1009 | 1009 | WHERE authenticator = '%s'", |
| 1010 | 1010 | $boinc_auth |
| 1011 | - )); |
|
| 1012 | - db_set_active('default'); |
|
| 1013 | - $uid = boincuser_lookup_uid($boinc_id); |
|
| 1011 | + )); |
|
| 1012 | + db_set_active('default'); |
|
| 1013 | + $uid = boincuser_lookup_uid($boinc_id); |
|
| 1014 | 1014 | |
| 1015 | - // Apply any relevant updates to the Drupal account, also |
|
| 1016 | - $country = !empty($_POST['country']) ? $_POST['country'] : (!empty($_GET['country']) ? $_GET['country'] : NULL); |
|
| 1017 | - $url = !empty($_POST['url']) ? $_POST['url'] : (!empty($_GET['url']) ? $_GET['url'] : NULL); |
|
| 1018 | - $email_addr = !empty($_POST['email_addr']) ? $_POST['email_addr'] : (!empty($_GET['email_addr']) ? $_GET['email_addr'] : NULL); |
|
| 1015 | + // Apply any relevant updates to the Drupal account, also |
|
| 1016 | + $country = !empty($_POST['country']) ? $_POST['country'] : (!empty($_GET['country']) ? $_GET['country'] : NULL); |
|
| 1017 | + $url = !empty($_POST['url']) ? $_POST['url'] : (!empty($_GET['url']) ? $_GET['url'] : NULL); |
|
| 1018 | + $email_addr = !empty($_POST['email_addr']) ? $_POST['email_addr'] : (!empty($_GET['email_addr']) ? $_GET['email_addr'] : NULL); |
|
| 1019 | 1019 | |
| 1020 | - if ($email_addr) { |
|
| 1020 | + if ($email_addr) { |
|
| 1021 | 1021 | $account = user_load($uid); |
| 1022 | 1022 | user_save($account, array('mail' => $email_addr)); |
| 1023 | - } |
|
| 1024 | - if ($country OR $url) { |
|
| 1023 | + } |
|
| 1024 | + if ($country OR $url) { |
|
| 1025 | 1025 | $content_profile = content_profile_load('profile', $uid); |
| 1026 | 1026 | if ($country) $content_profile->field_country[0]['value'] = $country; |
| 1027 | 1027 | if ($url) $content_profile->field_url[0]['value'] = $url; |
| 1028 | 1028 | node_save($content_profile); |
| 1029 | - } |
|
| 1029 | + } |
|
| 1030 | 1030 | } |
| 1031 | - } |
|
| 1032 | - else { |
|
| 1031 | + } |
|
| 1032 | + else { |
|
| 1033 | 1033 | $xml = array( |
| 1034 | - 'error' => array( |
|
| 1034 | + 'error' => array( |
|
| 1035 | 1035 | 'error_num' => -112, |
| 1036 | 1036 | 'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}" . |
| 1037 | 1037 | ': <br/>' . htmlentities($lines[$errors[0]->line - 1]) |
| 1038 | - ), |
|
| 1038 | + ), |
|
| 1039 | 1039 | ); |
| 1040 | - } |
|
| 1041 | - print save_configuration($xml); |
|
| 1040 | + } |
|
| 1041 | + print save_configuration($xml); |
|
| 1042 | 1042 | } |
| 1043 | 1043 | |
| 1044 | 1044 | /** |
@@ -1046,17 +1046,17 @@ discard block |
||
| 1046 | 1046 | * Update the venue for the given host |
| 1047 | 1047 | */ |
| 1048 | 1048 | function boinccore_am_set_host_info() { |
| 1049 | - // Remove q from the GET request or BOINC will panic |
|
| 1050 | - unset($_GET['q']); |
|
| 1051 | - // Capture the XML output of the RPC so we can override things |
|
| 1052 | - ob_start(); |
|
| 1053 | - include_boinc('user/am_set_host_info.php'); |
|
| 1054 | - $xml = ob_get_clean(); |
|
| 1055 | - $xml = load_configuration($xml); |
|
| 1056 | - if (isset($xml['am_set_host_info_reply']['success'])) { |
|
| 1049 | + // Remove q from the GET request or BOINC will panic |
|
| 1050 | + unset($_GET['q']); |
|
| 1051 | + // Capture the XML output of the RPC so we can override things |
|
| 1052 | + ob_start(); |
|
| 1053 | + include_boinc('user/am_set_host_info.php'); |
|
| 1054 | + $xml = ob_get_clean(); |
|
| 1055 | + $xml = load_configuration($xml); |
|
| 1056 | + if (isset($xml['am_set_host_info_reply']['success'])) { |
|
| 1057 | 1057 | // Override anything that needs overriding |
| 1058 | - } |
|
| 1059 | - print save_configuration($xml); |
|
| 1058 | + } |
|
| 1059 | + print save_configuration($xml); |
|
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | 1062 | /** |
@@ -1064,29 +1064,29 @@ discard block |
||
| 1064 | 1064 | * Get assorted details for a given account |
| 1065 | 1065 | */ |
| 1066 | 1066 | function boinccore_show_user() { |
| 1067 | - // Remove q from the GET request or BOINC will panic |
|
| 1068 | - unset($_GET['q']); |
|
| 1069 | - // Capture the XML output of the RPC so we can override things |
|
| 1070 | - ob_start(); |
|
| 1071 | - include_boinc('user/show_user.php'); |
|
| 1072 | - $xml = ob_get_clean(); |
|
| 1073 | - $xml = load_configuration($xml); |
|
| 1074 | - // See if the account has an approved profile in Drupal |
|
| 1075 | - $uid = !empty($xml['user']['id']) ? boincuser_lookup_uid($xml['user']['id']) : 0; |
|
| 1076 | - if ($uid) { |
|
| 1067 | + // Remove q from the GET request or BOINC will panic |
|
| 1068 | + unset($_GET['q']); |
|
| 1069 | + // Capture the XML output of the RPC so we can override things |
|
| 1070 | + ob_start(); |
|
| 1071 | + include_boinc('user/show_user.php'); |
|
| 1072 | + $xml = ob_get_clean(); |
|
| 1073 | + $xml = load_configuration($xml); |
|
| 1074 | + // See if the account has an approved profile in Drupal |
|
| 1075 | + $uid = !empty($xml['user']['id']) ? boincuser_lookup_uid($xml['user']['id']) : 0; |
|
| 1076 | + if ($uid) { |
|
| 1077 | 1077 | $content_profile = content_profile_load('profile', $uid); |
| 1078 | 1078 | $profile_is_approved = ($content_profile->status AND !$content_profile->moderate); |
| 1079 | 1079 | $country = check_plain($content_profile->field_country[0]['value']); |
| 1080 | 1080 | $website = ''; |
| 1081 | 1081 | if ($profile_is_approved) { |
| 1082 | - $website = check_plain($content_profile->field_url[0]['value']); |
|
| 1082 | + $website = check_plain($content_profile->field_url[0]['value']); |
|
| 1083 | 1083 | } |
| 1084 | 1084 | // Override BOINC values with Drupal values as needed |
| 1085 | 1085 | $xml['user']['has_profile']['@value'] = ($profile_is_approved) ? 1 : 0; |
| 1086 | 1086 | $xml['user']['country']['@value'] = $country; |
| 1087 | 1087 | $xml['user']['url']['@value'] = $website; |
| 1088 | - } |
|
| 1089 | - print save_configuration($xml); |
|
| 1088 | + } |
|
| 1089 | + print save_configuration($xml); |
|
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | 1092 | /** |
@@ -1094,9 +1094,9 @@ discard block |
||
| 1094 | 1094 | * Get pending credit information for a given account |
| 1095 | 1095 | */ |
| 1096 | 1096 | function boinccore_pending_credit() { |
| 1097 | - // Remove q from the GET request or BOINC will panic |
|
| 1098 | - unset($_GET['q']); |
|
| 1099 | - include_boinc('user/pending.php'); |
|
| 1097 | + // Remove q from the GET request or BOINC will panic |
|
| 1098 | + unset($_GET['q']); |
|
| 1099 | + include_boinc('user/pending.php'); |
|
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | /** |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | */ |
| 1106 | 1106 | function boinccore_create_team() { |
| 1107 | 1107 | |
| 1108 | - if (module_exists('boincteam')) { |
|
| 1108 | + if (module_exists('boincteam')) { |
|
| 1109 | 1109 | module_load_include('module', 'boincteam', 'boincteam'); |
| 1110 | 1110 | |
| 1111 | 1111 | $input_format = !empty($values['format']) ? $values['format'] : 4; |
@@ -1118,9 +1118,9 @@ discard block |
||
| 1118 | 1118 | $xml = load_configuration($xml); |
| 1119 | 1119 | |
| 1120 | 1120 | if (isset($xml['create_team_reply']['success'])) { |
| 1121 | - $boincteam_id = isset($xml['create_team_reply']['team_id']['@value']) ? $xml['create_team_reply']['team_id']['@value'] : 0; |
|
| 1121 | + $boincteam_id = isset($xml['create_team_reply']['team_id']['@value']) ? $xml['create_team_reply']['team_id']['@value'] : 0; |
|
| 1122 | 1122 | |
| 1123 | - if ($boincteam_id) { |
|
| 1123 | + if ($boincteam_id) { |
|
| 1124 | 1124 | |
| 1125 | 1125 | $boincteam = boincteam_load($boincteam_id); |
| 1126 | 1126 | $team_owner_uid = boincuser_lookup_uid($boincteam->userid); |
@@ -1128,92 +1128,92 @@ discard block |
||
| 1128 | 1128 | // Create the team node in Drupal |
| 1129 | 1129 | |
| 1130 | 1130 | $values = array( |
| 1131 | - 'name' => isset($_GET['name']) ? $_GET['name'] : '', |
|
| 1132 | - 'description' => isset($_GET['description']) ? $_GET['description'] : '', |
|
| 1133 | - 'type' => isset($_GET['type']) ? $_GET['type'] : '', |
|
| 1131 | + 'name' => isset($_GET['name']) ? $_GET['name'] : '', |
|
| 1132 | + 'description' => isset($_GET['description']) ? $_GET['description'] : '', |
|
| 1133 | + 'type' => isset($_GET['type']) ? $_GET['type'] : '', |
|
| 1134 | 1134 | ); |
| 1135 | 1135 | $teaser = node_teaser($values['description']); |
| 1136 | 1136 | $created_time = time(); |
| 1137 | 1137 | |
| 1138 | 1138 | $node = array( |
| 1139 | - 'type' => 'team', |
|
| 1140 | - 'title' => $values['name'], |
|
| 1141 | - 'body' => $values['description'], |
|
| 1142 | - 'teaser' => $teaser, |
|
| 1143 | - 'uid' => $team_owner_uid, |
|
| 1144 | - 'path' => null, |
|
| 1145 | - 'status' => 1, // published or not - always publish |
|
| 1146 | - 'promote' => 0, |
|
| 1147 | - 'created' => $created_time, |
|
| 1148 | - 'comment' => 0, // comments disabled |
|
| 1149 | - 'moderate' => 0, |
|
| 1150 | - 'sticky' => 0, |
|
| 1151 | - 'format' => $input_format |
|
| 1139 | + 'type' => 'team', |
|
| 1140 | + 'title' => $values['name'], |
|
| 1141 | + 'body' => $values['description'], |
|
| 1142 | + 'teaser' => $teaser, |
|
| 1143 | + 'uid' => $team_owner_uid, |
|
| 1144 | + 'path' => null, |
|
| 1145 | + 'status' => 1, // published or not - always publish |
|
| 1146 | + 'promote' => 0, |
|
| 1147 | + 'created' => $created_time, |
|
| 1148 | + 'comment' => 0, // comments disabled |
|
| 1149 | + 'moderate' => 0, |
|
| 1150 | + 'sticky' => 0, |
|
| 1151 | + 'format' => $input_format |
|
| 1152 | 1152 | ); |
| 1153 | 1153 | |
| 1154 | 1154 | // Use pathauto function, if available, to clean up the path |
| 1155 | 1155 | if (module_exists('pathauto')) { |
| 1156 | - module_load_include('inc', 'pathauto', 'pathauto'); |
|
| 1157 | - $node['path'] = pathauto_cleanstring($values['name']); |
|
| 1156 | + module_load_include('inc', 'pathauto', 'pathauto'); |
|
| 1157 | + $node['path'] = pathauto_cleanstring($values['name']); |
|
| 1158 | 1158 | |
| 1159 | - $node = (object) $node; // node_save requires an object form |
|
| 1160 | - $team_categories = taxonomy_get_term_by_name($values['type']); |
|
| 1161 | - $node->taxonomy[] = $team_categories[0]; |
|
| 1159 | + $node = (object) $node; // node_save requires an object form |
|
| 1160 | + $team_categories = taxonomy_get_term_by_name($values['type']); |
|
| 1161 | + $node->taxonomy[] = $team_categories[0]; |
|
| 1162 | 1162 | |
| 1163 | - // Save the team node |
|
| 1164 | - node_save($node); |
|
| 1165 | - // Save the team IDs to a BOINC <--> Drupal reference table. |
|
| 1166 | - db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam_id, $node->nid); |
|
| 1163 | + // Save the team node |
|
| 1164 | + node_save($node); |
|
| 1165 | + // Save the team IDs to a BOINC <--> Drupal reference table. |
|
| 1166 | + db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam_id, $node->nid); |
|
| 1167 | 1167 | } |
| 1168 | 1168 | else { |
| 1169 | - $xml['create_team_reply']['warning'] = t( |
|
| 1169 | + $xml['create_team_reply']['warning'] = t( |
|
| 1170 | 1170 | 'There was a problem integrating this team into Drupal. Please |
| 1171 | 1171 | contact @project administrators!', array('@project' => PROJECT) |
| 1172 | - ); |
|
| 1173 | - watchdog( |
|
| 1172 | + ); |
|
| 1173 | + watchdog( |
|
| 1174 | 1174 | 'BOINC team', |
| 1175 | 1175 | 'BOINC teams require the Pathauto module. Team cannot be created in |
| 1176 | 1176 | Drupal via create_team.php RPC.', |
| 1177 | 1177 | array(), |
| 1178 | 1178 | WATCHDOG_ERROR |
| 1179 | - ); |
|
| 1180 | - // Delete from the BOINC DB if we can't sync with Drupal |
|
| 1181 | - $boincteam::delete(); |
|
| 1179 | + ); |
|
| 1180 | + // Delete from the BOINC DB if we can't sync with Drupal |
|
| 1181 | + $boincteam::delete(); |
|
| 1182 | 1182 | } |
| 1183 | - } |
|
| 1184 | - else { |
|
| 1183 | + } |
|
| 1184 | + else { |
|
| 1185 | 1185 | $xml['create_team_reply']['warning'] = t( |
| 1186 | - 'There was a problem integrating this team into Drupal. Please |
|
| 1186 | + 'There was a problem integrating this team into Drupal. Please |
|
| 1187 | 1187 | contact @project administrators!', array('@project' => PROJECT) |
| 1188 | 1188 | ); |
| 1189 | 1189 | watchdog( |
| 1190 | - 'BOINC team', |
|
| 1191 | - 'Team cannot be created in Drupal via create_team.php RPC because no |
|
| 1190 | + 'BOINC team', |
|
| 1191 | + 'Team cannot be created in Drupal via create_team.php RPC because no |
|
| 1192 | 1192 | BOINC team ID was returned in the XML.', |
| 1193 | - array(), |
|
| 1194 | - WATCHDOG_ERROR |
|
| 1193 | + array(), |
|
| 1194 | + WATCHDOG_ERROR |
|
| 1195 | 1195 | ); |
| 1196 | - } |
|
| 1196 | + } |
|
| 1197 | 1197 | } |
| 1198 | - } |
|
| 1199 | - else { |
|
| 1198 | + } |
|
| 1199 | + else { |
|
| 1200 | 1200 | $xml = array( |
| 1201 | - 'error' => array( |
|
| 1201 | + 'error' => array( |
|
| 1202 | 1202 | 'error_num' => -1, |
| 1203 | 1203 | 'error_msg' => t( |
| 1204 | - 'Teams are not enabled for this project' |
|
| 1204 | + 'Teams are not enabled for this project' |
|
| 1205 | + ), |
|
| 1205 | 1206 | ), |
| 1206 | - ), |
|
| 1207 | 1207 | ); |
| 1208 | 1208 | watchdog( |
| 1209 | - 'BOINC team', |
|
| 1210 | - 'Team cannot be created in Drupal via create_team.php RPC because the |
|
| 1209 | + 'BOINC team', |
|
| 1210 | + 'Team cannot be created in Drupal via create_team.php RPC because the |
|
| 1211 | 1211 | BOINC team module is not enabled.', |
| 1212 | - array(), |
|
| 1213 | - WATCHDOG_ERROR |
|
| 1212 | + array(), |
|
| 1213 | + WATCHDOG_ERROR |
|
| 1214 | 1214 | ); |
| 1215 | - } |
|
| 1216 | - print save_configuration($xml); |
|
| 1215 | + } |
|
| 1216 | + print save_configuration($xml); |
|
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | 1219 | /** |
@@ -1221,9 +1221,9 @@ discard block |
||
| 1221 | 1221 | * Get info on a team by ID or a list of teams that match a given name |
| 1222 | 1222 | */ |
| 1223 | 1223 | function boinccore_team_lookup() { |
| 1224 | - // Remove q from the GET request or BOINC will panic |
|
| 1225 | - unset($_GET['q']); |
|
| 1226 | - include_boinc('user/team_lookup.php'); |
|
| 1224 | + // Remove q from the GET request or BOINC will panic |
|
| 1225 | + unset($_GET['q']); |
|
| 1226 | + include_boinc('user/team_lookup.php'); |
|
| 1227 | 1227 | } |
| 1228 | 1228 | |
| 1229 | 1229 | /** |
@@ -1231,72 +1231,72 @@ discard block |
||
| 1231 | 1231 | * Get members of a given team |
| 1232 | 1232 | */ |
| 1233 | 1233 | function boinccore_team_email_list() { |
| 1234 | - // See if the account has an approved profile in Drupal |
|
| 1235 | - $boincteam_id = !empty($_POST['teamid']) ? $_POST['teamid'] : $_GET['teamid']; |
|
| 1236 | - $credit_only = !empty($_POST['creditonly']) ? $_POST['creditonly'] : $_GET['creditonly']; |
|
| 1237 | - $show_xml = !empty($_POST['xml']) ? $_POST['xml'] : $_GET['xml']; |
|
| 1238 | - if (!$show_xml) { |
|
| 1239 | - // creditonly does not affect non xml output in BOINC |
|
| 1240 | - $credit_only = FALSE; |
|
| 1241 | - } |
|
| 1242 | - $xml = array(); |
|
| 1234 | + // See if the account has an approved profile in Drupal |
|
| 1235 | + $boincteam_id = !empty($_POST['teamid']) ? $_POST['teamid'] : $_GET['teamid']; |
|
| 1236 | + $credit_only = !empty($_POST['creditonly']) ? $_POST['creditonly'] : $_GET['creditonly']; |
|
| 1237 | + $show_xml = !empty($_POST['xml']) ? $_POST['xml'] : $_GET['xml']; |
|
| 1238 | + if (!$show_xml) { |
|
| 1239 | + // creditonly does not affect non xml output in BOINC |
|
| 1240 | + $credit_only = FALSE; |
|
| 1241 | + } |
|
| 1242 | + $xml = array(); |
|
| 1243 | 1243 | |
| 1244 | - if ($boincteam_id && is_numeric($boincteam_id)) { |
|
| 1244 | + if ($boincteam_id && is_numeric($boincteam_id)) { |
|
| 1245 | 1245 | if ($credit_only) { |
| 1246 | - db_set_active('boinc_rw'); |
|
| 1247 | - $result = db_query(" |
|
| 1246 | + db_set_active('boinc_rw'); |
|
| 1247 | + $result = db_query(" |
|
| 1248 | 1248 | SELECT |
| 1249 | 1249 | u.id, u.name, u.cross_project_id, u.email_addr, u.total_credit, u.expavg_credit, u.expavg_time |
| 1250 | 1250 | FROM {user} u |
| 1251 | 1251 | WHERE u.teamid = %d and u.total_credit > 0", |
| 1252 | 1252 | $boincteam_id |
| 1253 | - ); |
|
| 1254 | - db_set_active('default'); |
|
| 1253 | + ); |
|
| 1254 | + db_set_active('default'); |
|
| 1255 | 1255 | |
| 1256 | - $xml = array('users' => array()); |
|
| 1257 | - while ($member = db_fetch_object($result)) { |
|
| 1256 | + $xml = array('users' => array()); |
|
| 1257 | + while ($member = db_fetch_object($result)) { |
|
| 1258 | 1258 | $team_member = array( |
| 1259 | - 'id' => $member->id, |
|
| 1260 | - 'cpid' => md5($member->cross_project_id.$member->email_addr), |
|
| 1261 | - 'name' => htmlspecialchars($member->name), |
|
| 1262 | - 'total_credit' => round($member->total_credit), |
|
| 1263 | - 'expavg_credit' => round($member->expavg_credit), |
|
| 1264 | - 'expavg_time' => round($member->expavg_time), |
|
| 1259 | + 'id' => $member->id, |
|
| 1260 | + 'cpid' => md5($member->cross_project_id.$member->email_addr), |
|
| 1261 | + 'name' => htmlspecialchars($member->name), |
|
| 1262 | + 'total_credit' => round($member->total_credit), |
|
| 1263 | + 'expavg_credit' => round($member->expavg_credit), |
|
| 1264 | + 'expavg_time' => round($member->expavg_time), |
|
| 1265 | 1265 | ); |
| 1266 | 1266 | $xml['users']['user'][] = $team_member; |
| 1267 | - } |
|
| 1267 | + } |
|
| 1268 | 1268 | } |
| 1269 | 1269 | else { |
| 1270 | - // Query BOINC database user table |
|
| 1271 | - db_set_active('boinc_rw'); |
|
| 1272 | - $result = db_query(" |
|
| 1270 | + // Query BOINC database user table |
|
| 1271 | + db_set_active('boinc_rw'); |
|
| 1272 | + $result = db_query(" |
|
| 1273 | 1273 | SELECT |
| 1274 | 1274 | u.id, u.name, u.cross_project_id, u.create_time, u.email_addr, u.total_credit, u.expavg_credit, u.expavg_time |
| 1275 | 1275 | FROM {user} u |
| 1276 | 1276 | WHERE u.teamid = %d ORDER BY u.email_addr ASC", |
| 1277 | 1277 | $boincteam_id |
| 1278 | - ); |
|
| 1279 | - db_set_active('default'); |
|
| 1278 | + ); |
|
| 1279 | + db_set_active('default'); |
|
| 1280 | 1280 | |
| 1281 | - // Extract information from BOINC database for team members. |
|
| 1282 | - $team_members = array(); |
|
| 1283 | - while ($member = db_fetch_object($result)) { |
|
| 1281 | + // Extract information from BOINC database for team members. |
|
| 1282 | + $team_members = array(); |
|
| 1283 | + while ($member = db_fetch_object($result)) { |
|
| 1284 | 1284 | $team_members[$member->id] = array( |
| 1285 | - 'id' => $member->id, |
|
| 1286 | - 'cpid' => md5($member->cross_project_id.$member->email_addr), |
|
| 1287 | - 'create_time' => $member->create_time, |
|
| 1288 | - 'name' => htmlspecialchars($member->name), |
|
| 1289 | - 'country' => NULL, |
|
| 1290 | - 'total_credit' => round($member->total_credit), |
|
| 1291 | - 'expavg_credit' => round($member->expavg_credit), |
|
| 1292 | - 'expavg_time' => round($member->expavg_time), |
|
| 1293 | - 'url' => NULL, |
|
| 1294 | - 'has_profile' => 0, |
|
| 1285 | + 'id' => $member->id, |
|
| 1286 | + 'cpid' => md5($member->cross_project_id.$member->email_addr), |
|
| 1287 | + 'create_time' => $member->create_time, |
|
| 1288 | + 'name' => htmlspecialchars($member->name), |
|
| 1289 | + 'country' => NULL, |
|
| 1290 | + 'total_credit' => round($member->total_credit), |
|
| 1291 | + 'expavg_credit' => round($member->expavg_credit), |
|
| 1292 | + 'expavg_time' => round($member->expavg_time), |
|
| 1293 | + 'url' => NULL, |
|
| 1294 | + 'has_profile' => 0, |
|
| 1295 | 1295 | ); |
| 1296 | - } |
|
| 1296 | + } |
|
| 1297 | 1297 | |
| 1298 | - // Query Drupal database, multiple tables |
|
| 1299 | - $sql1 = " |
|
| 1298 | + // Query Drupal database, multiple tables |
|
| 1299 | + $sql1 = " |
|
| 1300 | 1300 | SELECT |
| 1301 | 1301 | bu.boinc_id, du.uid, du.name, n.nid, n.type, n.field_country_value, n.field_url_value |
| 1302 | 1302 | FROM {boincuser} AS bu |
@@ -1307,28 +1307,28 @@ discard block |
||
| 1307 | 1307 | INNER JOIN {content_type_profile} AS p ON node.nid=p.nid |
| 1308 | 1308 | WHERE node.type='profile' ) n ON du.uid=n.uid |
| 1309 | 1309 | WHERE bu.boinc_id IN (%s)"; |
| 1310 | - $member_id_list = implode(',', array_keys($team_members)); |
|
| 1311 | - if (!$member_id_list) { |
|
| 1310 | + $member_id_list = implode(',', array_keys($team_members)); |
|
| 1311 | + if (!$member_id_list) { |
|
| 1312 | 1312 | $member_id_list = '-1'; |
| 1313 | - } |
|
| 1314 | - $result = db_query($sql1, $member_id_list); |
|
| 1315 | - while ($member = db_fetch_object($result)) { |
|
| 1313 | + } |
|
| 1314 | + $result = db_query($sql1, $member_id_list); |
|
| 1315 | + while ($member = db_fetch_object($result)) { |
|
| 1316 | 1316 | $team_members[$member->boinc_id]['country'] = $member->field_country_value; |
| 1317 | 1317 | $team_members[$member->boinc_id]['url'] = $member->field_url_value; |
| 1318 | 1318 | $team_members[$member->boinc_id]['has_profile'] = isset($member->nid) ? 1: 0; |
| 1319 | 1319 | $xml['users']['user'][] = $team_members[$member->boinc_id]; |
| 1320 | - } |
|
| 1320 | + } |
|
| 1321 | 1321 | } // end if credit_only |
| 1322 | - } |
|
| 1323 | - else { |
|
| 1322 | + } |
|
| 1323 | + else { |
|
| 1324 | 1324 | $xml = array( |
| 1325 | - 'error' => array( |
|
| 1325 | + 'error' => array( |
|
| 1326 | 1326 | 'error_num' => -136, |
| 1327 | 1327 | 'error_msg' => 'Not found', |
| 1328 | - ), |
|
| 1328 | + ), |
|
| 1329 | 1329 | ); |
| 1330 | - } // end if boincteam_id |
|
| 1331 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1330 | + } // end if boincteam_id |
|
| 1331 | + print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1332 | 1332 | } |
| 1333 | 1333 | |
| 1334 | 1334 | /** |
@@ -1336,114 +1336,114 @@ discard block |
||
| 1336 | 1336 | * Edit the forum preferences for a given user |
| 1337 | 1337 | */ |
| 1338 | 1338 | function boinccore_edit_forum_preferences() { |
| 1339 | - // Do not pass through to BOINC in this case as BOINC forums are no longer |
|
| 1340 | - // relevant -- use Drupal data only |
|
| 1339 | + // Do not pass through to BOINC in this case as BOINC forums are no longer |
|
| 1340 | + // relevant -- use Drupal data only |
|
| 1341 | 1341 | |
| 1342 | - $account_key = !empty($_POST['account_key']) ? $_POST['account_key'] : (!empty($_GET['account_key']) ? $_GET['account_key'] : NULL); |
|
| 1342 | + $account_key = !empty($_POST['account_key']) ? $_POST['account_key'] : (!empty($_GET['account_key']) ? $_GET['account_key'] : NULL); |
|
| 1343 | 1343 | |
| 1344 | - require_boinc('boinc_db'); |
|
| 1345 | - $boincuser = BoincUser::lookup_auth($account_key); |
|
| 1346 | - if ($boincuser) { |
|
| 1344 | + require_boinc('boinc_db'); |
|
| 1345 | + $boincuser = BoincUser::lookup_auth($account_key); |
|
| 1346 | + if ($boincuser) { |
|
| 1347 | 1347 | $uid = boincuser_lookup_uid($boincuser->id); |
| 1348 | 1348 | if ($uid AND $account = user_load($uid)) { |
| 1349 | - // Currently supported preferences |
|
| 1350 | - $avatar_url = isset($_POST['avatar_url']) ? $_POST['avatar_url'] : (isset($_GET['avatar_url']) ? $_GET['avatar_url'] : NULL); |
|
| 1351 | - $hide_signatures = isset($_POST['forum_hide_signatures']) ? $_POST['forum_hide_signatures'] : (isset($_GET['forum_hide_signatures']) ? $_GET['forum_hide_signatures'] : NULL); |
|
| 1352 | - $signature = isset($_POST['signature']) ? $_POST['signature'] : (isset($_GET['signature']) ? $_GET['signature'] : NULL); |
|
| 1353 | - $post_order = isset($_POST['thread_sort']) ? $_POST['thread_sort'] : (isset($_GET['thread_sort']) ? $_GET['thread_sort'] : NULL); |
|
| 1354 | - // Update preferences as needed |
|
| 1355 | - if ($avatar_url) { |
|
| 1349 | + // Currently supported preferences |
|
| 1350 | + $avatar_url = isset($_POST['avatar_url']) ? $_POST['avatar_url'] : (isset($_GET['avatar_url']) ? $_GET['avatar_url'] : NULL); |
|
| 1351 | + $hide_signatures = isset($_POST['forum_hide_signatures']) ? $_POST['forum_hide_signatures'] : (isset($_GET['forum_hide_signatures']) ? $_GET['forum_hide_signatures'] : NULL); |
|
| 1352 | + $signature = isset($_POST['signature']) ? $_POST['signature'] : (isset($_GET['signature']) ? $_GET['signature'] : NULL); |
|
| 1353 | + $post_order = isset($_POST['thread_sort']) ? $_POST['thread_sort'] : (isset($_GET['thread_sort']) ? $_GET['thread_sort'] : NULL); |
|
| 1354 | + // Update preferences as needed |
|
| 1355 | + if ($avatar_url) { |
|
| 1356 | 1356 | $avatar_image = file_get_contents($avatar_url); |
| 1357 | 1357 | if ($avatar_image) { |
| 1358 | - $image_dir = 'profiles'; |
|
| 1359 | - $image_path = "{$image_dir}/{$boincuser->id}_avatar.jpg"; |
|
| 1360 | - $file = file_save_data($avatar_image, $image_path, FILE_EXISTS_REPLACE); |
|
| 1361 | - if ($file) { |
|
| 1358 | + $image_dir = 'profiles'; |
|
| 1359 | + $image_path = "{$image_dir}/{$boincuser->id}_avatar.jpg"; |
|
| 1360 | + $file = file_save_data($avatar_image, $image_path, FILE_EXISTS_REPLACE); |
|
| 1361 | + if ($file) { |
|
| 1362 | 1362 | $profile = new stdClass(); |
| 1363 | 1363 | $profile->type = 'profile'; |
| 1364 | 1364 | $profile->language = NULL; |
| 1365 | 1365 | if ($profile_nid = content_profile_profile_exists($profile, $account->uid)) { |
| 1366 | - $profile_node = node_load($profile_nid); |
|
| 1367 | - if ($profile_node) { |
|
| 1366 | + $profile_node = node_load($profile_nid); |
|
| 1367 | + if ($profile_node) { |
|
| 1368 | 1368 | $avatar_image = get_cck_image_object(file_directory_path() . '/' . $image_path, 'field_image', 'profile', TRUE); |
| 1369 | 1369 | if ($avatar_image) { |
| 1370 | - $profile_node->field_image[0] = $avatar_image; |
|
| 1371 | - node_save($profile_node); |
|
| 1370 | + $profile_node->field_image[0] = $avatar_image; |
|
| 1371 | + node_save($profile_node); |
|
| 1372 | 1372 | } |
| 1373 | 1373 | else { |
| 1374 | - $error = 'Error saving avatar to profile'; |
|
| 1374 | + $error = 'Error saving avatar to profile'; |
|
| 1375 | 1375 | } |
| 1376 | - } |
|
| 1377 | - else { |
|
| 1376 | + } |
|
| 1377 | + else { |
|
| 1378 | 1378 | $error = 'Unable to load user profile'; |
| 1379 | - } |
|
| 1379 | + } |
|
| 1380 | 1380 | } |
| 1381 | 1381 | else { |
| 1382 | - $error = 'User has no profile, so avatar could not be added'; |
|
| 1382 | + $error = 'User has no profile, so avatar could not be added'; |
|
| 1383 | + } |
|
| 1383 | 1384 | } |
| 1384 | - } |
|
| 1385 | - else { |
|
| 1385 | + else { |
|
| 1386 | 1386 | $error = 'Unable to save remote image'; |
| 1387 | - } |
|
| 1387 | + } |
|
| 1388 | 1388 | } |
| 1389 | 1389 | else { |
| 1390 | - $error = 'Could not find avatar image at URL'; |
|
| 1390 | + $error = 'Could not find avatar image at URL'; |
|
| 1391 | 1391 | } |
| 1392 | - } |
|
| 1393 | - if ($hide_signatures !== NULL) { |
|
| 1392 | + } |
|
| 1393 | + if ($hide_signatures !== NULL) { |
|
| 1394 | 1394 | user_save($account, array('hide_signatures' => ($hide_signatures ? 1 : 0))); |
| 1395 | - } |
|
| 1396 | - if ($signature !== NULL) { |
|
| 1395 | + } |
|
| 1396 | + if ($signature !== NULL) { |
|
| 1397 | 1397 | $signature = check_markup($signature); |
| 1398 | 1398 | user_save($account, array('signature' => $signature)); |
| 1399 | - } |
|
| 1400 | - if ($post_order) { |
|
| 1399 | + } |
|
| 1400 | + if ($post_order) { |
|
| 1401 | 1401 | require_boinc('forum'); |
| 1402 | 1402 | $post_order_map = array( |
| 1403 | - CREATE_TIME_OLD => 2, |
|
| 1404 | - CREATE_TIME_NEW => 1, |
|
| 1403 | + CREATE_TIME_OLD => 2, |
|
| 1404 | + CREATE_TIME_NEW => 1, |
|
| 1405 | 1405 | ); |
| 1406 | 1406 | $drupal_post_order = isset($post_order_map[$post_order]) ? $post_order_map[$post_order] : 2; |
| 1407 | 1407 | user_save($account, array('sort' => $drupal_post_order)); |
| 1408 | - } |
|
| 1409 | - if (!$error) { |
|
| 1408 | + } |
|
| 1409 | + if (!$error) { |
|
| 1410 | 1410 | // Success |
| 1411 | 1411 | $xml = array( |
| 1412 | - 'edit_forum_preferences' => array( |
|
| 1412 | + 'edit_forum_preferences' => array( |
|
| 1413 | 1413 | 'success' => NULL, |
| 1414 | - ), |
|
| 1414 | + ), |
|
| 1415 | 1415 | ); |
| 1416 | - } |
|
| 1417 | - else { |
|
| 1416 | + } |
|
| 1417 | + else { |
|
| 1418 | 1418 | // Failure |
| 1419 | 1419 | $xml = array( |
| 1420 | - 'error' => array( |
|
| 1420 | + 'error' => array( |
|
| 1421 | 1421 | 'error_num' => -1, |
| 1422 | 1422 | 'error_msg' => $error, |
| 1423 | - ), |
|
| 1423 | + ), |
|
| 1424 | 1424 | ); |
| 1425 | - } |
|
| 1425 | + } |
|
| 1426 | 1426 | } |
| 1427 | 1427 | else { |
| 1428 | - // Drupal user not found |
|
| 1429 | - $xml = array( |
|
| 1428 | + // Drupal user not found |
|
| 1429 | + $xml = array( |
|
| 1430 | 1430 | 'error' => array( |
| 1431 | - 'error_num' => -1, |
|
| 1432 | - 'error_msg' => 'Unknown error', |
|
| 1431 | + 'error_num' => -1, |
|
| 1432 | + 'error_msg' => 'Unknown error', |
|
| 1433 | 1433 | ), |
| 1434 | - ); |
|
| 1434 | + ); |
|
| 1435 | 1435 | } |
| 1436 | - } |
|
| 1437 | - else { |
|
| 1436 | + } |
|
| 1437 | + else { |
|
| 1438 | 1438 | // BOINC user not found |
| 1439 | 1439 | $xml = array( |
| 1440 | - 'error' => array( |
|
| 1440 | + 'error' => array( |
|
| 1441 | 1441 | 'error_num' => -136, |
| 1442 | 1442 | 'error_msg' => 'Not found', |
| 1443 | - ), |
|
| 1443 | + ), |
|
| 1444 | 1444 | ); |
| 1445 | - } |
|
| 1446 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1445 | + } |
|
| 1446 | + print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1447 | 1447 | } |
| 1448 | 1448 | |
| 1449 | 1449 | /** |
@@ -1451,14 +1451,14 @@ discard block |
||
| 1451 | 1451 | * Get the last comments OR threads made by a given user |
| 1452 | 1452 | */ |
| 1453 | 1453 | function boinccore_forum_get_data() { |
| 1454 | - // Do not pass through to BOINC in this case as BOINC forums are no longer |
|
| 1455 | - // relevant -- use Drupal data only |
|
| 1454 | + // Do not pass through to BOINC in this case as BOINC forums are no longer |
|
| 1455 | + // relevant -- use Drupal data only |
|
| 1456 | 1456 | |
| 1457 | - $xml = array(); |
|
| 1458 | - $boinc_id = !empty($_POST['userid']) ? $_POST['userid'] : (!empty($_GET['userid']) ? $_GET['userid'] : NULL); |
|
| 1459 | - $uid = boincuser_lookup_uid($boinc_id); |
|
| 1457 | + $xml = array(); |
|
| 1458 | + $boinc_id = !empty($_POST['userid']) ? $_POST['userid'] : (!empty($_GET['userid']) ? $_GET['userid'] : NULL); |
|
| 1459 | + $uid = boincuser_lookup_uid($boinc_id); |
|
| 1460 | 1460 | |
| 1461 | - if ($uid) { |
|
| 1461 | + if ($uid) { |
|
| 1462 | 1462 | $method = !empty($_POST['method']) ? $_POST['method'] : (!empty($_GET['method']) ? $_GET['method'] : NULL); |
| 1463 | 1463 | $count = !empty($_POST['count']) ? $_POST['count'] : (!empty($_GET['count']) ? $_GET['count'] : NULL); |
| 1464 | 1464 | if (!$count) $count = 10; |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | switch ($method) { |
| 1467 | 1467 | case 'user_posts': |
| 1468 | 1468 | $content_length = !empty($_POST['content_length']) ? $_POST['content_length'] : (!empty($_GET['content_length']) ? $_GET['content_length'] : NULL); |
| 1469 | - $posts = db_query(" |
|
| 1469 | + $posts = db_query(" |
|
| 1470 | 1470 | SELECT |
| 1471 | 1471 | c.cid, |
| 1472 | 1472 | n.nid, |
@@ -1480,26 +1480,26 @@ discard block |
||
| 1480 | 1480 | ORDER BY timestamp DESC |
| 1481 | 1481 | LIMIT %d", |
| 1482 | 1482 | $uid, (int) $count |
| 1483 | - ); |
|
| 1484 | - $xml = array( |
|
| 1483 | + ); |
|
| 1484 | + $xml = array( |
|
| 1485 | 1485 | 'rpc_response' => array( |
| 1486 | - 'count' => 0, |
|
| 1487 | - 'posts' => array(), |
|
| 1486 | + 'count' => 0, |
|
| 1487 | + 'posts' => array(), |
|
| 1488 | 1488 | ), |
| 1489 | - ); |
|
| 1490 | - $post_count = 0; |
|
| 1491 | - while ($post = db_fetch_object($posts)) { |
|
| 1489 | + ); |
|
| 1490 | + $post_count = 0; |
|
| 1491 | + while ($post = db_fetch_object($posts)) { |
|
| 1492 | 1492 | $xml['rpc_response']['posts']['post'][] = array( |
| 1493 | - 'id' => $post->cid, |
|
| 1494 | - 'threadid' => $post->nid, |
|
| 1495 | - 'threadtitle' => $post->title, |
|
| 1496 | - 'timestamp' => $post->timestamp, |
|
| 1497 | - 'content' => ($content_length ? substr($post->comment, 0, $content_length) : $post->comment), |
|
| 1493 | + 'id' => $post->cid, |
|
| 1494 | + 'threadid' => $post->nid, |
|
| 1495 | + 'threadtitle' => $post->title, |
|
| 1496 | + 'timestamp' => $post->timestamp, |
|
| 1497 | + 'content' => ($content_length ? substr($post->comment, 0, $content_length) : $post->comment), |
|
| 1498 | 1498 | ); |
| 1499 | 1499 | $post_count++; |
| 1500 | - } |
|
| 1501 | - $xml['rpc_response']['count'] = $post_count; |
|
| 1502 | - break; |
|
| 1500 | + } |
|
| 1501 | + $xml['rpc_response']['count'] = $post_count; |
|
| 1502 | + break; |
|
| 1503 | 1503 | |
| 1504 | 1504 | case 'user_threads': |
| 1505 | 1505 | $threads = db_query(" |
@@ -1523,45 +1523,45 @@ discard block |
||
| 1523 | 1523 | ORDER BY changed DESC |
| 1524 | 1524 | LIMIT %d", |
| 1525 | 1525 | $uid, (int) $count |
| 1526 | - ); |
|
| 1527 | - $xml = array( |
|
| 1526 | + ); |
|
| 1527 | + $xml = array( |
|
| 1528 | 1528 | 'rpc_response' => array( |
| 1529 | - 'count' => 0, |
|
| 1530 | - 'threads' => array(), |
|
| 1529 | + 'count' => 0, |
|
| 1530 | + 'threads' => array(), |
|
| 1531 | 1531 | ), |
| 1532 | - ); |
|
| 1533 | - $thread_count = 0; |
|
| 1534 | - while ($thread = db_fetch_object($threads)) { |
|
| 1532 | + ); |
|
| 1533 | + $thread_count = 0; |
|
| 1534 | + while ($thread = db_fetch_object($threads)) { |
|
| 1535 | 1535 | $xml['rpc_response']['threads']['thread'][] = array( |
| 1536 | - 'id' => $thread->nid, |
|
| 1537 | - 'forumid' => $thread->tid, |
|
| 1538 | - 'replies' => $thread->replies, |
|
| 1539 | - 'views' => $thread->views, |
|
| 1540 | - 'timestamp' => $thread->changed, |
|
| 1541 | - 'title' => $thread->title, |
|
| 1536 | + 'id' => $thread->nid, |
|
| 1537 | + 'forumid' => $thread->tid, |
|
| 1538 | + 'replies' => $thread->replies, |
|
| 1539 | + 'views' => $thread->views, |
|
| 1540 | + 'timestamp' => $thread->changed, |
|
| 1541 | + 'title' => $thread->title, |
|
| 1542 | 1542 | ); |
| 1543 | 1543 | $thread_count++; |
| 1544 | - } |
|
| 1545 | - $xml['rpc_response']['count'] = $thread_count; |
|
| 1546 | - break; |
|
| 1544 | + } |
|
| 1545 | + $xml['rpc_response']['count'] = $thread_count; |
|
| 1546 | + break; |
|
| 1547 | 1547 | default: |
| 1548 | 1548 | $xml = array( |
| 1549 | 1549 | 'error' => array( |
| 1550 | - 'error_num' => -1, |
|
| 1551 | - 'error_msg' => 'Unknown error', |
|
| 1550 | + 'error_num' => -1, |
|
| 1551 | + 'error_msg' => 'Unknown error', |
|
| 1552 | 1552 | ), |
| 1553 | - ); |
|
| 1553 | + ); |
|
| 1554 | 1554 | } |
| 1555 | - } |
|
| 1556 | - else { |
|
| 1555 | + } |
|
| 1556 | + else { |
|
| 1557 | 1557 | $xml = array( |
| 1558 | - 'error' => array( |
|
| 1558 | + 'error' => array( |
|
| 1559 | 1559 | 'error_num' => -136, |
| 1560 | 1560 | 'error_msg' => 'Not found', |
| 1561 | - ), |
|
| 1561 | + ), |
|
| 1562 | 1562 | ); |
| 1563 | - } |
|
| 1564 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1563 | + } |
|
| 1564 | + print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | /** |
@@ -1569,9 +1569,9 @@ discard block |
||
| 1569 | 1569 | * Get information on applications in the system |
| 1570 | 1570 | */ |
| 1571 | 1571 | function boinccore_apps() { |
| 1572 | - // Remove q from the GET request or BOINC will panic |
|
| 1573 | - unset($_GET['q']); |
|
| 1574 | - include_boinc('user/apps.php'); |
|
| 1572 | + // Remove q from the GET request or BOINC will panic |
|
| 1573 | + unset($_GET['q']); |
|
| 1574 | + include_boinc('user/apps.php'); |
|
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | /** |
@@ -1581,147 +1581,147 @@ discard block |
||
| 1581 | 1581 | * controller function, which can compute the page based on the user's settings |
| 1582 | 1582 | */ |
| 1583 | 1583 | function boinccore_url_pagination_handler($type, $object_id = NULL) { |
| 1584 | - global $user; |
|
| 1585 | - $path = NULL; |
|
| 1586 | - $params = array(); |
|
| 1587 | - switch ($type) { |
|
| 1588 | - case 'boinc-forum': |
|
| 1584 | + global $user; |
|
| 1585 | + $path = NULL; |
|
| 1586 | + $params = array(); |
|
| 1587 | + switch ($type) { |
|
| 1588 | + case 'boinc-forum': |
|
| 1589 | 1589 | // Redirect requests to a BOINC forum to the Drupal forum |
| 1590 | 1590 | $forum_id = db_result(db_query(' |
| 1591 | 1591 | SELECT tid |
| 1592 | 1592 | FROM {boincimport_temp_forum} |
| 1593 | 1593 | WHERE forum_id = %d', |
| 1594 | - $object_id |
|
| 1594 | + $object_id |
|
| 1595 | 1595 | )); |
| 1596 | 1596 | if ($forum_id) { |
| 1597 | - drupal_goto("community/forum/{$forum_id}"); |
|
| 1597 | + drupal_goto("community/forum/{$forum_id}"); |
|
| 1598 | 1598 | } |
| 1599 | 1599 | break; |
| 1600 | - case 'boinc-forum-index': |
|
| 1600 | + case 'boinc-forum-index': |
|
| 1601 | 1601 | // Redirect requests to the top level BOINC forum to Drupal forums |
| 1602 | 1602 | drupal_goto("community/forum"); |
| 1603 | 1603 | break; |
| 1604 | - case 'boinc-forum-post': |
|
| 1604 | + case 'boinc-forum-post': |
|
| 1605 | 1605 | // Redirect requests to a BOINC forum post to the Drupal comment |
| 1606 | 1606 | $cid = db_result(db_query(' |
| 1607 | 1607 | SELECT cid |
| 1608 | 1608 | FROM {boincimport_temp_post} |
| 1609 | 1609 | WHERE post_id = %d', |
| 1610 | - $object_id |
|
| 1610 | + $object_id |
|
| 1611 | 1611 | )); |
| 1612 | 1612 | if ($cid) { |
| 1613 | - drupal_goto("goto/comment/{$cid}"); |
|
| 1613 | + drupal_goto("goto/comment/{$cid}"); |
|
| 1614 | 1614 | } |
| 1615 | 1615 | break; |
| 1616 | - case 'boinc-forum-topic': |
|
| 1616 | + case 'boinc-forum-topic': |
|
| 1617 | 1617 | // Redirect requests to a BOINC forum topic to the Drupal node |
| 1618 | 1618 | $nid = db_result(db_query(' |
| 1619 | 1619 | SELECT nid |
| 1620 | 1620 | FROM {boincimport_temp_topic} |
| 1621 | 1621 | WHERE topic_id = %d', |
| 1622 | - $object_id |
|
| 1622 | + $object_id |
|
| 1623 | 1623 | )); |
| 1624 | 1624 | if ($nid) { |
| 1625 | - drupal_goto("node/{$nid}"); |
|
| 1625 | + drupal_goto("node/{$nid}"); |
|
| 1626 | 1626 | } |
| 1627 | 1627 | break; |
| 1628 | - case 'boinc-host': |
|
| 1628 | + case 'boinc-host': |
|
| 1629 | 1629 | // Redirect requests to BOINC host details to the host page in Drupal |
| 1630 | 1630 | drupal_goto("host/{$object_id}"); |
| 1631 | 1631 | break; |
| 1632 | - case 'boinc-hosts-user': |
|
| 1632 | + case 'boinc-hosts-user': |
|
| 1633 | 1633 | // Redirect requests to a BOINC user host list to the host list in Drupal |
| 1634 | 1634 | $uid = boincuser_lookup_uid($object_id); |
| 1635 | 1635 | if ($uid) { |
| 1636 | - drupal_goto("account/{$uid}/computers"); |
|
| 1636 | + drupal_goto("account/{$uid}/computers"); |
|
| 1637 | 1637 | } |
| 1638 | 1638 | break; |
| 1639 | - case 'boinc-result': |
|
| 1639 | + case 'boinc-result': |
|
| 1640 | 1640 | // Redirect requests to BOINC task details to the task page in Drupal |
| 1641 | 1641 | drupal_goto("task/{$object_id}"); |
| 1642 | - case 'boinc-results-host': |
|
| 1642 | + case 'boinc-results-host': |
|
| 1643 | 1643 | // Redirect requests to BOINC tasks by host to the host task page in Drupal |
| 1644 | 1644 | drupal_goto("host/{$object_id}/tasks"); |
| 1645 | 1645 | break; |
| 1646 | - case 'boinc-results-user': |
|
| 1646 | + case 'boinc-results-user': |
|
| 1647 | 1647 | // Redirect requests to a BOINC user's tasks to the Drupal account tasks |
| 1648 | 1648 | drupal_goto("account/tasks"); |
| 1649 | 1649 | break; |
| 1650 | - case 'boinc-user': |
|
| 1650 | + case 'boinc-user': |
|
| 1651 | 1651 | // Redirect requests to a BOINC user ID to the Drupal profile |
| 1652 | 1652 | $uid = boincuser_lookup_uid($object_id); |
| 1653 | 1653 | if ($uid) { |
| 1654 | - drupal_goto("account/{$uid}"); |
|
| 1654 | + drupal_goto("account/{$uid}"); |
|
| 1655 | 1655 | } |
| 1656 | 1656 | break; |
| 1657 | - case 'boinc-workunit': |
|
| 1657 | + case 'boinc-workunit': |
|
| 1658 | 1658 | // Redirect requests to BOINC workunits to the workunit page in Drupal |
| 1659 | 1659 | drupal_goto("workunit/{$object_id}"); |
| 1660 | 1660 | break; |
| 1661 | - case 'comment': |
|
| 1661 | + case 'comment': |
|
| 1662 | 1662 | $object = _comment_load($object_id); |
| 1663 | 1663 | if ($object) { |
| 1664 | - $path = "node/{$object->nid}"; |
|
| 1665 | - // Get the sort order |
|
| 1666 | - $gt_lt = '<'; |
|
| 1667 | - $comment_order = (isset($user->sort)) ? $user->sort : variable_get('comment_default_order_forum', 2); |
|
| 1668 | - if ($comment_order == COMMENT_ORDER_NEWEST_FIRST) { |
|
| 1664 | + $path = "node/{$object->nid}"; |
|
| 1665 | + // Get the sort order |
|
| 1666 | + $gt_lt = '<'; |
|
| 1667 | + $comment_order = (isset($user->sort)) ? $user->sort : variable_get('comment_default_order_forum', 2); |
|
| 1668 | + if ($comment_order == COMMENT_ORDER_NEWEST_FIRST) { |
|
| 1669 | 1669 | $gt_lt = '>'; |
| 1670 | - } |
|
| 1671 | - // don't filter hidden comments for admins/mods |
|
| 1672 | - $include_hidden = ''; |
|
| 1673 | - if (in_array('administrator', array_values($user->roles)) || |
|
| 1670 | + } |
|
| 1671 | + // don't filter hidden comments for admins/mods |
|
| 1672 | + $include_hidden = ''; |
|
| 1673 | + if (in_array('administrator', array_values($user->roles)) || |
|
| 1674 | 1674 | in_array('moderator', array_values($user->roles))) { |
| 1675 | 1675 | $include_hidden = 'OR status = 1'; |
| 1676 | - } |
|
| 1677 | - // See how many comments there are before (or after) this comment... |
|
| 1678 | - $comment_offset = db_result(db_query(' |
|
| 1676 | + } |
|
| 1677 | + // See how many comments there are before (or after) this comment... |
|
| 1678 | + $comment_offset = db_result(db_query(' |
|
| 1679 | 1679 | SELECT COUNT(*) FROM {comments} |
| 1680 | 1680 | WHERE nid = %d AND (status = 0 %s) AND timestamp %s %d', |
| 1681 | 1681 | $object->nid, $include_hidden, $gt_lt, $object->timestamp)); |
| 1682 | - if ($comment_offset) { |
|
| 1682 | + if ($comment_offset) { |
|
| 1683 | 1683 | // Get the number of comments per page |
| 1684 | 1684 | if ($user->comments_per_page) { |
| 1685 | - $comments_per_page = $user->comments_per_page; |
|
| 1685 | + $comments_per_page = $user->comments_per_page; |
|
| 1686 | 1686 | } |
| 1687 | 1687 | else { |
| 1688 | - $node = node_load($object->nid); |
|
| 1689 | - $comments_per_page = variable_get( |
|
| 1688 | + $node = node_load($object->nid); |
|
| 1689 | + $comments_per_page = variable_get( |
|
| 1690 | 1690 | "comment_default_per_page_{$node->type}", 50 |
| 1691 | - ); |
|
| 1691 | + ); |
|
| 1692 | 1692 | } |
| 1693 | 1693 | // Determine which page to display in order to show the given comment |
| 1694 | 1694 | $page = floor($comment_offset / $comments_per_page); |
| 1695 | 1695 | if ($page) { |
| 1696 | - $params = array('page' => $page); |
|
| 1696 | + $params = array('page' => $page); |
|
| 1697 | + } |
|
| 1697 | 1698 | } |
| 1698 | - } |
|
| 1699 | 1699 | } |
| 1700 | 1700 | if ($path) { |
| 1701 | - drupal_goto($path, $params, "comment-{$object->cid}"); |
|
| 1701 | + drupal_goto($path, $params, "comment-{$object->cid}"); |
|
| 1702 | 1702 | } |
| 1703 | 1703 | break; |
| 1704 | - case 'friend-requests': |
|
| 1704 | + case 'friend-requests': |
|
| 1705 | 1705 | // Check for a login, then redirect to the user's friend requests page |
| 1706 | 1706 | if ($user->uid) { |
| 1707 | - drupal_goto("account/{$user->uid}/friends/pending"); |
|
| 1707 | + drupal_goto("account/{$user->uid}/friends/pending"); |
|
| 1708 | 1708 | } |
| 1709 | 1709 | else { |
| 1710 | - drupal_goto('user/login', array( |
|
| 1710 | + drupal_goto('user/login', array( |
|
| 1711 | 1711 | 'destination' => 'goto/friend-requests' |
| 1712 | - )); |
|
| 1712 | + )); |
|
| 1713 | 1713 | } |
| 1714 | 1714 | break; |
| 1715 | - default: |
|
| 1715 | + default: |
|
| 1716 | 1716 | } |
| 1717 | - drupal_not_found(); |
|
| 1717 | + drupal_not_found(); |
|
| 1718 | 1718 | } |
| 1719 | 1719 | |
| 1720 | 1720 | /* |
| 1721 | 1721 | * Fetch an array of all countries |
| 1722 | 1722 | */ |
| 1723 | 1723 | function boinccore_get_country_list() { |
| 1724 | - return array( |
|
| 1724 | + return array( |
|
| 1725 | 1725 | 'None' => 'None', |
| 1726 | 1726 | 'International' => 'International', |
| 1727 | 1727 | 'Afghanistan' => 'Afghanistan', |
@@ -1955,7 +1955,7 @@ discard block |
||
| 1955 | 1955 | 'Yemen' => 'Yemen', |
| 1956 | 1956 | 'Zambia' => 'Zambia', |
| 1957 | 1957 | 'Zimbabwe' => 'Zimbabwe', |
| 1958 | - ); |
|
| 1958 | + ); |
|
| 1959 | 1959 | } |
| 1960 | 1960 | |
| 1961 | 1961 | |
@@ -1967,46 +1967,46 @@ discard block |
||
| 1967 | 1967 | * Action: Mark node for moderation |
| 1968 | 1968 | */ |
| 1969 | 1969 | function boinccore_rules_action_mark_content_for_moderation($node) { |
| 1970 | - $node->moderate = 1; |
|
| 1971 | - return array('node' => $node); |
|
| 1970 | + $node->moderate = 1; |
|
| 1971 | + return array('node' => $node); |
|
| 1972 | 1972 | } |
| 1973 | 1973 | |
| 1974 | 1974 | /** |
| 1975 | 1975 | * Action: Send mail to moderators. |
| 1976 | 1976 | */ |
| 1977 | 1977 | function boinccore_rules_action_mail_to_moderators($settings) { |
| 1978 | - module_load_include('inc', 'rules', 'modules/system.rules'); |
|
| 1979 | - $mailing_list = variable_get('boinc_moderator_mailing_list', ''); |
|
| 1980 | - $force_individual_notifications = variable_get('boinc_moderator_force_individual_notifications', 0); |
|
| 1978 | + module_load_include('inc', 'rules', 'modules/system.rules'); |
|
| 1979 | + $mailing_list = variable_get('boinc_moderator_mailing_list', ''); |
|
| 1980 | + $force_individual_notifications = variable_get('boinc_moderator_force_individual_notifications', 0); |
|
| 1981 | 1981 | |
| 1982 | - if (!$mailing_list OR $force_individual_notifications) { |
|
| 1982 | + if (!$mailing_list OR $force_individual_notifications) { |
|
| 1983 | 1983 | // Send individual emails to all moderators |
| 1984 | 1984 | $roles = user_roles(); |
| 1985 | 1985 | $moderator_rid = array_search('moderator', $roles); |
| 1986 | 1986 | if ($moderator_rid !== FALSE) { |
| 1987 | - $settings['recipients'] = array($moderator_rid); |
|
| 1988 | - rules_action_mail_to_users_of_role($settings); |
|
| 1987 | + $settings['recipients'] = array($moderator_rid); |
|
| 1988 | + rules_action_mail_to_users_of_role($settings); |
|
| 1989 | 1989 | } |
| 1990 | 1990 | else { |
| 1991 | - watchdog( |
|
| 1991 | + watchdog( |
|
| 1992 | 1992 | 'boinccore', |
| 1993 | 1993 | 'Unable to identify members of the moderator role to send moderator notifications!', |
| 1994 | 1994 | array(), |
| 1995 | 1995 | WATCHDOG_ERROR |
| 1996 | - ); |
|
| 1996 | + ); |
|
| 1997 | 1997 | } |
| 1998 | - } |
|
| 1999 | - if ($mailing_list) { |
|
| 1998 | + } |
|
| 1999 | + if ($mailing_list) { |
|
| 2000 | 2000 | $settings['to'] = $mailing_list; |
| 2001 | 2001 | rules_action_mail($settings); |
| 2002 | - } |
|
| 2002 | + } |
|
| 2003 | 2003 | } |
| 2004 | 2004 | /** |
| 2005 | 2005 | * Action "Send mail to moderators" configuration form |
| 2006 | 2006 | */ |
| 2007 | 2007 | function boinccore_rules_action_mail_to_moderators_form($settings = array(), &$form) { |
| 2008 | - // Select only non-anonymous user roles because anonymous users won't have emails. |
|
| 2009 | - rules_action_mail_to_user_form($settings, $form); |
|
| 2008 | + // Select only non-anonymous user roles because anonymous users won't have emails. |
|
| 2009 | + rules_action_mail_to_user_form($settings, $form); |
|
| 2010 | 2010 | } |
| 2011 | 2011 | |
| 2012 | 2012 | |
@@ -2014,27 +2014,27 @@ discard block |
||
| 2014 | 2014 | * Action: Send mail to admins. |
| 2015 | 2015 | */ |
| 2016 | 2016 | function boinccore_rules_action_mail_to_admins($settings) { |
| 2017 | - module_load_include('inc', 'rules', 'modules/system.rules'); |
|
| 2018 | - $mailing_list = variable_get('boinc_admin_mailing_list', ''); |
|
| 2019 | - if (empty($mailing_list)) { |
|
| 2017 | + module_load_include('inc', 'rules', 'modules/system.rules'); |
|
| 2018 | + $mailing_list = variable_get('boinc_admin_mailing_list', ''); |
|
| 2019 | + if (empty($mailing_list)) { |
|
| 2020 | 2020 | $mailing_list = variable_get('site_mail', ''); |
| 2021 | 2021 | if (empty($mailing_list)) { |
| 2022 | - watchdog('boinccore', |
|
| 2022 | + watchdog('boinccore', |
|
| 2023 | 2023 | 'Attempting to email administrators, but there is no admin email list or site email to send to.', array(), |
| 2024 | 2024 | WATCHDOG_ERROR |
| 2025 | - ); |
|
| 2026 | - return FALSE; |
|
| 2025 | + ); |
|
| 2026 | + return FALSE; |
|
| 2027 | 2027 | } |
| 2028 | - } |
|
| 2029 | - $settings['to'] = $mailing_list; |
|
| 2030 | - rules_action_mail($settings); |
|
| 2028 | + } |
|
| 2029 | + $settings['to'] = $mailing_list; |
|
| 2030 | + rules_action_mail($settings); |
|
| 2031 | 2031 | } |
| 2032 | 2032 | |
| 2033 | 2033 | /** |
| 2034 | 2034 | * Action "Send mail to admins" configuration form |
| 2035 | 2035 | */ |
| 2036 | 2036 | function boinccore_rules_action_mail_to_admins_form($settings = array(), &$form) { |
| 2037 | - rules_action_mail_to_user_form($settings, $form); |
|
| 2037 | + rules_action_mail_to_user_form($settings, $form); |
|
| 2038 | 2038 | } |
| 2039 | 2039 | |
| 2040 | 2040 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * |
@@ -2045,33 +2045,33 @@ discard block |
||
| 2045 | 2045 | * BOINC wrapper for string translation |
| 2046 | 2046 | */ |
| 2047 | 2047 | function bts($string, $args = array(), $langcode = NULL, $context = 'boinc: ', $update = TRUE) { |
| 2048 | - if (function_exists('i18nstrings_ts')) { |
|
| 2048 | + if (function_exists('i18nstrings_ts')) { |
|
| 2049 | 2049 | $string = i18nstrings_ts($context, $string, $langcode, $update); |
| 2050 | - } |
|
| 2051 | - if (empty($args)) { |
|
| 2050 | + } |
|
| 2051 | + if (empty($args)) { |
|
| 2052 | 2052 | return $string; |
| 2053 | - } |
|
| 2054 | - else { |
|
| 2053 | + } |
|
| 2054 | + else { |
|
| 2055 | 2055 | // Transform arguments before inserting them. |
| 2056 | 2056 | foreach ($args as $key => $value) { |
| 2057 | - switch ($key [0]) { |
|
| 2057 | + switch ($key [0]) { |
|
| 2058 | 2058 | case '@': |
| 2059 | 2059 | // Escaped only. |
| 2060 | 2060 | $args [$key] = check_plain($value); |
| 2061 | - break; |
|
| 2061 | + break; |
|
| 2062 | 2062 | |
| 2063 | 2063 | case '%': |
| 2064 | 2064 | default: |
| 2065 | 2065 | // Escaped and placeholder. |
| 2066 | 2066 | $args [$key] = theme('placeholder', $value); |
| 2067 | - break; |
|
| 2067 | + break; |
|
| 2068 | 2068 | |
| 2069 | 2069 | case '!': |
| 2070 | 2070 | // Pass-through. |
| 2071 | 2071 | } |
| 2072 | 2072 | } |
| 2073 | 2073 | return strtr($string, $args); |
| 2074 | - } |
|
| 2074 | + } |
|
| 2075 | 2075 | } |
| 2076 | 2076 | |
| 2077 | 2077 | |
@@ -2083,9 +2083,9 @@ discard block |
||
| 2083 | 2083 | * Overview of moderation queues |
| 2084 | 2084 | */ |
| 2085 | 2085 | function boinccore_moderation_overview_panel() { |
| 2086 | - $output = '<h2 class="pane-title">' . bts('Moderation', array(), NULL, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2087 | - $output .= '<ul class="tab-list action-list">'; |
|
| 2088 | - if (module_exists('user_profiles')) { |
|
| 2086 | + $output = '<h2 class="pane-title">' . bts('Moderation', array(), NULL, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2087 | + $output .= '<ul class="tab-list action-list">'; |
|
| 2088 | + if (module_exists('user_profiles')) { |
|
| 2089 | 2089 | $profile_count = db_result(db_query(" |
| 2090 | 2090 | SELECT COUNT(DISTINCT(n.nid)) |
| 2091 | 2091 | FROM {node} n |
@@ -2097,9 +2097,9 @@ discard block |
||
| 2097 | 2097 | $output .= '<span class="item-count">' . $profile_count . '</span>'; |
| 2098 | 2098 | $output .= '</div>'; |
| 2099 | 2099 | $output .= '</li>'; |
| 2100 | - } |
|
| 2101 | - $output .= '</ul>'; |
|
| 2102 | - return $output; |
|
| 2100 | + } |
|
| 2101 | + $output .= '</ul>'; |
|
| 2102 | + return $output; |
|
| 2103 | 2103 | } |
| 2104 | 2104 | |
| 2105 | 2105 | |
@@ -2109,10 +2109,10 @@ discard block |
||
| 2109 | 2109 | * |
| 2110 | 2110 | */ |
| 2111 | 2111 | function _boinccore_delete_expired_tokens() { |
| 2112 | - require_boinc('boinc_db'); |
|
| 2112 | + require_boinc('boinc_db'); |
|
| 2113 | 2113 | |
| 2114 | - $num_deleted = BoincToken::delete_expired(); |
|
| 2115 | - if ($num_deleted>0) { |
|
| 2114 | + $num_deleted = BoincToken::delete_expired(); |
|
| 2115 | + if ($num_deleted>0) { |
|
| 2116 | 2116 | watchdog('boinccore', "Deleted ${num_deleted} tokens from table token", WATCHDOG_NOTICE); |
| 2117 | - } |
|
| 2117 | + } |
|
| 2118 | 2118 | } |
@@ -5,8 +5,8 @@ |
||
| 5 | 5 | // Hackish... but there doesn't seem to be a non-hackish way to change the |
| 6 | 6 | // label on the search form!? Need a custom module to call hook_form_alter()... |
| 7 | 7 | function global_search_solr_form_alter(&$form, &$form_state, $form_id) { |
| 8 | - if ($form_id == 'apachesolr_search_custom_page_search_form') { |
|
| 8 | + if ($form_id == 'apachesolr_search_custom_page_search_form') { |
|
| 9 | 9 | $form['basic']['keys']['#title'] = t('Search'); |
| 10 | 10 | $form['basic']['keys']['#size'] = 40; |
| 11 | - } |
|
| 11 | + } |
|
| 12 | 12 | } |
@@ -4,33 +4,33 @@ discard block |
||
| 4 | 4 | * Implementation of hook_default_panels_mini(). |
| 5 | 5 | */ |
| 6 | 6 | function private_messages_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 = 'user_mail_summary'; |
|
| 13 | - $mini->category = 'BOINC'; |
|
| 14 | - $mini->admin_title = 'User mail summary'; |
|
| 15 | - $mini->admin_description = 'Mail widget for user dashboard'; |
|
| 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 = 'user_mail_summary'; |
|
| 13 | + $mini->category = 'BOINC'; |
|
| 14 | + $mini->admin_title = 'User mail summary'; |
|
| 15 | + $mini->admin_description = 'Mail widget for user dashboard'; |
|
| 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 = 'Messages'; |
|
| 30 | - $display->storage_type = 'panels_mini'; |
|
| 31 | - $display->storage_id = 'user_mail_summary'; |
|
| 32 | - $display->content = array(); |
|
| 33 | - $display->panels = array(); |
|
| 27 | + ); |
|
| 28 | + $display->cache = array(); |
|
| 29 | + $display->title = 'Messages'; |
|
| 30 | + $display->storage_type = 'panels_mini'; |
|
| 31 | + $display->storage_id = 'user_mail_summary'; |
|
| 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,9 +39,9 @@ discard block |
||
| 39 | 39 | $pane->shown = TRUE; |
| 40 | 40 | $pane->access = array(); |
| 41 | 41 | $pane->configuration = array( |
| 42 | - 'admin_title' => 'Mail summary', |
|
| 43 | - 'title' => 'Messages', |
|
| 44 | - 'body' => '<?php |
|
| 42 | + 'admin_title' => 'Mail summary', |
|
| 43 | + 'title' => 'Messages', |
|
| 44 | + 'body' => '<?php |
|
| 45 | 45 | $l1 = url(\'messages\'); |
| 46 | 46 | $l2 = url(\'messages/new\'); |
| 47 | 47 | ?> |
@@ -51,22 +51,22 @@ discard block |
||
| 51 | 51 | </li> |
| 52 | 52 | <li class="last tab"><a href="<?php echo $l2?>"><?php print bts(\'Compose new\', array(), NULL, \'boinc:account-dashboard\'); ?></a></li> |
| 53 | 53 | </ul>', |
| 54 | - 'format' => '3', |
|
| 55 | - 'substitute' => TRUE, |
|
| 54 | + 'format' => '3', |
|
| 55 | + 'substitute' => TRUE, |
|
| 56 | 56 | ); |
| 57 | 57 | $pane->cache = array(); |
| 58 | 58 | $pane->style = array( |
| 59 | - 'settings' => NULL, |
|
| 59 | + 'settings' => NULL, |
|
| 60 | 60 | ); |
| 61 | 61 | $pane->css = array(); |
| 62 | 62 | $pane->extras = array(); |
| 63 | 63 | $pane->position = 0; |
| 64 | 64 | $display->content['new-1'] = $pane; |
| 65 | 65 | $display->panels['middle'][0] = 'new-1'; |
| 66 | - $display->hide_title = PANELS_TITLE_NONE; |
|
| 67 | - $display->title_pane = 'new-1'; |
|
| 68 | - $mini->display = $display; |
|
| 69 | - $export['user_mail_summary'] = $mini; |
|
| 66 | + $display->hide_title = PANELS_TITLE_NONE; |
|
| 67 | + $display->title_pane = 'new-1'; |
|
| 68 | + $mini->display = $display; |
|
| 69 | + $export['user_mail_summary'] = $mini; |
|
| 70 | 70 | |
| 71 | - return $export; |
|
| 71 | + return $export; |
|
| 72 | 72 | } |
@@ -4,35 +4,35 @@ discard block |
||
| 4 | 4 | * Implementation of hook_ctools_plugin_api(). |
| 5 | 5 | */ |
| 6 | 6 | function boinc_standard_ctools_plugin_api() { |
| 7 | - list($module, $api) = func_get_args(); |
|
| 8 | - if ($module == "input_formats" && $api == "input_formats") { |
|
| 7 | + list($module, $api) = func_get_args(); |
|
| 8 | + if ($module == "input_formats" && $api == "input_formats") { |
|
| 9 | 9 | return array("version" => 1); |
| 10 | - } |
|
| 11 | - elseif ($module == "page_manager" && $api == "pages_default") { |
|
| 10 | + } |
|
| 11 | + elseif ($module == "page_manager" && $api == "pages_default") { |
|
| 12 | 12 | return array("version" => 1); |
| 13 | - } |
|
| 14 | - elseif ($module == "panels_mini" && $api == "panels_default") { |
|
| 13 | + } |
|
| 14 | + elseif ($module == "panels_mini" && $api == "panels_default") { |
|
| 15 | 15 | return array("version" => 1); |
| 16 | - } |
|
| 17 | - elseif ($module == "strongarm" && $api == "strongarm") { |
|
| 16 | + } |
|
| 17 | + elseif ($module == "strongarm" && $api == "strongarm") { |
|
| 18 | 18 | return array("version" => 1); |
| 19 | - } |
|
| 19 | + } |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Implementation of hook_flag_default_flags(). |
| 24 | 24 | */ |
| 25 | 25 | function boinc_standard_flag_default_flags() { |
| 26 | - $flags = array(); |
|
| 27 | - // Exported flag: "Comment Abuse 1 SPAM". |
|
| 28 | - $flags['abuse_comment_1'] = array( |
|
| 26 | + $flags = array(); |
|
| 27 | + // Exported flag: "Comment Abuse 1 SPAM". |
|
| 28 | + $flags['abuse_comment_1'] = array( |
|
| 29 | 29 | 'content_type' => 'comment', |
| 30 | 30 | 'title' => 'Comment Abuse 1 SPAM', |
| 31 | 31 | 'global' => FALSE, |
| 32 | 32 | 'types' => array( |
| 33 | - '0' => 'forum', |
|
| 34 | - '1' => 'news', |
|
| 35 | - '2' => 'team_forum', |
|
| 33 | + '0' => 'forum', |
|
| 34 | + '1' => 'news', |
|
| 35 | + '2' => 'team_forum', |
|
| 36 | 36 | ), |
| 37 | 37 | 'flag_short' => 'Flag as SPAM', |
| 38 | 38 | 'flag_long' => 'Flag this comment as SPAM.', |
@@ -43,31 +43,31 @@ discard block |
||
| 43 | 43 | 'unflag_denied_text' => '', |
| 44 | 44 | 'link_type' => 'toggle', |
| 45 | 45 | 'roles' => array( |
| 46 | - 'flag' => array( |
|
| 46 | + 'flag' => array( |
|
| 47 | 47 | '0' => 2, |
| 48 | - ), |
|
| 49 | - 'unflag' => array( |
|
| 48 | + ), |
|
| 49 | + 'unflag' => array( |
|
| 50 | 50 | '0' => 2, |
| 51 | - ), |
|
| 51 | + ), |
|
| 52 | 52 | ), |
| 53 | 53 | 'weight' => 0, |
| 54 | 54 | 'access_author' => '', |
| 55 | 55 | 'show_on_comment' => 0, |
| 56 | 56 | 'module' => 'boinc_standard', |
| 57 | 57 | 'locked' => array( |
| 58 | - '0' => 'name', |
|
| 58 | + '0' => 'name', |
|
| 59 | 59 | ), |
| 60 | 60 | 'api_version' => 2, |
| 61 | - ); |
|
| 62 | - // Exported flag: "Comment Abuse 2 LINK". |
|
| 63 | - $flags['abuse_comment_2'] = array( |
|
| 61 | + ); |
|
| 62 | + // Exported flag: "Comment Abuse 2 LINK". |
|
| 63 | + $flags['abuse_comment_2'] = array( |
|
| 64 | 64 | 'content_type' => 'comment', |
| 65 | 65 | 'title' => 'Comment Abuse 2 LINK', |
| 66 | 66 | 'global' => FALSE, |
| 67 | 67 | 'types' => array( |
| 68 | - '0' => 'forum', |
|
| 69 | - '1' => 'news', |
|
| 70 | - '2' => 'team_forum', |
|
| 68 | + '0' => 'forum', |
|
| 69 | + '1' => 'news', |
|
| 70 | + '2' => 'team_forum', |
|
| 71 | 71 | ), |
| 72 | 72 | 'flag_short' => 'Flag as abusive link', |
| 73 | 73 | 'flag_long' => 'Flag this comment with abusive link.', |
@@ -78,31 +78,31 @@ discard block |
||
| 78 | 78 | 'unflag_denied_text' => '', |
| 79 | 79 | 'link_type' => 'toggle', |
| 80 | 80 | 'roles' => array( |
| 81 | - 'flag' => array( |
|
| 81 | + 'flag' => array( |
|
| 82 | 82 | '0' => 2, |
| 83 | - ), |
|
| 84 | - 'unflag' => array( |
|
| 83 | + ), |
|
| 84 | + 'unflag' => array( |
|
| 85 | 85 | '0' => 2, |
| 86 | - ), |
|
| 86 | + ), |
|
| 87 | 87 | ), |
| 88 | 88 | 'weight' => 0, |
| 89 | 89 | 'access_author' => '', |
| 90 | 90 | 'show_on_comment' => 0, |
| 91 | 91 | 'module' => 'boinc_standard', |
| 92 | 92 | 'locked' => array( |
| 93 | - '0' => 'name', |
|
| 93 | + '0' => 'name', |
|
| 94 | 94 | ), |
| 95 | 95 | 'api_version' => 2, |
| 96 | - ); |
|
| 97 | - // Exported flag: "Comment Abuse 3 Hostile". |
|
| 98 | - $flags['abuse_comment_3'] = array( |
|
| 96 | + ); |
|
| 97 | + // Exported flag: "Comment Abuse 3 Hostile". |
|
| 98 | + $flags['abuse_comment_3'] = array( |
|
| 99 | 99 | 'content_type' => 'comment', |
| 100 | 100 | 'title' => 'Comment Abuse 3 Hostile', |
| 101 | 101 | 'global' => FALSE, |
| 102 | 102 | 'types' => array( |
| 103 | - '0' => 'forum', |
|
| 104 | - '1' => 'news', |
|
| 105 | - '2' => 'team_forum', |
|
| 103 | + '0' => 'forum', |
|
| 104 | + '1' => 'news', |
|
| 105 | + '2' => 'team_forum', |
|
| 106 | 106 | ), |
| 107 | 107 | 'flag_short' => 'Flag as hostile', |
| 108 | 108 | 'flag_long' => 'Flag this comment as hostile.', |
@@ -113,31 +113,31 @@ discard block |
||
| 113 | 113 | 'unflag_denied_text' => '', |
| 114 | 114 | 'link_type' => 'toggle', |
| 115 | 115 | 'roles' => array( |
| 116 | - 'flag' => array( |
|
| 116 | + 'flag' => array( |
|
| 117 | 117 | '0' => 2, |
| 118 | - ), |
|
| 119 | - 'unflag' => array( |
|
| 118 | + ), |
|
| 119 | + 'unflag' => array( |
|
| 120 | 120 | '0' => 2, |
| 121 | - ), |
|
| 121 | + ), |
|
| 122 | 122 | ), |
| 123 | 123 | 'weight' => 0, |
| 124 | 124 | 'access_author' => '', |
| 125 | 125 | 'show_on_comment' => 0, |
| 126 | 126 | 'module' => 'boinc_standard', |
| 127 | 127 | 'locked' => array( |
| 128 | - '0' => 'name', |
|
| 128 | + '0' => 'name', |
|
| 129 | 129 | ), |
| 130 | 130 | 'api_version' => 2, |
| 131 | - ); |
|
| 132 | - // Exported flag: "Comment Abuse 4 Not Kid Friendly". |
|
| 133 | - $flags['abuse_comment_4'] = array( |
|
| 131 | + ); |
|
| 132 | + // Exported flag: "Comment Abuse 4 Not Kid Friendly". |
|
| 133 | + $flags['abuse_comment_4'] = array( |
|
| 134 | 134 | 'content_type' => 'comment', |
| 135 | 135 | 'title' => 'Comment Abuse 4 Not Kid Friendly', |
| 136 | 136 | 'global' => FALSE, |
| 137 | 137 | 'types' => array( |
| 138 | - '0' => 'forum', |
|
| 139 | - '1' => 'news', |
|
| 140 | - '2' => 'team_forum', |
|
| 138 | + '0' => 'forum', |
|
| 139 | + '1' => 'news', |
|
| 140 | + '2' => 'team_forum', |
|
| 141 | 141 | ), |
| 142 | 142 | 'flag_short' => 'Flag as not kid-friendly', |
| 143 | 143 | 'flag_long' => 'Flag this comment as not kid-friendly.', |
@@ -148,31 +148,31 @@ discard block |
||
| 148 | 148 | 'unflag_denied_text' => '', |
| 149 | 149 | 'link_type' => 'toggle', |
| 150 | 150 | 'roles' => array( |
| 151 | - 'flag' => array( |
|
| 151 | + 'flag' => array( |
|
| 152 | 152 | '0' => 2, |
| 153 | - ), |
|
| 154 | - 'unflag' => array( |
|
| 153 | + ), |
|
| 154 | + 'unflag' => array( |
|
| 155 | 155 | '0' => 2, |
| 156 | - ), |
|
| 156 | + ), |
|
| 157 | 157 | ), |
| 158 | 158 | 'weight' => 0, |
| 159 | 159 | 'access_author' => '', |
| 160 | 160 | 'show_on_comment' => 0, |
| 161 | 161 | 'module' => 'boinc_standard', |
| 162 | 162 | 'locked' => array( |
| 163 | - '0' => 'name', |
|
| 163 | + '0' => 'name', |
|
| 164 | 164 | ), |
| 165 | 165 | 'api_version' => 2, |
| 166 | - ); |
|
| 167 | - // Exported flag: "Comment Abuse 5 Other". |
|
| 168 | - $flags['abuse_comment_5'] = array( |
|
| 166 | + ); |
|
| 167 | + // Exported flag: "Comment Abuse 5 Other". |
|
| 168 | + $flags['abuse_comment_5'] = array( |
|
| 169 | 169 | 'content_type' => 'comment', |
| 170 | 170 | 'title' => 'Comment Abuse 5 Other', |
| 171 | 171 | 'global' => FALSE, |
| 172 | 172 | 'types' => array( |
| 173 | - '0' => 'forum', |
|
| 174 | - '1' => 'news', |
|
| 175 | - '2' => 'team_forum', |
|
| 173 | + '0' => 'forum', |
|
| 174 | + '1' => 'news', |
|
| 175 | + '2' => 'team_forum', |
|
| 176 | 176 | ), |
| 177 | 177 | 'flag_short' => 'Flag as other', |
| 178 | 178 | 'flag_long' => 'Flag this comment - other reason', |
@@ -183,31 +183,31 @@ discard block |
||
| 183 | 183 | 'unflag_denied_text' => '', |
| 184 | 184 | 'link_type' => 'toggle', |
| 185 | 185 | 'roles' => array( |
| 186 | - 'flag' => array( |
|
| 186 | + 'flag' => array( |
|
| 187 | 187 | '0' => 2, |
| 188 | - ), |
|
| 189 | - 'unflag' => array( |
|
| 188 | + ), |
|
| 189 | + 'unflag' => array( |
|
| 190 | 190 | '0' => 2, |
| 191 | - ), |
|
| 191 | + ), |
|
| 192 | 192 | ), |
| 193 | 193 | 'weight' => 0, |
| 194 | 194 | 'access_author' => '', |
| 195 | 195 | 'show_on_comment' => 0, |
| 196 | 196 | 'module' => 'boinc_standard', |
| 197 | 197 | 'locked' => array( |
| 198 | - '0' => 'name', |
|
| 198 | + '0' => 'name', |
|
| 199 | 199 | ), |
| 200 | 200 | 'api_version' => 2, |
| 201 | - ); |
|
| 202 | - // Exported flag: "Comment Abuse meta". |
|
| 203 | - $flags['abuse_comment_meta'] = array( |
|
| 201 | + ); |
|
| 202 | + // Exported flag: "Comment Abuse meta". |
|
| 203 | + $flags['abuse_comment_meta'] = array( |
|
| 204 | 204 | 'content_type' => 'comment', |
| 205 | 205 | 'title' => 'Comment Abuse meta', |
| 206 | 206 | 'global' => '0', |
| 207 | 207 | 'types' => array( |
| 208 | - '0' => 'forum', |
|
| 209 | - '1' => 'news', |
|
| 210 | - '2' => 'team_forum', |
|
| 208 | + '0' => 'forum', |
|
| 209 | + '1' => 'news', |
|
| 210 | + '2' => 'team_forum', |
|
| 211 | 211 | ), |
| 212 | 212 | 'flag_short' => 'Report', |
| 213 | 213 | 'flag_long' => 'Report comment.', |
@@ -218,31 +218,31 @@ discard block |
||
| 218 | 218 | 'unflag_denied_text' => '', |
| 219 | 219 | 'link_type' => 'toggle', |
| 220 | 220 | 'roles' => array( |
| 221 | - 'flag' => array( |
|
| 221 | + 'flag' => array( |
|
| 222 | 222 | '0' => 2, |
| 223 | - ), |
|
| 224 | - 'unflag' => array( |
|
| 223 | + ), |
|
| 224 | + 'unflag' => array( |
|
| 225 | 225 | '0' => 2, |
| 226 | - ), |
|
| 226 | + ), |
|
| 227 | 227 | ), |
| 228 | 228 | 'weight' => 0, |
| 229 | 229 | 'access_author' => '', |
| 230 | 230 | 'show_on_comment' => 1, |
| 231 | 231 | 'module' => 'boinc_standard', |
| 232 | 232 | 'locked' => array( |
| 233 | - '0' => 'name', |
|
| 233 | + '0' => 'name', |
|
| 234 | 234 | ), |
| 235 | 235 | 'api_version' => 2, |
| 236 | - ); |
|
| 237 | - // Exported flag: "Node Abuse 1 SPAM". |
|
| 238 | - $flags['abuse_node_1'] = array( |
|
| 236 | + ); |
|
| 237 | + // Exported flag: "Node Abuse 1 SPAM". |
|
| 238 | + $flags['abuse_node_1'] = array( |
|
| 239 | 239 | 'content_type' => 'node', |
| 240 | 240 | 'title' => 'Node Abuse 1 SPAM', |
| 241 | 241 | 'global' => FALSE, |
| 242 | 242 | 'types' => array( |
| 243 | - '0' => 'forum', |
|
| 244 | - '1' => 'news', |
|
| 245 | - '2' => 'team_forum', |
|
| 243 | + '0' => 'forum', |
|
| 244 | + '1' => 'news', |
|
| 245 | + '2' => 'team_forum', |
|
| 246 | 246 | ), |
| 247 | 247 | 'flag_short' => 'Flag as SPAM', |
| 248 | 248 | 'flag_long' => 'Flag this content SPAM.', |
@@ -253,12 +253,12 @@ discard block |
||
| 253 | 253 | 'unflag_denied_text' => '', |
| 254 | 254 | 'link_type' => 'toggle', |
| 255 | 255 | 'roles' => array( |
| 256 | - 'flag' => array( |
|
| 256 | + 'flag' => array( |
|
| 257 | 257 | '0' => 2, |
| 258 | - ), |
|
| 259 | - 'unflag' => array( |
|
| 258 | + ), |
|
| 259 | + 'unflag' => array( |
|
| 260 | 260 | '0' => 2, |
| 261 | - ), |
|
| 261 | + ), |
|
| 262 | 262 | ), |
| 263 | 263 | 'weight' => 0, |
| 264 | 264 | 'show_on_page' => 0, |
@@ -268,19 +268,19 @@ discard block |
||
| 268 | 268 | 'i18n' => '0', |
| 269 | 269 | 'module' => 'boinc_standard', |
| 270 | 270 | 'locked' => array( |
| 271 | - '0' => 'name', |
|
| 271 | + '0' => 'name', |
|
| 272 | 272 | ), |
| 273 | 273 | 'api_version' => 2, |
| 274 | - ); |
|
| 275 | - // Exported flag: "Node Abuse 2 Link". |
|
| 276 | - $flags['abuse_node_2'] = array( |
|
| 274 | + ); |
|
| 275 | + // Exported flag: "Node Abuse 2 Link". |
|
| 276 | + $flags['abuse_node_2'] = array( |
|
| 277 | 277 | 'content_type' => 'node', |
| 278 | 278 | 'title' => 'Node Abuse 2 Link', |
| 279 | 279 | 'global' => FALSE, |
| 280 | 280 | 'types' => array( |
| 281 | - '0' => 'forum', |
|
| 282 | - '1' => 'news', |
|
| 283 | - '2' => 'team_forum', |
|
| 281 | + '0' => 'forum', |
|
| 282 | + '1' => 'news', |
|
| 283 | + '2' => 'team_forum', |
|
| 284 | 284 | ), |
| 285 | 285 | 'flag_short' => 'Report as abusive link', |
| 286 | 286 | 'flag_long' => 'Flag this content as abusive link.', |
@@ -291,12 +291,12 @@ discard block |
||
| 291 | 291 | 'unflag_denied_text' => '', |
| 292 | 292 | 'link_type' => 'toggle', |
| 293 | 293 | 'roles' => array( |
| 294 | - 'flag' => array( |
|
| 294 | + 'flag' => array( |
|
| 295 | 295 | '0' => 2, |
| 296 | - ), |
|
| 297 | - 'unflag' => array( |
|
| 296 | + ), |
|
| 297 | + 'unflag' => array( |
|
| 298 | 298 | '0' => 2, |
| 299 | - ), |
|
| 299 | + ), |
|
| 300 | 300 | ), |
| 301 | 301 | 'weight' => 0, |
| 302 | 302 | 'show_on_page' => 0, |
@@ -306,19 +306,19 @@ discard block |
||
| 306 | 306 | 'i18n' => '0', |
| 307 | 307 | 'module' => 'boinc_standard', |
| 308 | 308 | 'locked' => array( |
| 309 | - '0' => 'name', |
|
| 309 | + '0' => 'name', |
|
| 310 | 310 | ), |
| 311 | 311 | 'api_version' => 2, |
| 312 | - ); |
|
| 313 | - // Exported flag: "Node Abuse 3 Hostile". |
|
| 314 | - $flags['abuse_node_3'] = array( |
|
| 312 | + ); |
|
| 313 | + // Exported flag: "Node Abuse 3 Hostile". |
|
| 314 | + $flags['abuse_node_3'] = array( |
|
| 315 | 315 | 'content_type' => 'node', |
| 316 | 316 | 'title' => 'Node Abuse 3 Hostile', |
| 317 | 317 | 'global' => FALSE, |
| 318 | 318 | 'types' => array( |
| 319 | - '0' => 'forum', |
|
| 320 | - '1' => 'news', |
|
| 321 | - '2' => 'team_forum', |
|
| 319 | + '0' => 'forum', |
|
| 320 | + '1' => 'news', |
|
| 321 | + '2' => 'team_forum', |
|
| 322 | 322 | ), |
| 323 | 323 | 'flag_short' => 'Flag as hostile', |
| 324 | 324 | 'flag_long' => 'Flag this content as hostile.', |
@@ -329,12 +329,12 @@ discard block |
||
| 329 | 329 | 'unflag_denied_text' => '', |
| 330 | 330 | 'link_type' => 'toggle', |
| 331 | 331 | 'roles' => array( |
| 332 | - 'flag' => array( |
|
| 332 | + 'flag' => array( |
|
| 333 | 333 | '0' => 2, |
| 334 | - ), |
|
| 335 | - 'unflag' => array( |
|
| 334 | + ), |
|
| 335 | + 'unflag' => array( |
|
| 336 | 336 | '0' => 2, |
| 337 | - ), |
|
| 337 | + ), |
|
| 338 | 338 | ), |
| 339 | 339 | 'weight' => 0, |
| 340 | 340 | 'show_on_page' => 0, |
@@ -344,19 +344,19 @@ discard block |
||
| 344 | 344 | 'i18n' => '0', |
| 345 | 345 | 'module' => 'boinc_standard', |
| 346 | 346 | 'locked' => array( |
| 347 | - '0' => 'name', |
|
| 347 | + '0' => 'name', |
|
| 348 | 348 | ), |
| 349 | 349 | 'api_version' => 2, |
| 350 | - ); |
|
| 351 | - // Exported flag: "Node Abuse 4 Not Kid Friendly". |
|
| 352 | - $flags['abuse_node_4'] = array( |
|
| 350 | + ); |
|
| 351 | + // Exported flag: "Node Abuse 4 Not Kid Friendly". |
|
| 352 | + $flags['abuse_node_4'] = array( |
|
| 353 | 353 | 'content_type' => 'node', |
| 354 | 354 | 'title' => 'Node Abuse 4 Not Kid Friendly', |
| 355 | 355 | 'global' => FALSE, |
| 356 | 356 | 'types' => array( |
| 357 | - '0' => 'forum', |
|
| 358 | - '1' => 'news', |
|
| 359 | - '2' => 'team_forum', |
|
| 357 | + '0' => 'forum', |
|
| 358 | + '1' => 'news', |
|
| 359 | + '2' => 'team_forum', |
|
| 360 | 360 | ), |
| 361 | 361 | 'flag_short' => 'Flag as not kid-friendly', |
| 362 | 362 | 'flag_long' => 'Flag this content as not kid-friendly.', |
@@ -367,12 +367,12 @@ discard block |
||
| 367 | 367 | 'unflag_denied_text' => '', |
| 368 | 368 | 'link_type' => 'toggle', |
| 369 | 369 | 'roles' => array( |
| 370 | - 'flag' => array( |
|
| 370 | + 'flag' => array( |
|
| 371 | 371 | '0' => 2, |
| 372 | - ), |
|
| 373 | - 'unflag' => array( |
|
| 372 | + ), |
|
| 373 | + 'unflag' => array( |
|
| 374 | 374 | '0' => 2, |
| 375 | - ), |
|
| 375 | + ), |
|
| 376 | 376 | ), |
| 377 | 377 | 'weight' => 0, |
| 378 | 378 | 'show_on_page' => 0, |
@@ -382,19 +382,19 @@ discard block |
||
| 382 | 382 | 'i18n' => '0', |
| 383 | 383 | 'module' => 'boinc_standard', |
| 384 | 384 | 'locked' => array( |
| 385 | - '0' => 'name', |
|
| 385 | + '0' => 'name', |
|
| 386 | 386 | ), |
| 387 | 387 | 'api_version' => 2, |
| 388 | - ); |
|
| 389 | - // Exported flag: "Node Abuse 5 Other". |
|
| 390 | - $flags['abuse_node_5'] = array( |
|
| 388 | + ); |
|
| 389 | + // Exported flag: "Node Abuse 5 Other". |
|
| 390 | + $flags['abuse_node_5'] = array( |
|
| 391 | 391 | 'content_type' => 'node', |
| 392 | 392 | 'title' => 'Node Abuse 5 Other', |
| 393 | 393 | 'global' => FALSE, |
| 394 | 394 | 'types' => array( |
| 395 | - '0' => 'forum', |
|
| 396 | - '1' => 'news', |
|
| 397 | - '2' => 'team_forum', |
|
| 395 | + '0' => 'forum', |
|
| 396 | + '1' => 'news', |
|
| 397 | + '2' => 'team_forum', |
|
| 398 | 398 | ), |
| 399 | 399 | 'flag_short' => 'Flag as other', |
| 400 | 400 | 'flag_long' => 'Flag this content - other reason.', |
@@ -405,12 +405,12 @@ discard block |
||
| 405 | 405 | 'unflag_denied_text' => '', |
| 406 | 406 | 'link_type' => 'toggle', |
| 407 | 407 | 'roles' => array( |
| 408 | - 'flag' => array( |
|
| 408 | + 'flag' => array( |
|
| 409 | 409 | '0' => 2, |
| 410 | - ), |
|
| 411 | - 'unflag' => array( |
|
| 410 | + ), |
|
| 411 | + 'unflag' => array( |
|
| 412 | 412 | '0' => 2, |
| 413 | - ), |
|
| 413 | + ), |
|
| 414 | 414 | ), |
| 415 | 415 | 'weight' => 0, |
| 416 | 416 | 'show_on_page' => 0, |
@@ -420,19 +420,19 @@ discard block |
||
| 420 | 420 | 'i18n' => '0', |
| 421 | 421 | 'module' => 'boinc_standard', |
| 422 | 422 | 'locked' => array( |
| 423 | - '0' => 'name', |
|
| 423 | + '0' => 'name', |
|
| 424 | 424 | ), |
| 425 | 425 | 'api_version' => 2, |
| 426 | - ); |
|
| 427 | - // Exported flag: "Node Abuse meta". |
|
| 428 | - $flags['abuse_node_meta'] = array( |
|
| 426 | + ); |
|
| 427 | + // Exported flag: "Node Abuse meta". |
|
| 428 | + $flags['abuse_node_meta'] = array( |
|
| 429 | 429 | 'content_type' => 'node', |
| 430 | 430 | 'title' => 'Node Abuse meta', |
| 431 | 431 | 'global' => FALSE, |
| 432 | 432 | 'types' => array( |
| 433 | - '0' => 'forum', |
|
| 434 | - '1' => 'news', |
|
| 435 | - '2' => 'team_forum', |
|
| 433 | + '0' => 'forum', |
|
| 434 | + '1' => 'news', |
|
| 435 | + '2' => 'team_forum', |
|
| 436 | 436 | ), |
| 437 | 437 | 'flag_short' => 'Report', |
| 438 | 438 | 'flag_long' => 'Report content', |
@@ -443,12 +443,12 @@ discard block |
||
| 443 | 443 | 'unflag_denied_text' => '', |
| 444 | 444 | 'link_type' => 'toggle', |
| 445 | 445 | 'roles' => array( |
| 446 | - 'flag' => array( |
|
| 446 | + 'flag' => array( |
|
| 447 | 447 | '0' => 2, |
| 448 | - ), |
|
| 449 | - 'unflag' => array( |
|
| 448 | + ), |
|
| 449 | + 'unflag' => array( |
|
| 450 | 450 | '0' => 2, |
| 451 | - ), |
|
| 451 | + ), |
|
| 452 | 452 | ), |
| 453 | 453 | 'weight' => 0, |
| 454 | 454 | 'show_on_page' => 1, |
@@ -458,12 +458,12 @@ discard block |
||
| 458 | 458 | 'i18n' => '0', |
| 459 | 459 | 'module' => 'boinc_standard', |
| 460 | 460 | 'locked' => array( |
| 461 | - '0' => 'name', |
|
| 461 | + '0' => 'name', |
|
| 462 | 462 | ), |
| 463 | 463 | 'api_version' => 2, |
| 464 | - ); |
|
| 465 | - // Exported flag: "User Abuse 1 SPAM". |
|
| 466 | - $flags['abuse_user_1'] = array( |
|
| 464 | + ); |
|
| 465 | + // Exported flag: "User Abuse 1 SPAM". |
|
| 466 | + $flags['abuse_user_1'] = array( |
|
| 467 | 467 | 'content_type' => 'user', |
| 468 | 468 | 'title' => 'User Abuse 1 SPAM', |
| 469 | 469 | 'global' => FALSE, |
@@ -477,24 +477,24 @@ discard block |
||
| 477 | 477 | 'unflag_denied_text' => '', |
| 478 | 478 | 'link_type' => 'toggle', |
| 479 | 479 | 'roles' => array( |
| 480 | - 'flag' => array( |
|
| 480 | + 'flag' => array( |
|
| 481 | 481 | '0' => 2, |
| 482 | - ), |
|
| 483 | - 'unflag' => array( |
|
| 482 | + ), |
|
| 483 | + 'unflag' => array( |
|
| 484 | 484 | '0' => 2, |
| 485 | - ), |
|
| 485 | + ), |
|
| 486 | 486 | ), |
| 487 | 487 | 'weight' => 0, |
| 488 | 488 | 'show_on_profile' => 0, |
| 489 | 489 | 'access_uid' => '', |
| 490 | 490 | 'module' => 'boinc_standard', |
| 491 | 491 | 'locked' => array( |
| 492 | - '0' => 'name', |
|
| 492 | + '0' => 'name', |
|
| 493 | 493 | ), |
| 494 | 494 | 'api_version' => 2, |
| 495 | - ); |
|
| 496 | - // Exported flag: "User Abuse 2 Link". |
|
| 497 | - $flags['abuse_user_2'] = array( |
|
| 495 | + ); |
|
| 496 | + // Exported flag: "User Abuse 2 Link". |
|
| 497 | + $flags['abuse_user_2'] = array( |
|
| 498 | 498 | 'content_type' => 'user', |
| 499 | 499 | 'title' => 'User Abuse 2 Link', |
| 500 | 500 | 'global' => FALSE, |
@@ -508,24 +508,24 @@ discard block |
||
| 508 | 508 | 'unflag_denied_text' => '', |
| 509 | 509 | 'link_type' => 'toggle', |
| 510 | 510 | 'roles' => array( |
| 511 | - 'flag' => array( |
|
| 511 | + 'flag' => array( |
|
| 512 | 512 | '0' => 2, |
| 513 | - ), |
|
| 514 | - 'unflag' => array( |
|
| 513 | + ), |
|
| 514 | + 'unflag' => array( |
|
| 515 | 515 | '0' => 2, |
| 516 | - ), |
|
| 516 | + ), |
|
| 517 | 517 | ), |
| 518 | 518 | 'weight' => 0, |
| 519 | 519 | 'show_on_profile' => 0, |
| 520 | 520 | 'access_uid' => '', |
| 521 | 521 | 'module' => 'boinc_standard', |
| 522 | 522 | 'locked' => array( |
| 523 | - '0' => 'name', |
|
| 523 | + '0' => 'name', |
|
| 524 | 524 | ), |
| 525 | 525 | 'api_version' => 2, |
| 526 | - ); |
|
| 527 | - // Exported flag: "User Abuse 3 Not Kid Friendly". |
|
| 528 | - $flags['abuse_user_3'] = array( |
|
| 526 | + ); |
|
| 527 | + // Exported flag: "User Abuse 3 Not Kid Friendly". |
|
| 528 | + $flags['abuse_user_3'] = array( |
|
| 529 | 529 | 'content_type' => 'user', |
| 530 | 530 | 'title' => 'User Abuse 3 Not Kid Friendly', |
| 531 | 531 | 'global' => FALSE, |
@@ -539,24 +539,24 @@ discard block |
||
| 539 | 539 | 'unflag_denied_text' => '', |
| 540 | 540 | 'link_type' => 'toggle', |
| 541 | 541 | 'roles' => array( |
| 542 | - 'flag' => array( |
|
| 542 | + 'flag' => array( |
|
| 543 | 543 | '0' => 2, |
| 544 | - ), |
|
| 545 | - 'unflag' => array( |
|
| 544 | + ), |
|
| 545 | + 'unflag' => array( |
|
| 546 | 546 | '0' => 2, |
| 547 | - ), |
|
| 547 | + ), |
|
| 548 | 548 | ), |
| 549 | 549 | 'weight' => 0, |
| 550 | 550 | 'show_on_profile' => 0, |
| 551 | 551 | 'access_uid' => '', |
| 552 | 552 | 'module' => 'boinc_standard', |
| 553 | 553 | 'locked' => array( |
| 554 | - '0' => 'name', |
|
| 554 | + '0' => 'name', |
|
| 555 | 555 | ), |
| 556 | 556 | 'api_version' => 2, |
| 557 | - ); |
|
| 558 | - // Exported flag: "User Abuse 4 Other". |
|
| 559 | - $flags['abuse_user_4'] = array( |
|
| 557 | + ); |
|
| 558 | + // Exported flag: "User Abuse 4 Other". |
|
| 559 | + $flags['abuse_user_4'] = array( |
|
| 560 | 560 | 'content_type' => 'user', |
| 561 | 561 | 'title' => 'User Abuse 4 Other', |
| 562 | 562 | 'global' => FALSE, |
@@ -570,24 +570,24 @@ discard block |
||
| 570 | 570 | 'unflag_denied_text' => '', |
| 571 | 571 | 'link_type' => 'toggle', |
| 572 | 572 | 'roles' => array( |
| 573 | - 'flag' => array( |
|
| 573 | + 'flag' => array( |
|
| 574 | 574 | '0' => 2, |
| 575 | - ), |
|
| 576 | - 'unflag' => array( |
|
| 575 | + ), |
|
| 576 | + 'unflag' => array( |
|
| 577 | 577 | '0' => 2, |
| 578 | - ), |
|
| 578 | + ), |
|
| 579 | 579 | ), |
| 580 | 580 | 'weight' => 0, |
| 581 | 581 | 'show_on_profile' => 0, |
| 582 | 582 | 'access_uid' => '', |
| 583 | 583 | 'module' => 'boinc_standard', |
| 584 | 584 | 'locked' => array( |
| 585 | - '0' => 'name', |
|
| 585 | + '0' => 'name', |
|
| 586 | 586 | ), |
| 587 | 587 | 'api_version' => 2, |
| 588 | - ); |
|
| 589 | - // Exported flag: "User Abuse Meta". |
|
| 590 | - $flags['abuse_user_meta'] = array( |
|
| 588 | + ); |
|
| 589 | + // Exported flag: "User Abuse Meta". |
|
| 590 | + $flags['abuse_user_meta'] = array( |
|
| 591 | 591 | 'content_type' => 'user', |
| 592 | 592 | 'title' => 'User Abuse Meta', |
| 593 | 593 | 'global' => FALSE, |
@@ -601,31 +601,31 @@ discard block |
||
| 601 | 601 | 'unflag_denied_text' => '', |
| 602 | 602 | 'link_type' => 'toggle', |
| 603 | 603 | 'roles' => array( |
| 604 | - 'flag' => array( |
|
| 604 | + 'flag' => array( |
|
| 605 | 605 | '0' => 2, |
| 606 | - ), |
|
| 607 | - 'unflag' => array( |
|
| 606 | + ), |
|
| 607 | + 'unflag' => array( |
|
| 608 | 608 | '0' => 2, |
| 609 | - ), |
|
| 609 | + ), |
|
| 610 | 610 | ), |
| 611 | 611 | 'weight' => 0, |
| 612 | 612 | 'show_on_profile' => 1, |
| 613 | 613 | 'access_uid' => '', |
| 614 | 614 | 'module' => 'boinc_standard', |
| 615 | 615 | 'locked' => array( |
| 616 | - '0' => 'name', |
|
| 616 | + '0' => 'name', |
|
| 617 | 617 | ), |
| 618 | 618 | 'api_version' => 2, |
| 619 | - ); |
|
| 620 | - // Exported flag: "Subscriptions". |
|
| 621 | - $flags['subscriptions'] = array( |
|
| 619 | + ); |
|
| 620 | + // Exported flag: "Subscriptions". |
|
| 621 | + $flags['subscriptions'] = array( |
|
| 622 | 622 | 'content_type' => 'node', |
| 623 | 623 | 'title' => 'Subscriptions', |
| 624 | 624 | 'global' => '0', |
| 625 | 625 | 'types' => array( |
| 626 | - '0' => 'forum', |
|
| 627 | - '1' => 'news', |
|
| 628 | - '2' => 'team_forum', |
|
| 626 | + '0' => 'forum', |
|
| 627 | + '1' => 'news', |
|
| 628 | + '2' => 'team_forum', |
|
| 629 | 629 | ), |
| 630 | 630 | 'flag_short' => 'subscribe', |
| 631 | 631 | 'flag_long' => 'Subscribe to this topic', |
@@ -636,12 +636,12 @@ discard block |
||
| 636 | 636 | 'unflag_denied_text' => '', |
| 637 | 637 | 'link_type' => 'toggle', |
| 638 | 638 | 'roles' => array( |
| 639 | - 'flag' => array( |
|
| 639 | + 'flag' => array( |
|
| 640 | 640 | '0' => 2, |
| 641 | - ), |
|
| 642 | - 'unflag' => array( |
|
| 641 | + ), |
|
| 642 | + 'unflag' => array( |
|
| 643 | 643 | '0' => 2, |
| 644 | - ), |
|
| 644 | + ), |
|
| 645 | 645 | ), |
| 646 | 646 | 'weight' => 0, |
| 647 | 647 | 'show_on_page' => 1, |
@@ -651,11 +651,11 @@ discard block |
||
| 651 | 651 | 'i18n' => '0', |
| 652 | 652 | 'module' => 'boinc_standard', |
| 653 | 653 | 'locked' => array( |
| 654 | - '0' => 'name', |
|
| 654 | + '0' => 'name', |
|
| 655 | 655 | ), |
| 656 | 656 | 'api_version' => 2, |
| 657 | - ); |
|
| 658 | - return $flags; |
|
| 657 | + ); |
|
| 658 | + return $flags; |
|
| 659 | 659 | |
| 660 | 660 | } |
| 661 | 661 | |
@@ -663,47 +663,47 @@ discard block |
||
| 663 | 663 | * Implementation of hook_node_info(). |
| 664 | 664 | */ |
| 665 | 665 | function boinc_standard_node_info() { |
| 666 | - $items = array( |
|
| 666 | + $items = array( |
|
| 667 | 667 | 'page' => array( |
| 668 | - 'name' => t('Page'), |
|
| 669 | - 'module' => 'features', |
|
| 670 | - 'description' => t('A <em>page</em>, similar in form to a <em>story</em>, is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site\'s initial home page.'), |
|
| 671 | - 'has_title' => '1', |
|
| 672 | - 'title_label' => t('Title'), |
|
| 673 | - 'has_body' => '1', |
|
| 674 | - 'body_label' => t('Body'), |
|
| 675 | - 'min_word_count' => '0', |
|
| 676 | - 'help' => '', |
|
| 668 | + 'name' => t('Page'), |
|
| 669 | + 'module' => 'features', |
|
| 670 | + 'description' => t('A <em>page</em>, similar in form to a <em>story</em>, is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site\'s initial home page.'), |
|
| 671 | + 'has_title' => '1', |
|
| 672 | + 'title_label' => t('Title'), |
|
| 673 | + 'has_body' => '1', |
|
| 674 | + 'body_label' => t('Body'), |
|
| 675 | + 'min_word_count' => '0', |
|
| 676 | + 'help' => '', |
|
| 677 | 677 | ), |
| 678 | - ); |
|
| 679 | - return $items; |
|
| 678 | + ); |
|
| 679 | + return $items; |
|
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | /** |
| 683 | 683 | * Implementation of hook_rules_defaults(). |
| 684 | 684 | */ |
| 685 | 685 | function boinc_standard_rules_defaults() { |
| 686 | - return array( |
|
| 686 | + return array( |
|
| 687 | 687 | 'rules' => array( |
| 688 | - 'rules_notify_admins_about_circular_merge_error' => array( |
|
| 688 | + 'rules_notify_admins_about_circular_merge_error' => array( |
|
| 689 | 689 | '#type' => 'rule', |
| 690 | 690 | '#set' => 'event_boincwork_circular_merge_error', |
| 691 | 691 | '#label' => 'Notify admins about circular merge error', |
| 692 | 692 | '#active' => 1, |
| 693 | 693 | '#weight' => '0', |
| 694 | 694 | '#categories' => array( |
| 695 | - '0' => 'boinc_standard', |
|
| 696 | - '1' => 'admin notification', |
|
| 695 | + '0' => 'boinc_standard', |
|
| 696 | + '1' => 'admin notification', |
|
| 697 | 697 | ), |
| 698 | 698 | '#status' => 'default', |
| 699 | 699 | '#conditions' => array(), |
| 700 | 700 | '#actions' => array( |
| 701 | - '0' => array( |
|
| 701 | + '0' => array( |
|
| 702 | 702 | '#type' => 'action', |
| 703 | 703 | '#settings' => array( |
| 704 | - 'from' => '', |
|
| 705 | - 'subject' => '[subject_tag:string] Circular host merging error', |
|
| 706 | - 'message' => 'User tried to merge a host (old_host) into a target host where the target host\'s rpc_seqno is equal to the old_host\'s id. |
|
| 704 | + 'from' => '', |
|
| 705 | + 'subject' => '[subject_tag:string] Circular host merging error', |
|
| 706 | + 'message' => 'User tried to merge a host (old_host) into a target host where the target host\'s rpc_seqno is equal to the old_host\'s id. |
|
| 707 | 707 | |
| 708 | 708 | Information about this host merge attempt: |
| 709 | 709 | <?php |
@@ -714,62 +714,62 @@ discard block |
||
| 714 | 714 | print "BOINC id: " . $account->boincuser_id . "\\n"; |
| 715 | 715 | print "Drupal UID: " . $user->uid . "\\n"; |
| 716 | 716 | ?>', |
| 717 | - '#eval input' => array( |
|
| 717 | + '#eval input' => array( |
|
| 718 | 718 | 'token_rules_input_evaluator' => array( |
| 719 | - 'subject' => array( |
|
| 719 | + 'subject' => array( |
|
| 720 | 720 | '0' => 'subject_tag', |
| 721 | 721 | '1' => ':global', |
| 722 | - ), |
|
| 723 | - 'message' => array( |
|
| 722 | + ), |
|
| 723 | + 'message' => array( |
|
| 724 | 724 | '0' => ':global', |
| 725 | - ), |
|
| 726 | - 'from' => array( |
|
| 725 | + ), |
|
| 726 | + 'from' => array( |
|
| 727 | 727 | '0' => ':global', |
| 728 | - ), |
|
| 728 | + ), |
|
| 729 | 729 | ), |
| 730 | 730 | 'rules_input_evaluator_php' => array( |
| 731 | - 'message' => array( |
|
| 731 | + 'message' => array( |
|
| 732 | 732 | '0' => 'oldhost_id', |
| 733 | 733 | '1' => 'targethost_id', |
| 734 | 734 | '2' => 'user', |
| 735 | - ), |
|
| 735 | + ), |
|
| 736 | + ), |
|
| 736 | 737 | ), |
| 737 | - ), |
|
| 738 | 738 | ), |
| 739 | 739 | '#name' => 'boinccore_rules_action_mail_to_admins', |
| 740 | 740 | '#info' => array( |
| 741 | - 'label' => 'Notify admins via email', |
|
| 742 | - 'module' => 'BOINC core', |
|
| 743 | - 'eval input' => array( |
|
| 741 | + 'label' => 'Notify admins via email', |
|
| 742 | + 'module' => 'BOINC core', |
|
| 743 | + 'eval input' => array( |
|
| 744 | 744 | '0' => 'subject', |
| 745 | 745 | '1' => 'message', |
| 746 | 746 | '2' => 'from', |
| 747 | - ), |
|
| 747 | + ), |
|
| 748 | 748 | ), |
| 749 | 749 | '#weight' => 0.0, |
| 750 | - ), |
|
| 750 | + ), |
|
| 751 | 751 | ), |
| 752 | 752 | '#version' => 6003, |
| 753 | - ), |
|
| 754 | - 'rules_notify_admins_about_zombie_merge_attempt' => array( |
|
| 753 | + ), |
|
| 754 | + 'rules_notify_admins_about_zombie_merge_attempt' => array( |
|
| 755 | 755 | '#type' => 'rule', |
| 756 | 756 | '#set' => 'event_boincwork_zombie_merge_error', |
| 757 | 757 | '#label' => 'Notify admins about zombie merge attempt', |
| 758 | 758 | '#active' => 1, |
| 759 | 759 | '#weight' => '0', |
| 760 | 760 | '#categories' => array( |
| 761 | - '0' => 'boinc_standard', |
|
| 762 | - '1' => 'admin notification', |
|
| 761 | + '0' => 'boinc_standard', |
|
| 762 | + '1' => 'admin notification', |
|
| 763 | 763 | ), |
| 764 | 764 | '#status' => 'default', |
| 765 | 765 | '#conditions' => array(), |
| 766 | 766 | '#actions' => array( |
| 767 | - '0' => array( |
|
| 767 | + '0' => array( |
|
| 768 | 768 | '#type' => 'action', |
| 769 | 769 | '#settings' => array( |
| 770 | - 'from' => '', |
|
| 771 | - 'subject' => '[subject_tag:string] Zombie host merging error', |
|
| 772 | - 'message' => 'User tried to merge a host (old_host) into a target host where the target host\'s userid is equal to 0, a zombie host. |
|
| 770 | + 'from' => '', |
|
| 771 | + 'subject' => '[subject_tag:string] Zombie host merging error', |
|
| 772 | + 'message' => 'User tried to merge a host (old_host) into a target host where the target host\'s userid is equal to 0, a zombie host. |
|
| 773 | 773 | I.e., $target_host->userid == 0 |
| 774 | 774 | |
| 775 | 775 | Information about this host merge attempt: |
@@ -781,3303 +781,3303 @@ discard block |
||
| 781 | 781 | print "BOINC id: " . $account->boincuser_id . "\\n"; |
| 782 | 782 | print "Drupal UID: " . $user->uid . "\\n"; |
| 783 | 783 | ?>', |
| 784 | - '#eval input' => array( |
|
| 784 | + '#eval input' => array( |
|
| 785 | 785 | 'token_rules_input_evaluator' => array( |
| 786 | - 'subject' => array( |
|
| 786 | + 'subject' => array( |
|
| 787 | 787 | '0' => 'subject_tag', |
| 788 | 788 | '1' => ':global', |
| 789 | - ), |
|
| 790 | - 'message' => array( |
|
| 789 | + ), |
|
| 790 | + 'message' => array( |
|
| 791 | 791 | '0' => ':global', |
| 792 | - ), |
|
| 793 | - 'from' => array( |
|
| 792 | + ), |
|
| 793 | + 'from' => array( |
|
| 794 | 794 | '0' => ':global', |
| 795 | - ), |
|
| 795 | + ), |
|
| 796 | 796 | ), |
| 797 | 797 | 'rules_input_evaluator_php' => array( |
| 798 | - 'message' => array( |
|
| 798 | + 'message' => array( |
|
| 799 | 799 | '0' => 'oldhost_id', |
| 800 | 800 | '1' => 'targethost_id', |
| 801 | 801 | '2' => 'user', |
| 802 | - ), |
|
| 802 | + ), |
|
| 803 | + ), |
|
| 803 | 804 | ), |
| 804 | - ), |
|
| 805 | 805 | ), |
| 806 | 806 | '#name' => 'boinccore_rules_action_mail_to_admins', |
| 807 | 807 | '#info' => array( |
| 808 | - 'label' => 'Notify admins via email', |
|
| 809 | - 'module' => 'BOINC core', |
|
| 810 | - 'eval input' => array( |
|
| 808 | + 'label' => 'Notify admins via email', |
|
| 809 | + 'module' => 'BOINC core', |
|
| 810 | + 'eval input' => array( |
|
| 811 | 811 | '0' => 'subject', |
| 812 | 812 | '1' => 'message', |
| 813 | 813 | '2' => 'from', |
| 814 | - ), |
|
| 814 | + ), |
|
| 815 | 815 | ), |
| 816 | 816 | '#weight' => 0.0, |
| 817 | - ), |
|
| 817 | + ), |
|
| 818 | 818 | ), |
| 819 | 819 | '#version' => 6003, |
| 820 | - ), |
|
| 821 | - 'rules_notify_admins_error_when_user_consenting_with_missing_consent_type' => array( |
|
| 820 | + ), |
|
| 821 | + 'rules_notify_admins_error_when_user_consenting_with_missing_consent_type' => array( |
|
| 822 | 822 | '#type' => 'rule', |
| 823 | 823 | '#set' => 'event_boincuser_general_consent_type_error', |
| 824 | 824 | '#label' => 'Notify admins error when user consenting with missing consent type', |
| 825 | 825 | '#active' => 1, |
| 826 | 826 | '#weight' => '0', |
| 827 | 827 | '#categories' => array( |
| 828 | - '0' => 'boinc_standard', |
|
| 829 | - '1' => 'admin notification', |
|
| 828 | + '0' => 'boinc_standard', |
|
| 829 | + '1' => 'admin notification', |
|
| 830 | 830 | ), |
| 831 | 831 | '#status' => 'default', |
| 832 | 832 | '#conditions' => array(), |
| 833 | 833 | '#actions' => array( |
| 834 | - '0' => array( |
|
| 834 | + '0' => array( |
|
| 835 | 835 | '#type' => 'action', |
| 836 | 836 | '#settings' => array( |
| 837 | - 'from' => '', |
|
| 838 | - 'subject' => '[subject_tag:string] Error from user consenting to terms of use, missing consent type', |
|
| 839 | - 'message' => '[user:display-name], [user:mail], attempted to consent to terms-of-use form and the function \'check_consent_type\' returned an error. Consent type [consent_type:string] seems to be generating an error.', |
|
| 840 | - '#eval input' => array( |
|
| 837 | + 'from' => '', |
|
| 838 | + 'subject' => '[subject_tag:string] Error from user consenting to terms of use, missing consent type', |
|
| 839 | + 'message' => '[user:display-name], [user:mail], attempted to consent to terms-of-use form and the function \'check_consent_type\' returned an error. Consent type [consent_type:string] seems to be generating an error.', |
|
| 840 | + '#eval input' => array( |
|
| 841 | 841 | 'token_rules_input_evaluator' => array( |
| 842 | - 'subject' => array( |
|
| 842 | + 'subject' => array( |
|
| 843 | 843 | '0' => 'subject_tag', |
| 844 | 844 | '1' => ':global', |
| 845 | - ), |
|
| 846 | - 'message' => array( |
|
| 845 | + ), |
|
| 846 | + 'message' => array( |
|
| 847 | 847 | '0' => 'consent_type', |
| 848 | 848 | '1' => 'user', |
| 849 | 849 | '2' => ':global', |
| 850 | - ), |
|
| 851 | - 'from' => array( |
|
| 850 | + ), |
|
| 851 | + 'from' => array( |
|
| 852 | 852 | '0' => ':global', |
| 853 | - ), |
|
| 853 | + ), |
|
| 854 | + ), |
|
| 854 | 855 | ), |
| 855 | - ), |
|
| 856 | 856 | ), |
| 857 | 857 | '#name' => 'boinccore_rules_action_mail_to_admins', |
| 858 | 858 | '#info' => array( |
| 859 | - 'label' => 'Notify admins via email', |
|
| 860 | - 'module' => 'BOINC core', |
|
| 861 | - 'eval input' => array( |
|
| 859 | + 'label' => 'Notify admins via email', |
|
| 860 | + 'module' => 'BOINC core', |
|
| 861 | + 'eval input' => array( |
|
| 862 | 862 | '0' => 'subject', |
| 863 | 863 | '1' => 'message', |
| 864 | 864 | '2' => 'from', |
| 865 | - ), |
|
| 865 | + ), |
|
| 866 | 866 | ), |
| 867 | 867 | '#weight' => 0.0, |
| 868 | - ), |
|
| 868 | + ), |
|
| 869 | 869 | ), |
| 870 | 870 | '#version' => 6003, |
| 871 | - ), |
|
| 872 | - 'rules_notify_admins_user_changing_email_address_to_existing_user' => array( |
|
| 871 | + ), |
|
| 872 | + 'rules_notify_admins_user_changing_email_address_to_existing_user' => array( |
|
| 873 | 873 | '#type' => 'rule', |
| 874 | 874 | '#set' => 'event_boincuser_change_email_error', |
| 875 | 875 | '#label' => 'Notify admins user changing email address to existing user', |
| 876 | 876 | '#active' => 1, |
| 877 | 877 | '#weight' => '0', |
| 878 | 878 | '#categories' => array( |
| 879 | - '0' => 'boinc_standard', |
|
| 880 | - '1' => 'admin notification', |
|
| 879 | + '0' => 'boinc_standard', |
|
| 880 | + '1' => 'admin notification', |
|
| 881 | 881 | ), |
| 882 | 882 | '#status' => 'default', |
| 883 | 883 | '#conditions' => array(), |
| 884 | 884 | '#actions' => array( |
| 885 | - '0' => array( |
|
| 885 | + '0' => array( |
|
| 886 | 886 | '#type' => 'action', |
| 887 | 887 | '#settings' => array( |
| 888 | - 'from' => '', |
|
| 889 | - 'subject' => '[subject_tag:string] User attempted to change email address to one used by existing user.', |
|
| 890 | - 'message' => '[user:display-name] with email [user:mail] attempted to change their email to [new_email_addr:string], which is already in use by another user.', |
|
| 891 | - '#eval input' => array( |
|
| 888 | + 'from' => '', |
|
| 889 | + 'subject' => '[subject_tag:string] User attempted to change email address to one used by existing user.', |
|
| 890 | + 'message' => '[user:display-name] with email [user:mail] attempted to change their email to [new_email_addr:string], which is already in use by another user.', |
|
| 891 | + '#eval input' => array( |
|
| 892 | 892 | 'token_rules_input_evaluator' => array( |
| 893 | - 'subject' => array( |
|
| 893 | + 'subject' => array( |
|
| 894 | 894 | '0' => 'subject_tag', |
| 895 | 895 | '1' => ':global', |
| 896 | - ), |
|
| 897 | - 'message' => array( |
|
| 896 | + ), |
|
| 897 | + 'message' => array( |
|
| 898 | 898 | '0' => 'new_email_addr', |
| 899 | 899 | '1' => 'user', |
| 900 | 900 | '2' => ':global', |
| 901 | - ), |
|
| 902 | - 'from' => array( |
|
| 901 | + ), |
|
| 902 | + 'from' => array( |
|
| 903 | 903 | '0' => ':global', |
| 904 | - ), |
|
| 904 | + ), |
|
| 905 | + ), |
|
| 905 | 906 | ), |
| 906 | - ), |
|
| 907 | 907 | ), |
| 908 | 908 | '#name' => 'boinccore_rules_action_mail_to_admins', |
| 909 | 909 | '#info' => array( |
| 910 | - 'label' => 'Notify admins via email', |
|
| 911 | - 'module' => 'BOINC core', |
|
| 912 | - 'eval input' => array( |
|
| 910 | + 'label' => 'Notify admins via email', |
|
| 911 | + 'module' => 'BOINC core', |
|
| 912 | + 'eval input' => array( |
|
| 913 | 913 | '0' => 'subject', |
| 914 | 914 | '1' => 'message', |
| 915 | 915 | '2' => 'from', |
| 916 | - ), |
|
| 916 | + ), |
|
| 917 | 917 | ), |
| 918 | 918 | '#weight' => 0.0, |
| 919 | - ), |
|
| 919 | + ), |
|
| 920 | 920 | ), |
| 921 | 921 | '#version' => 6003, |
| 922 | - ), |
|
| 923 | - 'rules_notify_admins_user_reverting_to_previous_email_address_that_is_now_used_by_another_user' => array( |
|
| 922 | + ), |
|
| 923 | + 'rules_notify_admins_user_reverting_to_previous_email_address_that_is_now_used_by_another_user' => array( |
|
| 924 | 924 | '#type' => 'rule', |
| 925 | 925 | '#set' => 'event_boincuser_revert_email_error', |
| 926 | 926 | '#label' => 'Notify admins user reverting to previous email address that is now used by another user', |
| 927 | 927 | '#active' => 1, |
| 928 | 928 | '#weight' => '0', |
| 929 | 929 | '#categories' => array( |
| 930 | - '0' => 'boinc_standard', |
|
| 931 | - '1' => 'admin notification', |
|
| 930 | + '0' => 'boinc_standard', |
|
| 931 | + '1' => 'admin notification', |
|
| 932 | 932 | ), |
| 933 | 933 | '#status' => 'default', |
| 934 | 934 | '#conditions' => array(), |
| 935 | 935 | '#actions' => array( |
| 936 | - '0' => array( |
|
| 936 | + '0' => array( |
|
| 937 | 937 | '#type' => 'action', |
| 938 | 938 | '#settings' => array( |
| 939 | - 'from' => '', |
|
| 940 | - 'subject' => '[subject_tag:string] User attempted to revert to previous email address to one used by existing user.', |
|
| 941 | - 'message' => '[user:display-name] with email [user:mail] attempted to revert their email to their previous email address, [new_email_addr:string], which is already in use by another user.', |
|
| 942 | - '#eval input' => array( |
|
| 939 | + 'from' => '', |
|
| 940 | + 'subject' => '[subject_tag:string] User attempted to revert to previous email address to one used by existing user.', |
|
| 941 | + 'message' => '[user:display-name] with email [user:mail] attempted to revert their email to their previous email address, [new_email_addr:string], which is already in use by another user.', |
|
| 942 | + '#eval input' => array( |
|
| 943 | 943 | 'token_rules_input_evaluator' => array( |
| 944 | - 'subject' => array( |
|
| 944 | + 'subject' => array( |
|
| 945 | 945 | '0' => 'subject_tag', |
| 946 | 946 | '1' => ':global', |
| 947 | - ), |
|
| 948 | - 'message' => array( |
|
| 947 | + ), |
|
| 948 | + 'message' => array( |
|
| 949 | 949 | '0' => 'new_email_addr', |
| 950 | 950 | '1' => 'user', |
| 951 | 951 | '2' => ':global', |
| 952 | - ), |
|
| 953 | - 'from' => array( |
|
| 952 | + ), |
|
| 953 | + 'from' => array( |
|
| 954 | 954 | '0' => ':global', |
| 955 | - ), |
|
| 955 | + ), |
|
| 956 | + ), |
|
| 956 | 957 | ), |
| 957 | - ), |
|
| 958 | 958 | ), |
| 959 | 959 | '#name' => 'boinccore_rules_action_mail_to_admins', |
| 960 | 960 | '#info' => array( |
| 961 | - 'label' => 'Notify admins via email', |
|
| 962 | - 'module' => 'BOINC core', |
|
| 963 | - 'eval input' => array( |
|
| 961 | + 'label' => 'Notify admins via email', |
|
| 962 | + 'module' => 'BOINC core', |
|
| 963 | + 'eval input' => array( |
|
| 964 | 964 | '0' => 'subject', |
| 965 | 965 | '1' => 'message', |
| 966 | 966 | '2' => 'from', |
| 967 | - ), |
|
| 967 | + ), |
|
| 968 | 968 | ), |
| 969 | 969 | '#weight' => 0.0, |
| 970 | - ), |
|
| 970 | + ), |
|
| 971 | 971 | ), |
| 972 | 972 | '#version' => 6003, |
| 973 | - ), |
|
| 974 | - 'rules_notify_admins_when_user_fails_to_delete_their_own_account' => array( |
|
| 973 | + ), |
|
| 974 | + 'rules_notify_admins_when_user_fails_to_delete_their_own_account' => array( |
|
| 975 | 975 | '#type' => 'rule', |
| 976 | 976 | '#set' => 'event_boincuser_delete_general_error', |
| 977 | 977 | '#label' => 'Notify admins when user fails to delete their own account', |
| 978 | 978 | '#active' => 1, |
| 979 | 979 | '#weight' => '0', |
| 980 | 980 | '#categories' => array( |
| 981 | - '0' => 'boinc_standard', |
|
| 982 | - '1' => 'admin notification', |
|
| 981 | + '0' => 'boinc_standard', |
|
| 982 | + '1' => 'admin notification', |
|
| 983 | 983 | ), |
| 984 | 984 | '#status' => 'default', |
| 985 | 985 | '#conditions' => array(), |
| 986 | 986 | '#actions' => array( |
| 987 | - '0' => array( |
|
| 987 | + '0' => array( |
|
| 988 | 988 | '#type' => 'action', |
| 989 | 989 | '#settings' => array( |
| 990 | - 'from' => '', |
|
| 991 | - 'subject' => '[subject_tag:string] Error when user trying to delete their account', |
|
| 992 | - 'message' => 'User [user:display-name], [user:mail], attempted to delete their account. Error from \'boincuser_load\'.', |
|
| 993 | - '#eval input' => array( |
|
| 990 | + 'from' => '', |
|
| 991 | + 'subject' => '[subject_tag:string] Error when user trying to delete their account', |
|
| 992 | + 'message' => 'User [user:display-name], [user:mail], attempted to delete their account. Error from \'boincuser_load\'.', |
|
| 993 | + '#eval input' => array( |
|
| 994 | 994 | 'token_rules_input_evaluator' => array( |
| 995 | - 'subject' => array( |
|
| 995 | + 'subject' => array( |
|
| 996 | 996 | '0' => 'subject_tag', |
| 997 | 997 | '1' => ':global', |
| 998 | - ), |
|
| 999 | - 'message' => array( |
|
| 998 | + ), |
|
| 999 | + 'message' => array( |
|
| 1000 | 1000 | '0' => 'user', |
| 1001 | 1001 | '1' => ':global', |
| 1002 | - ), |
|
| 1003 | - 'from' => array( |
|
| 1002 | + ), |
|
| 1003 | + 'from' => array( |
|
| 1004 | 1004 | '0' => ':global', |
| 1005 | - ), |
|
| 1005 | + ), |
|
| 1006 | + ), |
|
| 1006 | 1007 | ), |
| 1007 | - ), |
|
| 1008 | 1008 | ), |
| 1009 | 1009 | '#name' => 'boinccore_rules_action_mail_to_admins', |
| 1010 | 1010 | '#info' => array( |
| 1011 | - 'label' => 'Notify admins via email', |
|
| 1012 | - 'module' => 'BOINC core', |
|
| 1013 | - 'eval input' => array( |
|
| 1011 | + 'label' => 'Notify admins via email', |
|
| 1012 | + 'module' => 'BOINC core', |
|
| 1013 | + 'eval input' => array( |
|
| 1014 | 1014 | '0' => 'subject', |
| 1015 | 1015 | '1' => 'message', |
| 1016 | 1016 | '2' => 'from', |
| 1017 | - ), |
|
| 1017 | + ), |
|
| 1018 | 1018 | ), |
| 1019 | 1019 | '#weight' => 0.0, |
| 1020 | - ), |
|
| 1020 | + ), |
|
| 1021 | 1021 | ), |
| 1022 | 1022 | '#version' => 6003, |
| 1023 | - ), |
|
| 1024 | - 'rules_notify_admins_when_user_tries_to_delete_account_with_invalid_uid' => array( |
|
| 1023 | + ), |
|
| 1024 | + 'rules_notify_admins_when_user_tries_to_delete_account_with_invalid_uid' => array( |
|
| 1025 | 1025 | '#type' => 'rule', |
| 1026 | 1026 | '#set' => 'event_boincuser_delete_uid_invalid_error', |
| 1027 | 1027 | '#label' => 'Notify admins when user tries to delete account with invalid uid', |
| 1028 | 1028 | '#active' => 1, |
| 1029 | 1029 | '#weight' => '0', |
| 1030 | 1030 | '#categories' => array( |
| 1031 | - '0' => 'boinc_standard', |
|
| 1032 | - '1' => 'admin notification', |
|
| 1031 | + '0' => 'boinc_standard', |
|
| 1032 | + '1' => 'admin notification', |
|
| 1033 | 1033 | ), |
| 1034 | 1034 | '#status' => 'default', |
| 1035 | 1035 | '#conditions' => array(), |
| 1036 | 1036 | '#actions' => array( |
| 1037 | - '0' => array( |
|
| 1037 | + '0' => array( |
|
| 1038 | 1038 | '#type' => 'action', |
| 1039 | 1039 | '#settings' => array( |
| 1040 | - 'from' => '', |
|
| 1041 | - 'subject' => '[subject_tag:string] invalid uid when user trying to delete their account', |
|
| 1042 | - 'message' => 'User [user:display-name], [user:mail], attempted to delete their account. Error is Drupal UID=[user:uid] cannot be located.', |
|
| 1043 | - '#eval input' => array( |
|
| 1040 | + 'from' => '', |
|
| 1041 | + 'subject' => '[subject_tag:string] invalid uid when user trying to delete their account', |
|
| 1042 | + 'message' => 'User [user:display-name], [user:mail], attempted to delete their account. Error is Drupal UID=[user:uid] cannot be located.', |
|
| 1043 | + '#eval input' => array( |
|
| 1044 | 1044 | 'token_rules_input_evaluator' => array( |
| 1045 | - 'subject' => array( |
|
| 1045 | + 'subject' => array( |
|
| 1046 | 1046 | '0' => 'subject_tag', |
| 1047 | 1047 | '1' => ':global', |
| 1048 | - ), |
|
| 1049 | - 'message' => array( |
|
| 1048 | + ), |
|
| 1049 | + 'message' => array( |
|
| 1050 | 1050 | '0' => 'user', |
| 1051 | 1051 | '1' => ':global', |
| 1052 | - ), |
|
| 1053 | - 'from' => array( |
|
| 1052 | + ), |
|
| 1053 | + 'from' => array( |
|
| 1054 | 1054 | '0' => ':global', |
| 1055 | - ), |
|
| 1055 | + ), |
|
| 1056 | + ), |
|
| 1056 | 1057 | ), |
| 1057 | - ), |
|
| 1058 | 1058 | ), |
| 1059 | 1059 | '#name' => 'boinccore_rules_action_mail_to_admins', |
| 1060 | 1060 | '#info' => array( |
| 1061 | - 'label' => 'Notify admins via email', |
|
| 1062 | - 'module' => 'BOINC core', |
|
| 1063 | - 'eval input' => array( |
|
| 1061 | + 'label' => 'Notify admins via email', |
|
| 1062 | + 'module' => 'BOINC core', |
|
| 1063 | + 'eval input' => array( |
|
| 1064 | 1064 | '0' => 'subject', |
| 1065 | 1065 | '1' => 'message', |
| 1066 | 1066 | '2' => 'from', |
| 1067 | - ), |
|
| 1067 | + ), |
|
| 1068 | 1068 | ), |
| 1069 | 1069 | '#weight' => 0.0, |
| 1070 | - ), |
|
| 1070 | + ), |
|
| 1071 | 1071 | ), |
| 1072 | 1072 | '#version' => 6003, |
| 1073 | - ), |
|
| 1074 | - 'rules_notify_admin_error_when_user_consenting_to_terms_of_use' => array( |
|
| 1073 | + ), |
|
| 1074 | + 'rules_notify_admin_error_when_user_consenting_to_terms_of_use' => array( |
|
| 1075 | 1075 | '#type' => 'rule', |
| 1076 | 1076 | '#set' => 'event_boincuser_general_consent_error', |
| 1077 | 1077 | '#label' => 'Notify admins error when user consenting to terms of use', |
| 1078 | 1078 | '#active' => 1, |
| 1079 | 1079 | '#weight' => '0', |
| 1080 | 1080 | '#categories' => array( |
| 1081 | - '0' => 'boinc_standard', |
|
| 1082 | - '1' => 'admin notification', |
|
| 1081 | + '0' => 'boinc_standard', |
|
| 1082 | + '1' => 'admin notification', |
|
| 1083 | 1083 | ), |
| 1084 | 1084 | '#status' => 'default', |
| 1085 | 1085 | '#conditions' => array(), |
| 1086 | 1086 | '#actions' => array( |
| 1087 | - '0' => array( |
|
| 1087 | + '0' => array( |
|
| 1088 | 1088 | '#type' => 'action', |
| 1089 | 1089 | '#settings' => array( |
| 1090 | - 'from' => '', |
|
| 1091 | - 'subject' => '[subject_tag:string] Error when user attempted to consent to terms of use', |
|
| 1092 | - 'message' => '[user:display-name], [user:mail], attempted to consent to terms-of-use form and an error was generated from function \'consent_to_a_policy\'. |
|
| 1090 | + 'from' => '', |
|
| 1091 | + 'subject' => '[subject_tag:string] Error when user attempted to consent to terms of use', |
|
| 1092 | + 'message' => '[user:display-name], [user:mail], attempted to consent to terms-of-use form and an error was generated from function \'consent_to_a_policy\'. |
|
| 1093 | 1093 | |
| 1094 | 1094 | asdf jkl;', |
| 1095 | - '#eval input' => array( |
|
| 1095 | + '#eval input' => array( |
|
| 1096 | 1096 | 'token_rules_input_evaluator' => array( |
| 1097 | - 'subject' => array( |
|
| 1097 | + 'subject' => array( |
|
| 1098 | 1098 | '0' => 'subject_tag', |
| 1099 | 1099 | '1' => ':global', |
| 1100 | - ), |
|
| 1101 | - 'message' => array( |
|
| 1100 | + ), |
|
| 1101 | + 'message' => array( |
|
| 1102 | 1102 | '0' => 'user', |
| 1103 | 1103 | '1' => ':global', |
| 1104 | - ), |
|
| 1105 | - 'from' => array( |
|
| 1104 | + ), |
|
| 1105 | + 'from' => array( |
|
| 1106 | 1106 | '0' => ':global', |
| 1107 | - ), |
|
| 1107 | + ), |
|
| 1108 | + ), |
|
| 1108 | 1109 | ), |
| 1109 | - ), |
|
| 1110 | 1110 | ), |
| 1111 | 1111 | '#name' => 'boinccore_rules_action_mail_to_admins', |
| 1112 | 1112 | '#info' => array( |
| 1113 | - 'label' => 'Notify admins via email', |
|
| 1114 | - 'module' => 'BOINC core', |
|
| 1115 | - 'eval input' => array( |
|
| 1113 | + 'label' => 'Notify admins via email', |
|
| 1114 | + 'module' => 'BOINC core', |
|
| 1115 | + 'eval input' => array( |
|
| 1116 | 1116 | '0' => 'subject', |
| 1117 | 1117 | '1' => 'message', |
| 1118 | 1118 | '2' => 'from', |
| 1119 | - ), |
|
| 1119 | + ), |
|
| 1120 | 1120 | ), |
| 1121 | 1121 | '#weight' => 0.0, |
| 1122 | - ), |
|
| 1122 | + ), |
|
| 1123 | 1123 | ), |
| 1124 | 1124 | '#version' => 6003, |
| 1125 | - ), |
|
| 1126 | - 'rules_offensive_comment_reported_hostile' => array( |
|
| 1125 | + ), |
|
| 1126 | + 'rules_offensive_comment_reported_hostile' => array( |
|
| 1127 | 1127 | '#type' => 'rule', |
| 1128 | 1128 | '#set' => 'event_flag_flagged_abuse_comment_3', |
| 1129 | 1129 | '#label' => 'Offensive comment reported - Hostile', |
| 1130 | 1130 | '#active' => 1, |
| 1131 | 1131 | '#weight' => '0', |
| 1132 | 1132 | '#categories' => array( |
| 1133 | - '0' => 'boinc_standard', |
|
| 1134 | - '1' => 'moderator notification', |
|
| 1133 | + '0' => 'boinc_standard', |
|
| 1134 | + '1' => 'moderator notification', |
|
| 1135 | 1135 | ), |
| 1136 | 1136 | '#status' => 'default', |
| 1137 | 1137 | '#conditions' => array(), |
| 1138 | 1138 | '#actions' => array( |
| 1139 | - '0' => array( |
|
| 1139 | + '0' => array( |
|
| 1140 | 1140 | '#type' => 'action', |
| 1141 | 1141 | '#settings' => array( |
| 1142 | - 'from' => '', |
|
| 1143 | - 'subject' => 'Report of hostile language in [node:type] comment at [:global:site-name]', |
|
| 1144 | - 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content as |
|
| 1142 | + 'from' => '', |
|
| 1143 | + 'subject' => 'Report of hostile language in [node:type] comment at [:global:site-name]', |
|
| 1144 | + 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content as |
|
| 1145 | 1145 | containing hostile language for the [:global:site-name] site: |
| 1146 | 1146 | |
| 1147 | 1147 | <?php print url(\'<front>\', array(\'absolute\' => TRUE, \'language\' => \'en\')); ?>/goto/comment/[comment:comment-cid] |
| 1148 | 1148 | |
| 1149 | 1149 | Total reports of this comment: [comment:flag-abuse-comment-meta-count]', |
| 1150 | - '#eval input' => array( |
|
| 1150 | + '#eval input' => array( |
|
| 1151 | 1151 | 'token_rules_input_evaluator' => array( |
| 1152 | - 'subject' => array( |
|
| 1152 | + 'subject' => array( |
|
| 1153 | 1153 | '0' => 'node', |
| 1154 | 1154 | '1' => ':global', |
| 1155 | - ), |
|
| 1156 | - 'message' => array( |
|
| 1155 | + ), |
|
| 1156 | + 'message' => array( |
|
| 1157 | 1157 | '0' => 'flagging_user', |
| 1158 | 1158 | '1' => 'comment', |
| 1159 | 1159 | '2' => 'node', |
| 1160 | 1160 | '3' => ':global', |
| 1161 | - ), |
|
| 1162 | - 'from' => array( |
|
| 1161 | + ), |
|
| 1162 | + 'from' => array( |
|
| 1163 | 1163 | '0' => ':global', |
| 1164 | - ), |
|
| 1164 | + ), |
|
| 1165 | 1165 | ), |
| 1166 | 1166 | 'rules_input_evaluator_php' => array( |
| 1167 | - 'message' => array(), |
|
| 1167 | + 'message' => array(), |
|
| 1168 | + ), |
|
| 1168 | 1169 | ), |
| 1169 | - ), |
|
| 1170 | 1170 | ), |
| 1171 | 1171 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1172 | 1172 | '#info' => array( |
| 1173 | - 'label' => 'Notify moderators via email', |
|
| 1174 | - 'module' => 'BOINC core', |
|
| 1175 | - 'eval input' => array( |
|
| 1173 | + 'label' => 'Notify moderators via email', |
|
| 1174 | + 'module' => 'BOINC core', |
|
| 1175 | + 'eval input' => array( |
|
| 1176 | 1176 | '0' => 'subject', |
| 1177 | 1177 | '1' => 'message', |
| 1178 | 1178 | '2' => 'from', |
| 1179 | - ), |
|
| 1179 | + ), |
|
| 1180 | 1180 | ), |
| 1181 | 1181 | '#weight' => 0.0, |
| 1182 | - ), |
|
| 1182 | + ), |
|
| 1183 | 1183 | ), |
| 1184 | 1184 | '#version' => 6003, |
| 1185 | - ), |
|
| 1186 | - 'rules_offensive_comment_reported_link' => array( |
|
| 1185 | + ), |
|
| 1186 | + 'rules_offensive_comment_reported_link' => array( |
|
| 1187 | 1187 | '#type' => 'rule', |
| 1188 | 1188 | '#set' => 'event_flag_flagged_abuse_comment_2', |
| 1189 | 1189 | '#label' => 'Offensive comment reported - Link', |
| 1190 | 1190 | '#active' => 1, |
| 1191 | 1191 | '#weight' => '0', |
| 1192 | 1192 | '#categories' => array( |
| 1193 | - '0' => 'boinc_standard', |
|
| 1194 | - '1' => 'moderator notification', |
|
| 1193 | + '0' => 'boinc_standard', |
|
| 1194 | + '1' => 'moderator notification', |
|
| 1195 | 1195 | ), |
| 1196 | 1196 | '#status' => 'default', |
| 1197 | 1197 | '#conditions' => array(), |
| 1198 | 1198 | '#actions' => array( |
| 1199 | - '0' => array( |
|
| 1199 | + '0' => array( |
|
| 1200 | 1200 | '#type' => 'action', |
| 1201 | 1201 | '#settings' => array( |
| 1202 | - 'from' => '', |
|
| 1203 | - 'subject' => 'Report of inappropriate link in [node:type] comment at [:global:site-name]', |
|
| 1204 | - 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content as |
|
| 1202 | + 'from' => '', |
|
| 1203 | + 'subject' => 'Report of inappropriate link in [node:type] comment at [:global:site-name]', |
|
| 1204 | + 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content as |
|
| 1205 | 1205 | containing an offensive or inappropriate link for the [:global:site-name] site: |
| 1206 | 1206 | |
| 1207 | 1207 | <?php print url(\'<front>\', array(\'absolute\' => TRUE, \'language\' => \'en\')); ?>/goto/comment/[comment:comment-cid] |
| 1208 | 1208 | |
| 1209 | 1209 | Total reports of this comment: [comment:flag-abuse-comment-meta-count]', |
| 1210 | - '#eval input' => array( |
|
| 1210 | + '#eval input' => array( |
|
| 1211 | 1211 | 'token_rules_input_evaluator' => array( |
| 1212 | - 'subject' => array( |
|
| 1212 | + 'subject' => array( |
|
| 1213 | 1213 | '0' => 'node', |
| 1214 | 1214 | '1' => ':global', |
| 1215 | - ), |
|
| 1216 | - 'message' => array( |
|
| 1215 | + ), |
|
| 1216 | + 'message' => array( |
|
| 1217 | 1217 | '0' => 'flagging_user', |
| 1218 | 1218 | '1' => 'comment', |
| 1219 | 1219 | '2' => 'node', |
| 1220 | 1220 | '3' => ':global', |
| 1221 | - ), |
|
| 1222 | - 'from' => array( |
|
| 1221 | + ), |
|
| 1222 | + 'from' => array( |
|
| 1223 | 1223 | '0' => ':global', |
| 1224 | - ), |
|
| 1224 | + ), |
|
| 1225 | 1225 | ), |
| 1226 | 1226 | 'rules_input_evaluator_php' => array( |
| 1227 | - 'message' => array(), |
|
| 1227 | + 'message' => array(), |
|
| 1228 | + ), |
|
| 1228 | 1229 | ), |
| 1229 | - ), |
|
| 1230 | 1230 | ), |
| 1231 | 1231 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1232 | 1232 | '#info' => array( |
| 1233 | - 'label' => 'Notify moderators via email', |
|
| 1234 | - 'module' => 'BOINC core', |
|
| 1235 | - 'eval input' => array( |
|
| 1233 | + 'label' => 'Notify moderators via email', |
|
| 1234 | + 'module' => 'BOINC core', |
|
| 1235 | + 'eval input' => array( |
|
| 1236 | 1236 | '0' => 'subject', |
| 1237 | 1237 | '1' => 'message', |
| 1238 | 1238 | '2' => 'from', |
| 1239 | - ), |
|
| 1239 | + ), |
|
| 1240 | 1240 | ), |
| 1241 | 1241 | '#weight' => 0.0, |
| 1242 | - ), |
|
| 1242 | + ), |
|
| 1243 | 1243 | ), |
| 1244 | 1244 | '#version' => 6003, |
| 1245 | - ), |
|
| 1246 | - 'rules_offensive_comment_reported_not_kid_friendly' => array( |
|
| 1245 | + ), |
|
| 1246 | + 'rules_offensive_comment_reported_not_kid_friendly' => array( |
|
| 1247 | 1247 | '#type' => 'rule', |
| 1248 | 1248 | '#set' => 'event_flag_flagged_abuse_comment_4', |
| 1249 | 1249 | '#label' => 'Offensive comment reported - Not Kid Friendly', |
| 1250 | 1250 | '#active' => 1, |
| 1251 | 1251 | '#weight' => '0', |
| 1252 | 1252 | '#categories' => array( |
| 1253 | - '0' => 'boinc_standard', |
|
| 1254 | - '1' => 'moderator notification', |
|
| 1253 | + '0' => 'boinc_standard', |
|
| 1254 | + '1' => 'moderator notification', |
|
| 1255 | 1255 | ), |
| 1256 | 1256 | '#status' => 'default', |
| 1257 | 1257 | '#conditions' => array(), |
| 1258 | 1258 | '#actions' => array( |
| 1259 | - '0' => array( |
|
| 1259 | + '0' => array( |
|
| 1260 | 1260 | '#type' => 'action', |
| 1261 | 1261 | '#settings' => array( |
| 1262 | - 'from' => '', |
|
| 1263 | - 'subject' => 'Report of non Kid-friendly language in [node:type] comment at [:global:site-name]', |
|
| 1264 | - 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content as |
|
| 1262 | + 'from' => '', |
|
| 1263 | + 'subject' => 'Report of non Kid-friendly language in [node:type] comment at [:global:site-name]', |
|
| 1264 | + 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content as |
|
| 1265 | 1265 | containing non Kid-friendly language for the [:global:site-name] site: |
| 1266 | 1266 | |
| 1267 | 1267 | <?php print url(\'<front>\', array(\'absolute\' => TRUE, \'language\' => \'en\')); ?>/goto/comment/[comment:comment-cid] |
| 1268 | 1268 | |
| 1269 | 1269 | Total reports of this comment: [comment:flag-abuse-comment-meta-count]', |
| 1270 | - '#eval input' => array( |
|
| 1270 | + '#eval input' => array( |
|
| 1271 | 1271 | 'token_rules_input_evaluator' => array( |
| 1272 | - 'subject' => array( |
|
| 1272 | + 'subject' => array( |
|
| 1273 | 1273 | '0' => 'node', |
| 1274 | 1274 | '1' => ':global', |
| 1275 | - ), |
|
| 1276 | - 'message' => array( |
|
| 1275 | + ), |
|
| 1276 | + 'message' => array( |
|
| 1277 | 1277 | '0' => 'flagging_user', |
| 1278 | 1278 | '1' => 'comment', |
| 1279 | 1279 | '2' => 'node', |
| 1280 | 1280 | '3' => ':global', |
| 1281 | - ), |
|
| 1282 | - 'from' => array( |
|
| 1281 | + ), |
|
| 1282 | + 'from' => array( |
|
| 1283 | 1283 | '0' => ':global', |
| 1284 | - ), |
|
| 1284 | + ), |
|
| 1285 | 1285 | ), |
| 1286 | 1286 | 'rules_input_evaluator_php' => array( |
| 1287 | - 'message' => array(), |
|
| 1287 | + 'message' => array(), |
|
| 1288 | + ), |
|
| 1288 | 1289 | ), |
| 1289 | - ), |
|
| 1290 | 1290 | ), |
| 1291 | 1291 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1292 | 1292 | '#info' => array( |
| 1293 | - 'label' => 'Notify moderators via email', |
|
| 1294 | - 'module' => 'BOINC core', |
|
| 1295 | - 'eval input' => array( |
|
| 1293 | + 'label' => 'Notify moderators via email', |
|
| 1294 | + 'module' => 'BOINC core', |
|
| 1295 | + 'eval input' => array( |
|
| 1296 | 1296 | '0' => 'subject', |
| 1297 | 1297 | '1' => 'message', |
| 1298 | 1298 | '2' => 'from', |
| 1299 | - ), |
|
| 1299 | + ), |
|
| 1300 | 1300 | ), |
| 1301 | 1301 | '#weight' => 0.0, |
| 1302 | - ), |
|
| 1302 | + ), |
|
| 1303 | 1303 | ), |
| 1304 | 1304 | '#version' => 6003, |
| 1305 | - ), |
|
| 1306 | - 'rules_offensive_comment_reported_other' => array( |
|
| 1305 | + ), |
|
| 1306 | + 'rules_offensive_comment_reported_other' => array( |
|
| 1307 | 1307 | '#type' => 'rule', |
| 1308 | 1308 | '#set' => 'event_flag_flagged_abuse_comment_5', |
| 1309 | 1309 | '#label' => 'Offensive comment reported - Other', |
| 1310 | 1310 | '#active' => 1, |
| 1311 | 1311 | '#weight' => '0', |
| 1312 | 1312 | '#categories' => array( |
| 1313 | - '0' => 'boinc_standard', |
|
| 1314 | - '1' => 'moderator notification', |
|
| 1313 | + '0' => 'boinc_standard', |
|
| 1314 | + '1' => 'moderator notification', |
|
| 1315 | 1315 | ), |
| 1316 | 1316 | '#status' => 'default', |
| 1317 | 1317 | '#conditions' => array(), |
| 1318 | 1318 | '#actions' => array( |
| 1319 | - '0' => array( |
|
| 1319 | + '0' => array( |
|
| 1320 | 1320 | '#type' => 'action', |
| 1321 | 1321 | '#settings' => array( |
| 1322 | - 'from' => '', |
|
| 1323 | - 'subject' => 'Report of offensive [node:type] comment at [:global:site-name]', |
|
| 1324 | - 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content as |
|
| 1322 | + 'from' => '', |
|
| 1323 | + 'subject' => 'Report of offensive [node:type] comment at [:global:site-name]', |
|
| 1324 | + 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content as |
|
| 1325 | 1325 | being offensive or inappropriate for the [:global:site-name] site, with reason \'Other\': |
| 1326 | 1326 | |
| 1327 | 1327 | <?php print url(\'<front>\', array(\'absolute\' => TRUE, \'language\' => \'en\')); ?>/goto/comment/[comment:comment-cid] |
| 1328 | 1328 | |
| 1329 | 1329 | Total reports of this comment: [comment:flag-abuse-comment-meta-count]', |
| 1330 | - '#eval input' => array( |
|
| 1330 | + '#eval input' => array( |
|
| 1331 | 1331 | 'token_rules_input_evaluator' => array( |
| 1332 | - 'subject' => array( |
|
| 1332 | + 'subject' => array( |
|
| 1333 | 1333 | '0' => 'node', |
| 1334 | 1334 | '1' => ':global', |
| 1335 | - ), |
|
| 1336 | - 'message' => array( |
|
| 1335 | + ), |
|
| 1336 | + 'message' => array( |
|
| 1337 | 1337 | '0' => 'flagging_user', |
| 1338 | 1338 | '1' => 'comment', |
| 1339 | 1339 | '2' => 'node', |
| 1340 | 1340 | '3' => ':global', |
| 1341 | - ), |
|
| 1342 | - 'from' => array( |
|
| 1341 | + ), |
|
| 1342 | + 'from' => array( |
|
| 1343 | 1343 | '0' => ':global', |
| 1344 | - ), |
|
| 1344 | + ), |
|
| 1345 | 1345 | ), |
| 1346 | 1346 | 'rules_input_evaluator_php' => array( |
| 1347 | - 'message' => array(), |
|
| 1347 | + 'message' => array(), |
|
| 1348 | + ), |
|
| 1348 | 1349 | ), |
| 1349 | - ), |
|
| 1350 | 1350 | ), |
| 1351 | 1351 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1352 | 1352 | '#info' => array( |
| 1353 | - 'label' => 'Notify moderators via email', |
|
| 1354 | - 'module' => 'BOINC core', |
|
| 1355 | - 'eval input' => array( |
|
| 1353 | + 'label' => 'Notify moderators via email', |
|
| 1354 | + 'module' => 'BOINC core', |
|
| 1355 | + 'eval input' => array( |
|
| 1356 | 1356 | '0' => 'subject', |
| 1357 | 1357 | '1' => 'message', |
| 1358 | 1358 | '2' => 'from', |
| 1359 | - ), |
|
| 1359 | + ), |
|
| 1360 | 1360 | ), |
| 1361 | 1361 | '#weight' => 0.0, |
| 1362 | - ), |
|
| 1362 | + ), |
|
| 1363 | 1363 | ), |
| 1364 | 1364 | '#version' => 6003, |
| 1365 | - ), |
|
| 1366 | - 'rules_offensive_comment_reported_spam' => array( |
|
| 1365 | + ), |
|
| 1366 | + 'rules_offensive_comment_reported_spam' => array( |
|
| 1367 | 1367 | '#type' => 'rule', |
| 1368 | 1368 | '#set' => 'event_flag_flagged_abuse_comment_1', |
| 1369 | 1369 | '#label' => 'Offensive comment reported - SPAM', |
| 1370 | 1370 | '#active' => 1, |
| 1371 | 1371 | '#weight' => '0', |
| 1372 | 1372 | '#categories' => array( |
| 1373 | - '0' => 'boinc_standard', |
|
| 1374 | - '1' => 'moderator notification', |
|
| 1373 | + '0' => 'boinc_standard', |
|
| 1374 | + '1' => 'moderator notification', |
|
| 1375 | 1375 | ), |
| 1376 | 1376 | '#status' => 'default', |
| 1377 | 1377 | '#conditions' => array(), |
| 1378 | 1378 | '#actions' => array( |
| 1379 | - '0' => array( |
|
| 1379 | + '0' => array( |
|
| 1380 | 1380 | '#type' => 'action', |
| 1381 | 1381 | '#settings' => array( |
| 1382 | - 'from' => '', |
|
| 1383 | - 'subject' => 'Report of SPAM [node:type] comment at [:global:site-name]', |
|
| 1384 | - 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content |
|
| 1382 | + 'from' => '', |
|
| 1383 | + 'subject' => 'Report of SPAM [node:type] comment at [:global:site-name]', |
|
| 1384 | + 'message' => '[flagging_user:display-name] has reported the following comment on [node:type] content |
|
| 1385 | 1385 | as being SPAM for the [:global:site-name] site: |
| 1386 | 1386 | |
| 1387 | 1387 | <?php print url(\'<front>\', array(\'absolute\' => TRUE, \'language\' => \'en\')); ?>/goto/comment/[comment:comment-cid] |
| 1388 | 1388 | |
| 1389 | 1389 | Total reports of this comment: [comment:flag-abuse-comment-meta-count]', |
| 1390 | - '#eval input' => array( |
|
| 1390 | + '#eval input' => array( |
|
| 1391 | 1391 | 'token_rules_input_evaluator' => array( |
| 1392 | - 'subject' => array( |
|
| 1392 | + 'subject' => array( |
|
| 1393 | 1393 | '0' => 'node', |
| 1394 | 1394 | '1' => ':global', |
| 1395 | - ), |
|
| 1396 | - 'message' => array( |
|
| 1395 | + ), |
|
| 1396 | + 'message' => array( |
|
| 1397 | 1397 | '0' => 'flagging_user', |
| 1398 | 1398 | '1' => 'comment', |
| 1399 | 1399 | '2' => 'node', |
| 1400 | 1400 | '3' => ':global', |
| 1401 | - ), |
|
| 1402 | - 'from' => array( |
|
| 1401 | + ), |
|
| 1402 | + 'from' => array( |
|
| 1403 | 1403 | '0' => ':global', |
| 1404 | - ), |
|
| 1404 | + ), |
|
| 1405 | 1405 | ), |
| 1406 | 1406 | 'rules_input_evaluator_php' => array( |
| 1407 | - 'message' => array(), |
|
| 1407 | + 'message' => array(), |
|
| 1408 | + ), |
|
| 1408 | 1409 | ), |
| 1409 | - ), |
|
| 1410 | 1410 | ), |
| 1411 | 1411 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1412 | 1412 | '#info' => array( |
| 1413 | - 'label' => 'Notify moderators via email', |
|
| 1414 | - 'module' => 'BOINC core', |
|
| 1415 | - 'eval input' => array( |
|
| 1413 | + 'label' => 'Notify moderators via email', |
|
| 1414 | + 'module' => 'BOINC core', |
|
| 1415 | + 'eval input' => array( |
|
| 1416 | 1416 | '0' => 'subject', |
| 1417 | 1417 | '1' => 'message', |
| 1418 | 1418 | '2' => 'from', |
| 1419 | - ), |
|
| 1419 | + ), |
|
| 1420 | 1420 | ), |
| 1421 | 1421 | '#weight' => 0.0, |
| 1422 | - ), |
|
| 1422 | + ), |
|
| 1423 | 1423 | ), |
| 1424 | 1424 | '#version' => 6003, |
| 1425 | - ), |
|
| 1426 | - 'rules_offensive_content_reported_hostile' => array( |
|
| 1425 | + ), |
|
| 1426 | + 'rules_offensive_content_reported_hostile' => array( |
|
| 1427 | 1427 | '#type' => 'rule', |
| 1428 | 1428 | '#set' => 'event_flag_flagged_abuse_node_3', |
| 1429 | 1429 | '#label' => 'Offensive content reported - Hostile', |
| 1430 | 1430 | '#active' => 1, |
| 1431 | 1431 | '#weight' => '0', |
| 1432 | 1432 | '#categories' => array( |
| 1433 | - '0' => 'boinc_standard', |
|
| 1434 | - '1' => 'moderator notification', |
|
| 1433 | + '0' => 'boinc_standard', |
|
| 1434 | + '1' => 'moderator notification', |
|
| 1435 | 1435 | ), |
| 1436 | 1436 | '#status' => 'default', |
| 1437 | 1437 | '#conditions' => array(), |
| 1438 | 1438 | '#actions' => array( |
| 1439 | - '0' => array( |
|
| 1439 | + '0' => array( |
|
| 1440 | 1440 | '#type' => 'action', |
| 1441 | 1441 | '#settings' => array( |
| 1442 | - 'from' => '', |
|
| 1443 | - 'subject' => 'Report of hostile language in [node:type] content at [:global:site-name]', |
|
| 1444 | - 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1442 | + 'from' => '', |
|
| 1443 | + 'subject' => 'Report of hostile language in [node:type] content at [:global:site-name]', |
|
| 1444 | + 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1445 | 1445 | as hostile language for the [:global:site-name] site: |
| 1446 | 1446 | |
| 1447 | 1447 | <?php print url(\'node/\' . \\$node->nid, array(\'absolute\' => TRUE, \'language\' => \'en\')); ?> |
| 1448 | 1448 | |
| 1449 | 1449 | Total reports of this content: [node:flag-abuse-node-meta-count]', |
| 1450 | - '#eval input' => array( |
|
| 1450 | + '#eval input' => array( |
|
| 1451 | 1451 | 'token_rules_input_evaluator' => array( |
| 1452 | - 'subject' => array( |
|
| 1452 | + 'subject' => array( |
|
| 1453 | 1453 | '0' => 'node', |
| 1454 | 1454 | '1' => ':global', |
| 1455 | - ), |
|
| 1456 | - 'message' => array( |
|
| 1455 | + ), |
|
| 1456 | + 'message' => array( |
|
| 1457 | 1457 | '0' => 'flagging_user', |
| 1458 | 1458 | '1' => 'node', |
| 1459 | 1459 | '2' => ':global', |
| 1460 | - ), |
|
| 1461 | - 'from' => array( |
|
| 1460 | + ), |
|
| 1461 | + 'from' => array( |
|
| 1462 | 1462 | '0' => ':global', |
| 1463 | - ), |
|
| 1463 | + ), |
|
| 1464 | 1464 | ), |
| 1465 | 1465 | 'rules_input_evaluator_php' => array( |
| 1466 | - 'message' => array( |
|
| 1466 | + 'message' => array( |
|
| 1467 | 1467 | '0' => 'node', |
| 1468 | - ), |
|
| 1468 | + ), |
|
| 1469 | + ), |
|
| 1469 | 1470 | ), |
| 1470 | - ), |
|
| 1471 | 1471 | ), |
| 1472 | 1472 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1473 | 1473 | '#info' => array( |
| 1474 | - 'label' => 'Notify moderators via email', |
|
| 1475 | - 'module' => 'BOINC core', |
|
| 1476 | - 'eval input' => array( |
|
| 1474 | + 'label' => 'Notify moderators via email', |
|
| 1475 | + 'module' => 'BOINC core', |
|
| 1476 | + 'eval input' => array( |
|
| 1477 | 1477 | '0' => 'subject', |
| 1478 | 1478 | '1' => 'message', |
| 1479 | 1479 | '2' => 'from', |
| 1480 | - ), |
|
| 1480 | + ), |
|
| 1481 | 1481 | ), |
| 1482 | 1482 | '#weight' => 0.0, |
| 1483 | - ), |
|
| 1483 | + ), |
|
| 1484 | 1484 | ), |
| 1485 | 1485 | '#version' => 6003, |
| 1486 | - ), |
|
| 1487 | - 'rules_offensive_content_reported_link' => array( |
|
| 1486 | + ), |
|
| 1487 | + 'rules_offensive_content_reported_link' => array( |
|
| 1488 | 1488 | '#type' => 'rule', |
| 1489 | 1489 | '#set' => 'event_flag_flagged_abuse_node_2', |
| 1490 | 1490 | '#label' => 'Offensive content reported - Link', |
| 1491 | 1491 | '#active' => 1, |
| 1492 | 1492 | '#weight' => '0', |
| 1493 | 1493 | '#categories' => array( |
| 1494 | - '0' => 'boinc_standard', |
|
| 1495 | - '1' => 'moderator notification', |
|
| 1494 | + '0' => 'boinc_standard', |
|
| 1495 | + '1' => 'moderator notification', |
|
| 1496 | 1496 | ), |
| 1497 | 1497 | '#status' => 'default', |
| 1498 | 1498 | '#conditions' => array(), |
| 1499 | 1499 | '#actions' => array( |
| 1500 | - '0' => array( |
|
| 1500 | + '0' => array( |
|
| 1501 | 1501 | '#type' => 'action', |
| 1502 | 1502 | '#settings' => array( |
| 1503 | - 'from' => '', |
|
| 1504 | - 'subject' => 'Report of inappropriate link in [node:type] content at [:global:site-name]', |
|
| 1505 | - 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1503 | + 'from' => '', |
|
| 1504 | + 'subject' => 'Report of inappropriate link in [node:type] content at [:global:site-name]', |
|
| 1505 | + 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1506 | 1506 | as containing an offensive or inappropriate link for the [:global:site-name] site: |
| 1507 | 1507 | |
| 1508 | 1508 | <?php print url(\'node/\' . \\$node->nid, array(\'absolute\' => TRUE, \'language\' => \'en\')); ?> |
| 1509 | 1509 | |
| 1510 | 1510 | Total reports of this content: [node:flag-abuse-node-meta-count]', |
| 1511 | - '#eval input' => array( |
|
| 1511 | + '#eval input' => array( |
|
| 1512 | 1512 | 'token_rules_input_evaluator' => array( |
| 1513 | - 'subject' => array( |
|
| 1513 | + 'subject' => array( |
|
| 1514 | 1514 | '0' => 'node', |
| 1515 | 1515 | '1' => ':global', |
| 1516 | - ), |
|
| 1517 | - 'message' => array( |
|
| 1516 | + ), |
|
| 1517 | + 'message' => array( |
|
| 1518 | 1518 | '0' => 'flagging_user', |
| 1519 | 1519 | '1' => 'node', |
| 1520 | 1520 | '2' => ':global', |
| 1521 | - ), |
|
| 1522 | - 'from' => array( |
|
| 1521 | + ), |
|
| 1522 | + 'from' => array( |
|
| 1523 | 1523 | '0' => ':global', |
| 1524 | - ), |
|
| 1524 | + ), |
|
| 1525 | 1525 | ), |
| 1526 | 1526 | 'rules_input_evaluator_php' => array( |
| 1527 | - 'message' => array( |
|
| 1527 | + 'message' => array( |
|
| 1528 | 1528 | '0' => 'node', |
| 1529 | - ), |
|
| 1529 | + ), |
|
| 1530 | + ), |
|
| 1530 | 1531 | ), |
| 1531 | - ), |
|
| 1532 | 1532 | ), |
| 1533 | 1533 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1534 | 1534 | '#info' => array( |
| 1535 | - 'label' => 'Notify moderators via email', |
|
| 1536 | - 'module' => 'BOINC core', |
|
| 1537 | - 'eval input' => array( |
|
| 1535 | + 'label' => 'Notify moderators via email', |
|
| 1536 | + 'module' => 'BOINC core', |
|
| 1537 | + 'eval input' => array( |
|
| 1538 | 1538 | '0' => 'subject', |
| 1539 | 1539 | '1' => 'message', |
| 1540 | 1540 | '2' => 'from', |
| 1541 | - ), |
|
| 1541 | + ), |
|
| 1542 | 1542 | ), |
| 1543 | 1543 | '#weight' => 0.0, |
| 1544 | - ), |
|
| 1544 | + ), |
|
| 1545 | 1545 | ), |
| 1546 | 1546 | '#version' => 6003, |
| 1547 | - ), |
|
| 1548 | - 'rules_offensive_content_reported_not_kid_friendly' => array( |
|
| 1547 | + ), |
|
| 1548 | + 'rules_offensive_content_reported_not_kid_friendly' => array( |
|
| 1549 | 1549 | '#type' => 'rule', |
| 1550 | 1550 | '#set' => 'event_flag_flagged_abuse_node_4', |
| 1551 | 1551 | '#label' => 'Offensive content reported - Not Kid Friendly', |
| 1552 | 1552 | '#active' => 1, |
| 1553 | 1553 | '#weight' => '0', |
| 1554 | 1554 | '#categories' => array( |
| 1555 | - '0' => 'boinc_standard', |
|
| 1556 | - '1' => 'moderator notification', |
|
| 1555 | + '0' => 'boinc_standard', |
|
| 1556 | + '1' => 'moderator notification', |
|
| 1557 | 1557 | ), |
| 1558 | 1558 | '#status' => 'default', |
| 1559 | 1559 | '#conditions' => array(), |
| 1560 | 1560 | '#actions' => array( |
| 1561 | - '0' => array( |
|
| 1561 | + '0' => array( |
|
| 1562 | 1562 | '#type' => 'action', |
| 1563 | 1563 | '#settings' => array( |
| 1564 | - 'from' => '', |
|
| 1565 | - 'subject' => 'Report of non Kid-friendly language in [node:type] content at [:global:site-name]', |
|
| 1566 | - 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1564 | + 'from' => '', |
|
| 1565 | + 'subject' => 'Report of non Kid-friendly language in [node:type] content at [:global:site-name]', |
|
| 1566 | + 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1567 | 1567 | as containing non Kid-friendly language for the [:global:site-name] site: |
| 1568 | 1568 | |
| 1569 | 1569 | <?php print url(\'node/\' . \\$node->nid, array(\'absolute\' => TRUE, \'language\' => \'en\')); ?> |
| 1570 | 1570 | |
| 1571 | 1571 | Total reports of this content: [node:flag-abuse-node-meta-count]', |
| 1572 | - '#eval input' => array( |
|
| 1572 | + '#eval input' => array( |
|
| 1573 | 1573 | 'token_rules_input_evaluator' => array( |
| 1574 | - 'subject' => array( |
|
| 1574 | + 'subject' => array( |
|
| 1575 | 1575 | '0' => 'node', |
| 1576 | 1576 | '1' => ':global', |
| 1577 | - ), |
|
| 1578 | - 'message' => array( |
|
| 1577 | + ), |
|
| 1578 | + 'message' => array( |
|
| 1579 | 1579 | '0' => 'flagging_user', |
| 1580 | 1580 | '1' => 'node', |
| 1581 | 1581 | '2' => ':global', |
| 1582 | - ), |
|
| 1583 | - 'from' => array( |
|
| 1582 | + ), |
|
| 1583 | + 'from' => array( |
|
| 1584 | 1584 | '0' => ':global', |
| 1585 | - ), |
|
| 1585 | + ), |
|
| 1586 | 1586 | ), |
| 1587 | 1587 | 'rules_input_evaluator_php' => array( |
| 1588 | - 'message' => array( |
|
| 1588 | + 'message' => array( |
|
| 1589 | 1589 | '0' => 'node', |
| 1590 | - ), |
|
| 1590 | + ), |
|
| 1591 | + ), |
|
| 1591 | 1592 | ), |
| 1592 | - ), |
|
| 1593 | 1593 | ), |
| 1594 | 1594 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1595 | 1595 | '#info' => array( |
| 1596 | - 'label' => 'Notify moderators via email', |
|
| 1597 | - 'module' => 'BOINC core', |
|
| 1598 | - 'eval input' => array( |
|
| 1596 | + 'label' => 'Notify moderators via email', |
|
| 1597 | + 'module' => 'BOINC core', |
|
| 1598 | + 'eval input' => array( |
|
| 1599 | 1599 | '0' => 'subject', |
| 1600 | 1600 | '1' => 'message', |
| 1601 | 1601 | '2' => 'from', |
| 1602 | - ), |
|
| 1602 | + ), |
|
| 1603 | 1603 | ), |
| 1604 | 1604 | '#weight' => 0.0, |
| 1605 | - ), |
|
| 1605 | + ), |
|
| 1606 | 1606 | ), |
| 1607 | 1607 | '#version' => 6003, |
| 1608 | - ), |
|
| 1609 | - 'rules_offensive_content_reported_other' => array( |
|
| 1608 | + ), |
|
| 1609 | + 'rules_offensive_content_reported_other' => array( |
|
| 1610 | 1610 | '#type' => 'rule', |
| 1611 | 1611 | '#set' => 'event_flag_flagged_abuse_node_4', |
| 1612 | 1612 | '#label' => 'Offensive content reported - Other', |
| 1613 | 1613 | '#active' => 1, |
| 1614 | 1614 | '#weight' => '0', |
| 1615 | 1615 | '#categories' => array( |
| 1616 | - '0' => 'boinc_standard', |
|
| 1617 | - '1' => 'moderator notification', |
|
| 1616 | + '0' => 'boinc_standard', |
|
| 1617 | + '1' => 'moderator notification', |
|
| 1618 | 1618 | ), |
| 1619 | 1619 | '#status' => 'default', |
| 1620 | 1620 | '#conditions' => array(), |
| 1621 | 1621 | '#actions' => array( |
| 1622 | - '0' => array( |
|
| 1622 | + '0' => array( |
|
| 1623 | 1623 | '#type' => 'action', |
| 1624 | 1624 | '#settings' => array( |
| 1625 | - 'from' => '', |
|
| 1626 | - 'subject' => 'Report of offensive [node:type] content at [:global:site-name]', |
|
| 1627 | - 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1625 | + 'from' => '', |
|
| 1626 | + 'subject' => 'Report of offensive [node:type] content at [:global:site-name]', |
|
| 1627 | + 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1628 | 1628 | as being offensive or inappropriate for the [:global:site-name] site: |
| 1629 | 1629 | |
| 1630 | 1630 | <?php print url(\'node/\' . \\$node->nid, array(\'absolute\' => TRUE, \'language\' => \'en\')); ?> |
| 1631 | 1631 | |
| 1632 | 1632 | Total reports of this content: [node:flag-abuse-node-meta-count]', |
| 1633 | - '#eval input' => array( |
|
| 1633 | + '#eval input' => array( |
|
| 1634 | 1634 | 'token_rules_input_evaluator' => array( |
| 1635 | - 'subject' => array( |
|
| 1635 | + 'subject' => array( |
|
| 1636 | 1636 | '0' => 'node', |
| 1637 | 1637 | '1' => ':global', |
| 1638 | - ), |
|
| 1639 | - 'message' => array( |
|
| 1638 | + ), |
|
| 1639 | + 'message' => array( |
|
| 1640 | 1640 | '0' => 'flagging_user', |
| 1641 | 1641 | '1' => 'node', |
| 1642 | 1642 | '2' => ':global', |
| 1643 | - ), |
|
| 1644 | - 'from' => array( |
|
| 1643 | + ), |
|
| 1644 | + 'from' => array( |
|
| 1645 | 1645 | '0' => ':global', |
| 1646 | - ), |
|
| 1646 | + ), |
|
| 1647 | 1647 | ), |
| 1648 | 1648 | 'rules_input_evaluator_php' => array( |
| 1649 | - 'message' => array( |
|
| 1649 | + 'message' => array( |
|
| 1650 | 1650 | '0' => 'node', |
| 1651 | - ), |
|
| 1651 | + ), |
|
| 1652 | + ), |
|
| 1652 | 1653 | ), |
| 1653 | - ), |
|
| 1654 | 1654 | ), |
| 1655 | 1655 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1656 | 1656 | '#info' => array( |
| 1657 | - 'label' => 'Notify moderators via email', |
|
| 1658 | - 'module' => 'BOINC core', |
|
| 1659 | - 'eval input' => array( |
|
| 1657 | + 'label' => 'Notify moderators via email', |
|
| 1658 | + 'module' => 'BOINC core', |
|
| 1659 | + 'eval input' => array( |
|
| 1660 | 1660 | '0' => 'subject', |
| 1661 | 1661 | '1' => 'message', |
| 1662 | 1662 | '2' => 'from', |
| 1663 | - ), |
|
| 1663 | + ), |
|
| 1664 | 1664 | ), |
| 1665 | 1665 | '#weight' => 0.0, |
| 1666 | - ), |
|
| 1666 | + ), |
|
| 1667 | 1667 | ), |
| 1668 | 1668 | '#version' => 6003, |
| 1669 | - ), |
|
| 1670 | - 'rules_offensive_content_reported_spam' => array( |
|
| 1669 | + ), |
|
| 1670 | + 'rules_offensive_content_reported_spam' => array( |
|
| 1671 | 1671 | '#type' => 'rule', |
| 1672 | 1672 | '#set' => 'event_flag_flagged_abuse_node_1', |
| 1673 | 1673 | '#label' => 'Offensive content reported - SPAM', |
| 1674 | 1674 | '#active' => 1, |
| 1675 | 1675 | '#weight' => '0', |
| 1676 | 1676 | '#categories' => array( |
| 1677 | - '0' => 'boinc_standard', |
|
| 1678 | - '1' => 'moderator notification', |
|
| 1677 | + '0' => 'boinc_standard', |
|
| 1678 | + '1' => 'moderator notification', |
|
| 1679 | 1679 | ), |
| 1680 | 1680 | '#status' => 'default', |
| 1681 | 1681 | '#conditions' => array(), |
| 1682 | 1682 | '#actions' => array( |
| 1683 | - '0' => array( |
|
| 1683 | + '0' => array( |
|
| 1684 | 1684 | '#type' => 'action', |
| 1685 | 1685 | '#settings' => array( |
| 1686 | - 'from' => '', |
|
| 1687 | - 'subject' => 'Report of SPAM [node:type] content at [:global:site-name]', |
|
| 1688 | - 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1686 | + 'from' => '', |
|
| 1687 | + 'subject' => 'Report of SPAM [node:type] content at [:global:site-name]', |
|
| 1688 | + 'message' => '[flagging_user:display-name] has reported the following [node:type] content |
|
| 1689 | 1689 | as being SPAM for the [:global:site-name] site: |
| 1690 | 1690 | |
| 1691 | 1691 | <?php print url(\'node/\' . \\$node->nid, array(\'absolute\' => TRUE, \'language\' => \'en\')); ?> |
| 1692 | 1692 | |
| 1693 | 1693 | Total reports of this content: [node:flag-abuse-node-meta-count]', |
| 1694 | - '#eval input' => array( |
|
| 1694 | + '#eval input' => array( |
|
| 1695 | 1695 | 'token_rules_input_evaluator' => array( |
| 1696 | - 'subject' => array( |
|
| 1696 | + 'subject' => array( |
|
| 1697 | 1697 | '0' => 'node', |
| 1698 | 1698 | '1' => ':global', |
| 1699 | - ), |
|
| 1700 | - 'message' => array( |
|
| 1699 | + ), |
|
| 1700 | + 'message' => array( |
|
| 1701 | 1701 | '0' => 'flagging_user', |
| 1702 | 1702 | '1' => 'node', |
| 1703 | 1703 | '2' => ':global', |
| 1704 | - ), |
|
| 1705 | - 'from' => array( |
|
| 1704 | + ), |
|
| 1705 | + 'from' => array( |
|
| 1706 | 1706 | '0' => ':global', |
| 1707 | - ), |
|
| 1707 | + ), |
|
| 1708 | 1708 | ), |
| 1709 | 1709 | 'rules_input_evaluator_php' => array( |
| 1710 | - 'message' => array( |
|
| 1710 | + 'message' => array( |
|
| 1711 | 1711 | '0' => 'node', |
| 1712 | - ), |
|
| 1712 | + ), |
|
| 1713 | + ), |
|
| 1713 | 1714 | ), |
| 1714 | - ), |
|
| 1715 | 1715 | ), |
| 1716 | 1716 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1717 | 1717 | '#info' => array( |
| 1718 | - 'label' => 'Notify moderators via email', |
|
| 1719 | - 'module' => 'BOINC core', |
|
| 1720 | - 'eval input' => array( |
|
| 1718 | + 'label' => 'Notify moderators via email', |
|
| 1719 | + 'module' => 'BOINC core', |
|
| 1720 | + 'eval input' => array( |
|
| 1721 | 1721 | '0' => 'subject', |
| 1722 | 1722 | '1' => 'message', |
| 1723 | 1723 | '2' => 'from', |
| 1724 | - ), |
|
| 1724 | + ), |
|
| 1725 | 1725 | ), |
| 1726 | 1726 | '#weight' => 0.0, |
| 1727 | - ), |
|
| 1727 | + ), |
|
| 1728 | 1728 | ), |
| 1729 | 1729 | '#version' => 6003, |
| 1730 | - ), |
|
| 1731 | - 'rules_offensive_user_reported_link' => array( |
|
| 1730 | + ), |
|
| 1731 | + 'rules_offensive_user_reported_link' => array( |
|
| 1732 | 1732 | '#type' => 'rule', |
| 1733 | 1733 | '#set' => 'event_flag_flagged_abuse_user_2', |
| 1734 | 1734 | '#label' => 'Offensive user reported - Link', |
| 1735 | 1735 | '#active' => 1, |
| 1736 | 1736 | '#weight' => '0', |
| 1737 | 1737 | '#categories' => array( |
| 1738 | - '0' => 'boinc_standard', |
|
| 1739 | - '1' => 'moderator notification', |
|
| 1738 | + '0' => 'boinc_standard', |
|
| 1739 | + '1' => 'moderator notification', |
|
| 1740 | 1740 | ), |
| 1741 | 1741 | '#status' => 'default', |
| 1742 | 1742 | '#conditions' => array(), |
| 1743 | 1743 | '#actions' => array( |
| 1744 | - '0' => array( |
|
| 1744 | + '0' => array( |
|
| 1745 | 1745 | '#type' => 'action', |
| 1746 | 1746 | '#settings' => array( |
| 1747 | - 'from' => '', |
|
| 1748 | - 'subject' => 'Report of inappropriate link in user profile at [:global:site-name]', |
|
| 1749 | - 'message' => '[flagging_user:display-name] has reported [account:display-name] for |
|
| 1747 | + 'from' => '', |
|
| 1748 | + 'subject' => 'Report of inappropriate link in user profile at [:global:site-name]', |
|
| 1749 | + 'message' => '[flagging_user:display-name] has reported [account:display-name] for |
|
| 1750 | 1750 | inappropriate link in a user profile: |
| 1751 | 1751 | |
| 1752 | 1752 | <?php print url(\\\'<front>\\\', array(\\\'absolute\\\' => TRUE, \\\'language\\\' => \\\'en\\\')); ?>/account/[account:uid] |
| 1753 | 1753 | |
| 1754 | 1754 | Total current reports of this user: [account:flag-abuse-user-meta-count]', |
| 1755 | - '#eval input' => array( |
|
| 1755 | + '#eval input' => array( |
|
| 1756 | 1756 | 'token_rules_input_evaluator' => array( |
| 1757 | - 'subject' => array( |
|
| 1757 | + 'subject' => array( |
|
| 1758 | 1758 | '0' => ':global', |
| 1759 | - ), |
|
| 1760 | - 'message' => array( |
|
| 1759 | + ), |
|
| 1760 | + 'message' => array( |
|
| 1761 | 1761 | '0' => 'flagging_user', |
| 1762 | 1762 | '1' => 'account', |
| 1763 | 1763 | '2' => ':global', |
| 1764 | - ), |
|
| 1765 | - 'from' => array( |
|
| 1764 | + ), |
|
| 1765 | + 'from' => array( |
|
| 1766 | 1766 | '0' => ':global', |
| 1767 | - ), |
|
| 1767 | + ), |
|
| 1768 | 1768 | ), |
| 1769 | 1769 | 'rules_input_evaluator_php' => array( |
| 1770 | - 'message' => array(), |
|
| 1770 | + 'message' => array(), |
|
| 1771 | + ), |
|
| 1771 | 1772 | ), |
| 1772 | - ), |
|
| 1773 | 1773 | ), |
| 1774 | 1774 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1775 | 1775 | '#info' => array( |
| 1776 | - 'label' => 'Notify moderators via email', |
|
| 1777 | - 'module' => 'BOINC core', |
|
| 1778 | - 'eval input' => array( |
|
| 1776 | + 'label' => 'Notify moderators via email', |
|
| 1777 | + 'module' => 'BOINC core', |
|
| 1778 | + 'eval input' => array( |
|
| 1779 | 1779 | '0' => 'subject', |
| 1780 | 1780 | '1' => 'message', |
| 1781 | 1781 | '2' => 'from', |
| 1782 | - ), |
|
| 1782 | + ), |
|
| 1783 | 1783 | ), |
| 1784 | 1784 | '#weight' => 0.0, |
| 1785 | - ), |
|
| 1785 | + ), |
|
| 1786 | 1786 | ), |
| 1787 | 1787 | '#version' => 6003, |
| 1788 | - ), |
|
| 1789 | - 'rules_offensive_user_reported_not_kid_friendly' => array( |
|
| 1788 | + ), |
|
| 1789 | + 'rules_offensive_user_reported_not_kid_friendly' => array( |
|
| 1790 | 1790 | '#type' => 'rule', |
| 1791 | 1791 | '#set' => 'event_flag_flagged_abuse_user_3', |
| 1792 | 1792 | '#label' => 'Offensive user reported - Not Kid Friendly', |
| 1793 | 1793 | '#active' => 1, |
| 1794 | 1794 | '#weight' => '0', |
| 1795 | 1795 | '#categories' => array( |
| 1796 | - '0' => 'boinc_standard', |
|
| 1797 | - '1' => 'moderator notification', |
|
| 1796 | + '0' => 'boinc_standard', |
|
| 1797 | + '1' => 'moderator notification', |
|
| 1798 | 1798 | ), |
| 1799 | 1799 | '#status' => 'default', |
| 1800 | 1800 | '#conditions' => array(), |
| 1801 | 1801 | '#actions' => array( |
| 1802 | - '0' => array( |
|
| 1802 | + '0' => array( |
|
| 1803 | 1803 | '#type' => 'action', |
| 1804 | 1804 | '#settings' => array( |
| 1805 | - 'from' => '', |
|
| 1806 | - 'subject' => 'Report of hostile language in user profile at [:global:site-name]', |
|
| 1807 | - 'message' => '[flagging_user:display-name] has reported [account:display-name] for |
|
| 1805 | + 'from' => '', |
|
| 1806 | + 'subject' => 'Report of hostile language in user profile at [:global:site-name]', |
|
| 1807 | + 'message' => '[flagging_user:display-name] has reported [account:display-name] for |
|
| 1808 | 1808 | hostile language in a user profile: |
| 1809 | 1809 | |
| 1810 | 1810 | <?php print url(\\\'<front>\\\', array(\\\'absolute\\\' => TRUE, \\\'language\\\' => \\\'en\\\')); ?>/account/[account:uid] |
| 1811 | 1811 | |
| 1812 | 1812 | Total current reports of this user: [account:flag-abuse-user-meta-count]', |
| 1813 | - '#eval input' => array( |
|
| 1813 | + '#eval input' => array( |
|
| 1814 | 1814 | 'token_rules_input_evaluator' => array( |
| 1815 | - 'subject' => array( |
|
| 1815 | + 'subject' => array( |
|
| 1816 | 1816 | '0' => ':global', |
| 1817 | - ), |
|
| 1818 | - 'message' => array( |
|
| 1817 | + ), |
|
| 1818 | + 'message' => array( |
|
| 1819 | 1819 | '0' => 'flagging_user', |
| 1820 | 1820 | '1' => 'account', |
| 1821 | 1821 | '2' => ':global', |
| 1822 | - ), |
|
| 1823 | - 'from' => array( |
|
| 1822 | + ), |
|
| 1823 | + 'from' => array( |
|
| 1824 | 1824 | '0' => ':global', |
| 1825 | - ), |
|
| 1825 | + ), |
|
| 1826 | 1826 | ), |
| 1827 | 1827 | 'rules_input_evaluator_php' => array( |
| 1828 | - 'message' => array(), |
|
| 1828 | + 'message' => array(), |
|
| 1829 | + ), |
|
| 1829 | 1830 | ), |
| 1830 | - ), |
|
| 1831 | 1831 | ), |
| 1832 | 1832 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1833 | 1833 | '#info' => array( |
| 1834 | - 'label' => 'Notify moderators via email', |
|
| 1835 | - 'module' => 'BOINC core', |
|
| 1836 | - 'eval input' => array( |
|
| 1834 | + 'label' => 'Notify moderators via email', |
|
| 1835 | + 'module' => 'BOINC core', |
|
| 1836 | + 'eval input' => array( |
|
| 1837 | 1837 | '0' => 'subject', |
| 1838 | 1838 | '1' => 'message', |
| 1839 | 1839 | '2' => 'from', |
| 1840 | - ), |
|
| 1840 | + ), |
|
| 1841 | 1841 | ), |
| 1842 | 1842 | '#weight' => 0.0, |
| 1843 | - ), |
|
| 1843 | + ), |
|
| 1844 | 1844 | ), |
| 1845 | 1845 | '#version' => 6003, |
| 1846 | - ), |
|
| 1847 | - 'rules_offensive_user_reported_other' => array( |
|
| 1846 | + ), |
|
| 1847 | + 'rules_offensive_user_reported_other' => array( |
|
| 1848 | 1848 | '#type' => 'rule', |
| 1849 | 1849 | '#set' => 'event_flag_flagged_abuse_user_4', |
| 1850 | 1850 | '#label' => 'Offensive user reported - Other', |
| 1851 | 1851 | '#active' => 1, |
| 1852 | 1852 | '#weight' => '0', |
| 1853 | 1853 | '#categories' => array( |
| 1854 | - '0' => 'boinc_standard', |
|
| 1855 | - '1' => 'moderator notification', |
|
| 1854 | + '0' => 'boinc_standard', |
|
| 1855 | + '1' => 'moderator notification', |
|
| 1856 | 1856 | ), |
| 1857 | 1857 | '#status' => 'default', |
| 1858 | 1858 | '#conditions' => array(), |
| 1859 | 1859 | '#actions' => array( |
| 1860 | - '0' => array( |
|
| 1860 | + '0' => array( |
|
| 1861 | 1861 | '#type' => 'action', |
| 1862 | 1862 | '#settings' => array( |
| 1863 | - 'from' => '', |
|
| 1864 | - 'subject' => 'Report of offensive user at [:global:site-name]', |
|
| 1865 | - 'message' => '[flagging_user:display-name] has reported [account:display-name] for |
|
| 1863 | + 'from' => '', |
|
| 1864 | + 'subject' => 'Report of offensive user at [:global:site-name]', |
|
| 1865 | + 'message' => '[flagging_user:display-name] has reported [account:display-name] for |
|
| 1866 | 1866 | inappropriate behavior: |
| 1867 | 1867 | |
| 1868 | 1868 | <?php print url(\\\'<front>\\\', array(\\\'absolute\\\' => TRUE, \\\'language\\\' => \\\'en\\\')); ?>/account/[account:uid] |
| 1869 | 1869 | |
| 1870 | 1870 | Total current reports of this user: [account:flag-abuse-user-meta-count]', |
| 1871 | - '#eval input' => array( |
|
| 1871 | + '#eval input' => array( |
|
| 1872 | 1872 | 'token_rules_input_evaluator' => array( |
| 1873 | - 'subject' => array( |
|
| 1873 | + 'subject' => array( |
|
| 1874 | 1874 | '0' => ':global', |
| 1875 | - ), |
|
| 1876 | - 'message' => array( |
|
| 1875 | + ), |
|
| 1876 | + 'message' => array( |
|
| 1877 | 1877 | '0' => 'flagging_user', |
| 1878 | 1878 | '1' => 'account', |
| 1879 | 1879 | '2' => ':global', |
| 1880 | - ), |
|
| 1881 | - 'from' => array( |
|
| 1880 | + ), |
|
| 1881 | + 'from' => array( |
|
| 1882 | 1882 | '0' => ':global', |
| 1883 | - ), |
|
| 1883 | + ), |
|
| 1884 | 1884 | ), |
| 1885 | 1885 | 'rules_input_evaluator_php' => array( |
| 1886 | - 'message' => array(), |
|
| 1886 | + 'message' => array(), |
|
| 1887 | + ), |
|
| 1887 | 1888 | ), |
| 1888 | - ), |
|
| 1889 | 1889 | ), |
| 1890 | 1890 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1891 | 1891 | '#info' => array( |
| 1892 | - 'label' => 'Notify moderators via email', |
|
| 1893 | - 'module' => 'BOINC core', |
|
| 1894 | - 'eval input' => array( |
|
| 1892 | + 'label' => 'Notify moderators via email', |
|
| 1893 | + 'module' => 'BOINC core', |
|
| 1894 | + 'eval input' => array( |
|
| 1895 | 1895 | '0' => 'subject', |
| 1896 | 1896 | '1' => 'message', |
| 1897 | 1897 | '2' => 'from', |
| 1898 | - ), |
|
| 1898 | + ), |
|
| 1899 | 1899 | ), |
| 1900 | 1900 | '#weight' => 0.0, |
| 1901 | - ), |
|
| 1901 | + ), |
|
| 1902 | 1902 | ), |
| 1903 | 1903 | '#version' => 6003, |
| 1904 | - ), |
|
| 1905 | - 'rules_offensive_user_reported_spam' => array( |
|
| 1904 | + ), |
|
| 1905 | + 'rules_offensive_user_reported_spam' => array( |
|
| 1906 | 1906 | '#type' => 'rule', |
| 1907 | 1907 | '#set' => 'event_flag_flagged_abuse_user_1', |
| 1908 | 1908 | '#label' => 'Offensive user reported - SPAM', |
| 1909 | 1909 | '#active' => 1, |
| 1910 | 1910 | '#weight' => '0', |
| 1911 | 1911 | '#categories' => array( |
| 1912 | - '0' => 'boinc_standard', |
|
| 1913 | - '1' => 'moderator notification', |
|
| 1912 | + '0' => 'boinc_standard', |
|
| 1913 | + '1' => 'moderator notification', |
|
| 1914 | 1914 | ), |
| 1915 | 1915 | '#status' => 'default', |
| 1916 | 1916 | '#conditions' => array(), |
| 1917 | 1917 | '#actions' => array( |
| 1918 | - '0' => array( |
|
| 1918 | + '0' => array( |
|
| 1919 | 1919 | '#type' => 'action', |
| 1920 | 1920 | '#settings' => array( |
| 1921 | - 'from' => '', |
|
| 1922 | - 'subject' => 'Report of SPAM user at [:global:site-name]', |
|
| 1923 | - 'message' => '[flagging_user:display-name] has reported [account:display-name] for |
|
| 1921 | + 'from' => '', |
|
| 1922 | + 'subject' => 'Report of SPAM user at [:global:site-name]', |
|
| 1923 | + 'message' => '[flagging_user:display-name] has reported [account:display-name] for |
|
| 1924 | 1924 | a SPAM user profile: |
| 1925 | 1925 | |
| 1926 | 1926 | <?php print url(\\\'<front>\\\', array(\\\'absolute\\\' => TRUE, \\\'language\\\' => \\\'en\\\')); ?>/account/[account:uid] |
| 1927 | 1927 | |
| 1928 | 1928 | Total current reports of this user: [account:flag-abuse-user-meta-count]', |
| 1929 | - '#eval input' => array( |
|
| 1929 | + '#eval input' => array( |
|
| 1930 | 1930 | 'token_rules_input_evaluator' => array( |
| 1931 | - 'subject' => array( |
|
| 1931 | + 'subject' => array( |
|
| 1932 | 1932 | '0' => ':global', |
| 1933 | - ), |
|
| 1934 | - 'message' => array( |
|
| 1933 | + ), |
|
| 1934 | + 'message' => array( |
|
| 1935 | 1935 | '0' => 'flagging_user', |
| 1936 | 1936 | '1' => 'account', |
| 1937 | 1937 | '2' => ':global', |
| 1938 | - ), |
|
| 1939 | - 'from' => array( |
|
| 1938 | + ), |
|
| 1939 | + 'from' => array( |
|
| 1940 | 1940 | '0' => ':global', |
| 1941 | - ), |
|
| 1941 | + ), |
|
| 1942 | 1942 | ), |
| 1943 | 1943 | 'rules_input_evaluator_php' => array( |
| 1944 | - 'message' => array(), |
|
| 1944 | + 'message' => array(), |
|
| 1945 | + ), |
|
| 1945 | 1946 | ), |
| 1946 | - ), |
|
| 1947 | 1947 | ), |
| 1948 | 1948 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1949 | 1949 | '#info' => array( |
| 1950 | - 'label' => 'Notify moderators via email', |
|
| 1951 | - 'module' => 'BOINC core', |
|
| 1952 | - 'eval input' => array( |
|
| 1950 | + 'label' => 'Notify moderators via email', |
|
| 1951 | + 'module' => 'BOINC core', |
|
| 1952 | + 'eval input' => array( |
|
| 1953 | 1953 | '0' => 'subject', |
| 1954 | 1954 | '1' => 'message', |
| 1955 | 1955 | '2' => 'from', |
| 1956 | - ), |
|
| 1956 | + ), |
|
| 1957 | 1957 | ), |
| 1958 | 1958 | '#weight' => 0.0, |
| 1959 | - ), |
|
| 1959 | + ), |
|
| 1960 | 1960 | ), |
| 1961 | 1961 | '#version' => 6003, |
| 1962 | - ), |
|
| 1963 | - 'rules_comment_converted_to_new_forum_topic_by_moderator_or_admin' => array( |
|
| 1962 | + ), |
|
| 1963 | + 'rules_comment_converted_to_new_forum_topic_by_moderator_or_admin' => array( |
|
| 1964 | 1964 | '#type' => 'rule', |
| 1965 | 1965 | '#set' => 'event_boinccore_comment_convert', |
| 1966 | 1966 | '#label' => 'Comment is converted to new forum topic by moderator or admin', |
| 1967 | 1967 | '#active' => 1, |
| 1968 | 1968 | '#weight' => '0', |
| 1969 | 1969 | '#categories' => array( |
| 1970 | - '0' => 'boinc_standard', |
|
| 1971 | - '1' => 'moderator notification', |
|
| 1970 | + '0' => 'boinc_standard', |
|
| 1971 | + '1' => 'moderator notification', |
|
| 1972 | 1972 | ), |
| 1973 | 1973 | '#status' => 'default', |
| 1974 | 1974 | '#conditions' => array(), |
| 1975 | 1975 | '#actions' => array( |
| 1976 | - '0' => array( |
|
| 1976 | + '0' => array( |
|
| 1977 | 1977 | '#info' => array( |
| 1978 | - 'label' => 'Notify moderators via email', |
|
| 1979 | - 'module' => 'BOINC core', |
|
| 1980 | - 'eval input' => array( |
|
| 1978 | + 'label' => 'Notify moderators via email', |
|
| 1979 | + 'module' => 'BOINC core', |
|
| 1980 | + 'eval input' => array( |
|
| 1981 | 1981 | '0' => 'subject', |
| 1982 | 1982 | '1' => 'message', |
| 1983 | 1983 | '2' => 'from', |
| 1984 | - ), |
|
| 1984 | + ), |
|
| 1985 | 1985 | ), |
| 1986 | 1986 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 1987 | 1987 | '#settings' => array( |
| 1988 | - 'from' => '', |
|
| 1989 | - 'subject' => 'Comment at [:global:site-name] converted to new forum topic', |
|
| 1990 | - 'message' => "Comment has been converted to new forum topic by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 1991 | - '#eval input' => array( |
|
| 1988 | + 'from' => '', |
|
| 1989 | + 'subject' => 'Comment at [:global:site-name] converted to new forum topic', |
|
| 1990 | + 'message' => "Comment has been converted to new forum topic by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 1991 | + '#eval input' => array( |
|
| 1992 | 1992 | 'token_rules_input_evaluator' => array( |
| 1993 | - 'subject' => array( |
|
| 1993 | + 'subject' => array( |
|
| 1994 | 1994 | '0' => ':global', |
| 1995 | - ), |
|
| 1996 | - 'message' => array( |
|
| 1995 | + ), |
|
| 1996 | + 'message' => array( |
|
| 1997 | 1997 | '0' => 'user', |
| 1998 | 1998 | '1' => ':global', |
| 1999 | - ), |
|
| 2000 | - 'from' => array( |
|
| 1999 | + ), |
|
| 2000 | + 'from' => array( |
|
| 2001 | 2001 | '0' => ':global', |
| 2002 | - ), |
|
| 2002 | + ), |
|
| 2003 | 2003 | ), |
| 2004 | 2004 | 'rules_input_evaluator_php' => array( |
| 2005 | - 'message' => array( |
|
| 2005 | + 'message' => array( |
|
| 2006 | 2006 | '0' => 'node', |
| 2007 | - ), |
|
| 2007 | + ), |
|
| 2008 | + ), |
|
| 2008 | 2009 | ), |
| 2009 | - ), |
|
| 2010 | 2010 | ), |
| 2011 | 2011 | '#type' => 'action', |
| 2012 | 2012 | '#weight' => 0.0, |
| 2013 | - ), |
|
| 2013 | + ), |
|
| 2014 | 2014 | ), |
| 2015 | 2015 | '#version' => 6003, |
| 2016 | - ), |
|
| 2017 | - 'rules_comment_deleted_by_admin' => array( |
|
| 2016 | + ), |
|
| 2017 | + 'rules_comment_deleted_by_admin' => array( |
|
| 2018 | 2018 | '#type' => 'rule', |
| 2019 | 2019 | '#set' => 'event_comment_delete', |
| 2020 | 2020 | '#label' => 'Comment deleted by admin', |
| 2021 | 2021 | '#active' => 1, |
| 2022 | 2022 | '#weight' => '0', |
| 2023 | 2023 | '#categories' => array( |
| 2024 | - '0' => 'moderator notification', |
|
| 2025 | - '1' => 'boinc_standard', |
|
| 2024 | + '0' => 'moderator notification', |
|
| 2025 | + '1' => 'boinc_standard', |
|
| 2026 | 2026 | ), |
| 2027 | 2027 | '#status' => 'default', |
| 2028 | 2028 | '#conditions' => array(), |
| 2029 | 2029 | '#actions' => array( |
| 2030 | - '0' => array( |
|
| 2030 | + '0' => array( |
|
| 2031 | 2031 | '#type' => 'action', |
| 2032 | 2032 | '#settings' => array( |
| 2033 | - 'from' => '', |
|
| 2034 | - 'subject' => 'Comment deleted at [:global:site-name] by admin', |
|
| 2035 | - 'message' => "Comment to [node:type] topic '[node:title]' deleted by admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2036 | - '#eval input' => array( |
|
| 2033 | + 'from' => '', |
|
| 2034 | + 'subject' => 'Comment deleted at [:global:site-name] by admin', |
|
| 2035 | + 'message' => "Comment to [node:type] topic '[node:title]' deleted by admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2036 | + '#eval input' => array( |
|
| 2037 | 2037 | 'token_rules_input_evaluator' => array( |
| 2038 | - 'subject' => array( |
|
| 2038 | + 'subject' => array( |
|
| 2039 | 2039 | '0' => ':global', |
| 2040 | - ), |
|
| 2041 | - 'message' => array( |
|
| 2040 | + ), |
|
| 2041 | + 'message' => array( |
|
| 2042 | 2042 | '0' => 'node', |
| 2043 | 2043 | '1' => 'user', |
| 2044 | 2044 | '2' => ':global', |
| 2045 | - ), |
|
| 2046 | - 'from' => array( |
|
| 2045 | + ), |
|
| 2046 | + 'from' => array( |
|
| 2047 | 2047 | '0' => ':global', |
| 2048 | - ), |
|
| 2048 | + ), |
|
| 2049 | 2049 | ), |
| 2050 | 2050 | 'rules_input_evaluator_php' => array( |
| 2051 | - 'message' => array( |
|
| 2051 | + 'message' => array( |
|
| 2052 | 2052 | '0' => 'node', |
| 2053 | - ), |
|
| 2053 | + ), |
|
| 2054 | + ), |
|
| 2054 | 2055 | ), |
| 2055 | - ), |
|
| 2056 | 2056 | ), |
| 2057 | 2057 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 2058 | 2058 | '#info' => array( |
| 2059 | - 'label' => 'Notify moderators via email', |
|
| 2060 | - 'module' => 'BOINC core', |
|
| 2061 | - 'eval input' => array( |
|
| 2059 | + 'label' => 'Notify moderators via email', |
|
| 2060 | + 'module' => 'BOINC core', |
|
| 2061 | + 'eval input' => array( |
|
| 2062 | 2062 | '0' => 'subject', |
| 2063 | 2063 | '1' => 'message', |
| 2064 | 2064 | '2' => 'from', |
| 2065 | - ), |
|
| 2065 | + ), |
|
| 2066 | 2066 | ), |
| 2067 | 2067 | '#weight' => 0.0, |
| 2068 | - ), |
|
| 2068 | + ), |
|
| 2069 | 2069 | ), |
| 2070 | 2070 | '#version' => 6003, |
| 2071 | - ), |
|
| 2072 | - 'rules_comment_edited_by_moderator_or_admin' => array( |
|
| 2071 | + ), |
|
| 2072 | + 'rules_comment_edited_by_moderator_or_admin' => array( |
|
| 2073 | 2073 | '#type' => 'rule', |
| 2074 | 2074 | '#set' => 'event_comment_update', |
| 2075 | 2075 | '#label' => 'Comment is edited by moderator or admin', |
| 2076 | 2076 | '#active' => 1, |
| 2077 | 2077 | '#weight' => '0', |
| 2078 | 2078 | '#categories' => array( |
| 2079 | - '0' => 'boinc_standard', |
|
| 2080 | - '1' => 'moderator notification', |
|
| 2079 | + '0' => 'boinc_standard', |
|
| 2080 | + '1' => 'moderator notification', |
|
| 2081 | 2081 | ), |
| 2082 | 2082 | '#status' => 'default', |
| 2083 | 2083 | '#conditions' => array( |
| 2084 | - '0' => array( |
|
| 2084 | + '0' => array( |
|
| 2085 | 2085 | '#negate' => 1, |
| 2086 | 2086 | '#weight' => 0.0, |
| 2087 | 2087 | '#info' => array( |
| 2088 | - 'label' => 'Compare two users: acting user (who edited the comment) is NOT the comment author', |
|
| 2089 | - 'label callback' => FALSE, |
|
| 2090 | - 'arguments' => array( |
|
| 2088 | + 'label' => 'Compare two users: acting user (who edited the comment) is NOT the comment author', |
|
| 2089 | + 'label callback' => FALSE, |
|
| 2090 | + 'arguments' => array( |
|
| 2091 | 2091 | 'user1' => array( |
| 2092 | - 'type' => 'user', |
|
| 2093 | - 'label' => 'User account 1', |
|
| 2092 | + 'type' => 'user', |
|
| 2093 | + 'label' => 'User account 1', |
|
| 2094 | 2094 | ), |
| 2095 | 2095 | 'user2' => array( |
| 2096 | - 'type' => 'user', |
|
| 2097 | - 'label' => 'User account 2', |
|
| 2096 | + 'type' => 'user', |
|
| 2097 | + 'label' => 'User account 2', |
|
| 2098 | + ), |
|
| 2098 | 2099 | ), |
| 2099 | - ), |
|
| 2100 | - 'module' => 'User', |
|
| 2100 | + 'module' => 'User', |
|
| 2101 | 2101 | ), |
| 2102 | 2102 | '#name' => 'rules_condition_user_comparison', |
| 2103 | 2103 | '#settings' => array( |
| 2104 | - '#argument map' => array( |
|
| 2104 | + '#argument map' => array( |
|
| 2105 | 2105 | 'user1' => 'user', |
| 2106 | 2106 | 'user2' => 'comment_author', |
| 2107 | - ), |
|
| 2107 | + ), |
|
| 2108 | 2108 | ), |
| 2109 | 2109 | '#type' => 'condition', |
| 2110 | - ), |
|
| 2110 | + ), |
|
| 2111 | 2111 | ), |
| 2112 | 2112 | '#actions' => array( |
| 2113 | - '0' => array( |
|
| 2113 | + '0' => array( |
|
| 2114 | 2114 | '#type' => 'action', |
| 2115 | 2115 | '#settings' => array( |
| 2116 | - 'from' => '', |
|
| 2117 | - 'subject' => 'Comment edited at [:global:site-name] by moderator or admin', |
|
| 2118 | - 'message' => "Comment has been edited by moderator/admin [user:display-name]\r\n\r\nLink: <?php print url('<front>', array('absolute' => TRUE, 'language' => 'en')); ?>/goto/comment/[comment:comment-cid]", |
|
| 2119 | - '#eval input' => array( |
|
| 2116 | + 'from' => '', |
|
| 2117 | + 'subject' => 'Comment edited at [:global:site-name] by moderator or admin', |
|
| 2118 | + 'message' => "Comment has been edited by moderator/admin [user:display-name]\r\n\r\nLink: <?php print url('<front>', array('absolute' => TRUE, 'language' => 'en')); ?>/goto/comment/[comment:comment-cid]", |
|
| 2119 | + '#eval input' => array( |
|
| 2120 | 2120 | 'token_rules_input_evaluator' => array( |
| 2121 | - 'subject' => array( |
|
| 2121 | + 'subject' => array( |
|
| 2122 | 2122 | '0' => ':global', |
| 2123 | - ), |
|
| 2124 | - 'message' => array( |
|
| 2123 | + ), |
|
| 2124 | + 'message' => array( |
|
| 2125 | 2125 | '0' => 'comment', |
| 2126 | 2126 | '1' => 'user', |
| 2127 | 2127 | '2' => ':global', |
| 2128 | - ), |
|
| 2129 | - 'from' => array( |
|
| 2128 | + ), |
|
| 2129 | + 'from' => array( |
|
| 2130 | 2130 | '0' => ':global', |
| 2131 | - ), |
|
| 2131 | + ), |
|
| 2132 | 2132 | ), |
| 2133 | 2133 | 'rules_input_evaluator_php' => array( |
| 2134 | - 'message' => array(), |
|
| 2134 | + 'message' => array(), |
|
| 2135 | + ), |
|
| 2135 | 2136 | ), |
| 2136 | - ), |
|
| 2137 | 2137 | ), |
| 2138 | 2138 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 2139 | 2139 | '#info' => array( |
| 2140 | - 'label' => 'Notify moderators via email', |
|
| 2141 | - 'module' => 'BOINC core', |
|
| 2142 | - 'eval input' => array( |
|
| 2140 | + 'label' => 'Notify moderators via email', |
|
| 2141 | + 'module' => 'BOINC core', |
|
| 2142 | + 'eval input' => array( |
|
| 2143 | 2143 | '0' => 'subject', |
| 2144 | 2144 | '1' => 'message', |
| 2145 | 2145 | '2' => 'from', |
| 2146 | - ), |
|
| 2146 | + ), |
|
| 2147 | 2147 | ), |
| 2148 | 2148 | '#weight' => 0.0, |
| 2149 | - ), |
|
| 2149 | + ), |
|
| 2150 | 2150 | ), |
| 2151 | 2151 | '#version' => 6003, |
| 2152 | - ), |
|
| 2153 | - 'rules_comment_is_published_unhidden_by_moderator_or_admin' => array( |
|
| 2152 | + ), |
|
| 2153 | + 'rules_comment_is_published_unhidden_by_moderator_or_admin' => array( |
|
| 2154 | 2154 | '#type' => 'rule', |
| 2155 | 2155 | '#set' => 'event_boinccore_comment_unhidden', |
| 2156 | 2156 | '#label' => 'Comment is unhidden by moderator or admin', |
| 2157 | 2157 | '#active' => 1, |
| 2158 | 2158 | '#weight' => '0', |
| 2159 | 2159 | '#categories' => array( |
| 2160 | - '0' => 'boinc_standard', |
|
| 2161 | - '1' => 'moderator notification', |
|
| 2160 | + '0' => 'boinc_standard', |
|
| 2161 | + '1' => 'moderator notification', |
|
| 2162 | 2162 | ), |
| 2163 | 2163 | '#status' => 'default', |
| 2164 | 2164 | '#conditions' => array( |
| 2165 | - '0' => array( |
|
| 2165 | + '0' => array( |
|
| 2166 | 2166 | '#type' => 'condition', |
| 2167 | 2167 | '#settings' => array( |
| 2168 | - '#argument map' => array( |
|
| 2168 | + '#argument map' => array( |
|
| 2169 | 2169 | 'user1' => 'user', |
| 2170 | 2170 | 'user2' => 'comment_author', |
| 2171 | - ), |
|
| 2171 | + ), |
|
| 2172 | 2172 | ), |
| 2173 | 2173 | '#name' => 'rules_condition_user_comparison', |
| 2174 | 2174 | '#info' => array( |
| 2175 | - 'label' => 'Compare two users: acting user (who unhid the comment) is NOT the comment author', |
|
| 2176 | - 'label callback' => FALSE, |
|
| 2177 | - 'arguments' => array( |
|
| 2175 | + 'label' => 'Compare two users: acting user (who unhid the comment) is NOT the comment author', |
|
| 2176 | + 'label callback' => FALSE, |
|
| 2177 | + 'arguments' => array( |
|
| 2178 | 2178 | 'user1' => array( |
| 2179 | - 'type' => 'user', |
|
| 2180 | - 'label' => 'User account 1', |
|
| 2179 | + 'type' => 'user', |
|
| 2180 | + 'label' => 'User account 1', |
|
| 2181 | 2181 | ), |
| 2182 | 2182 | 'user2' => array( |
| 2183 | - 'type' => 'user', |
|
| 2184 | - 'label' => 'User account 2', |
|
| 2183 | + 'type' => 'user', |
|
| 2184 | + 'label' => 'User account 2', |
|
| 2185 | 2185 | ), |
| 2186 | - ), |
|
| 2187 | - 'module' => 'User', |
|
| 2186 | + ), |
|
| 2187 | + 'module' => 'User', |
|
| 2188 | 2188 | ), |
| 2189 | 2189 | '#negate' => 1, |
| 2190 | 2190 | '#weight' => 0.0, |
| 2191 | - ), |
|
| 2191 | + ), |
|
| 2192 | 2192 | ), |
| 2193 | 2193 | '#actions' => array( |
| 2194 | - '0' => array( |
|
| 2194 | + '0' => array( |
|
| 2195 | 2195 | '#info' => array( |
| 2196 | - 'label' => 'Notify moderators via email', |
|
| 2197 | - 'module' => 'BOINC core', |
|
| 2198 | - 'eval input' => array( |
|
| 2196 | + 'label' => 'Notify moderators via email', |
|
| 2197 | + 'module' => 'BOINC core', |
|
| 2198 | + 'eval input' => array( |
|
| 2199 | 2199 | '0' => 'subject', |
| 2200 | 2200 | '1' => 'message', |
| 2201 | 2201 | '2' => 'from', |
| 2202 | - ), |
|
| 2202 | + ), |
|
| 2203 | 2203 | ), |
| 2204 | 2204 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 2205 | 2205 | '#settings' => array( |
| 2206 | - 'from' => '', |
|
| 2207 | - 'subject' => 'Comment at [:global:site-name] unhidden by moderator or admin', |
|
| 2208 | - 'message' => "Comment has been unhidden by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('<front>', array('absolute' => TRUE, 'language' => 'en')); ?>/goto/comment/[comment:comment-cid]", |
|
| 2209 | - '#eval input' => array( |
|
| 2206 | + 'from' => '', |
|
| 2207 | + 'subject' => 'Comment at [:global:site-name] unhidden by moderator or admin', |
|
| 2208 | + 'message' => "Comment has been unhidden by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('<front>', array('absolute' => TRUE, 'language' => 'en')); ?>/goto/comment/[comment:comment-cid]", |
|
| 2209 | + '#eval input' => array( |
|
| 2210 | 2210 | 'token_rules_input_evaluator' => array( |
| 2211 | - 'subject' => array( |
|
| 2211 | + 'subject' => array( |
|
| 2212 | 2212 | '0' => ':global', |
| 2213 | - ), |
|
| 2214 | - 'message' => array( |
|
| 2213 | + ), |
|
| 2214 | + 'message' => array( |
|
| 2215 | 2215 | '0' => 'comment', |
| 2216 | 2216 | '1' => 'user', |
| 2217 | 2217 | '2' => ':global', |
| 2218 | - ), |
|
| 2219 | - 'from' => array( |
|
| 2218 | + ), |
|
| 2219 | + 'from' => array( |
|
| 2220 | 2220 | '0' => ':global', |
| 2221 | - ), |
|
| 2221 | + ), |
|
| 2222 | 2222 | ), |
| 2223 | 2223 | 'rules_input_evaluator_php' => array( |
| 2224 | - 'message' => array(), |
|
| 2224 | + 'message' => array(), |
|
| 2225 | + ), |
|
| 2225 | 2226 | ), |
| 2226 | - ), |
|
| 2227 | 2227 | ), |
| 2228 | 2228 | '#type' => 'action', |
| 2229 | 2229 | '#weight' => 0.0, |
| 2230 | - ), |
|
| 2230 | + ), |
|
| 2231 | 2231 | ), |
| 2232 | 2232 | '#version' => 6003, |
| 2233 | - ), |
|
| 2234 | - 'rules_comment_is_unpublished_hidden_by_moderator_or_admin' => array( |
|
| 2233 | + ), |
|
| 2234 | + 'rules_comment_is_unpublished_hidden_by_moderator_or_admin' => array( |
|
| 2235 | 2235 | '#type' => 'rule', |
| 2236 | 2236 | '#set' => 'event_comment_unpublish', |
| 2237 | 2237 | '#label' => 'Comment is hidden by moderator or admin', |
| 2238 | 2238 | '#active' => 1, |
| 2239 | 2239 | '#weight' => '0', |
| 2240 | 2240 | '#categories' => array( |
| 2241 | - '0' => 'boinc_standard', |
|
| 2242 | - '1' => 'moderator notification', |
|
| 2241 | + '0' => 'boinc_standard', |
|
| 2242 | + '1' => 'moderator notification', |
|
| 2243 | 2243 | ), |
| 2244 | 2244 | '#status' => 'default', |
| 2245 | 2245 | '#conditions' => array( |
| 2246 | - '0' => array( |
|
| 2246 | + '0' => array( |
|
| 2247 | 2247 | '#weight' => 0.0, |
| 2248 | 2248 | '#negate' => 1, |
| 2249 | 2249 | '#info' => array( |
| 2250 | - 'label' => 'Compare two users: acting user (who hid the comment) is NOT the comment author', |
|
| 2251 | - 'label callback' => FALSE, |
|
| 2252 | - 'arguments' => array( |
|
| 2250 | + 'label' => 'Compare two users: acting user (who hid the comment) is NOT the comment author', |
|
| 2251 | + 'label callback' => FALSE, |
|
| 2252 | + 'arguments' => array( |
|
| 2253 | 2253 | 'user1' => array( |
| 2254 | - 'type' => 'user', |
|
| 2255 | - 'label' => 'User account 1', |
|
| 2254 | + 'type' => 'user', |
|
| 2255 | + 'label' => 'User account 1', |
|
| 2256 | 2256 | ), |
| 2257 | 2257 | 'user2' => array( |
| 2258 | - 'type' => 'user', |
|
| 2259 | - 'label' => 'User account 2', |
|
| 2258 | + 'type' => 'user', |
|
| 2259 | + 'label' => 'User account 2', |
|
| 2260 | + ), |
|
| 2260 | 2261 | ), |
| 2261 | - ), |
|
| 2262 | - 'module' => 'User', |
|
| 2262 | + 'module' => 'User', |
|
| 2263 | 2263 | ), |
| 2264 | 2264 | '#name' => 'rules_condition_user_comparison', |
| 2265 | 2265 | '#type' => 'condition', |
| 2266 | 2266 | '#settings' => array( |
| 2267 | - '#argument map' => array( |
|
| 2267 | + '#argument map' => array( |
|
| 2268 | 2268 | 'user1' => 'user', |
| 2269 | 2269 | 'user2' => 'comment_author', |
| 2270 | - ), |
|
| 2270 | + ), |
|
| 2271 | + ), |
|
| 2271 | 2272 | ), |
| 2272 | - ), |
|
| 2273 | 2273 | ), |
| 2274 | 2274 | '#actions' => array( |
| 2275 | - '0' => array( |
|
| 2275 | + '0' => array( |
|
| 2276 | 2276 | '#type' => 'action', |
| 2277 | 2277 | '#settings' => array( |
| 2278 | - 'from' => '', |
|
| 2279 | - 'subject' => 'Comment at [:global:site-name] hidden by moderator or admin', |
|
| 2280 | - 'message' => "Comment has been hidden by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('<front>', array('absolute' => TRUE, 'language' => 'en')); ?>/goto/comment/[comment:comment-cid]", |
|
| 2281 | - '#eval input' => array( |
|
| 2278 | + 'from' => '', |
|
| 2279 | + 'subject' => 'Comment at [:global:site-name] hidden by moderator or admin', |
|
| 2280 | + 'message' => "Comment has been hidden by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('<front>', array('absolute' => TRUE, 'language' => 'en')); ?>/goto/comment/[comment:comment-cid]", |
|
| 2281 | + '#eval input' => array( |
|
| 2282 | 2282 | 'token_rules_input_evaluator' => array( |
| 2283 | - 'subject' => array( |
|
| 2283 | + 'subject' => array( |
|
| 2284 | 2284 | '0' => ':global', |
| 2285 | - ), |
|
| 2286 | - 'message' => array( |
|
| 2285 | + ), |
|
| 2286 | + 'message' => array( |
|
| 2287 | 2287 | '0' => 'comment', |
| 2288 | 2288 | '1' => 'user', |
| 2289 | 2289 | '2' => ':global', |
| 2290 | - ), |
|
| 2291 | - 'from' => array( |
|
| 2290 | + ), |
|
| 2291 | + 'from' => array( |
|
| 2292 | 2292 | '0' => ':global', |
| 2293 | - ), |
|
| 2293 | + ), |
|
| 2294 | 2294 | ), |
| 2295 | 2295 | 'rules_input_evaluator_php' => array( |
| 2296 | - 'message' => array(), |
|
| 2296 | + 'message' => array(), |
|
| 2297 | + ), |
|
| 2297 | 2298 | ), |
| 2298 | - ), |
|
| 2299 | 2299 | ), |
| 2300 | 2300 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 2301 | 2301 | '#info' => array( |
| 2302 | - 'label' => 'Notify moderators via email', |
|
| 2303 | - 'module' => 'BOINC core', |
|
| 2304 | - 'eval input' => array( |
|
| 2302 | + 'label' => 'Notify moderators via email', |
|
| 2303 | + 'module' => 'BOINC core', |
|
| 2304 | + 'eval input' => array( |
|
| 2305 | 2305 | '0' => 'subject', |
| 2306 | 2306 | '1' => 'message', |
| 2307 | 2307 | '2' => 'from', |
| 2308 | - ), |
|
| 2308 | + ), |
|
| 2309 | 2309 | ), |
| 2310 | 2310 | '#weight' => 0.0, |
| 2311 | - ), |
|
| 2311 | + ), |
|
| 2312 | 2312 | ), |
| 2313 | 2313 | '#version' => 6003, |
| 2314 | - ), |
|
| 2315 | - 'rules_forum_topic_is_edited_by_moderator_or_admin' => array( |
|
| 2314 | + ), |
|
| 2315 | + 'rules_forum_topic_is_edited_by_moderator_or_admin' => array( |
|
| 2316 | 2316 | '#type' => 'rule', |
| 2317 | 2317 | '#set' => 'event_node_update', |
| 2318 | 2318 | '#label' => 'Forum topic is edited by moderator or admin', |
| 2319 | 2319 | '#active' => 1, |
| 2320 | 2320 | '#weight' => '0', |
| 2321 | 2321 | '#categories' => array( |
| 2322 | - '0' => 'boinc_standard', |
|
| 2323 | - '1' => 'moderator notification', |
|
| 2322 | + '0' => 'boinc_standard', |
|
| 2323 | + '1' => 'moderator notification', |
|
| 2324 | 2324 | ), |
| 2325 | 2325 | '#status' => 'default', |
| 2326 | 2326 | '#conditions' => array( |
| 2327 | - '0' => array( |
|
| 2327 | + '0' => array( |
|
| 2328 | 2328 | '#weight' => 0.0, |
| 2329 | 2329 | '#type' => 'condition', |
| 2330 | 2330 | '#settings' => array( |
| 2331 | - 'roles' => array( |
|
| 2331 | + 'roles' => array( |
|
| 2332 | 2332 | '0' => 3519698132, |
| 2333 | 2333 | '1' => 1271379760, |
| 2334 | - ), |
|
| 2335 | - 'operation' => 'OR', |
|
| 2336 | - '#argument map' => array( |
|
| 2334 | + ), |
|
| 2335 | + 'operation' => 'OR', |
|
| 2336 | + '#argument map' => array( |
|
| 2337 | 2337 | 'user' => 'user', |
| 2338 | - ), |
|
| 2338 | + ), |
|
| 2339 | 2339 | ), |
| 2340 | 2340 | '#name' => 'rules_condition_user_hasrole', |
| 2341 | 2341 | '#info' => array( |
| 2342 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 2343 | - 'label callback' => FALSE, |
|
| 2344 | - 'arguments' => array( |
|
| 2342 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 2343 | + 'label callback' => FALSE, |
|
| 2344 | + 'arguments' => array( |
|
| 2345 | 2345 | 'user' => array( |
| 2346 | - 'type' => 'user', |
|
| 2347 | - 'label' => 'User', |
|
| 2346 | + 'type' => 'user', |
|
| 2347 | + 'label' => 'User', |
|
| 2348 | 2348 | ), |
| 2349 | - ), |
|
| 2350 | - 'module' => 'User', |
|
| 2349 | + ), |
|
| 2350 | + 'module' => 'User', |
|
| 2351 | + ), |
|
| 2351 | 2352 | ), |
| 2352 | - ), |
|
| 2353 | - '1' => array( |
|
| 2353 | + '1' => array( |
|
| 2354 | 2354 | '#weight' => 0.0, |
| 2355 | 2355 | '0' => array( |
| 2356 | - '#weight' => 0.0, |
|
| 2357 | - '#info' => array( |
|
| 2356 | + '#weight' => 0.0, |
|
| 2357 | + '#info' => array( |
|
| 2358 | 2358 | 'label' => 'Updated content is Forum topic', |
| 2359 | 2359 | 'arguments' => array( |
| 2360 | - 'node' => array( |
|
| 2360 | + 'node' => array( |
|
| 2361 | 2361 | 'type' => 'node', |
| 2362 | 2362 | 'label' => 'Content', |
| 2363 | - ), |
|
| 2363 | + ), |
|
| 2364 | 2364 | ), |
| 2365 | 2365 | 'module' => 'Node', |
| 2366 | - ), |
|
| 2367 | - '#name' => 'rules_condition_content_is_type', |
|
| 2368 | - '#settings' => array( |
|
| 2366 | + ), |
|
| 2367 | + '#name' => 'rules_condition_content_is_type', |
|
| 2368 | + '#settings' => array( |
|
| 2369 | 2369 | 'type' => array( |
| 2370 | - 'forum' => 'forum', |
|
| 2370 | + 'forum' => 'forum', |
|
| 2371 | 2371 | ), |
| 2372 | 2372 | '#argument map' => array( |
| 2373 | - 'node' => 'node', |
|
| 2373 | + 'node' => 'node', |
|
| 2374 | + ), |
|
| 2374 | 2375 | ), |
| 2375 | - ), |
|
| 2376 | - '#type' => 'condition', |
|
| 2376 | + '#type' => 'condition', |
|
| 2377 | 2377 | ), |
| 2378 | 2378 | '#type' => 'OR', |
| 2379 | 2379 | '1' => array( |
| 2380 | - '#type' => 'condition', |
|
| 2381 | - '#settings' => array( |
|
| 2380 | + '#type' => 'condition', |
|
| 2381 | + '#settings' => array( |
|
| 2382 | 2382 | 'type' => array( |
| 2383 | - 'team_forum' => 'team_forum', |
|
| 2383 | + 'team_forum' => 'team_forum', |
|
| 2384 | 2384 | ), |
| 2385 | 2385 | '#argument map' => array( |
| 2386 | - 'node' => 'node', |
|
| 2386 | + 'node' => 'node', |
|
| 2387 | + ), |
|
| 2387 | 2388 | ), |
| 2388 | - ), |
|
| 2389 | - '#name' => 'rules_condition_content_is_type', |
|
| 2390 | - '#info' => array( |
|
| 2389 | + '#name' => 'rules_condition_content_is_type', |
|
| 2390 | + '#info' => array( |
|
| 2391 | 2391 | 'label' => 'Updated content is Team forum topic', |
| 2392 | 2392 | 'arguments' => array( |
| 2393 | - 'node' => array( |
|
| 2393 | + 'node' => array( |
|
| 2394 | 2394 | 'type' => 'node', |
| 2395 | 2395 | 'label' => 'Content', |
| 2396 | - ), |
|
| 2396 | + ), |
|
| 2397 | 2397 | ), |
| 2398 | 2398 | 'module' => 'Node', |
| 2399 | - ), |
|
| 2400 | - '#weight' => 0.0, |
|
| 2399 | + ), |
|
| 2400 | + '#weight' => 0.0, |
|
| 2401 | + ), |
|
| 2401 | 2402 | ), |
| 2402 | - ), |
|
| 2403 | - '2' => array( |
|
| 2403 | + '2' => array( |
|
| 2404 | 2404 | '#weight' => 0.0, |
| 2405 | 2405 | '#info' => array( |
| 2406 | - 'label' => 'PHP code: content changed', |
|
| 2407 | - 'label callback' => FALSE, |
|
| 2408 | - 'module' => 'PHP', |
|
| 2409 | - 'eval input' => array( |
|
| 2406 | + 'label' => 'PHP code: content changed', |
|
| 2407 | + 'label callback' => FALSE, |
|
| 2408 | + 'module' => 'PHP', |
|
| 2409 | + 'eval input' => array( |
|
| 2410 | 2410 | '0' => 'code', |
| 2411 | - ), |
|
| 2411 | + ), |
|
| 2412 | 2412 | ), |
| 2413 | 2413 | '#name' => 'rules_condition_custom_php', |
| 2414 | 2414 | '#settings' => array( |
| 2415 | - 'code' => 'return ($node->body != $node_unchanged->body);', |
|
| 2416 | - 'vars' => array( |
|
| 2415 | + 'code' => 'return ($node->body != $node_unchanged->body);', |
|
| 2416 | + 'vars' => array( |
|
| 2417 | 2417 | '0' => 'node', |
| 2418 | 2418 | '1' => 'node_unchanged', |
| 2419 | - ), |
|
| 2420 | - '#eval input' => array( |
|
| 2419 | + ), |
|
| 2420 | + '#eval input' => array( |
|
| 2421 | 2421 | 'token_rules_input_evaluator' => array( |
| 2422 | - 'code' => array( |
|
| 2422 | + 'code' => array( |
|
| 2423 | 2423 | '0' => ':global', |
| 2424 | - ), |
|
| 2424 | + ), |
|
| 2425 | + ), |
|
| 2425 | 2426 | ), |
| 2426 | - ), |
|
| 2427 | 2427 | ), |
| 2428 | 2428 | '#type' => 'condition', |
| 2429 | - ), |
|
| 2429 | + ), |
|
| 2430 | 2430 | ), |
| 2431 | 2431 | '#actions' => array( |
| 2432 | - '0' => array( |
|
| 2432 | + '0' => array( |
|
| 2433 | 2433 | '#type' => 'action', |
| 2434 | 2434 | '#settings' => array( |
| 2435 | - 'from' => '', |
|
| 2436 | - 'subject' => 'Forum topic at [:global:site-name] edited by moderator/admin', |
|
| 2437 | - 'message' => "[node:type] topic '[node:title]' has been edited by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2438 | - '#eval input' => array( |
|
| 2435 | + 'from' => '', |
|
| 2436 | + 'subject' => 'Forum topic at [:global:site-name] edited by moderator/admin', |
|
| 2437 | + 'message' => "[node:type] topic '[node:title]' has been edited by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2438 | + '#eval input' => array( |
|
| 2439 | 2439 | 'token_rules_input_evaluator' => array( |
| 2440 | - 'subject' => array( |
|
| 2440 | + 'subject' => array( |
|
| 2441 | 2441 | '0' => ':global', |
| 2442 | - ), |
|
| 2443 | - 'message' => array( |
|
| 2442 | + ), |
|
| 2443 | + 'message' => array( |
|
| 2444 | 2444 | '0' => 'node', |
| 2445 | 2445 | '1' => 'user', |
| 2446 | 2446 | '2' => ':global', |
| 2447 | - ), |
|
| 2448 | - 'from' => array( |
|
| 2447 | + ), |
|
| 2448 | + 'from' => array( |
|
| 2449 | 2449 | '0' => ':global', |
| 2450 | - ), |
|
| 2450 | + ), |
|
| 2451 | 2451 | ), |
| 2452 | 2452 | 'rules_input_evaluator_php' => array( |
| 2453 | - 'message' => array( |
|
| 2453 | + 'message' => array( |
|
| 2454 | 2454 | '0' => 'node', |
| 2455 | - ), |
|
| 2455 | + ), |
|
| 2456 | + ), |
|
| 2456 | 2457 | ), |
| 2457 | - ), |
|
| 2458 | 2458 | ), |
| 2459 | 2459 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 2460 | 2460 | '#info' => array( |
| 2461 | - 'label' => 'Notify moderators via email', |
|
| 2462 | - 'module' => 'BOINC core', |
|
| 2463 | - 'eval input' => array( |
|
| 2461 | + 'label' => 'Notify moderators via email', |
|
| 2462 | + 'module' => 'BOINC core', |
|
| 2463 | + 'eval input' => array( |
|
| 2464 | 2464 | '0' => 'subject', |
| 2465 | 2465 | '1' => 'message', |
| 2466 | 2466 | '2' => 'from', |
| 2467 | - ), |
|
| 2467 | + ), |
|
| 2468 | 2468 | ), |
| 2469 | 2469 | '#weight' => 0.0, |
| 2470 | - ), |
|
| 2470 | + ), |
|
| 2471 | 2471 | ), |
| 2472 | 2472 | '#version' => 6003, |
| 2473 | - ), |
|
| 2474 | - 'rules_forum_topic_is_hidden_by_moderator_admin' => array( |
|
| 2473 | + ), |
|
| 2474 | + 'rules_forum_topic_is_hidden_by_moderator_admin' => array( |
|
| 2475 | 2475 | '#type' => 'rule', |
| 2476 | 2476 | '#set' => 'event_node_update', |
| 2477 | 2477 | '#label' => 'Forum topic is hidden by moderator/admin', |
| 2478 | 2478 | '#active' => 1, |
| 2479 | 2479 | '#weight' => '0', |
| 2480 | 2480 | '#categories' => array( |
| 2481 | - '0' => 'boinc_standard', |
|
| 2482 | - '1' => 'moderator notification', |
|
| 2481 | + '0' => 'boinc_standard', |
|
| 2482 | + '1' => 'moderator notification', |
|
| 2483 | 2483 | ), |
| 2484 | 2484 | '#status' => 'default', |
| 2485 | 2485 | '#conditions' => array( |
| 2486 | - '0' => array( |
|
| 2486 | + '0' => array( |
|
| 2487 | 2487 | '#type' => 'condition', |
| 2488 | 2488 | '#settings' => array( |
| 2489 | - 'roles' => array( |
|
| 2489 | + 'roles' => array( |
|
| 2490 | 2490 | '0' => 3519698132, |
| 2491 | 2491 | '1' => 1271379760, |
| 2492 | - ), |
|
| 2493 | - 'operation' => 'OR', |
|
| 2494 | - '#argument map' => array( |
|
| 2492 | + ), |
|
| 2493 | + 'operation' => 'OR', |
|
| 2494 | + '#argument map' => array( |
|
| 2495 | 2495 | 'user' => 'user', |
| 2496 | - ), |
|
| 2496 | + ), |
|
| 2497 | 2497 | ), |
| 2498 | 2498 | '#name' => 'rules_condition_user_hasrole', |
| 2499 | 2499 | '#info' => array( |
| 2500 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 2501 | - 'label callback' => FALSE, |
|
| 2502 | - 'arguments' => array( |
|
| 2500 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 2501 | + 'label callback' => FALSE, |
|
| 2502 | + 'arguments' => array( |
|
| 2503 | 2503 | 'user' => array( |
| 2504 | - 'type' => 'user', |
|
| 2505 | - 'label' => 'User', |
|
| 2504 | + 'type' => 'user', |
|
| 2505 | + 'label' => 'User', |
|
| 2506 | + ), |
|
| 2506 | 2507 | ), |
| 2507 | - ), |
|
| 2508 | - 'module' => 'User', |
|
| 2508 | + 'module' => 'User', |
|
| 2509 | 2509 | ), |
| 2510 | 2510 | '#weight' => 0.0, |
| 2511 | - ), |
|
| 2512 | - '1' => array( |
|
| 2511 | + ), |
|
| 2512 | + '1' => array( |
|
| 2513 | 2513 | '#weight' => 0.0, |
| 2514 | 2514 | '0' => array( |
| 2515 | - '#weight' => 0.0, |
|
| 2516 | - '#type' => 'condition', |
|
| 2517 | - '#settings' => array( |
|
| 2515 | + '#weight' => 0.0, |
|
| 2516 | + '#type' => 'condition', |
|
| 2517 | + '#settings' => array( |
|
| 2518 | 2518 | 'type' => array( |
| 2519 | - 'forum' => 'forum', |
|
| 2519 | + 'forum' => 'forum', |
|
| 2520 | 2520 | ), |
| 2521 | 2521 | '#argument map' => array( |
| 2522 | - 'node' => 'node', |
|
| 2522 | + 'node' => 'node', |
|
| 2523 | + ), |
|
| 2523 | 2524 | ), |
| 2524 | - ), |
|
| 2525 | - '#name' => 'rules_condition_content_is_type', |
|
| 2526 | - '#info' => array( |
|
| 2525 | + '#name' => 'rules_condition_content_is_type', |
|
| 2526 | + '#info' => array( |
|
| 2527 | 2527 | 'label' => 'Updated content is Forum topic', |
| 2528 | 2528 | 'arguments' => array( |
| 2529 | - 'node' => array( |
|
| 2529 | + 'node' => array( |
|
| 2530 | 2530 | 'type' => 'node', |
| 2531 | 2531 | 'label' => 'Content', |
| 2532 | - ), |
|
| 2532 | + ), |
|
| 2533 | 2533 | ), |
| 2534 | 2534 | 'module' => 'Node', |
| 2535 | - ), |
|
| 2535 | + ), |
|
| 2536 | 2536 | ), |
| 2537 | 2537 | '#type' => 'OR', |
| 2538 | 2538 | '1' => array( |
| 2539 | - '#type' => 'condition', |
|
| 2540 | - '#settings' => array( |
|
| 2539 | + '#type' => 'condition', |
|
| 2540 | + '#settings' => array( |
|
| 2541 | 2541 | 'type' => array( |
| 2542 | - 'team_forum' => 'team_forum', |
|
| 2542 | + 'team_forum' => 'team_forum', |
|
| 2543 | 2543 | ), |
| 2544 | 2544 | '#argument map' => array( |
| 2545 | - 'node' => 'node', |
|
| 2545 | + 'node' => 'node', |
|
| 2546 | + ), |
|
| 2546 | 2547 | ), |
| 2547 | - ), |
|
| 2548 | - '#name' => 'rules_condition_content_is_type', |
|
| 2549 | - '#info' => array( |
|
| 2548 | + '#name' => 'rules_condition_content_is_type', |
|
| 2549 | + '#info' => array( |
|
| 2550 | 2550 | 'label' => 'Updated content is Team forum topic', |
| 2551 | 2551 | 'arguments' => array( |
| 2552 | - 'node' => array( |
|
| 2552 | + 'node' => array( |
|
| 2553 | 2553 | 'type' => 'node', |
| 2554 | 2554 | 'label' => 'Content', |
| 2555 | - ), |
|
| 2555 | + ), |
|
| 2556 | 2556 | ), |
| 2557 | 2557 | 'module' => 'Node', |
| 2558 | - ), |
|
| 2559 | - '#weight' => 0.0, |
|
| 2558 | + ), |
|
| 2559 | + '#weight' => 0.0, |
|
| 2560 | + ), |
|
| 2560 | 2561 | ), |
| 2561 | - ), |
|
| 2562 | - '3' => array( |
|
| 2562 | + '3' => array( |
|
| 2563 | 2563 | '#weight' => 0.0, |
| 2564 | 2564 | '#info' => array( |
| 2565 | - 'label' => 'PHP code: node content unchanged', |
|
| 2566 | - 'label callback' => FALSE, |
|
| 2567 | - 'module' => 'PHP', |
|
| 2568 | - 'eval input' => array( |
|
| 2565 | + 'label' => 'PHP code: node content unchanged', |
|
| 2566 | + 'label callback' => FALSE, |
|
| 2567 | + 'module' => 'PHP', |
|
| 2568 | + 'eval input' => array( |
|
| 2569 | 2569 | '0' => 'code', |
| 2570 | - ), |
|
| 2570 | + ), |
|
| 2571 | 2571 | ), |
| 2572 | 2572 | '#name' => 'rules_condition_custom_php', |
| 2573 | 2573 | '#settings' => array( |
| 2574 | - 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 2575 | - 'vars' => array( |
|
| 2574 | + 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 2575 | + 'vars' => array( |
|
| 2576 | 2576 | '0' => 'node', |
| 2577 | 2577 | '1' => 'node_unchanged', |
| 2578 | - ), |
|
| 2579 | - '#eval input' => array( |
|
| 2578 | + ), |
|
| 2579 | + '#eval input' => array( |
|
| 2580 | 2580 | 'token_rules_input_evaluator' => array( |
| 2581 | - 'code' => array( |
|
| 2581 | + 'code' => array( |
|
| 2582 | 2582 | '0' => ':global', |
| 2583 | - ), |
|
| 2583 | + ), |
|
| 2584 | + ), |
|
| 2584 | 2585 | ), |
| 2585 | - ), |
|
| 2586 | 2586 | ), |
| 2587 | 2587 | '#type' => 'condition', |
| 2588 | - ), |
|
| 2589 | - '4' => array( |
|
| 2588 | + ), |
|
| 2589 | + '4' => array( |
|
| 2590 | 2590 | '#weight' => 0.0, |
| 2591 | 2591 | '#info' => array( |
| 2592 | - 'label' => 'PHP code: node status changed to hidden', |
|
| 2593 | - 'label callback' => FALSE, |
|
| 2594 | - 'module' => 'PHP', |
|
| 2595 | - 'eval input' => array( |
|
| 2592 | + 'label' => 'PHP code: node status changed to hidden', |
|
| 2593 | + 'label callback' => FALSE, |
|
| 2594 | + 'module' => 'PHP', |
|
| 2595 | + 'eval input' => array( |
|
| 2596 | 2596 | '0' => 'code', |
| 2597 | - ), |
|
| 2597 | + ), |
|
| 2598 | 2598 | ), |
| 2599 | 2599 | '#name' => 'rules_condition_custom_php', |
| 2600 | 2600 | '#type' => 'condition', |
| 2601 | 2601 | '#settings' => array( |
| 2602 | - 'code' => 'return $node_unchanged->status == 1 && $node->status == 0;', |
|
| 2603 | - 'vars' => array( |
|
| 2602 | + 'code' => 'return $node_unchanged->status == 1 && $node->status == 0;', |
|
| 2603 | + 'vars' => array( |
|
| 2604 | 2604 | '0' => 'node', |
| 2605 | 2605 | '1' => 'node_unchanged', |
| 2606 | - ), |
|
| 2607 | - '#eval input' => array( |
|
| 2606 | + ), |
|
| 2607 | + '#eval input' => array( |
|
| 2608 | 2608 | 'token_rules_input_evaluator' => array( |
| 2609 | - 'code' => array( |
|
| 2609 | + 'code' => array( |
|
| 2610 | 2610 | '0' => ':global', |
| 2611 | - ), |
|
| 2611 | + ), |
|
| 2612 | + ), |
|
| 2612 | 2613 | ), |
| 2613 | - ), |
|
| 2614 | 2614 | ), |
| 2615 | - ), |
|
| 2615 | + ), |
|
| 2616 | 2616 | ), |
| 2617 | 2617 | '#actions' => array( |
| 2618 | - '0' => array( |
|
| 2618 | + '0' => array( |
|
| 2619 | 2619 | '#info' => array( |
| 2620 | - 'label' => 'Notify moderators via email', |
|
| 2621 | - 'module' => 'BOINC core', |
|
| 2622 | - 'eval input' => array( |
|
| 2620 | + 'label' => 'Notify moderators via email', |
|
| 2621 | + 'module' => 'BOINC core', |
|
| 2622 | + 'eval input' => array( |
|
| 2623 | 2623 | '0' => 'subject', |
| 2624 | 2624 | '1' => 'message', |
| 2625 | 2625 | '2' => 'from', |
| 2626 | - ), |
|
| 2626 | + ), |
|
| 2627 | 2627 | ), |
| 2628 | 2628 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 2629 | 2629 | '#settings' => array( |
| 2630 | - 'from' => '', |
|
| 2631 | - 'subject' => 'Forum topic at [:global:site-name] hidden by moderator/admin', |
|
| 2632 | - 'message' => "[node:type] topic '[node:title]' has been hidden by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2633 | - '#eval input' => array( |
|
| 2630 | + 'from' => '', |
|
| 2631 | + 'subject' => 'Forum topic at [:global:site-name] hidden by moderator/admin', |
|
| 2632 | + 'message' => "[node:type] topic '[node:title]' has been hidden by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2633 | + '#eval input' => array( |
|
| 2634 | 2634 | 'token_rules_input_evaluator' => array( |
| 2635 | - 'subject' => array( |
|
| 2635 | + 'subject' => array( |
|
| 2636 | 2636 | '0' => ':global', |
| 2637 | - ), |
|
| 2638 | - 'message' => array( |
|
| 2637 | + ), |
|
| 2638 | + 'message' => array( |
|
| 2639 | 2639 | '0' => 'node', |
| 2640 | 2640 | '1' => 'user', |
| 2641 | 2641 | '2' => ':global', |
| 2642 | - ), |
|
| 2643 | - 'from' => array( |
|
| 2642 | + ), |
|
| 2643 | + 'from' => array( |
|
| 2644 | 2644 | '0' => ':global', |
| 2645 | - ), |
|
| 2645 | + ), |
|
| 2646 | 2646 | ), |
| 2647 | 2647 | 'rules_input_evaluator_php' => array( |
| 2648 | - 'message' => array( |
|
| 2648 | + 'message' => array( |
|
| 2649 | 2649 | '0' => 'node', |
| 2650 | - ), |
|
| 2650 | + ), |
|
| 2651 | + ), |
|
| 2651 | 2652 | ), |
| 2652 | - ), |
|
| 2653 | 2653 | ), |
| 2654 | 2654 | '#type' => 'action', |
| 2655 | 2655 | '#weight' => 0.0, |
| 2656 | - ), |
|
| 2656 | + ), |
|
| 2657 | 2657 | ), |
| 2658 | 2658 | '#version' => 6003, |
| 2659 | - ), |
|
| 2660 | - 'rules_forum_topic_is_moved_to_a_different_forum_by_moderator_or_admin' => array( |
|
| 2659 | + ), |
|
| 2660 | + 'rules_forum_topic_is_moved_to_a_different_forum_by_moderator_or_admin' => array( |
|
| 2661 | 2661 | '#type' => 'rule', |
| 2662 | 2662 | '#set' => 'event_node_update', |
| 2663 | 2663 | '#label' => 'Forum topic is moved to a different forum by moderator or admin', |
| 2664 | 2664 | '#active' => 1, |
| 2665 | 2665 | '#weight' => '0', |
| 2666 | 2666 | '#categories' => array( |
| 2667 | - '0' => 'boinc_standard', |
|
| 2668 | - '1' => 'moderator notification', |
|
| 2667 | + '0' => 'boinc_standard', |
|
| 2668 | + '1' => 'moderator notification', |
|
| 2669 | 2669 | ), |
| 2670 | 2670 | '#status' => 'default', |
| 2671 | 2671 | '#conditions' => array( |
| 2672 | - '0' => array( |
|
| 2672 | + '0' => array( |
|
| 2673 | 2673 | '#weight' => 0.0, |
| 2674 | 2674 | '#type' => 'condition', |
| 2675 | 2675 | '#settings' => array( |
| 2676 | - 'roles' => array( |
|
| 2676 | + 'roles' => array( |
|
| 2677 | 2677 | '0' => 3519698132, |
| 2678 | 2678 | '1' => 1271379760, |
| 2679 | - ), |
|
| 2680 | - 'operation' => 'OR', |
|
| 2681 | - '#argument map' => array( |
|
| 2679 | + ), |
|
| 2680 | + 'operation' => 'OR', |
|
| 2681 | + '#argument map' => array( |
|
| 2682 | 2682 | 'user' => 'user', |
| 2683 | - ), |
|
| 2683 | + ), |
|
| 2684 | 2684 | ), |
| 2685 | 2685 | '#name' => 'rules_condition_user_hasrole', |
| 2686 | 2686 | '#info' => array( |
| 2687 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 2688 | - 'label callback' => FALSE, |
|
| 2689 | - 'arguments' => array( |
|
| 2687 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 2688 | + 'label callback' => FALSE, |
|
| 2689 | + 'arguments' => array( |
|
| 2690 | 2690 | 'user' => array( |
| 2691 | - 'type' => 'user', |
|
| 2692 | - 'label' => 'User', |
|
| 2691 | + 'type' => 'user', |
|
| 2692 | + 'label' => 'User', |
|
| 2693 | 2693 | ), |
| 2694 | - ), |
|
| 2695 | - 'module' => 'User', |
|
| 2694 | + ), |
|
| 2695 | + 'module' => 'User', |
|
| 2696 | + ), |
|
| 2696 | 2697 | ), |
| 2697 | - ), |
|
| 2698 | - '1' => array( |
|
| 2698 | + '1' => array( |
|
| 2699 | 2699 | '#weight' => 0.0, |
| 2700 | 2700 | '0' => array( |
| 2701 | - '#weight' => 0.0, |
|
| 2702 | - '#info' => array( |
|
| 2701 | + '#weight' => 0.0, |
|
| 2702 | + '#info' => array( |
|
| 2703 | 2703 | 'label' => 'Updated content is Forum topic', |
| 2704 | 2704 | 'arguments' => array( |
| 2705 | - 'node' => array( |
|
| 2705 | + 'node' => array( |
|
| 2706 | 2706 | 'type' => 'node', |
| 2707 | 2707 | 'label' => 'Content', |
| 2708 | - ), |
|
| 2708 | + ), |
|
| 2709 | 2709 | ), |
| 2710 | 2710 | 'module' => 'Node', |
| 2711 | - ), |
|
| 2712 | - '#name' => 'rules_condition_content_is_type', |
|
| 2713 | - '#settings' => array( |
|
| 2711 | + ), |
|
| 2712 | + '#name' => 'rules_condition_content_is_type', |
|
| 2713 | + '#settings' => array( |
|
| 2714 | 2714 | 'type' => array( |
| 2715 | - 'forum' => 'forum', |
|
| 2715 | + 'forum' => 'forum', |
|
| 2716 | 2716 | ), |
| 2717 | 2717 | '#argument map' => array( |
| 2718 | - 'node' => 'node', |
|
| 2718 | + 'node' => 'node', |
|
| 2719 | + ), |
|
| 2719 | 2720 | ), |
| 2720 | - ), |
|
| 2721 | - '#type' => 'condition', |
|
| 2721 | + '#type' => 'condition', |
|
| 2722 | 2722 | ), |
| 2723 | 2723 | '#type' => 'OR', |
| 2724 | 2724 | '1' => array( |
| 2725 | - '#type' => 'condition', |
|
| 2726 | - '#settings' => array( |
|
| 2725 | + '#type' => 'condition', |
|
| 2726 | + '#settings' => array( |
|
| 2727 | 2727 | 'type' => array( |
| 2728 | - 'team_forum' => 'team_forum', |
|
| 2728 | + 'team_forum' => 'team_forum', |
|
| 2729 | 2729 | ), |
| 2730 | 2730 | '#argument map' => array( |
| 2731 | - 'node' => 'node', |
|
| 2731 | + 'node' => 'node', |
|
| 2732 | 2732 | ), |
| 2733 | - ), |
|
| 2734 | - '#name' => 'rules_condition_content_is_type', |
|
| 2735 | - '#info' => array( |
|
| 2733 | + ), |
|
| 2734 | + '#name' => 'rules_condition_content_is_type', |
|
| 2735 | + '#info' => array( |
|
| 2736 | 2736 | 'label' => 'Updated content is Team forum topic', |
| 2737 | 2737 | 'arguments' => array( |
| 2738 | - 'node' => array( |
|
| 2738 | + 'node' => array( |
|
| 2739 | 2739 | 'type' => 'node', |
| 2740 | 2740 | 'label' => 'Content', |
| 2741 | - ), |
|
| 2741 | + ), |
|
| 2742 | 2742 | ), |
| 2743 | 2743 | 'module' => 'Node', |
| 2744 | - ), |
|
| 2745 | - '#weight' => 0.0, |
|
| 2744 | + ), |
|
| 2745 | + '#weight' => 0.0, |
|
| 2746 | 2746 | ), |
| 2747 | - ), |
|
| 2748 | - '2' => array( |
|
| 2747 | + ), |
|
| 2748 | + '2' => array( |
|
| 2749 | 2749 | '#weight' => 0.0, |
| 2750 | 2750 | '#info' => array( |
| 2751 | - 'label' => 'PHP code: node moved to new forum parent', |
|
| 2752 | - 'label callback' => FALSE, |
|
| 2753 | - 'module' => 'PHP', |
|
| 2754 | - 'eval input' => array( |
|
| 2751 | + 'label' => 'PHP code: node moved to new forum parent', |
|
| 2752 | + 'label callback' => FALSE, |
|
| 2753 | + 'module' => 'PHP', |
|
| 2754 | + 'eval input' => array( |
|
| 2755 | 2755 | '0' => 'code', |
| 2756 | - ), |
|
| 2756 | + ), |
|
| 2757 | 2757 | ), |
| 2758 | 2758 | '#name' => 'rules_condition_custom_php', |
| 2759 | 2759 | '#settings' => array( |
| 2760 | - 'code' => 'return ($node->tid != $node_unchanged->tid);', |
|
| 2761 | - 'vars' => array( |
|
| 2760 | + 'code' => 'return ($node->tid != $node_unchanged->tid);', |
|
| 2761 | + 'vars' => array( |
|
| 2762 | 2762 | '0' => 'node', |
| 2763 | 2763 | '1' => 'node_unchanged', |
| 2764 | - ), |
|
| 2765 | - '#eval input' => array( |
|
| 2764 | + ), |
|
| 2765 | + '#eval input' => array( |
|
| 2766 | 2766 | 'token_rules_input_evaluator' => array( |
| 2767 | - 'code' => array( |
|
| 2767 | + 'code' => array( |
|
| 2768 | 2768 | '0' => ':global', |
| 2769 | - ), |
|
| 2769 | + ), |
|
| 2770 | + ), |
|
| 2770 | 2771 | ), |
| 2771 | - ), |
|
| 2772 | 2772 | ), |
| 2773 | 2773 | '#type' => 'condition', |
| 2774 | - ), |
|
| 2774 | + ), |
|
| 2775 | 2775 | ), |
| 2776 | 2776 | '#actions' => array( |
| 2777 | - '0' => array( |
|
| 2777 | + '0' => array( |
|
| 2778 | 2778 | '#type' => 'action', |
| 2779 | 2779 | '#settings' => array( |
| 2780 | - 'from' => '', |
|
| 2781 | - 'subject' => 'Forum topic at [:global:site-name] moved by moderator/admin', |
|
| 2782 | - 'message' => "[node:type] topic '[node:title]' has been moved by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2783 | - '#eval input' => array( |
|
| 2780 | + 'from' => '', |
|
| 2781 | + 'subject' => 'Forum topic at [:global:site-name] moved by moderator/admin', |
|
| 2782 | + 'message' => "[node:type] topic '[node:title]' has been moved by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2783 | + '#eval input' => array( |
|
| 2784 | 2784 | 'token_rules_input_evaluator' => array( |
| 2785 | - 'subject' => array( |
|
| 2785 | + 'subject' => array( |
|
| 2786 | 2786 | '0' => ':global', |
| 2787 | - ), |
|
| 2788 | - 'message' => array( |
|
| 2787 | + ), |
|
| 2788 | + 'message' => array( |
|
| 2789 | 2789 | '0' => 'node', |
| 2790 | 2790 | '1' => 'user', |
| 2791 | 2791 | '2' => ':global', |
| 2792 | - ), |
|
| 2793 | - 'from' => array( |
|
| 2792 | + ), |
|
| 2793 | + 'from' => array( |
|
| 2794 | 2794 | '0' => ':global', |
| 2795 | - ), |
|
| 2795 | + ), |
|
| 2796 | 2796 | ), |
| 2797 | 2797 | 'rules_input_evaluator_php' => array( |
| 2798 | - 'message' => array( |
|
| 2798 | + 'message' => array( |
|
| 2799 | 2799 | '0' => 'node', |
| 2800 | - ), |
|
| 2800 | + ), |
|
| 2801 | + ), |
|
| 2801 | 2802 | ), |
| 2802 | - ), |
|
| 2803 | 2803 | ), |
| 2804 | 2804 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 2805 | 2805 | '#info' => array( |
| 2806 | - 'label' => 'Notify moderators via email', |
|
| 2807 | - 'module' => 'BOINC core', |
|
| 2808 | - 'eval input' => array( |
|
| 2806 | + 'label' => 'Notify moderators via email', |
|
| 2807 | + 'module' => 'BOINC core', |
|
| 2808 | + 'eval input' => array( |
|
| 2809 | 2809 | '0' => 'subject', |
| 2810 | 2810 | '1' => 'message', |
| 2811 | 2811 | '2' => 'from', |
| 2812 | - ), |
|
| 2812 | + ), |
|
| 2813 | 2813 | ), |
| 2814 | 2814 | '#weight' => 0.0, |
| 2815 | - ), |
|
| 2815 | + ), |
|
| 2816 | 2816 | ), |
| 2817 | 2817 | '#version' => 6003, |
| 2818 | - ), |
|
| 2819 | - 'rules_forum_topic_is_unhidden_by_moderator_admin' => array( |
|
| 2818 | + ), |
|
| 2819 | + 'rules_forum_topic_is_unhidden_by_moderator_admin' => array( |
|
| 2820 | 2820 | '#type' => 'rule', |
| 2821 | 2821 | '#set' => 'event_node_update', |
| 2822 | 2822 | '#label' => 'Forum topic is unhidden by moderator/admin', |
| 2823 | 2823 | '#active' => 1, |
| 2824 | 2824 | '#weight' => '0', |
| 2825 | 2825 | '#categories' => array( |
| 2826 | - '0' => 'boinc_standard', |
|
| 2827 | - '1' => 'moderator notification', |
|
| 2826 | + '0' => 'boinc_standard', |
|
| 2827 | + '1' => 'moderator notification', |
|
| 2828 | 2828 | ), |
| 2829 | 2829 | '#status' => 'default', |
| 2830 | 2830 | '#conditions' => array( |
| 2831 | - '0' => array( |
|
| 2831 | + '0' => array( |
|
| 2832 | 2832 | '#type' => 'condition', |
| 2833 | 2833 | '#settings' => array( |
| 2834 | - 'roles' => array( |
|
| 2834 | + 'roles' => array( |
|
| 2835 | 2835 | '0' => 3519698132, |
| 2836 | 2836 | '1' => 1271379760, |
| 2837 | - ), |
|
| 2838 | - 'operation' => 'OR', |
|
| 2839 | - '#argument map' => array( |
|
| 2837 | + ), |
|
| 2838 | + 'operation' => 'OR', |
|
| 2839 | + '#argument map' => array( |
|
| 2840 | 2840 | 'user' => 'user', |
| 2841 | - ), |
|
| 2841 | + ), |
|
| 2842 | 2842 | ), |
| 2843 | 2843 | '#name' => 'rules_condition_user_hasrole', |
| 2844 | 2844 | '#info' => array( |
| 2845 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 2846 | - 'label callback' => FALSE, |
|
| 2847 | - 'arguments' => array( |
|
| 2845 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 2846 | + 'label callback' => FALSE, |
|
| 2847 | + 'arguments' => array( |
|
| 2848 | 2848 | 'user' => array( |
| 2849 | - 'type' => 'user', |
|
| 2850 | - 'label' => 'User', |
|
| 2849 | + 'type' => 'user', |
|
| 2850 | + 'label' => 'User', |
|
| 2851 | 2851 | ), |
| 2852 | - ), |
|
| 2853 | - 'module' => 'User', |
|
| 2852 | + ), |
|
| 2853 | + 'module' => 'User', |
|
| 2854 | 2854 | ), |
| 2855 | 2855 | '#weight' => 0.0, |
| 2856 | - ), |
|
| 2857 | - '1' => array( |
|
| 2856 | + ), |
|
| 2857 | + '1' => array( |
|
| 2858 | 2858 | '#type' => 'OR', |
| 2859 | 2859 | '0' => array( |
| 2860 | - '#info' => array( |
|
| 2860 | + '#info' => array( |
|
| 2861 | 2861 | 'label' => 'Updated content is Forum topic', |
| 2862 | 2862 | 'arguments' => array( |
| 2863 | - 'node' => array( |
|
| 2863 | + 'node' => array( |
|
| 2864 | 2864 | 'type' => 'node', |
| 2865 | 2865 | 'label' => 'Content', |
| 2866 | - ), |
|
| 2866 | + ), |
|
| 2867 | 2867 | ), |
| 2868 | 2868 | 'module' => 'Node', |
| 2869 | - ), |
|
| 2870 | - '#name' => 'rules_condition_content_is_type', |
|
| 2871 | - '#settings' => array( |
|
| 2869 | + ), |
|
| 2870 | + '#name' => 'rules_condition_content_is_type', |
|
| 2871 | + '#settings' => array( |
|
| 2872 | 2872 | 'type' => array( |
| 2873 | - 'forum' => 'forum', |
|
| 2873 | + 'forum' => 'forum', |
|
| 2874 | 2874 | ), |
| 2875 | 2875 | '#argument map' => array( |
| 2876 | - 'node' => 'node', |
|
| 2876 | + 'node' => 'node', |
|
| 2877 | + ), |
|
| 2877 | 2878 | ), |
| 2878 | - ), |
|
| 2879 | - '#type' => 'condition', |
|
| 2880 | - '#weight' => 0.0, |
|
| 2879 | + '#type' => 'condition', |
|
| 2880 | + '#weight' => 0.0, |
|
| 2881 | 2881 | ), |
| 2882 | 2882 | '#weight' => 0.0, |
| 2883 | 2883 | '1' => array( |
| 2884 | - '#weight' => 0.0, |
|
| 2885 | - '#info' => array( |
|
| 2884 | + '#weight' => 0.0, |
|
| 2885 | + '#info' => array( |
|
| 2886 | 2886 | 'label' => 'Updated content is Team forum topic', |
| 2887 | 2887 | 'arguments' => array( |
| 2888 | - 'node' => array( |
|
| 2888 | + 'node' => array( |
|
| 2889 | 2889 | 'type' => 'node', |
| 2890 | 2890 | 'label' => 'Content', |
| 2891 | - ), |
|
| 2891 | + ), |
|
| 2892 | 2892 | ), |
| 2893 | 2893 | 'module' => 'Node', |
| 2894 | - ), |
|
| 2895 | - '#name' => 'rules_condition_content_is_type', |
|
| 2896 | - '#settings' => array( |
|
| 2894 | + ), |
|
| 2895 | + '#name' => 'rules_condition_content_is_type', |
|
| 2896 | + '#settings' => array( |
|
| 2897 | 2897 | 'type' => array( |
| 2898 | - 'team_forum' => 'team_forum', |
|
| 2898 | + 'team_forum' => 'team_forum', |
|
| 2899 | 2899 | ), |
| 2900 | 2900 | '#argument map' => array( |
| 2901 | - 'node' => 'node', |
|
| 2901 | + 'node' => 'node', |
|
| 2902 | + ), |
|
| 2902 | 2903 | ), |
| 2903 | - ), |
|
| 2904 | - '#type' => 'condition', |
|
| 2904 | + '#type' => 'condition', |
|
| 2905 | 2905 | ), |
| 2906 | - ), |
|
| 2907 | - '3' => array( |
|
| 2906 | + ), |
|
| 2907 | + '3' => array( |
|
| 2908 | 2908 | '#type' => 'condition', |
| 2909 | 2909 | '#settings' => array( |
| 2910 | - 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 2911 | - 'vars' => array( |
|
| 2910 | + 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 2911 | + 'vars' => array( |
|
| 2912 | 2912 | '0' => 'node', |
| 2913 | 2913 | '1' => 'node_unchanged', |
| 2914 | - ), |
|
| 2915 | - '#eval input' => array( |
|
| 2914 | + ), |
|
| 2915 | + '#eval input' => array( |
|
| 2916 | 2916 | 'token_rules_input_evaluator' => array( |
| 2917 | - 'code' => array( |
|
| 2917 | + 'code' => array( |
|
| 2918 | 2918 | '0' => ':global', |
| 2919 | - ), |
|
| 2919 | + ), |
|
| 2920 | + ), |
|
| 2920 | 2921 | ), |
| 2921 | - ), |
|
| 2922 | 2922 | ), |
| 2923 | 2923 | '#name' => 'rules_condition_custom_php', |
| 2924 | 2924 | '#info' => array( |
| 2925 | - 'label' => 'PHP code: node content is unchanged', |
|
| 2926 | - 'label callback' => FALSE, |
|
| 2927 | - 'module' => 'PHP', |
|
| 2928 | - 'eval input' => array( |
|
| 2925 | + 'label' => 'PHP code: node content is unchanged', |
|
| 2926 | + 'label callback' => FALSE, |
|
| 2927 | + 'module' => 'PHP', |
|
| 2928 | + 'eval input' => array( |
|
| 2929 | 2929 | '0' => 'code', |
| 2930 | - ), |
|
| 2930 | + ), |
|
| 2931 | 2931 | ), |
| 2932 | 2932 | '#weight' => 0.0, |
| 2933 | - ), |
|
| 2934 | - '4' => array( |
|
| 2933 | + ), |
|
| 2934 | + '4' => array( |
|
| 2935 | 2935 | '#type' => 'condition', |
| 2936 | 2936 | '#settings' => array( |
| 2937 | - 'code' => 'return $node_unchanged->status == 0 && $node->status == 1;', |
|
| 2938 | - 'vars' => array( |
|
| 2937 | + 'code' => 'return $node_unchanged->status == 0 && $node->status == 1;', |
|
| 2938 | + 'vars' => array( |
|
| 2939 | 2939 | '0' => 'node', |
| 2940 | 2940 | '1' => 'node_unchanged', |
| 2941 | - ), |
|
| 2942 | - '#eval input' => array( |
|
| 2941 | + ), |
|
| 2942 | + '#eval input' => array( |
|
| 2943 | 2943 | 'token_rules_input_evaluator' => array( |
| 2944 | - 'code' => array( |
|
| 2944 | + 'code' => array( |
|
| 2945 | 2945 | '0' => ':global', |
| 2946 | - ), |
|
| 2946 | + ), |
|
| 2947 | + ), |
|
| 2947 | 2948 | ), |
| 2948 | - ), |
|
| 2949 | 2949 | ), |
| 2950 | 2950 | '#name' => 'rules_condition_custom_php', |
| 2951 | 2951 | '#info' => array( |
| 2952 | - 'label' => 'PHP code: node status changed to unhidden', |
|
| 2953 | - 'label callback' => FALSE, |
|
| 2954 | - 'module' => 'PHP', |
|
| 2955 | - 'eval input' => array( |
|
| 2952 | + 'label' => 'PHP code: node status changed to unhidden', |
|
| 2953 | + 'label callback' => FALSE, |
|
| 2954 | + 'module' => 'PHP', |
|
| 2955 | + 'eval input' => array( |
|
| 2956 | 2956 | '0' => 'code', |
| 2957 | - ), |
|
| 2957 | + ), |
|
| 2958 | 2958 | ), |
| 2959 | 2959 | '#weight' => 0.0, |
| 2960 | - ), |
|
| 2960 | + ), |
|
| 2961 | 2961 | ), |
| 2962 | 2962 | '#actions' => array( |
| 2963 | - '0' => array( |
|
| 2963 | + '0' => array( |
|
| 2964 | 2964 | '#info' => array( |
| 2965 | - 'label' => 'Notify moderators via email', |
|
| 2966 | - 'module' => 'BOINC core', |
|
| 2967 | - 'eval input' => array( |
|
| 2965 | + 'label' => 'Notify moderators via email', |
|
| 2966 | + 'module' => 'BOINC core', |
|
| 2967 | + 'eval input' => array( |
|
| 2968 | 2968 | '0' => 'subject', |
| 2969 | 2969 | '1' => 'message', |
| 2970 | 2970 | '2' => 'from', |
| 2971 | - ), |
|
| 2971 | + ), |
|
| 2972 | 2972 | ), |
| 2973 | 2973 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 2974 | 2974 | '#settings' => array( |
| 2975 | - 'from' => '', |
|
| 2976 | - 'subject' => 'Forum topic at [:global:site-name] unhidden by moderator/admin', |
|
| 2977 | - 'message' => "[node:type] topic '[node:title]' has been unhidden by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2978 | - '#eval input' => array( |
|
| 2975 | + 'from' => '', |
|
| 2976 | + 'subject' => 'Forum topic at [:global:site-name] unhidden by moderator/admin', |
|
| 2977 | + 'message' => "[node:type] topic '[node:title]' has been unhidden by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 2978 | + '#eval input' => array( |
|
| 2979 | 2979 | 'token_rules_input_evaluator' => array( |
| 2980 | - 'subject' => array( |
|
| 2980 | + 'subject' => array( |
|
| 2981 | 2981 | '0' => ':global', |
| 2982 | - ), |
|
| 2983 | - 'message' => array( |
|
| 2982 | + ), |
|
| 2983 | + 'message' => array( |
|
| 2984 | 2984 | '0' => 'node', |
| 2985 | 2985 | '1' => 'user', |
| 2986 | 2986 | '2' => ':global', |
| 2987 | - ), |
|
| 2988 | - 'from' => array( |
|
| 2987 | + ), |
|
| 2988 | + 'from' => array( |
|
| 2989 | 2989 | '0' => ':global', |
| 2990 | - ), |
|
| 2990 | + ), |
|
| 2991 | 2991 | ), |
| 2992 | 2992 | 'rules_input_evaluator_php' => array( |
| 2993 | - 'message' => array( |
|
| 2993 | + 'message' => array( |
|
| 2994 | 2994 | '0' => 'node', |
| 2995 | - ), |
|
| 2995 | + ), |
|
| 2996 | + ), |
|
| 2996 | 2997 | ), |
| 2997 | - ), |
|
| 2998 | 2998 | ), |
| 2999 | 2999 | '#type' => 'action', |
| 3000 | 3000 | '#weight' => 0.0, |
| 3001 | - ), |
|
| 3001 | + ), |
|
| 3002 | 3002 | ), |
| 3003 | 3003 | '#version' => 6003, |
| 3004 | - ), |
|
| 3005 | - 'rules_forum_topic_locked_by_moderator_admin' => array( |
|
| 3004 | + ), |
|
| 3005 | + 'rules_forum_topic_locked_by_moderator_admin' => array( |
|
| 3006 | 3006 | '#type' => 'rule', |
| 3007 | 3007 | '#set' => 'event_node_update', |
| 3008 | 3008 | '#label' => 'Forum topic locked by moderator/admin', |
| 3009 | 3009 | '#active' => 1, |
| 3010 | 3010 | '#weight' => '0', |
| 3011 | 3011 | '#categories' => array( |
| 3012 | - '0' => 'boinc_standard', |
|
| 3013 | - '1' => 'moderator notification', |
|
| 3012 | + '0' => 'boinc_standard', |
|
| 3013 | + '1' => 'moderator notification', |
|
| 3014 | 3014 | ), |
| 3015 | 3015 | '#status' => 'default', |
| 3016 | 3016 | '#conditions' => array( |
| 3017 | - '0' => array( |
|
| 3017 | + '0' => array( |
|
| 3018 | 3018 | '#type' => 'condition', |
| 3019 | 3019 | '#settings' => array( |
| 3020 | - 'roles' => array( |
|
| 3020 | + 'roles' => array( |
|
| 3021 | 3021 | '0' => 3519698132, |
| 3022 | 3022 | '1' => 1271379760, |
| 3023 | - ), |
|
| 3024 | - 'operation' => 'OR', |
|
| 3025 | - '#argument map' => array( |
|
| 3023 | + ), |
|
| 3024 | + 'operation' => 'OR', |
|
| 3025 | + '#argument map' => array( |
|
| 3026 | 3026 | 'user' => 'user', |
| 3027 | - ), |
|
| 3027 | + ), |
|
| 3028 | 3028 | ), |
| 3029 | 3029 | '#name' => 'rules_condition_user_hasrole', |
| 3030 | 3030 | '#info' => array( |
| 3031 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 3032 | - 'label callback' => FALSE, |
|
| 3033 | - 'arguments' => array( |
|
| 3031 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 3032 | + 'label callback' => FALSE, |
|
| 3033 | + 'arguments' => array( |
|
| 3034 | 3034 | 'user' => array( |
| 3035 | - 'type' => 'user', |
|
| 3036 | - 'label' => 'User', |
|
| 3035 | + 'type' => 'user', |
|
| 3036 | + 'label' => 'User', |
|
| 3037 | + ), |
|
| 3037 | 3038 | ), |
| 3038 | - ), |
|
| 3039 | - 'module' => 'User', |
|
| 3039 | + 'module' => 'User', |
|
| 3040 | 3040 | ), |
| 3041 | 3041 | '#weight' => 0.0, |
| 3042 | - ), |
|
| 3043 | - '1' => array( |
|
| 3042 | + ), |
|
| 3043 | + '1' => array( |
|
| 3044 | 3044 | '#weight' => 0.0, |
| 3045 | 3045 | '0' => array( |
| 3046 | - '#weight' => 0.0, |
|
| 3047 | - '#type' => 'condition', |
|
| 3048 | - '#settings' => array( |
|
| 3046 | + '#weight' => 0.0, |
|
| 3047 | + '#type' => 'condition', |
|
| 3048 | + '#settings' => array( |
|
| 3049 | 3049 | 'type' => array( |
| 3050 | - 'forum' => 'forum', |
|
| 3050 | + 'forum' => 'forum', |
|
| 3051 | 3051 | ), |
| 3052 | 3052 | '#argument map' => array( |
| 3053 | - 'node' => 'node', |
|
| 3053 | + 'node' => 'node', |
|
| 3054 | + ), |
|
| 3054 | 3055 | ), |
| 3055 | - ), |
|
| 3056 | - '#name' => 'rules_condition_content_is_type', |
|
| 3057 | - '#info' => array( |
|
| 3056 | + '#name' => 'rules_condition_content_is_type', |
|
| 3057 | + '#info' => array( |
|
| 3058 | 3058 | 'label' => 'Updated content is Forum topic', |
| 3059 | 3059 | 'arguments' => array( |
| 3060 | - 'node' => array( |
|
| 3060 | + 'node' => array( |
|
| 3061 | 3061 | 'type' => 'node', |
| 3062 | 3062 | 'label' => 'Content', |
| 3063 | - ), |
|
| 3063 | + ), |
|
| 3064 | 3064 | ), |
| 3065 | 3065 | 'module' => 'Node', |
| 3066 | - ), |
|
| 3066 | + ), |
|
| 3067 | 3067 | ), |
| 3068 | 3068 | '#type' => 'OR', |
| 3069 | 3069 | '1' => array( |
| 3070 | - '#type' => 'condition', |
|
| 3071 | - '#settings' => array( |
|
| 3070 | + '#type' => 'condition', |
|
| 3071 | + '#settings' => array( |
|
| 3072 | 3072 | 'type' => array( |
| 3073 | - 'team_forum' => 'team_forum', |
|
| 3073 | + 'team_forum' => 'team_forum', |
|
| 3074 | 3074 | ), |
| 3075 | 3075 | '#argument map' => array( |
| 3076 | - 'node' => 'node', |
|
| 3076 | + 'node' => 'node', |
|
| 3077 | + ), |
|
| 3077 | 3078 | ), |
| 3078 | - ), |
|
| 3079 | - '#name' => 'rules_condition_content_is_type', |
|
| 3080 | - '#info' => array( |
|
| 3079 | + '#name' => 'rules_condition_content_is_type', |
|
| 3080 | + '#info' => array( |
|
| 3081 | 3081 | 'label' => 'Updated content is Team forum topic', |
| 3082 | 3082 | 'arguments' => array( |
| 3083 | - 'node' => array( |
|
| 3083 | + 'node' => array( |
|
| 3084 | 3084 | 'type' => 'node', |
| 3085 | 3085 | 'label' => 'Content', |
| 3086 | - ), |
|
| 3086 | + ), |
|
| 3087 | 3087 | ), |
| 3088 | 3088 | 'module' => 'Node', |
| 3089 | - ), |
|
| 3090 | - '#weight' => 0.0, |
|
| 3089 | + ), |
|
| 3090 | + '#weight' => 0.0, |
|
| 3091 | + ), |
|
| 3091 | 3092 | ), |
| 3092 | - ), |
|
| 3093 | - '3' => array( |
|
| 3093 | + '3' => array( |
|
| 3094 | 3094 | '#weight' => 0.0, |
| 3095 | 3095 | '#info' => array( |
| 3096 | - 'label' => 'PHP code: node content unchanged', |
|
| 3097 | - 'label callback' => FALSE, |
|
| 3098 | - 'module' => 'PHP', |
|
| 3099 | - 'eval input' => array( |
|
| 3096 | + 'label' => 'PHP code: node content unchanged', |
|
| 3097 | + 'label callback' => FALSE, |
|
| 3098 | + 'module' => 'PHP', |
|
| 3099 | + 'eval input' => array( |
|
| 3100 | 3100 | '0' => 'code', |
| 3101 | - ), |
|
| 3101 | + ), |
|
| 3102 | 3102 | ), |
| 3103 | 3103 | '#name' => 'rules_condition_custom_php', |
| 3104 | 3104 | '#settings' => array( |
| 3105 | - 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 3106 | - 'vars' => array( |
|
| 3105 | + 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 3106 | + 'vars' => array( |
|
| 3107 | 3107 | '0' => 'node', |
| 3108 | 3108 | '1' => 'node_unchanged', |
| 3109 | - ), |
|
| 3110 | - '#eval input' => array( |
|
| 3109 | + ), |
|
| 3110 | + '#eval input' => array( |
|
| 3111 | 3111 | 'token_rules_input_evaluator' => array( |
| 3112 | - 'code' => array( |
|
| 3112 | + 'code' => array( |
|
| 3113 | 3113 | '0' => ':global', |
| 3114 | - ), |
|
| 3114 | + ), |
|
| 3115 | + ), |
|
| 3115 | 3116 | ), |
| 3116 | - ), |
|
| 3117 | 3117 | ), |
| 3118 | 3118 | '#type' => 'condition', |
| 3119 | - ), |
|
| 3120 | - '4' => array( |
|
| 3119 | + ), |
|
| 3120 | + '4' => array( |
|
| 3121 | 3121 | '#weight' => 0.0, |
| 3122 | 3122 | '#info' => array( |
| 3123 | - 'label' => 'PHP code: node locked', |
|
| 3124 | - 'label callback' => FALSE, |
|
| 3125 | - 'module' => 'PHP', |
|
| 3126 | - 'eval input' => array( |
|
| 3123 | + 'label' => 'PHP code: node locked', |
|
| 3124 | + 'label callback' => FALSE, |
|
| 3125 | + 'module' => 'PHP', |
|
| 3126 | + 'eval input' => array( |
|
| 3127 | 3127 | '0' => 'code', |
| 3128 | - ), |
|
| 3128 | + ), |
|
| 3129 | 3129 | ), |
| 3130 | 3130 | '#name' => 'rules_condition_custom_php', |
| 3131 | 3131 | '#type' => 'condition', |
| 3132 | 3132 | '#settings' => array( |
| 3133 | - 'code' => 'return $node_unchanged->comment == 2 && $node->comment == 1;', |
|
| 3134 | - 'vars' => array( |
|
| 3133 | + 'code' => 'return $node_unchanged->comment == 2 && $node->comment == 1;', |
|
| 3134 | + 'vars' => array( |
|
| 3135 | 3135 | '0' => 'node', |
| 3136 | 3136 | '1' => 'node_unchanged', |
| 3137 | - ), |
|
| 3138 | - '#eval input' => array( |
|
| 3137 | + ), |
|
| 3138 | + '#eval input' => array( |
|
| 3139 | 3139 | 'token_rules_input_evaluator' => array( |
| 3140 | - 'code' => array( |
|
| 3140 | + 'code' => array( |
|
| 3141 | 3141 | '0' => ':global', |
| 3142 | - ), |
|
| 3142 | + ), |
|
| 3143 | 3143 | ), |
| 3144 | - ), |
|
| 3144 | + ), |
|
| 3145 | + ), |
|
| 3145 | 3146 | ), |
| 3146 | - ), |
|
| 3147 | 3147 | ), |
| 3148 | 3148 | '#actions' => array( |
| 3149 | - '0' => array( |
|
| 3149 | + '0' => array( |
|
| 3150 | 3150 | '#info' => array( |
| 3151 | - 'label' => 'Notify moderators via email', |
|
| 3152 | - 'module' => 'BOINC core', |
|
| 3153 | - 'eval input' => array( |
|
| 3151 | + 'label' => 'Notify moderators via email', |
|
| 3152 | + 'module' => 'BOINC core', |
|
| 3153 | + 'eval input' => array( |
|
| 3154 | 3154 | '0' => 'subject', |
| 3155 | 3155 | '1' => 'message', |
| 3156 | 3156 | '2' => 'from', |
| 3157 | - ), |
|
| 3157 | + ), |
|
| 3158 | 3158 | ), |
| 3159 | 3159 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 3160 | 3160 | '#settings' => array( |
| 3161 | - 'from' => '', |
|
| 3162 | - 'subject' => 'Forum topic at [:global:site-name] locked by moderator/admin', |
|
| 3163 | - 'message' => "[node:type] topic '[node:title]' has been locked by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3164 | - '#eval input' => array( |
|
| 3161 | + 'from' => '', |
|
| 3162 | + 'subject' => 'Forum topic at [:global:site-name] locked by moderator/admin', |
|
| 3163 | + 'message' => "[node:type] topic '[node:title]' has been locked by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3164 | + '#eval input' => array( |
|
| 3165 | 3165 | 'token_rules_input_evaluator' => array( |
| 3166 | - 'subject' => array( |
|
| 3166 | + 'subject' => array( |
|
| 3167 | 3167 | '0' => ':global', |
| 3168 | - ), |
|
| 3169 | - 'message' => array( |
|
| 3168 | + ), |
|
| 3169 | + 'message' => array( |
|
| 3170 | 3170 | '0' => 'node', |
| 3171 | 3171 | '1' => 'user', |
| 3172 | 3172 | '2' => ':global', |
| 3173 | - ), |
|
| 3174 | - 'from' => array( |
|
| 3173 | + ), |
|
| 3174 | + 'from' => array( |
|
| 3175 | 3175 | '0' => ':global', |
| 3176 | - ), |
|
| 3176 | + ), |
|
| 3177 | 3177 | ), |
| 3178 | 3178 | 'rules_input_evaluator_php' => array( |
| 3179 | - 'message' => array( |
|
| 3179 | + 'message' => array( |
|
| 3180 | 3180 | '0' => 'node', |
| 3181 | - ), |
|
| 3181 | + ), |
|
| 3182 | + ), |
|
| 3182 | 3183 | ), |
| 3183 | - ), |
|
| 3184 | 3184 | ), |
| 3185 | 3185 | '#type' => 'action', |
| 3186 | 3186 | '#weight' => 0.0, |
| 3187 | - ), |
|
| 3187 | + ), |
|
| 3188 | 3188 | ), |
| 3189 | 3189 | '#version' => 6003, |
| 3190 | - ), |
|
| 3191 | - 'rules_forum_topic_marked_sticky_by_moderator_admin' => array( |
|
| 3190 | + ), |
|
| 3191 | + 'rules_forum_topic_marked_sticky_by_moderator_admin' => array( |
|
| 3192 | 3192 | '#type' => 'rule', |
| 3193 | 3193 | '#set' => 'event_node_update', |
| 3194 | 3194 | '#label' => 'Forum topic marked sticky by moderator/admin', |
| 3195 | 3195 | '#active' => 1, |
| 3196 | 3196 | '#weight' => '0', |
| 3197 | 3197 | '#categories' => array( |
| 3198 | - '0' => 'boinc_standard', |
|
| 3199 | - '1' => 'moderator notification', |
|
| 3198 | + '0' => 'boinc_standard', |
|
| 3199 | + '1' => 'moderator notification', |
|
| 3200 | 3200 | ), |
| 3201 | 3201 | '#status' => 'default', |
| 3202 | 3202 | '#conditions' => array( |
| 3203 | - '0' => array( |
|
| 3203 | + '0' => array( |
|
| 3204 | 3204 | '#type' => 'condition', |
| 3205 | 3205 | '#settings' => array( |
| 3206 | - 'roles' => array( |
|
| 3206 | + 'roles' => array( |
|
| 3207 | 3207 | '0' => 3519698132, |
| 3208 | 3208 | '1' => 1271379760, |
| 3209 | - ), |
|
| 3210 | - 'operation' => 'OR', |
|
| 3211 | - '#argument map' => array( |
|
| 3209 | + ), |
|
| 3210 | + 'operation' => 'OR', |
|
| 3211 | + '#argument map' => array( |
|
| 3212 | 3212 | 'user' => 'user', |
| 3213 | - ), |
|
| 3213 | + ), |
|
| 3214 | 3214 | ), |
| 3215 | 3215 | '#name' => 'rules_condition_user_hasrole', |
| 3216 | 3216 | '#info' => array( |
| 3217 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 3218 | - 'label callback' => FALSE, |
|
| 3219 | - 'arguments' => array( |
|
| 3217 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 3218 | + 'label callback' => FALSE, |
|
| 3219 | + 'arguments' => array( |
|
| 3220 | 3220 | 'user' => array( |
| 3221 | - 'type' => 'user', |
|
| 3222 | - 'label' => 'User', |
|
| 3221 | + 'type' => 'user', |
|
| 3222 | + 'label' => 'User', |
|
| 3223 | + ), |
|
| 3223 | 3224 | ), |
| 3224 | - ), |
|
| 3225 | - 'module' => 'User', |
|
| 3225 | + 'module' => 'User', |
|
| 3226 | 3226 | ), |
| 3227 | 3227 | '#weight' => 0.0, |
| 3228 | - ), |
|
| 3229 | - '1' => array( |
|
| 3228 | + ), |
|
| 3229 | + '1' => array( |
|
| 3230 | 3230 | '#weight' => 0.0, |
| 3231 | 3231 | '0' => array( |
| 3232 | - '#weight' => 0.0, |
|
| 3233 | - '#type' => 'condition', |
|
| 3234 | - '#settings' => array( |
|
| 3232 | + '#weight' => 0.0, |
|
| 3233 | + '#type' => 'condition', |
|
| 3234 | + '#settings' => array( |
|
| 3235 | 3235 | 'type' => array( |
| 3236 | - 'forum' => 'forum', |
|
| 3236 | + 'forum' => 'forum', |
|
| 3237 | 3237 | ), |
| 3238 | 3238 | '#argument map' => array( |
| 3239 | - 'node' => 'node', |
|
| 3239 | + 'node' => 'node', |
|
| 3240 | + ), |
|
| 3240 | 3241 | ), |
| 3241 | - ), |
|
| 3242 | - '#name' => 'rules_condition_content_is_type', |
|
| 3243 | - '#info' => array( |
|
| 3242 | + '#name' => 'rules_condition_content_is_type', |
|
| 3243 | + '#info' => array( |
|
| 3244 | 3244 | 'label' => 'Updated content is Forum topic', |
| 3245 | 3245 | 'arguments' => array( |
| 3246 | - 'node' => array( |
|
| 3246 | + 'node' => array( |
|
| 3247 | 3247 | 'type' => 'node', |
| 3248 | 3248 | 'label' => 'Content', |
| 3249 | - ), |
|
| 3249 | + ), |
|
| 3250 | 3250 | ), |
| 3251 | 3251 | 'module' => 'Node', |
| 3252 | - ), |
|
| 3252 | + ), |
|
| 3253 | 3253 | ), |
| 3254 | 3254 | '#type' => 'OR', |
| 3255 | 3255 | '1' => array( |
| 3256 | - '#type' => 'condition', |
|
| 3257 | - '#settings' => array( |
|
| 3256 | + '#type' => 'condition', |
|
| 3257 | + '#settings' => array( |
|
| 3258 | 3258 | 'type' => array( |
| 3259 | - 'team_forum' => 'team_forum', |
|
| 3259 | + 'team_forum' => 'team_forum', |
|
| 3260 | 3260 | ), |
| 3261 | 3261 | '#argument map' => array( |
| 3262 | - 'node' => 'node', |
|
| 3262 | + 'node' => 'node', |
|
| 3263 | + ), |
|
| 3263 | 3264 | ), |
| 3264 | - ), |
|
| 3265 | - '#name' => 'rules_condition_content_is_type', |
|
| 3266 | - '#info' => array( |
|
| 3265 | + '#name' => 'rules_condition_content_is_type', |
|
| 3266 | + '#info' => array( |
|
| 3267 | 3267 | 'label' => 'Updated content is Team forum topic', |
| 3268 | 3268 | 'arguments' => array( |
| 3269 | - 'node' => array( |
|
| 3269 | + 'node' => array( |
|
| 3270 | 3270 | 'type' => 'node', |
| 3271 | 3271 | 'label' => 'Content', |
| 3272 | - ), |
|
| 3272 | + ), |
|
| 3273 | 3273 | ), |
| 3274 | 3274 | 'module' => 'Node', |
| 3275 | - ), |
|
| 3276 | - '#weight' => 0.0, |
|
| 3275 | + ), |
|
| 3276 | + '#weight' => 0.0, |
|
| 3277 | + ), |
|
| 3277 | 3278 | ), |
| 3278 | - ), |
|
| 3279 | - '3' => array( |
|
| 3279 | + '3' => array( |
|
| 3280 | 3280 | '#weight' => 0.0, |
| 3281 | 3281 | '#info' => array( |
| 3282 | - 'label' => 'PHP code: node content unchanged', |
|
| 3283 | - 'label callback' => FALSE, |
|
| 3284 | - 'module' => 'PHP', |
|
| 3285 | - 'eval input' => array( |
|
| 3282 | + 'label' => 'PHP code: node content unchanged', |
|
| 3283 | + 'label callback' => FALSE, |
|
| 3284 | + 'module' => 'PHP', |
|
| 3285 | + 'eval input' => array( |
|
| 3286 | 3286 | '0' => 'code', |
| 3287 | - ), |
|
| 3287 | + ), |
|
| 3288 | 3288 | ), |
| 3289 | 3289 | '#name' => 'rules_condition_custom_php', |
| 3290 | 3290 | '#settings' => array( |
| 3291 | - 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 3292 | - 'vars' => array( |
|
| 3291 | + 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 3292 | + 'vars' => array( |
|
| 3293 | 3293 | '0' => 'node', |
| 3294 | 3294 | '1' => 'node_unchanged', |
| 3295 | - ), |
|
| 3296 | - '#eval input' => array( |
|
| 3295 | + ), |
|
| 3296 | + '#eval input' => array( |
|
| 3297 | 3297 | 'token_rules_input_evaluator' => array( |
| 3298 | - 'code' => array( |
|
| 3298 | + 'code' => array( |
|
| 3299 | 3299 | '0' => ':global', |
| 3300 | - ), |
|
| 3300 | + ), |
|
| 3301 | + ), |
|
| 3301 | 3302 | ), |
| 3302 | - ), |
|
| 3303 | 3303 | ), |
| 3304 | 3304 | '#type' => 'condition', |
| 3305 | - ), |
|
| 3306 | - '4' => array( |
|
| 3305 | + ), |
|
| 3306 | + '4' => array( |
|
| 3307 | 3307 | '#weight' => 0.0, |
| 3308 | 3308 | '#info' => array( |
| 3309 | - 'label' => 'PHP code: node made sticky', |
|
| 3310 | - 'label callback' => FALSE, |
|
| 3311 | - 'module' => 'PHP', |
|
| 3312 | - 'eval input' => array( |
|
| 3309 | + 'label' => 'PHP code: node made sticky', |
|
| 3310 | + 'label callback' => FALSE, |
|
| 3311 | + 'module' => 'PHP', |
|
| 3312 | + 'eval input' => array( |
|
| 3313 | 3313 | '0' => 'code', |
| 3314 | - ), |
|
| 3314 | + ), |
|
| 3315 | 3315 | ), |
| 3316 | 3316 | '#name' => 'rules_condition_custom_php', |
| 3317 | 3317 | '#type' => 'condition', |
| 3318 | 3318 | '#settings' => array( |
| 3319 | - 'code' => 'return $node_unchanged->sticky == 0 && $node->sticky == 1;', |
|
| 3320 | - 'vars' => array( |
|
| 3319 | + 'code' => 'return $node_unchanged->sticky == 0 && $node->sticky == 1;', |
|
| 3320 | + 'vars' => array( |
|
| 3321 | 3321 | '0' => 'node', |
| 3322 | 3322 | '1' => 'node_unchanged', |
| 3323 | - ), |
|
| 3324 | - '#eval input' => array( |
|
| 3323 | + ), |
|
| 3324 | + '#eval input' => array( |
|
| 3325 | 3325 | 'token_rules_input_evaluator' => array( |
| 3326 | - 'code' => array( |
|
| 3326 | + 'code' => array( |
|
| 3327 | 3327 | '0' => ':global', |
| 3328 | - ), |
|
| 3328 | + ), |
|
| 3329 | + ), |
|
| 3329 | 3330 | ), |
| 3330 | - ), |
|
| 3331 | 3331 | ), |
| 3332 | - ), |
|
| 3332 | + ), |
|
| 3333 | 3333 | ), |
| 3334 | 3334 | '#actions' => array( |
| 3335 | - '0' => array( |
|
| 3335 | + '0' => array( |
|
| 3336 | 3336 | '#info' => array( |
| 3337 | - 'label' => 'Notify moderators via email', |
|
| 3338 | - 'module' => 'BOINC core', |
|
| 3339 | - 'eval input' => array( |
|
| 3337 | + 'label' => 'Notify moderators via email', |
|
| 3338 | + 'module' => 'BOINC core', |
|
| 3339 | + 'eval input' => array( |
|
| 3340 | 3340 | '0' => 'subject', |
| 3341 | 3341 | '1' => 'message', |
| 3342 | 3342 | '2' => 'from', |
| 3343 | - ), |
|
| 3343 | + ), |
|
| 3344 | 3344 | ), |
| 3345 | 3345 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 3346 | 3346 | '#settings' => array( |
| 3347 | - 'from' => '', |
|
| 3348 | - 'subject' => 'Forum topic at [:global:site-name] marked sticky by moderator/admin', |
|
| 3349 | - 'message' => "[node:type] topic '[node:title]' has been marked sticky by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3350 | - '#eval input' => array( |
|
| 3347 | + 'from' => '', |
|
| 3348 | + 'subject' => 'Forum topic at [:global:site-name] marked sticky by moderator/admin', |
|
| 3349 | + 'message' => "[node:type] topic '[node:title]' has been marked sticky by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3350 | + '#eval input' => array( |
|
| 3351 | 3351 | 'token_rules_input_evaluator' => array( |
| 3352 | - 'subject' => array( |
|
| 3352 | + 'subject' => array( |
|
| 3353 | 3353 | '0' => ':global', |
| 3354 | - ), |
|
| 3355 | - 'message' => array( |
|
| 3354 | + ), |
|
| 3355 | + 'message' => array( |
|
| 3356 | 3356 | '0' => 'node', |
| 3357 | 3357 | '1' => 'user', |
| 3358 | 3358 | '2' => ':global', |
| 3359 | - ), |
|
| 3360 | - 'from' => array( |
|
| 3359 | + ), |
|
| 3360 | + 'from' => array( |
|
| 3361 | 3361 | '0' => ':global', |
| 3362 | - ), |
|
| 3362 | + ), |
|
| 3363 | 3363 | ), |
| 3364 | 3364 | 'rules_input_evaluator_php' => array( |
| 3365 | - 'message' => array( |
|
| 3365 | + 'message' => array( |
|
| 3366 | 3366 | '0' => 'node', |
| 3367 | - ), |
|
| 3367 | + ), |
|
| 3368 | + ), |
|
| 3368 | 3369 | ), |
| 3369 | - ), |
|
| 3370 | 3370 | ), |
| 3371 | 3371 | '#type' => 'action', |
| 3372 | 3372 | '#weight' => 0.0, |
| 3373 | - ), |
|
| 3373 | + ), |
|
| 3374 | 3374 | ), |
| 3375 | 3375 | '#version' => 6003, |
| 3376 | - ), |
|
| 3377 | - 'rules_forum_topic_marked_unsticky_by_moderator_admin' => array( |
|
| 3376 | + ), |
|
| 3377 | + 'rules_forum_topic_marked_unsticky_by_moderator_admin' => array( |
|
| 3378 | 3378 | '#type' => 'rule', |
| 3379 | 3379 | '#set' => 'event_node_update', |
| 3380 | 3380 | '#label' => 'Forum topic marked unsticky by moderator/admin', |
| 3381 | 3381 | '#active' => 1, |
| 3382 | 3382 | '#weight' => '0', |
| 3383 | 3383 | '#categories' => array( |
| 3384 | - '0' => 'boinc_standard', |
|
| 3385 | - '1' => 'moderator notification', |
|
| 3384 | + '0' => 'boinc_standard', |
|
| 3385 | + '1' => 'moderator notification', |
|
| 3386 | 3386 | ), |
| 3387 | 3387 | '#status' => 'default', |
| 3388 | 3388 | '#conditions' => array( |
| 3389 | - '0' => array( |
|
| 3389 | + '0' => array( |
|
| 3390 | 3390 | '#type' => 'condition', |
| 3391 | 3391 | '#settings' => array( |
| 3392 | - 'roles' => array( |
|
| 3392 | + 'roles' => array( |
|
| 3393 | 3393 | '0' => 3519698132, |
| 3394 | 3394 | '1' => 1271379760, |
| 3395 | - ), |
|
| 3396 | - 'operation' => 'OR', |
|
| 3397 | - '#argument map' => array( |
|
| 3395 | + ), |
|
| 3396 | + 'operation' => 'OR', |
|
| 3397 | + '#argument map' => array( |
|
| 3398 | 3398 | 'user' => 'user', |
| 3399 | - ), |
|
| 3399 | + ), |
|
| 3400 | 3400 | ), |
| 3401 | 3401 | '#name' => 'rules_condition_user_hasrole', |
| 3402 | 3402 | '#info' => array( |
| 3403 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 3404 | - 'label callback' => FALSE, |
|
| 3405 | - 'arguments' => array( |
|
| 3403 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 3404 | + 'label callback' => FALSE, |
|
| 3405 | + 'arguments' => array( |
|
| 3406 | 3406 | 'user' => array( |
| 3407 | - 'type' => 'user', |
|
| 3408 | - 'label' => 'User', |
|
| 3407 | + 'type' => 'user', |
|
| 3408 | + 'label' => 'User', |
|
| 3409 | + ), |
|
| 3409 | 3410 | ), |
| 3410 | - ), |
|
| 3411 | - 'module' => 'User', |
|
| 3411 | + 'module' => 'User', |
|
| 3412 | 3412 | ), |
| 3413 | 3413 | '#weight' => 0.0, |
| 3414 | - ), |
|
| 3415 | - '1' => array( |
|
| 3414 | + ), |
|
| 3415 | + '1' => array( |
|
| 3416 | 3416 | '#weight' => 0.0, |
| 3417 | 3417 | '0' => array( |
| 3418 | - '#weight' => 0.0, |
|
| 3419 | - '#type' => 'condition', |
|
| 3420 | - '#settings' => array( |
|
| 3418 | + '#weight' => 0.0, |
|
| 3419 | + '#type' => 'condition', |
|
| 3420 | + '#settings' => array( |
|
| 3421 | 3421 | 'type' => array( |
| 3422 | - 'forum' => 'forum', |
|
| 3422 | + 'forum' => 'forum', |
|
| 3423 | 3423 | ), |
| 3424 | 3424 | '#argument map' => array( |
| 3425 | - 'node' => 'node', |
|
| 3425 | + 'node' => 'node', |
|
| 3426 | + ), |
|
| 3426 | 3427 | ), |
| 3427 | - ), |
|
| 3428 | - '#name' => 'rules_condition_content_is_type', |
|
| 3429 | - '#info' => array( |
|
| 3428 | + '#name' => 'rules_condition_content_is_type', |
|
| 3429 | + '#info' => array( |
|
| 3430 | 3430 | 'label' => 'Updated content is Forum topic', |
| 3431 | 3431 | 'arguments' => array( |
| 3432 | - 'node' => array( |
|
| 3432 | + 'node' => array( |
|
| 3433 | 3433 | 'type' => 'node', |
| 3434 | 3434 | 'label' => 'Content', |
| 3435 | - ), |
|
| 3435 | + ), |
|
| 3436 | 3436 | ), |
| 3437 | 3437 | 'module' => 'Node', |
| 3438 | - ), |
|
| 3438 | + ), |
|
| 3439 | 3439 | ), |
| 3440 | 3440 | '#type' => 'OR', |
| 3441 | 3441 | '1' => array( |
| 3442 | - '#type' => 'condition', |
|
| 3443 | - '#settings' => array( |
|
| 3442 | + '#type' => 'condition', |
|
| 3443 | + '#settings' => array( |
|
| 3444 | 3444 | 'type' => array( |
| 3445 | - 'team_forum' => 'team_forum', |
|
| 3445 | + 'team_forum' => 'team_forum', |
|
| 3446 | 3446 | ), |
| 3447 | 3447 | '#argument map' => array( |
| 3448 | - 'node' => 'node', |
|
| 3448 | + 'node' => 'node', |
|
| 3449 | 3449 | ), |
| 3450 | - ), |
|
| 3451 | - '#name' => 'rules_condition_content_is_type', |
|
| 3452 | - '#info' => array( |
|
| 3450 | + ), |
|
| 3451 | + '#name' => 'rules_condition_content_is_type', |
|
| 3452 | + '#info' => array( |
|
| 3453 | 3453 | 'label' => 'Updated content is Team forum topic', |
| 3454 | 3454 | 'arguments' => array( |
| 3455 | - 'node' => array( |
|
| 3455 | + 'node' => array( |
|
| 3456 | 3456 | 'type' => 'node', |
| 3457 | 3457 | 'label' => 'Content', |
| 3458 | - ), |
|
| 3458 | + ), |
|
| 3459 | 3459 | ), |
| 3460 | 3460 | 'module' => 'Node', |
| 3461 | - ), |
|
| 3462 | - '#weight' => 0.0, |
|
| 3461 | + ), |
|
| 3462 | + '#weight' => 0.0, |
|
| 3463 | 3463 | ), |
| 3464 | - ), |
|
| 3465 | - '3' => array( |
|
| 3464 | + ), |
|
| 3465 | + '3' => array( |
|
| 3466 | 3466 | '#weight' => 0.0, |
| 3467 | 3467 | '#info' => array( |
| 3468 | - 'label' => 'PHP code: node content unchanged', |
|
| 3469 | - 'label callback' => FALSE, |
|
| 3470 | - 'module' => 'PHP', |
|
| 3471 | - 'eval input' => array( |
|
| 3468 | + 'label' => 'PHP code: node content unchanged', |
|
| 3469 | + 'label callback' => FALSE, |
|
| 3470 | + 'module' => 'PHP', |
|
| 3471 | + 'eval input' => array( |
|
| 3472 | 3472 | '0' => 'code', |
| 3473 | - ), |
|
| 3473 | + ), |
|
| 3474 | 3474 | ), |
| 3475 | 3475 | '#name' => 'rules_condition_custom_php', |
| 3476 | 3476 | '#settings' => array( |
| 3477 | - 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 3478 | - 'vars' => array( |
|
| 3477 | + 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 3478 | + 'vars' => array( |
|
| 3479 | 3479 | '0' => 'node', |
| 3480 | 3480 | '1' => 'node_unchanged', |
| 3481 | - ), |
|
| 3482 | - '#eval input' => array( |
|
| 3481 | + ), |
|
| 3482 | + '#eval input' => array( |
|
| 3483 | 3483 | 'token_rules_input_evaluator' => array( |
| 3484 | - 'code' => array( |
|
| 3484 | + 'code' => array( |
|
| 3485 | 3485 | '0' => ':global', |
| 3486 | - ), |
|
| 3486 | + ), |
|
| 3487 | + ), |
|
| 3487 | 3488 | ), |
| 3488 | - ), |
|
| 3489 | 3489 | ), |
| 3490 | 3490 | '#type' => 'condition', |
| 3491 | - ), |
|
| 3492 | - '4' => array( |
|
| 3491 | + ), |
|
| 3492 | + '4' => array( |
|
| 3493 | 3493 | '#weight' => 0.0, |
| 3494 | 3494 | '#info' => array( |
| 3495 | - 'label' => 'PHP code: node made sticky', |
|
| 3496 | - 'label callback' => FALSE, |
|
| 3497 | - 'module' => 'PHP', |
|
| 3498 | - 'eval input' => array( |
|
| 3495 | + 'label' => 'PHP code: node made sticky', |
|
| 3496 | + 'label callback' => FALSE, |
|
| 3497 | + 'module' => 'PHP', |
|
| 3498 | + 'eval input' => array( |
|
| 3499 | 3499 | '0' => 'code', |
| 3500 | - ), |
|
| 3500 | + ), |
|
| 3501 | 3501 | ), |
| 3502 | 3502 | '#name' => 'rules_condition_custom_php', |
| 3503 | 3503 | '#type' => 'condition', |
| 3504 | 3504 | '#settings' => array( |
| 3505 | - 'code' => 'return $node_unchanged->sticky == 1 && $node->sticky == 0;', |
|
| 3506 | - 'vars' => array( |
|
| 3505 | + 'code' => 'return $node_unchanged->sticky == 1 && $node->sticky == 0;', |
|
| 3506 | + 'vars' => array( |
|
| 3507 | 3507 | '0' => 'node', |
| 3508 | 3508 | '1' => 'node_unchanged', |
| 3509 | - ), |
|
| 3510 | - '#eval input' => array( |
|
| 3509 | + ), |
|
| 3510 | + '#eval input' => array( |
|
| 3511 | 3511 | 'token_rules_input_evaluator' => array( |
| 3512 | - 'code' => array( |
|
| 3512 | + 'code' => array( |
|
| 3513 | 3513 | '0' => ':global', |
| 3514 | - ), |
|
| 3514 | + ), |
|
| 3515 | + ), |
|
| 3515 | 3516 | ), |
| 3516 | - ), |
|
| 3517 | 3517 | ), |
| 3518 | - ), |
|
| 3518 | + ), |
|
| 3519 | 3519 | ), |
| 3520 | 3520 | '#actions' => array( |
| 3521 | - '0' => array( |
|
| 3521 | + '0' => array( |
|
| 3522 | 3522 | '#info' => array( |
| 3523 | - 'label' => 'Notify moderators via email', |
|
| 3524 | - 'module' => 'BOINC core', |
|
| 3525 | - 'eval input' => array( |
|
| 3523 | + 'label' => 'Notify moderators via email', |
|
| 3524 | + 'module' => 'BOINC core', |
|
| 3525 | + 'eval input' => array( |
|
| 3526 | 3526 | '0' => 'subject', |
| 3527 | 3527 | '1' => 'message', |
| 3528 | 3528 | '2' => 'from', |
| 3529 | - ), |
|
| 3529 | + ), |
|
| 3530 | 3530 | ), |
| 3531 | 3531 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 3532 | 3532 | '#settings' => array( |
| 3533 | - 'from' => '', |
|
| 3534 | - 'subject' => 'Forum topic at [:global:site-name] marked unsticky by moderator/admin', |
|
| 3535 | - 'message' => "[node:type] topic '[node:title]' has been marked unsticky by moderator/admin [user:display-name].\r\n\\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3536 | - '#eval input' => array( |
|
| 3533 | + 'from' => '', |
|
| 3534 | + 'subject' => 'Forum topic at [:global:site-name] marked unsticky by moderator/admin', |
|
| 3535 | + 'message' => "[node:type] topic '[node:title]' has been marked unsticky by moderator/admin [user:display-name].\r\n\\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3536 | + '#eval input' => array( |
|
| 3537 | 3537 | 'token_rules_input_evaluator' => array( |
| 3538 | - 'subject' => array( |
|
| 3538 | + 'subject' => array( |
|
| 3539 | 3539 | '0' => ':global', |
| 3540 | - ), |
|
| 3541 | - 'message' => array( |
|
| 3540 | + ), |
|
| 3541 | + 'message' => array( |
|
| 3542 | 3542 | '0' => 'node', |
| 3543 | 3543 | '1' => 'user', |
| 3544 | 3544 | '2' => ':global', |
| 3545 | - ), |
|
| 3546 | - 'from' => array( |
|
| 3545 | + ), |
|
| 3546 | + 'from' => array( |
|
| 3547 | 3547 | '0' => ':global', |
| 3548 | - ), |
|
| 3548 | + ), |
|
| 3549 | 3549 | ), |
| 3550 | 3550 | 'rules_input_evaluator_php' => array( |
| 3551 | - 'message' => array( |
|
| 3551 | + 'message' => array( |
|
| 3552 | 3552 | '0' => 'node', |
| 3553 | - ), |
|
| 3553 | + ), |
|
| 3554 | + ), |
|
| 3554 | 3555 | ), |
| 3555 | - ), |
|
| 3556 | 3556 | ), |
| 3557 | 3557 | '#type' => 'action', |
| 3558 | 3558 | '#weight' => 0.0, |
| 3559 | - ), |
|
| 3559 | + ), |
|
| 3560 | 3560 | ), |
| 3561 | 3561 | '#version' => 6003, |
| 3562 | - ), |
|
| 3563 | - 'rules_forum_topic_nenamed_title_by_moderator_or_admin' => array( |
|
| 3562 | + ), |
|
| 3563 | + 'rules_forum_topic_nenamed_title_by_moderator_or_admin' => array( |
|
| 3564 | 3564 | '#type' => 'rule', |
| 3565 | 3565 | '#set' => 'event_node_update', |
| 3566 | 3566 | '#label' => 'Forum topic renamed title by moderator or admin', |
| 3567 | 3567 | '#active' => 1, |
| 3568 | 3568 | '#weight' => '0', |
| 3569 | 3569 | '#categories' => array( |
| 3570 | - '0' => 'boinc_standard', |
|
| 3571 | - '1' => 'moderator notification', |
|
| 3570 | + '0' => 'boinc_standard', |
|
| 3571 | + '1' => 'moderator notification', |
|
| 3572 | 3572 | ), |
| 3573 | 3573 | '#status' => 'default', |
| 3574 | 3574 | '#conditions' => array( |
| 3575 | - '0' => array( |
|
| 3575 | + '0' => array( |
|
| 3576 | 3576 | '#weight' => 0.0, |
| 3577 | 3577 | '#type' => 'condition', |
| 3578 | 3578 | '#settings' => array( |
| 3579 | - 'roles' => array( |
|
| 3579 | + 'roles' => array( |
|
| 3580 | 3580 | '0' => 3519698132, |
| 3581 | 3581 | '1' => 1271379760, |
| 3582 | - ), |
|
| 3583 | - 'operation' => 'OR', |
|
| 3584 | - '#argument map' => array( |
|
| 3582 | + ), |
|
| 3583 | + 'operation' => 'OR', |
|
| 3584 | + '#argument map' => array( |
|
| 3585 | 3585 | 'user' => 'user', |
| 3586 | - ), |
|
| 3586 | + ), |
|
| 3587 | 3587 | ), |
| 3588 | 3588 | '#name' => 'rules_condition_user_hasrole', |
| 3589 | 3589 | '#info' => array( |
| 3590 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 3591 | - 'label callback' => FALSE, |
|
| 3592 | - 'arguments' => array( |
|
| 3590 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 3591 | + 'label callback' => FALSE, |
|
| 3592 | + 'arguments' => array( |
|
| 3593 | 3593 | 'user' => array( |
| 3594 | - 'type' => 'user', |
|
| 3595 | - 'label' => 'User', |
|
| 3594 | + 'type' => 'user', |
|
| 3595 | + 'label' => 'User', |
|
| 3596 | + ), |
|
| 3596 | 3597 | ), |
| 3597 | - ), |
|
| 3598 | - 'module' => 'User', |
|
| 3598 | + 'module' => 'User', |
|
| 3599 | + ), |
|
| 3599 | 3600 | ), |
| 3600 | - ), |
|
| 3601 | - '1' => array( |
|
| 3601 | + '1' => array( |
|
| 3602 | 3602 | '#weight' => 0.0, |
| 3603 | 3603 | '0' => array( |
| 3604 | - '#weight' => 0.0, |
|
| 3605 | - '#info' => array( |
|
| 3604 | + '#weight' => 0.0, |
|
| 3605 | + '#info' => array( |
|
| 3606 | 3606 | 'label' => 'Updated content is Forum topic', |
| 3607 | 3607 | 'arguments' => array( |
| 3608 | - 'node' => array( |
|
| 3608 | + 'node' => array( |
|
| 3609 | 3609 | 'type' => 'node', |
| 3610 | 3610 | 'label' => 'Content', |
| 3611 | - ), |
|
| 3611 | + ), |
|
| 3612 | 3612 | ), |
| 3613 | 3613 | 'module' => 'Node', |
| 3614 | - ), |
|
| 3615 | - '#name' => 'rules_condition_content_is_type', |
|
| 3616 | - '#settings' => array( |
|
| 3614 | + ), |
|
| 3615 | + '#name' => 'rules_condition_content_is_type', |
|
| 3616 | + '#settings' => array( |
|
| 3617 | 3617 | 'type' => array( |
| 3618 | - 'forum' => 'forum', |
|
| 3618 | + 'forum' => 'forum', |
|
| 3619 | 3619 | ), |
| 3620 | 3620 | '#argument map' => array( |
| 3621 | - 'node' => 'node', |
|
| 3621 | + 'node' => 'node', |
|
| 3622 | + ), |
|
| 3622 | 3623 | ), |
| 3623 | - ), |
|
| 3624 | - '#type' => 'condition', |
|
| 3624 | + '#type' => 'condition', |
|
| 3625 | 3625 | ), |
| 3626 | 3626 | '#type' => 'OR', |
| 3627 | 3627 | '1' => array( |
| 3628 | - '#type' => 'condition', |
|
| 3629 | - '#settings' => array( |
|
| 3628 | + '#type' => 'condition', |
|
| 3629 | + '#settings' => array( |
|
| 3630 | 3630 | 'type' => array( |
| 3631 | - 'team_forum' => 'team_forum', |
|
| 3631 | + 'team_forum' => 'team_forum', |
|
| 3632 | 3632 | ), |
| 3633 | 3633 | '#argument map' => array( |
| 3634 | - 'node' => 'node', |
|
| 3634 | + 'node' => 'node', |
|
| 3635 | 3635 | ), |
| 3636 | - ), |
|
| 3637 | - '#name' => 'rules_condition_content_is_type', |
|
| 3638 | - '#info' => array( |
|
| 3636 | + ), |
|
| 3637 | + '#name' => 'rules_condition_content_is_type', |
|
| 3638 | + '#info' => array( |
|
| 3639 | 3639 | 'label' => 'Updated content is Team forum topic', |
| 3640 | 3640 | 'arguments' => array( |
| 3641 | - 'node' => array( |
|
| 3641 | + 'node' => array( |
|
| 3642 | 3642 | 'type' => 'node', |
| 3643 | 3643 | 'label' => 'Content', |
| 3644 | - ), |
|
| 3644 | + ), |
|
| 3645 | 3645 | ), |
| 3646 | 3646 | 'module' => 'Node', |
| 3647 | - ), |
|
| 3648 | - '#weight' => 0.0, |
|
| 3647 | + ), |
|
| 3648 | + '#weight' => 0.0, |
|
| 3649 | 3649 | ), |
| 3650 | - ), |
|
| 3651 | - '2' => array( |
|
| 3650 | + ), |
|
| 3651 | + '2' => array( |
|
| 3652 | 3652 | '#weight' => 0.0, |
| 3653 | 3653 | '#info' => array( |
| 3654 | - 'label' => 'PHP code: title changed', |
|
| 3655 | - 'label callback' => FALSE, |
|
| 3656 | - 'module' => 'PHP', |
|
| 3657 | - 'eval input' => array( |
|
| 3654 | + 'label' => 'PHP code: title changed', |
|
| 3655 | + 'label callback' => FALSE, |
|
| 3656 | + 'module' => 'PHP', |
|
| 3657 | + 'eval input' => array( |
|
| 3658 | 3658 | '0' => 'code', |
| 3659 | - ), |
|
| 3659 | + ), |
|
| 3660 | 3660 | ), |
| 3661 | 3661 | '#name' => 'rules_condition_custom_php', |
| 3662 | 3662 | '#settings' => array( |
| 3663 | - 'code' => 'return ($node->title != $node_unchanged->title);', |
|
| 3664 | - 'vars' => array( |
|
| 3663 | + 'code' => 'return ($node->title != $node_unchanged->title);', |
|
| 3664 | + 'vars' => array( |
|
| 3665 | 3665 | '0' => 'node', |
| 3666 | 3666 | '1' => 'node_unchanged', |
| 3667 | - ), |
|
| 3668 | - '#eval input' => array( |
|
| 3667 | + ), |
|
| 3668 | + '#eval input' => array( |
|
| 3669 | 3669 | 'token_rules_input_evaluator' => array( |
| 3670 | - 'code' => array( |
|
| 3670 | + 'code' => array( |
|
| 3671 | 3671 | '0' => ':global', |
| 3672 | - ), |
|
| 3672 | + ), |
|
| 3673 | + ), |
|
| 3673 | 3674 | ), |
| 3674 | - ), |
|
| 3675 | 3675 | ), |
| 3676 | 3676 | '#type' => 'condition', |
| 3677 | - ), |
|
| 3677 | + ), |
|
| 3678 | 3678 | ), |
| 3679 | 3679 | '#actions' => array( |
| 3680 | - '0' => array( |
|
| 3680 | + '0' => array( |
|
| 3681 | 3681 | '#type' => 'action', |
| 3682 | 3682 | '#settings' => array( |
| 3683 | - 'from' => '', |
|
| 3684 | - 'subject' => 'Forum topic at [:global:site-name] renamed by moderator/admin', |
|
| 3685 | - 'message' => "[node:type] topic '[node:title]' has its title renamed by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3686 | - '#eval input' => array( |
|
| 3683 | + 'from' => '', |
|
| 3684 | + 'subject' => 'Forum topic at [:global:site-name] renamed by moderator/admin', |
|
| 3685 | + 'message' => "[node:type] topic '[node:title]' has its title renamed by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3686 | + '#eval input' => array( |
|
| 3687 | 3687 | 'token_rules_input_evaluator' => array( |
| 3688 | - 'subject' => array( |
|
| 3688 | + 'subject' => array( |
|
| 3689 | 3689 | '0' => ':global', |
| 3690 | - ), |
|
| 3691 | - 'message' => array( |
|
| 3690 | + ), |
|
| 3691 | + 'message' => array( |
|
| 3692 | 3692 | '0' => 'node', |
| 3693 | 3693 | '1' => 'user', |
| 3694 | 3694 | '2' => ':global', |
| 3695 | - ), |
|
| 3696 | - 'from' => array( |
|
| 3695 | + ), |
|
| 3696 | + 'from' => array( |
|
| 3697 | 3697 | '0' => ':global', |
| 3698 | - ), |
|
| 3698 | + ), |
|
| 3699 | 3699 | ), |
| 3700 | 3700 | 'rules_input_evaluator_php' => array( |
| 3701 | - 'message' => array( |
|
| 3701 | + 'message' => array( |
|
| 3702 | 3702 | '0' => 'node', |
| 3703 | - ), |
|
| 3703 | + ), |
|
| 3704 | + ), |
|
| 3704 | 3705 | ), |
| 3705 | - ), |
|
| 3706 | 3706 | ), |
| 3707 | 3707 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 3708 | 3708 | '#info' => array( |
| 3709 | - 'label' => 'Notify moderators via email', |
|
| 3710 | - 'module' => 'BOINC core', |
|
| 3711 | - 'eval input' => array( |
|
| 3709 | + 'label' => 'Notify moderators via email', |
|
| 3710 | + 'module' => 'BOINC core', |
|
| 3711 | + 'eval input' => array( |
|
| 3712 | 3712 | '0' => 'subject', |
| 3713 | 3713 | '1' => 'message', |
| 3714 | 3714 | '2' => 'from', |
| 3715 | - ), |
|
| 3715 | + ), |
|
| 3716 | 3716 | ), |
| 3717 | 3717 | '#weight' => 0.0, |
| 3718 | - ), |
|
| 3718 | + ), |
|
| 3719 | 3719 | ), |
| 3720 | 3720 | '#version' => 6003, |
| 3721 | - ), |
|
| 3722 | - 'rules_forum_topic_unlocked_by_moderator_admin' => array( |
|
| 3721 | + ), |
|
| 3722 | + 'rules_forum_topic_unlocked_by_moderator_admin' => array( |
|
| 3723 | 3723 | '#type' => 'rule', |
| 3724 | 3724 | '#set' => 'event_node_update', |
| 3725 | 3725 | '#label' => 'Forum topic unlocked by moderator/admin', |
| 3726 | 3726 | '#active' => 1, |
| 3727 | 3727 | '#weight' => '0', |
| 3728 | 3728 | '#categories' => array( |
| 3729 | - '0' => 'boinc_standard', |
|
| 3730 | - '1' => 'moderator notification', |
|
| 3729 | + '0' => 'boinc_standard', |
|
| 3730 | + '1' => 'moderator notification', |
|
| 3731 | 3731 | ), |
| 3732 | 3732 | '#status' => 'default', |
| 3733 | 3733 | '#conditions' => array( |
| 3734 | - '0' => array( |
|
| 3734 | + '0' => array( |
|
| 3735 | 3735 | '#type' => 'condition', |
| 3736 | 3736 | '#settings' => array( |
| 3737 | - 'roles' => array( |
|
| 3737 | + 'roles' => array( |
|
| 3738 | 3738 | '0' => 3519698132, |
| 3739 | 3739 | '1' => 1271379760, |
| 3740 | - ), |
|
| 3741 | - 'operation' => 'OR', |
|
| 3742 | - '#argument map' => array( |
|
| 3740 | + ), |
|
| 3741 | + 'operation' => 'OR', |
|
| 3742 | + '#argument map' => array( |
|
| 3743 | 3743 | 'user' => 'user', |
| 3744 | - ), |
|
| 3744 | + ), |
|
| 3745 | 3745 | ), |
| 3746 | 3746 | '#name' => 'rules_condition_user_hasrole', |
| 3747 | 3747 | '#info' => array( |
| 3748 | - 'label' => 'User has role(s): administrator or moderator', |
|
| 3749 | - 'label callback' => FALSE, |
|
| 3750 | - 'arguments' => array( |
|
| 3748 | + 'label' => 'User has role(s): administrator or moderator', |
|
| 3749 | + 'label callback' => FALSE, |
|
| 3750 | + 'arguments' => array( |
|
| 3751 | 3751 | 'user' => array( |
| 3752 | - 'type' => 'user', |
|
| 3753 | - 'label' => 'User', |
|
| 3752 | + 'type' => 'user', |
|
| 3753 | + 'label' => 'User', |
|
| 3754 | + ), |
|
| 3754 | 3755 | ), |
| 3755 | - ), |
|
| 3756 | - 'module' => 'User', |
|
| 3756 | + 'module' => 'User', |
|
| 3757 | 3757 | ), |
| 3758 | 3758 | '#weight' => 0.0, |
| 3759 | - ), |
|
| 3760 | - '1' => array( |
|
| 3759 | + ), |
|
| 3760 | + '1' => array( |
|
| 3761 | 3761 | '#weight' => 0.0, |
| 3762 | 3762 | '0' => array( |
| 3763 | - '#weight' => 0.0, |
|
| 3764 | - '#type' => 'condition', |
|
| 3765 | - '#settings' => array( |
|
| 3763 | + '#weight' => 0.0, |
|
| 3764 | + '#type' => 'condition', |
|
| 3765 | + '#settings' => array( |
|
| 3766 | 3766 | 'type' => array( |
| 3767 | - 'forum' => 'forum', |
|
| 3767 | + 'forum' => 'forum', |
|
| 3768 | 3768 | ), |
| 3769 | 3769 | '#argument map' => array( |
| 3770 | - 'node' => 'node', |
|
| 3770 | + 'node' => 'node', |
|
| 3771 | + ), |
|
| 3771 | 3772 | ), |
| 3772 | - ), |
|
| 3773 | - '#name' => 'rules_condition_content_is_type', |
|
| 3774 | - '#info' => array( |
|
| 3773 | + '#name' => 'rules_condition_content_is_type', |
|
| 3774 | + '#info' => array( |
|
| 3775 | 3775 | 'label' => 'Updated content is Forum topic', |
| 3776 | 3776 | 'arguments' => array( |
| 3777 | - 'node' => array( |
|
| 3777 | + 'node' => array( |
|
| 3778 | 3778 | 'type' => 'node', |
| 3779 | 3779 | 'label' => 'Content', |
| 3780 | - ), |
|
| 3780 | + ), |
|
| 3781 | 3781 | ), |
| 3782 | 3782 | 'module' => 'Node', |
| 3783 | - ), |
|
| 3783 | + ), |
|
| 3784 | 3784 | ), |
| 3785 | 3785 | '#type' => 'OR', |
| 3786 | 3786 | '1' => array( |
| 3787 | - '#type' => 'condition', |
|
| 3788 | - '#settings' => array( |
|
| 3787 | + '#type' => 'condition', |
|
| 3788 | + '#settings' => array( |
|
| 3789 | 3789 | 'type' => array( |
| 3790 | - 'team_forum' => 'team_forum', |
|
| 3790 | + 'team_forum' => 'team_forum', |
|
| 3791 | 3791 | ), |
| 3792 | 3792 | '#argument map' => array( |
| 3793 | - 'node' => 'node', |
|
| 3793 | + 'node' => 'node', |
|
| 3794 | + ), |
|
| 3794 | 3795 | ), |
| 3795 | - ), |
|
| 3796 | - '#name' => 'rules_condition_content_is_type', |
|
| 3797 | - '#info' => array( |
|
| 3796 | + '#name' => 'rules_condition_content_is_type', |
|
| 3797 | + '#info' => array( |
|
| 3798 | 3798 | 'label' => 'Updated content is Team forum topic', |
| 3799 | 3799 | 'arguments' => array( |
| 3800 | - 'node' => array( |
|
| 3800 | + 'node' => array( |
|
| 3801 | 3801 | 'type' => 'node', |
| 3802 | 3802 | 'label' => 'Content', |
| 3803 | - ), |
|
| 3803 | + ), |
|
| 3804 | 3804 | ), |
| 3805 | 3805 | 'module' => 'Node', |
| 3806 | - ), |
|
| 3807 | - '#weight' => 0.0, |
|
| 3806 | + ), |
|
| 3807 | + '#weight' => 0.0, |
|
| 3808 | 3808 | ), |
| 3809 | - ), |
|
| 3810 | - '3' => array( |
|
| 3809 | + ), |
|
| 3810 | + '3' => array( |
|
| 3811 | 3811 | '#weight' => 0.0, |
| 3812 | 3812 | '#info' => array( |
| 3813 | - 'label' => 'PHP code: node content unchanged', |
|
| 3814 | - 'label callback' => FALSE, |
|
| 3815 | - 'module' => 'PHP', |
|
| 3816 | - 'eval input' => array( |
|
| 3813 | + 'label' => 'PHP code: node content unchanged', |
|
| 3814 | + 'label callback' => FALSE, |
|
| 3815 | + 'module' => 'PHP', |
|
| 3816 | + 'eval input' => array( |
|
| 3817 | 3817 | '0' => 'code', |
| 3818 | - ), |
|
| 3818 | + ), |
|
| 3819 | 3819 | ), |
| 3820 | 3820 | '#name' => 'rules_condition_custom_php', |
| 3821 | 3821 | '#settings' => array( |
| 3822 | - 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 3823 | - 'vars' => array( |
|
| 3822 | + 'code' => 'return $node->body == $node_unchanged->body;', |
|
| 3823 | + 'vars' => array( |
|
| 3824 | 3824 | '0' => 'node', |
| 3825 | 3825 | '1' => 'node_unchanged', |
| 3826 | - ), |
|
| 3827 | - '#eval input' => array( |
|
| 3826 | + ), |
|
| 3827 | + '#eval input' => array( |
|
| 3828 | 3828 | 'token_rules_input_evaluator' => array( |
| 3829 | - 'code' => array( |
|
| 3829 | + 'code' => array( |
|
| 3830 | 3830 | '0' => ':global', |
| 3831 | - ), |
|
| 3831 | + ), |
|
| 3832 | + ), |
|
| 3832 | 3833 | ), |
| 3833 | - ), |
|
| 3834 | 3834 | ), |
| 3835 | 3835 | '#type' => 'condition', |
| 3836 | - ), |
|
| 3837 | - '4' => array( |
|
| 3836 | + ), |
|
| 3837 | + '4' => array( |
|
| 3838 | 3838 | '#weight' => 0.0, |
| 3839 | 3839 | '#info' => array( |
| 3840 | - 'label' => 'PHP code: node unlocked', |
|
| 3841 | - 'label callback' => FALSE, |
|
| 3842 | - 'module' => 'PHP', |
|
| 3843 | - 'eval input' => array( |
|
| 3840 | + 'label' => 'PHP code: node unlocked', |
|
| 3841 | + 'label callback' => FALSE, |
|
| 3842 | + 'module' => 'PHP', |
|
| 3843 | + 'eval input' => array( |
|
| 3844 | 3844 | '0' => 'code', |
| 3845 | - ), |
|
| 3845 | + ), |
|
| 3846 | 3846 | ), |
| 3847 | 3847 | '#name' => 'rules_condition_custom_php', |
| 3848 | 3848 | '#type' => 'condition', |
| 3849 | 3849 | '#settings' => array( |
| 3850 | - 'code' => 'return $node_unchanged->comment == 1 && $node->comment == 2;', |
|
| 3851 | - 'vars' => array( |
|
| 3850 | + 'code' => 'return $node_unchanged->comment == 1 && $node->comment == 2;', |
|
| 3851 | + 'vars' => array( |
|
| 3852 | 3852 | '0' => 'node', |
| 3853 | 3853 | '1' => 'node_unchanged', |
| 3854 | - ), |
|
| 3855 | - '#eval input' => array( |
|
| 3854 | + ), |
|
| 3855 | + '#eval input' => array( |
|
| 3856 | 3856 | 'token_rules_input_evaluator' => array( |
| 3857 | - 'code' => array( |
|
| 3857 | + 'code' => array( |
|
| 3858 | 3858 | '0' => ':global', |
| 3859 | - ), |
|
| 3859 | + ), |
|
| 3860 | 3860 | ), |
| 3861 | - ), |
|
| 3861 | + ), |
|
| 3862 | + ), |
|
| 3862 | 3863 | ), |
| 3863 | - ), |
|
| 3864 | 3864 | ), |
| 3865 | 3865 | '#actions' => array( |
| 3866 | - '0' => array( |
|
| 3866 | + '0' => array( |
|
| 3867 | 3867 | '#info' => array( |
| 3868 | - 'label' => 'Notify moderators via email', |
|
| 3869 | - 'module' => 'BOINC core', |
|
| 3870 | - 'eval input' => array( |
|
| 3868 | + 'label' => 'Notify moderators via email', |
|
| 3869 | + 'module' => 'BOINC core', |
|
| 3870 | + 'eval input' => array( |
|
| 3871 | 3871 | '0' => 'subject', |
| 3872 | 3872 | '1' => 'message', |
| 3873 | 3873 | '2' => 'from', |
| 3874 | - ), |
|
| 3874 | + ), |
|
| 3875 | 3875 | ), |
| 3876 | 3876 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 3877 | 3877 | '#settings' => array( |
| 3878 | - 'from' => '', |
|
| 3879 | - 'subject' => 'Forum topic at [:global:site-name] unlocked by moderator/admin', |
|
| 3880 | - 'message' => "[node:type] topic '[node:title]' has been unlocked by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3881 | - '#eval input' => array( |
|
| 3878 | + 'from' => '', |
|
| 3879 | + 'subject' => 'Forum topic at [:global:site-name] unlocked by moderator/admin', |
|
| 3880 | + 'message' => "[node:type] topic '[node:title]' has been unlocked by moderator/admin [user:display-name].\r\n\r\nLink: <?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>", |
|
| 3881 | + '#eval input' => array( |
|
| 3882 | 3882 | 'token_rules_input_evaluator' => array( |
| 3883 | - 'subject' => array( |
|
| 3883 | + 'subject' => array( |
|
| 3884 | 3884 | '0' => ':global', |
| 3885 | - ), |
|
| 3886 | - 'message' => array( |
|
| 3885 | + ), |
|
| 3886 | + 'message' => array( |
|
| 3887 | 3887 | '0' => 'node', |
| 3888 | 3888 | '1' => 'user', |
| 3889 | 3889 | '2' => ':global', |
| 3890 | - ), |
|
| 3891 | - 'from' => array( |
|
| 3890 | + ), |
|
| 3891 | + 'from' => array( |
|
| 3892 | 3892 | '0' => ':global', |
| 3893 | - ), |
|
| 3893 | + ), |
|
| 3894 | 3894 | ), |
| 3895 | 3895 | 'rules_input_evaluator_php' => array( |
| 3896 | - 'message' => array( |
|
| 3896 | + 'message' => array( |
|
| 3897 | 3897 | '0' => 'node', |
| 3898 | - ), |
|
| 3898 | + ), |
|
| 3899 | + ), |
|
| 3899 | 3900 | ), |
| 3900 | - ), |
|
| 3901 | 3901 | ), |
| 3902 | 3902 | '#type' => 'action', |
| 3903 | 3903 | '#weight' => 0.0, |
| 3904 | - ), |
|
| 3904 | + ), |
|
| 3905 | 3905 | ), |
| 3906 | 3906 | '#version' => 6003, |
| 3907 | - ), |
|
| 3908 | - 'rules_offensive_comment_reported' => array( |
|
| 3907 | + ), |
|
| 3908 | + 'rules_offensive_comment_reported' => array( |
|
| 3909 | 3909 | '#type' => 'rule', |
| 3910 | 3910 | '#set' => 'event_flag_flagged_abuse_comment', |
| 3911 | 3911 | '#label' => 'Offensive comment reported', |
| 3912 | 3912 | '#active' => 1, |
| 3913 | 3913 | '#weight' => '0', |
| 3914 | 3914 | '#categories' => array( |
| 3915 | - '0' => 'moderator notification', |
|
| 3916 | - '1' => 'boinc_standard', |
|
| 3915 | + '0' => 'moderator notification', |
|
| 3916 | + '1' => 'boinc_standard', |
|
| 3917 | 3917 | ), |
| 3918 | 3918 | '#status' => 'default', |
| 3919 | 3919 | '#conditions' => array(), |
| 3920 | 3920 | '#actions' => array( |
| 3921 | - '1' => array( |
|
| 3921 | + '1' => array( |
|
| 3922 | 3922 | '#info' => array( |
| 3923 | - 'label' => 'Notify moderators via email', |
|
| 3924 | - 'module' => 'BOINC core', |
|
| 3925 | - 'eval input' => array( |
|
| 3923 | + 'label' => 'Notify moderators via email', |
|
| 3924 | + 'module' => 'BOINC core', |
|
| 3925 | + 'eval input' => array( |
|
| 3926 | 3926 | '0' => 'subject', |
| 3927 | 3927 | '1' => 'message', |
| 3928 | 3928 | '2' => 'from', |
| 3929 | - ), |
|
| 3929 | + ), |
|
| 3930 | 3930 | ), |
| 3931 | 3931 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 3932 | 3932 | '#settings' => array( |
| 3933 | - 'from' => '', |
|
| 3934 | - 'subject' => 'Report of offensive [node:type] comment at [:global:site-name]', |
|
| 3935 | - 'message' => "[flagging_user:display-name] has reported the following comment on [node:type] content as being offensive or inappropriate for the [:global:site-name] site:\r\n\r\n<?php print url('<front>', array('absolute' => TRUE, 'language' => 'en')); ?>/goto/comment/[comment:comment-cid]\r\n\r\nTotal reports of this comment: [comment:flag-abuse-comment-count]", |
|
| 3936 | - '#eval input' => array( |
|
| 3933 | + 'from' => '', |
|
| 3934 | + 'subject' => 'Report of offensive [node:type] comment at [:global:site-name]', |
|
| 3935 | + 'message' => "[flagging_user:display-name] has reported the following comment on [node:type] content as being offensive or inappropriate for the [:global:site-name] site:\r\n\r\n<?php print url('<front>', array('absolute' => TRUE, 'language' => 'en')); ?>/goto/comment/[comment:comment-cid]\r\n\r\nTotal reports of this comment: [comment:flag-abuse-comment-count]", |
|
| 3936 | + '#eval input' => array( |
|
| 3937 | 3937 | 'token_rules_input_evaluator' => array( |
| 3938 | - 'subject' => array( |
|
| 3938 | + 'subject' => array( |
|
| 3939 | 3939 | '0' => 'node', |
| 3940 | 3940 | '1' => ':global', |
| 3941 | - ), |
|
| 3942 | - 'message' => array( |
|
| 3941 | + ), |
|
| 3942 | + 'message' => array( |
|
| 3943 | 3943 | '0' => 'flagging_user', |
| 3944 | 3944 | '1' => 'comment', |
| 3945 | 3945 | '2' => 'node', |
| 3946 | 3946 | '3' => ':global', |
| 3947 | - ), |
|
| 3948 | - 'from' => array( |
|
| 3947 | + ), |
|
| 3948 | + 'from' => array( |
|
| 3949 | 3949 | '0' => ':global', |
| 3950 | - ), |
|
| 3950 | + ), |
|
| 3951 | 3951 | ), |
| 3952 | 3952 | 'rules_input_evaluator_php' => array( |
| 3953 | - 'message' => array(), |
|
| 3953 | + 'message' => array(), |
|
| 3954 | + ), |
|
| 3954 | 3955 | ), |
| 3955 | - ), |
|
| 3956 | 3956 | ), |
| 3957 | 3957 | '#type' => 'action', |
| 3958 | 3958 | '#weight' => 0.0, |
| 3959 | - ), |
|
| 3959 | + ), |
|
| 3960 | 3960 | ), |
| 3961 | 3961 | '#version' => 6003, |
| 3962 | - ), |
|
| 3963 | - 'rules_offensive_content_reported' => array( |
|
| 3962 | + ), |
|
| 3963 | + 'rules_offensive_content_reported' => array( |
|
| 3964 | 3964 | '#type' => 'rule', |
| 3965 | 3965 | '#set' => 'event_flag_flagged_abuse_node', |
| 3966 | 3966 | '#label' => 'Offensive content reported', |
| 3967 | 3967 | '#active' => 1, |
| 3968 | 3968 | '#weight' => '0', |
| 3969 | 3969 | '#categories' => array( |
| 3970 | - '0' => 'moderator notification', |
|
| 3971 | - 'boinc_standard' => 'boinc_standard', |
|
| 3970 | + '0' => 'moderator notification', |
|
| 3971 | + 'boinc_standard' => 'boinc_standard', |
|
| 3972 | 3972 | ), |
| 3973 | 3973 | '#status' => 'default', |
| 3974 | 3974 | '#conditions' => array(), |
| 3975 | 3975 | '#actions' => array( |
| 3976 | - '1' => array( |
|
| 3976 | + '1' => array( |
|
| 3977 | 3977 | '#type' => 'action', |
| 3978 | 3978 | '#settings' => array( |
| 3979 | - 'from' => '', |
|
| 3980 | - 'subject' => 'Report of offensive [node:type] content at [:global:site-name]', |
|
| 3981 | - 'message' => "[flagging_user:display-name] has reported the following [node:type] content as being offensive or inappropriate for the [:global:site-name] site:\r\n\r\n<?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>\r\n\r\nTotal reports of this content: [node:flag-abuse-node-count]", |
|
| 3982 | - '#eval input' => array( |
|
| 3979 | + 'from' => '', |
|
| 3980 | + 'subject' => 'Report of offensive [node:type] content at [:global:site-name]', |
|
| 3981 | + 'message' => "[flagging_user:display-name] has reported the following [node:type] content as being offensive or inappropriate for the [:global:site-name] site:\r\n\r\n<?php print url('node/' . \$node->nid, array('absolute' => TRUE, 'language' => 'en')); ?>\r\n\r\nTotal reports of this content: [node:flag-abuse-node-count]", |
|
| 3982 | + '#eval input' => array( |
|
| 3983 | 3983 | 'token_rules_input_evaluator' => array( |
| 3984 | - 'subject' => array( |
|
| 3984 | + 'subject' => array( |
|
| 3985 | 3985 | '0' => 'node', |
| 3986 | 3986 | '1' => ':global', |
| 3987 | - ), |
|
| 3988 | - 'message' => array( |
|
| 3987 | + ), |
|
| 3988 | + 'message' => array( |
|
| 3989 | 3989 | '0' => 'flagging_user', |
| 3990 | 3990 | '1' => 'node', |
| 3991 | 3991 | '2' => ':global', |
| 3992 | - ), |
|
| 3993 | - 'from' => array( |
|
| 3992 | + ), |
|
| 3993 | + 'from' => array( |
|
| 3994 | 3994 | '0' => ':global', |
| 3995 | - ), |
|
| 3995 | + ), |
|
| 3996 | 3996 | ), |
| 3997 | 3997 | 'rules_input_evaluator_php' => array( |
| 3998 | - 'message' => array( |
|
| 3998 | + 'message' => array( |
|
| 3999 | 3999 | '0' => 'node', |
| 4000 | - ), |
|
| 4000 | + ), |
|
| 4001 | + ), |
|
| 4001 | 4002 | ), |
| 4002 | - ), |
|
| 4003 | 4003 | ), |
| 4004 | 4004 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 4005 | 4005 | '#info' => array( |
| 4006 | - 'label' => 'Notify moderators via email', |
|
| 4007 | - 'module' => 'BOINC core', |
|
| 4008 | - 'eval input' => array( |
|
| 4006 | + 'label' => 'Notify moderators via email', |
|
| 4007 | + 'module' => 'BOINC core', |
|
| 4008 | + 'eval input' => array( |
|
| 4009 | 4009 | '0' => 'subject', |
| 4010 | 4010 | '1' => 'message', |
| 4011 | 4011 | '2' => 'from', |
| 4012 | - ), |
|
| 4012 | + ), |
|
| 4013 | 4013 | ), |
| 4014 | 4014 | '#weight' => 0.0, |
| 4015 | - ), |
|
| 4015 | + ), |
|
| 4016 | 4016 | ), |
| 4017 | 4017 | '#version' => 6003, |
| 4018 | - ), |
|
| 4019 | - 'rules_offensive_user_reported' => array( |
|
| 4018 | + ), |
|
| 4019 | + 'rules_offensive_user_reported' => array( |
|
| 4020 | 4020 | '#type' => 'rule', |
| 4021 | 4021 | '#set' => 'event_flag_flagged_abuse_user', |
| 4022 | 4022 | '#label' => 'Offensive user reported', |
| 4023 | 4023 | '#active' => 1, |
| 4024 | 4024 | '#weight' => '0', |
| 4025 | 4025 | '#categories' => array( |
| 4026 | - '0' => 'moderator notification', |
|
| 4027 | - 'boinc_standard' => 'boinc_standard', |
|
| 4026 | + '0' => 'moderator notification', |
|
| 4027 | + 'boinc_standard' => 'boinc_standard', |
|
| 4028 | 4028 | ), |
| 4029 | 4029 | '#status' => 'default', |
| 4030 | 4030 | '#conditions' => array(), |
| 4031 | 4031 | '#actions' => array( |
| 4032 | - '1' => array( |
|
| 4032 | + '1' => array( |
|
| 4033 | 4033 | '#type' => 'action', |
| 4034 | 4034 | '#settings' => array( |
| 4035 | - 'from' => '', |
|
| 4036 | - 'subject' => 'Report of offensive user at [:global:site-name]', |
|
| 4037 | - 'message' => "[flagging_user:display-name] has reported [account:display-name] for inappropriate behavior:\r\n\r\n<?php print url(\'<front>\', array(\'absolute\' => TRUE, \'language\' => \'en\')); ?>/account/[account:uid]\r\n\r\nTotal current reports of this user: [account:flag-abuse-user-count]", |
|
| 4038 | - '#eval input' => array( |
|
| 4035 | + 'from' => '', |
|
| 4036 | + 'subject' => 'Report of offensive user at [:global:site-name]', |
|
| 4037 | + 'message' => "[flagging_user:display-name] has reported [account:display-name] for inappropriate behavior:\r\n\r\n<?php print url(\'<front>\', array(\'absolute\' => TRUE, \'language\' => \'en\')); ?>/account/[account:uid]\r\n\r\nTotal current reports of this user: [account:flag-abuse-user-count]", |
|
| 4038 | + '#eval input' => array( |
|
| 4039 | 4039 | 'token_rules_input_evaluator' => array( |
| 4040 | - 'subject' => array( |
|
| 4040 | + 'subject' => array( |
|
| 4041 | 4041 | '0' => ':global', |
| 4042 | - ), |
|
| 4043 | - 'message' => array( |
|
| 4042 | + ), |
|
| 4043 | + 'message' => array( |
|
| 4044 | 4044 | '0' => 'flagging_user', |
| 4045 | 4045 | '1' => 'account', |
| 4046 | 4046 | '2' => ':global', |
| 4047 | - ), |
|
| 4048 | - 'from' => array( |
|
| 4047 | + ), |
|
| 4048 | + 'from' => array( |
|
| 4049 | 4049 | '0' => ':global', |
| 4050 | - ), |
|
| 4050 | + ), |
|
| 4051 | 4051 | ), |
| 4052 | 4052 | 'rules_input_evaluator_php' => array( |
| 4053 | - 'message' => array(), |
|
| 4053 | + 'message' => array(), |
|
| 4054 | + ), |
|
| 4054 | 4055 | ), |
| 4055 | - ), |
|
| 4056 | 4056 | ), |
| 4057 | 4057 | '#name' => 'boinccore_rules_action_mail_to_moderators', |
| 4058 | 4058 | '#info' => array( |
| 4059 | - 'label' => 'Notify moderators via email', |
|
| 4060 | - 'module' => 'BOINC core', |
|
| 4061 | - 'eval input' => array( |
|
| 4059 | + 'label' => 'Notify moderators via email', |
|
| 4060 | + 'module' => 'BOINC core', |
|
| 4061 | + 'eval input' => array( |
|
| 4062 | 4062 | '0' => 'subject', |
| 4063 | 4063 | '1' => 'message', |
| 4064 | 4064 | '2' => 'from', |
| 4065 | - ), |
|
| 4065 | + ), |
|
| 4066 | 4066 | ), |
| 4067 | 4067 | '#weight' => 0.0, |
| 4068 | - ), |
|
| 4068 | + ), |
|
| 4069 | 4069 | ), |
| 4070 | 4070 | '#version' => 6003, |
| 4071 | - ), |
|
| 4071 | + ), |
|
| 4072 | 4072 | ), |
| 4073 | - ); |
|
| 4073 | + ); |
|
| 4074 | 4074 | } |
| 4075 | 4075 | |
| 4076 | 4076 | /** |
| 4077 | 4077 | * Implementation of hook_views_api(). |
| 4078 | 4078 | */ |
| 4079 | 4079 | function boinc_standard_views_api() { |
| 4080 | - return array( |
|
| 4080 | + return array( |
|
| 4081 | 4081 | 'api' => '2', |
| 4082 | - ); |
|
| 4082 | + ); |
|
| 4083 | 4083 | } |