function _shoutbox_get_links in Shoutbox 6
Same name and namespace in other branches
- 5 shoutbox.module \_shoutbox_get_links()
- 6.2 shoutbox.module \_shoutbox_get_links()
- 7.2 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.
2 calls to _shoutbox_get_links()
- shoutbox_add_form_submit in ./
shoutbox.module - Handles submission of a shout. Handles both ajax submission and regular form submission.
- _shoutbox_display_posts in ./
shoutbox.module - Output existing shoutbox posts as html. Used by shoutbox_get_view.
File
- ./
shoutbox.module, line 946 - shoutbox module displays a block for users to create short messages for thw whole site. Uses AHAH to update the database and display content.
Code
function _shoutbox_get_links($shout) {
global $user;
$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;
}