? Drupal-differentiate-content-markers.patch
? Drupal-differentiate-content-markers2.patch
? Drupal-differentiate-content-markers3.patch
? Drupal-differentiate-content-markers4.patch
? Drupal-differentiate-content-markers5.patch
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.222
diff -u -r1.222 theme.inc
--- includes/theme.inc 27 Jan 2005 12:57:08 -0000 1.222
+++ includes/theme.inc 29 Jan 2005 22:12:09 -0000
@@ -12,6 +12,19 @@
* @see themeable
*/
+ /**
+ * @name Content markers
+ * @{
+ * Markers used by theme_mark() and node_mark() to designate content.
+ * @see theme_mark(), node_mark()
+ */
+define('MARK_READ', 0);
+define('MARK_NEW', 1);
+define('MARK_UPDATED', 2);
+/**
+ * @} End of "Content markers".
+ */
+
/**
* Hook Help - returns theme specific help and information.
*
@@ -522,7 +535,7 @@
function theme_form_element($title, $value, $description = NULL, $id = NULL, $required = FALSE, $error = FALSE) {
$output = "
\n";
- $required = $required ? theme('mark', 'required') : '';
+ $required = $required ? '
*' : '';
if ($title) {
if ($id) {
@@ -695,16 +708,20 @@
}
/**
- * Return a themed marker, useful for marking new comments or required form
- * elements.
+ * Return a themed marker, useful for marking new or updated
+ * content.
*
* @param $type
- * Type of marker to return: 'new' or 'required'
+ * Number representing the marker type to display
+ * @see MARK_NEW, MARK_UPDATED, MARK_READ
* @return
* A string containing the marker.
*/
-function theme_mark($type = 'new') {
- return '
*';
+function theme_mark($type = MARK_NEW) {
+ global $user;
+ if ($user->uid && $type != MARK_READ) {
+ return '
*';
+ }
}
/**
Index: misc/drupal.css
===================================================================
RCS file: /cvs/drupal/drupal/misc/drupal.css,v
retrieving revision 1.93
diff -u -r1.93 drupal.css
--- misc/drupal.css 25 Jan 2005 20:27:09 -0000 1.93
+++ misc/drupal.css 29 Jan 2005 22:12:09 -0000
@@ -154,7 +154,7 @@
.form-submit {
margin: 0.5em 0;
}
-.marker {
+.marker, .form-required {
color: #f00;
}
.more-link {
Index: modules/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment.module,v
retrieving revision 1.329
diff -u -r1.329 comment.module
--- modules/comment.module 27 Jan 2005 12:57:08 -0000 1.329
+++ modules/comment.module 29 Jan 2005 22:12:11 -0000
@@ -1017,7 +1017,7 @@
while ($comment = db_fetch_object($result)) {
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
$rows[] = array(
- l($comment->subject, "node/$comment->nid", array('title' => htmlspecialchars(truncate_utf8($comment->comment, 128))), NULL, "comment-$comment->cid") ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme('mark', 'new') : ''),
+ l($comment->subject, "node/$comment->nid", array('title' => htmlspecialchars(truncate_utf8($comment->comment, 128))), NULL, "comment-$comment->cid") ." ". theme('mark', node_mark($comment->nid, $comment->timestamp)),
format_name($comment),
($comment->status == 0 ? t('Published') : t('Not published')),
format_date($comment->timestamp, 'small'),
@@ -1428,8 +1428,7 @@
// Emit selectors:
$output = '';
- if (node_is_new($comment->nid, $comment->timestamp)) {
- $comment->new = 1;
+ if (($comment->new = node_mark($comment->nid, $comment->timestamp)) != MARK_READ) {
$output .= "
\n";
}
@@ -1549,7 +1548,7 @@
function theme_comment($comment, $links = 0) {
$output = "