Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for elastic skin #36

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions authres_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function init()
$this->add_hook('storage_init', array($this, 'storage_init'));
$this->add_hook('messages_list', array($this, 'messages_list'));
$this->add_hook('message_headers_output', array($this, 'message_headers'));
$this->add_hook('template_object_messagesummary', array($this, 'message_summary'));

$dont_override = $rcmail->config->get('dont_override', array());

Expand Down Expand Up @@ -229,8 +230,7 @@ public function messages_list($p)
return $p;
}

public function message_headers($p)
{
private function populate_message_headers($p){
/* We only have to check the headers once and this method is executed more than once,
/* so let's cache the result
*/
Expand All @@ -240,13 +240,22 @@ public function message_headers($p)
$show_statuses = (int)rcmail::get_instance()->config->get('show_statuses');
$this->img_status = $this->get_authentication_status($p['headers'], $show_statuses, (int)$_GET["_uid"]);
}
}
public function message_headers($p)
{
$this->populate_message_headers($p);

$p['output']['from']['value'] = $this->img_status . $p['output']['from']['value'];
$p['output']['from']['html'] = true;

return $p;
}

public function message_summary($p){
$this->populate_message_headers($GLOBALS['MESSAGE']);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didnt look this up in the docs but is using $GLOBALS really required?

return array('content' => preg_replace('/(<span>\s*)()(From)/', '$1' . $this->img_status . ' $3', $p['content']));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at the comment/regex provided by @photoninger

}

/* See https://tools.ietf.org/html/rfc5451
*/
public function rfc5451_extract_authresheader($headers)
Expand Down
2 changes: 1 addition & 1 deletion localization/en_CA.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $labels['invalidsignature'] = 'Signature is not valid! verified by ';
$labels['for'] = 'for';
$labels['by'] = 'by';

$labels['section_title'] = 'Authenticaton Status';
$labels['section_title'] = 'Authentication Status';
$labels['column_title'] = 'Auth. Result';

$labels['title_enable_column'] = 'Enable Column';
Expand Down
2 changes: 1 addition & 1 deletion localization/en_GB.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $labels['invalidsignature'] = 'Signature is not valid! verified by ';
$labels['for'] = 'for';
$labels['by'] = 'by';

$labels['section_title'] = 'Authenticaton Status';
$labels['section_title'] = 'Authentication Status';
$labels['column_title'] = 'Auth. Result';

$labels['title_enable_column'] = 'Enable Column';
Expand Down
2 changes: 1 addition & 1 deletion localization/en_NZ.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $labels['invalidsignature'] = 'Signature is not valid! verified by ';
$labels['for'] = 'for';
$labels['by'] = 'by';

$labels['section_title'] = 'Authenticaton Status';
$labels['section_title'] = 'Authentication Status';
$labels['column_title'] = 'Auth. Result';

$labels['title_enable_column'] = 'Enable Column';
Expand Down
2 changes: 1 addition & 1 deletion localization/en_US.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $labels['invalidsignature'] = 'Signature is not valid! verified by ';
$labels['for'] = 'for';
$labels['by'] = 'by';

$labels['section_title'] = 'Authenticaton Status';
$labels['section_title'] = 'Authentication Status';
$labels['column_title'] = 'Auth. Result';

$labels['title_enable_column'] = 'Enable Column';
Expand Down
36 changes: 36 additions & 0 deletions skins/elastic/authres_status.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.listing.iconized tr.authres_status>td.section:before {
content: url(badge.png);
}

.webkit .messagelist tr > .authres_status
{
width: 20px;
}

.messagelist tr > .authres_status {
width: 20px;
padding: 2px 3px;
text-align: center;
}

.messagelist tr > .authres_status span {
display: inline-block;
vertical-align: middle;
background: url(badge.png) center no-repeat;
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
}

.widescreen .authres-status-img {
position: relative;
top: -1px;
height: 12px;
width: 12px;
}
Binary file added skins/elastic/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.