Skip to content

Commit

Permalink
! Action menu was disabled when viewing a guest post. I'm not sure wh…
Browse files Browse the repository at this point in the history
…y I did this at all, but let's say it was an oversight, and hope it doesn't break something else... Apparently it's working fine. (Display.php)
  • Loading branch information
Nao committed Nov 12, 2014
1 parent 5ab1c8c commit d424bb0
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions core/app/Display.php
Expand Up @@ -1437,48 +1437,45 @@ function prepareDisplayContext($reset = false)
}

// Bit longer, but this should be helpful too... The per-post menu.
if ($output['member']['id'] != 0)
{
$menu = array();
$menu = array();

// Maybe we can approve it, maybe we should?
if ($output['can_approve'])
$menu[] = 'ap';
// Maybe we can approve it, maybe we should?
if ($output['can_approve'])
$menu[] = 'ap';

// How about... even... remove it entirely?!
if ($output['can_remove'])
$menu[] = 're';
// How about... even... remove it entirely?!
if ($output['can_remove'])
$menu[] = 're';

// What about splitting it off the rest of the topic?
if ($context['can_split'] && !empty($context['real_num_replies']))
$menu[] = 'sp';
// What about splitting it off the rest of the topic?
if ($context['can_split'] && !empty($context['real_num_replies']))
$menu[] = 'sp';

// Can we merge this post to the previous one? (Normally requires same author)
if ($output['can_mergeposts'])
$menu[] = 'me/' . $output['last_post_id'];
// Can we merge this post to the previous one? (Normally requires same author)
if ($output['can_mergeposts'])
$menu[] = 'me/' . $output['last_post_id'];

// Can we restore topics?
if ($context['can_restore_msg'])
$menu[] = 'rs';
// Can we restore topics?
if ($context['can_restore_msg'])
$menu[] = 'rs';

if ($context['can_report_moderator'] && !$is_me)
$menu[] = 'rp';
if ($context['can_report_moderator'] && !$is_me)
$menu[] = 'rp';

if ($context['can_issue_warning'] && !$is_me && !$output['member']['is_guest'])
$menu[] = 'wa/' . $output['member']['id'];
if ($context['can_issue_warning'] && !$is_me && !$output['member']['is_guest'])
$menu[] = 'wa/' . $output['member']['id'];

if ($ignore && !$is_me)
$menu[] = ($output['is_ignored'] ? 'ri' : 'ai') . '/' . $output['member']['id'];
if ($ignore && !$is_me && !$output['member']['is_guest'])
$menu[] = ($output['is_ignored'] ? 'ri' : 'ai') . '/' . $output['member']['id'];

// If we can't do anything, it's not even worth recording the last message ID...
if (!empty($menu))
{
$context['mini_menu']['action'][$output['id']] = $menu;
$amenu = array();
foreach ($menu as $mid => $name)
$amenu[substr($name, 0, 2)] = true;
$context['mini_menu_items_show']['action'] += $amenu;
}
// If we can't do anything, it's not even worth recording the last message ID...
if (!empty($menu))
{
$context['mini_menu']['action'][$output['id']] = $menu;
$amenu = array();
foreach ($menu as $mid => $name)
$amenu[substr($name, 0, 2)] = true;
$context['mini_menu_items_show']['action'] += $amenu;
}

// Don't forget to set this to true in the following hook if you're going to add a non-menu button.
Expand Down

0 comments on commit d424bb0

Please sign in to comment.