| 1 |
<?php |
<?php |
| 2 |
// $Id: shoutbox.module,v 1.18.2.24 2008/07/29 09:05:00 disterics Exp $ |
// $Id: shoutbox.module,v 1.18.2.25 2008/08/01 07:22:07 disterics Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 286 |
*/ |
*/ |
| 287 |
function theme_shoutbox_links() { |
function theme_shoutbox_links() { |
| 288 |
$links['edit']['action'] = 'edit'; |
$links['edit']['action'] = 'edit'; |
| 289 |
$links['edit']['title'] = 'Edit Shout'; |
$links['edit']['title'] = 'Edit'; |
| 290 |
$links['edit']['img'] = base_path() . drupal_get_path('module', 'shoutbox') .'/icon_edit.gif'; |
$links['edit']['attributes'] = array("class" => "edit-shout"); |
|
$links['edit']['img_width'] = 15; |
|
|
$links['edit']['img_height'] = 15; |
|
| 291 |
$links['delete']['action'] = 'delete'; |
$links['delete']['action'] = 'delete'; |
| 292 |
$links['delete']['title'] = 'Delete Shout'; |
$links['delete']['title'] = 'Delete'; |
| 293 |
$links['delete']['img'] = base_path() . drupal_get_path('module', 'shoutbox') .'/icon_delete.gif'; |
$links['delete']['attributes'] = array("class" => "delete-shout"); |
|
$links['delete']['img_width'] = 15; |
|
|
$links['delete']['img_height'] = 15; |
|
| 294 |
$links['publish']['action'] = 'publish'; |
$links['publish']['action'] = 'publish'; |
| 295 |
$links['publish']['title'] = 'Publish'; |
$links['publish']['title'] = 'Publish'; |
| 296 |
$links['publish']['img'] = base_path() . drupal_get_path('module', 'shoutbox') .'/thumb_up.gif'; |
$links['publish']['attributes'] = array("class" => "publish-shout"); |
|
$links['publish']['img_width'] = 15; |
|
|
$links['publish']['img_height'] = 15; |
|
| 297 |
$links['unpublish']['action'] = 'unpublish'; |
$links['unpublish']['action'] = 'unpublish'; |
| 298 |
$links['unpublish']['title'] = 'Unpublish'; |
$links['unpublish']['title'] = 'Unpublish'; |
| 299 |
$links['unpublish']['img'] = base_path() . drupal_get_path('module', 'shoutbox') .'/thumb_down.gif'; |
$links['unpublish']['attributes'] = array("class" => "unpublish-shout"); |
|
$links['unpublish']['img_width'] = 15; |
|
|
$links['unpublish']['img_height'] = 15; |
|
| 300 |
|
|
| 301 |
return $links; |
return $links; |
| 302 |
} |
} |
| 334 |
|
|
| 335 |
if ($links) { |
if ($links) { |
| 336 |
foreach ($links as $link) { |
foreach ($links as $link) { |
| 337 |
$linkattributes = $link['linkattributes']; |
$linkattributes = $link['attributes']; |
| 338 |
$link_html = '<img src="'. $link['img'] .'" width="'. $link['img_width'] .'" height="'. $link['img_height'] .'" alt="'. $link['title'] .'" class="shoutbox-imglink">'; |
$link_html = $link['title']; |
| 339 |
$link_url = 'shoutbox/'. $shout->shout_id .'/'. $link['action']; |
$link_url = 'shoutbox/'. $shout->shout_id .'/'. $link['action']; |
| 340 |
$img_links = l($link_html, $link_url, array(), NULL, NULL, FALSE, TRUE) . $img_links; |
$action_links = l($link_html, $link_url, $linkattributes, NULL, NULL, FALSE, TRUE) . $action_links; |
| 341 |
|
|
| 342 |
} |
} |
| 343 |
} |
} |
| 345 |
$title = 'Posted '. format_date($shout->created, 'custom', 'm/d/y') .' at '. format_date($shout->created, 'custom', 'h:ia') .' by '. $shout->username; |
$title = 'Posted '. format_date($shout->created, 'custom', 'm/d/y') .' at '. format_date($shout->created, 'custom', 'h:ia') .' by '. $shout->username; |
| 346 |
$shout_classes="shoutbox-msg "; |
$shout_classes="shoutbox-msg "; |
| 347 |
if ($alter_row_color) { |
if ($alter_row_color) { |
| 348 |
$shout_classes .= (($shout->color) ? ("shout-odd ") : ("shout-even ")); |
$shout_classes .= (($shout->color) ? ("shoutbox-odd ") : ("shoutbox-even ")); |
| 349 |
} |
} |
| 350 |
if ($shout->moderate == 1) { |
if ($shout->moderate == 1) { |
| 351 |
$shout_classes .= "shoutbox-unpublished "; |
$shout_classes .= "shoutbox-unpublished "; |
| 352 |
} |
} |
| 353 |
return "<div class=\" $shout_classes \" title=\"$title\">$img_links<b>$shout->url</b>: $shout->shout</div>\n"; |
return "<div class=\" $shout_classes \" title=\"$title\"><span class=\"actions\">$action_links</span> <span class=\"shout\"><b>$shout->url</b>: $shout->shout</span></div>\n"; |
| 354 |
} |
} |
| 355 |
|
|
| 356 |
/** |
/** |