| 1 |
<?php |
<?php |
| 2 |
// $Id: shoutbox.module,v 1.25.2.17 2008/07/29 09:05:21 disterics Exp $ |
// $Id: shoutbox.module,v 1.25.2.18 2008/08/01 07:21:25 disterics Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 253 |
*/ |
*/ |
| 254 |
function theme_shoutbox_links() { |
function theme_shoutbox_links() { |
| 255 |
$links['edit']['action'] = 'edit'; |
$links['edit']['action'] = 'edit'; |
| 256 |
$links['edit']['title'] = 'Edit Shout'; |
$links['edit']['title'] = 'Edit'; |
| 257 |
$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; |
|
| 258 |
$links['delete']['action'] = 'delete'; |
$links['delete']['action'] = 'delete'; |
| 259 |
$links['delete']['title'] = 'Delete Shout'; |
$links['delete']['title'] = 'Delete'; |
| 260 |
$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; |
|
| 261 |
$links['publish']['action'] = 'publish'; |
$links['publish']['action'] = 'publish'; |
| 262 |
$links['publish']['title'] = 'Publish'; |
$links['publish']['title'] = 'Publish'; |
| 263 |
$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; |
|
| 264 |
$links['unpublish']['action'] = 'unpublish'; |
$links['unpublish']['action'] = 'unpublish'; |
| 265 |
$links['unpublish']['title'] = 'Unpublish'; |
$links['unpublish']['title'] = 'Unpublish'; |
| 266 |
$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; |
|
| 267 |
|
|
| 268 |
return $links; |
return $links; |
| 269 |
} |
} |
| 301 |
|
|
| 302 |
if ($links) { |
if ($links) { |
| 303 |
foreach ($links as $link) { |
foreach ($links as $link) { |
| 304 |
$linkattributes = $link['linkattributes']; |
$linkattributes = $link['attributes']; |
| 305 |
$link_html = '<img src="'. $link['img'] .'" width="'. $link['img_width'] .'" height="'. $link['img_height'] .'" alt="'. $link['title'] .'" class="shoutbox-imglink">'; |
$link_html = $link['title']; |
| 306 |
$link_url = 'shoutbox/'. $shout->shout_id .'/'. $link['action']; |
$link_url = 'shoutbox/'. $shout->shout_id .'/'. $link['action']; |
| 307 |
$img_links = l($link_html, $link_url, array('html' => TRUE)) . $img_links; |
$action_links = l($link_html, $link_url, array('html' => TRUE, 'attributes' => $linkattributes, )) . $action_links; |
| 308 |
} |
} |
| 309 |
} |
} |
| 310 |
|
|
| 311 |
$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; |
| 312 |
$shout_classes="shoutbox-msg "; |
$shout_classes="shoutbox-msg "; |
| 313 |
if ($alter_row_color) { |
if ($alter_row_color) { |
| 314 |
$shout_classes .= (($shout->color) ? ("shout-odd ") : ("shout-even ")); |
$shout_classes .= (($shout->color) ? ("shoutbox-odd ") : ("shoutbox-even ")); |
| 315 |
} |
} |
| 316 |
|
|
| 317 |
if ($shout->moderate == 1) { |
if ($shout->moderate == 1) { |
| 318 |
$shout_classes .= "shoutbox-unpublished "; |
$shout_classes .= "shoutbox-unpublished "; |
| 319 |
$shout->shout .= t("(This shout is waiting for approval by a moderator.)"); |
$shout->shout .= t("(This shout is waiting for approval by a moderator.)"); |
| 320 |
} |
} |
| 321 |
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"; |
| 322 |
} |
} |
| 323 |
|
|
| 324 |
/** |
/** |