| 1 |
<?php |
<?php |
| 2 |
// $Id: flag_content.module,v 1.6.2.12.2.2 2008/05/03 14:46:42 kbahey Exp $ |
// $Id: flag_content.module,v 1.6.2.12.2.3 2008/06/01 04:50:24 kbahey Exp $ |
| 3 |
|
|
| 4 |
// Copyright 2006-2007 Khalid Baheyeldin http://2bits.com |
// Copyright 2006-2007 Khalid Baheyeldin http://2bits.com |
| 5 |
|
|
| 491 |
} |
} |
| 492 |
|
|
| 493 |
function theme_flag_content_mail($entry = NULL, $type = FLAG_CONTENT_TYPE_NODE, $name, $mail, $reason) { |
function theme_flag_content_mail($entry = NULL, $type = FLAG_CONTENT_TYPE_NODE, $name, $mail, $reason) { |
| 494 |
global $user, $base_url; |
global $user; |
| 495 |
switch ($type) { |
switch ($type) { |
| 496 |
case FLAG_CONTENT_TYPE_NODE: |
case FLAG_CONTENT_TYPE_NODE: |
| 497 |
$title = $entry->title; |
$title = $entry->title; |
| 498 |
$eid = $entry->nid; |
$eid = $entry->nid; |
| 499 |
$path = "$type/$eid"; |
$path = url("$type/$eid", NULL, NULL, 1); |
| 500 |
break; |
break; |
| 501 |
case FLAG_CONTENT_TYPE_USER: |
case FLAG_CONTENT_TYPE_USER: |
| 502 |
$title = $entry->name; |
$title = $entry->name; |
| 503 |
$eid = $entry->uid; |
$eid = $entry->uid; |
| 504 |
$path = "$type/$eid"; |
$path = url("$type/$eid", NULL, NULL, 1); |
| 505 |
break; |
break; |
| 506 |
case FLAG_CONTENT_TYPE_COMMENT: |
case FLAG_CONTENT_TYPE_COMMENT: |
| 507 |
$title = $entry->subject; |
$title = $entry->subject; |
| 508 |
$eid = $entry->cid; |
$eid = $entry->cid; |
| 509 |
$path = url('node/' . $entry->nid, NULL, NULL, 0) . "#comment-" . $entry->cid; |
$path = url('node/' . $entry->nid, NULL, NULL, 1) . "#comment-" . $entry->cid; |
| 510 |
break; |
break; |
| 511 |
} |
} |
| 512 |
|
|
| 513 |
if ($user->uid) { |
if ($user->uid) { |
| 514 |
$user_url = $base_url . base_path() . "user/$user->uid"; |
$user_url = url("user/$user->uid", NULL, NULL, 1); |
| 515 |
} |
} |
| 516 |
else { |
else { |
| 517 |
$user_url = t('n/a'); |
$user_url = t('n/a'); |
| 525 |
)); |
)); |
| 526 |
$body .= t("\nItem: @title (@entry_url)", array( |
$body .= t("\nItem: @title (@entry_url)", array( |
| 527 |
'@title' => $title, |
'@title' => $title, |
| 528 |
'@entry_url' => $base_url . base_path() . $path, |
'@entry_url' => $path, |
| 529 |
)); |
)); |
| 530 |
$body .= t("\nReason: @reason", array( |
$body .= t("\nReason: @reason", array( |
| 531 |
'@reason' => $reason, |
'@reason' => $reason, |
| 532 |
)); |
)); |
| 533 |
$body .= t("\n\nManage the flagged items list at @manage", array( |
$body .= t("\n\nManage the flagged items list at @manage", array( |
| 534 |
'@manage' => $base_url . base_path() . 'admin/content/flag_content', |
'@manage' => url('admin/content/flag_content', NULL, NULL, 1), |
| 535 |
)); |
)); |
| 536 |
|
|
| 537 |
$to = check_plain($to); |
$to = check_plain($to); |