function _shoutbox_get_links in Shoutbox 7.2
Same name and namespace in other branches
- 5 shoutbox.module \_shoutbox_get_links()
- 6.2 shoutbox.module \_shoutbox_get_links()
- 6 shoutbox.module \_shoutbox_get_links()
- 7 shoutbox.module \_shoutbox_get_links()
Returns an array containing the possible actions for the current user based on permissions and shout. The actions are edit, delete, moderate.
Parameters
shout: The shout for which we are testing permissions.
Return value
Array of themed actions.
1 call to _shoutbox_get_links()
- shoutbox_display_posts in ./
shoutbox.module - Output existing shoutbox posts as html.
File
- ./
shoutbox.module, line 855 - Shoutbox module displays a block for users to create short messages for the whole site. Uses AHAH to update the database and display content.
Code
function _shoutbox_get_links($shout) {
global $user;
$shoutlinks = array();
// TODO - this is not a theme, stop treating it as such
$links = theme('shoutbox_links');
// Get array of links.
if (_shoutbox_user_access('edit own shouts', $shout)) {
$shoutlinks[] = $links['edit'];
}
if (_shoutbox_user_access('delete own shouts', $shout)) {
$shoutlinks[] = $links['delete'];
}
if (_shoutbox_user_access('moderate shoutbox', $shout)) {
if ($shout->moderate == 0) {
$shoutlinks[] = $links['unpublish'];
}
else {
$shoutlinks[] = $links['publish'];
}
}
return $shoutlinks;
}