diff --git a/include/class.thread.php b/include/class.thread.php index b1e8445211bb52ce6f19d8700dffd12ab0758432..21ac9336cde18cdf3cfe4631aee13b09e436f731 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -594,6 +594,7 @@ implements TemplateVariable { const FLAG_COLLABORATOR = 0x0020; // Message from collaborator const FLAG_BALANCED = 0x0040; // HTML does not need to be balanced on ::display() + const FLAG_SYSTEM = 0x0080; // Entry is a system note. const PERM_EDIT = 'thread.edit'; @@ -871,6 +872,10 @@ implements TemplateVariable { return $this->set('flags', $this->get('flags') | $flag); } + function isSystem() { + return $this->hasFlag(self::FLAG_SYSTEM); + } + //Web uploads - caller is expected to format, validate and set any errors. function uploadFiles($files) { @@ -1361,6 +1366,10 @@ implements TemplateVariable { // The current codebase properly balances html $entry->flags |= self::FLAG_BALANCED; + // Flag system messages + if (!($vars['staffId'] || $vars['userId'])) + $entry->flags |= self::FLAG_SYSTEM; + if (!isset($vars['attachments']) || !$vars['attachments']) // Otherwise, body will be configured in a block below (after // inline attachments are saved and updated in the database) diff --git a/include/staff/templates/thread-entry.tmpl.php b/include/staff/templates/thread-entry.tmpl.php index 4a86b68ee0f17bffd1c9647c8fca4bae081a2731..eeec47f8b85e2c4cfeb0c2f37fc8dfbc03e86ee8 100644 --- a/include/staff/templates/thread-entry.tmpl.php +++ b/include/staff/templates/thread-entry.tmpl.php @@ -5,9 +5,9 @@ $name = $user ? $user->getName() : $entry->poster; $avatar = ''; if ($user) $avatar = $user->getAvatar(); - ?> -<div class="thread-entry <?php echo $entryTypes[$entry->type]; ?> <?php if ($avatar) echo 'avatar'; ?>"> +<div class="thread-entry <?php + echo $entry->isSystem() ? 'system' : $entryTypes[$entry->type]; ?> <?php if ($avatar) echo 'avatar'; ?>"> <?php if ($avatar) { ?> <span class="<?php echo ($entry->type == 'M') ? 'pull-right' : 'pull-left'; ?> avatar"> <?php echo $avatar; ?> @@ -51,7 +51,8 @@ if ($user) </span> </div> <?php - echo sprintf(__('<b>%s</b> posted %s'), $name, + echo sprintf(__('<b>%s</b> posted %s'), + $entry->isSystem() ? __('SYSTEM') : $name, sprintf('<a name="entry-%d" href="#entry-%1$s"><time class="relative" datetime="%s" title="%s">%s</time></a>', $entry->id, date(DateTime::W3C, Misc::db2gmtime($entry->created)), diff --git a/scp/css/scp.css b/scp/css/scp.css index 73c0e0029ce6eee6905006512fd2b9abf8ca2ba9..d487797241bd860f90d5ba51bfd9babe32304666 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -1001,9 +1001,10 @@ img.avatar { border-left: none; border-right: 8px solid #CCC; } -.thread-entry.note:not(.avatar) .header { +.thread-entry.system .header { background-color: #f4f4f4; } + .thread-entry.avatar.response .header:before { border-right-color: #ccb3af; }