| 1 |
<?php |
<?php |
| 2 |
// $Id: comment_revisions.module,v 1.40 2008/06/14 08:23:43 Raiden Exp $ |
// $Id: comment_revisions.module,v 1.42 2008/06/14 11:19:06 Raiden Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Complete module for comment_revisions |
* Complete module for comment_revisions |
| 293 |
|
|
| 294 |
/** |
/** |
| 295 |
* creates an overview of revisions for cid |
* creates an overview of revisions for cid |
|
* with permission "view own revisions" |
|
|
*/ |
|
|
function comment_revisions_overview_own($cid) { |
|
|
global $user; |
|
|
$creator = $user->uid; |
|
|
echo "ELLO"; |
|
|
comment_revisions_overview($cid, $creator); |
|
|
} |
|
|
/** |
|
|
* creates an overview of revisions for cid |
|
| 296 |
*/ |
*/ |
| 297 |
function comment_revisions_overview($cid) { |
function comment_revisions_overview($cid) { |
| 298 |
global $user; |
global $user; |
| 326 |
$row[] = $tempar; |
$row[] = $tempar; |
| 327 |
$rows[] = array_merge($row, $operations); |
$rows[] = array_merge($row, $operations); |
| 328 |
} |
} |
| 329 |
|
|
| 330 |
$header = array(t('Revision'), array('data' => t('Operations'), 'colspan' => 2)); |
$header = array(t('Revision'), array('data' => t('Operations'), 'colspan' => 2)); |
| 331 |
return theme('table', $header, $rows); |
/* create back link */ |
| 332 |
|
$path = "node/" ._comment_revisions_getnid($cid); |
| 333 |
|
$pathfragment = "comment-". $cid; |
| 334 |
|
$attributes = array(); |
| 335 |
|
$query = NULL; |
| 336 |
|
$output = l(t("Back to comment"), $path , $attributes, $query, $pathfragment); |
| 337 |
|
$output .= theme('table', $header, $rows); |
| 338 |
|
return $output; |
| 339 |
} |
} |
| 340 |
|
|
| 341 |
/** |
/** |
| 448 |
*/ |
*/ |
| 449 |
function _comment_revision_get_actual_revision($cid) { |
function _comment_revision_get_actual_revision($cid) { |
| 450 |
return db_result(db_query("SELECT vid FROM {comment_revisions_actual} WHERE cid=%d", $cid)); |
return db_result(db_query("SELECT vid FROM {comment_revisions_actual} WHERE cid=%d", $cid)); |
| 451 |
|
} |
| 452 |
|
|
| 453 |
|
/** |
| 454 |
|
* returns nid of cid |
| 455 |
|
*/ |
| 456 |
|
function _comment_revisions_getnid($cid) { |
| 457 |
|
return db_result(db_query("SELECT nid FROM {comments} WHERE cid=%d", $cid)); |
| 458 |
} |
} |