| 1 |
<?php |
<?php |
| 2 |
// $Id: shoutbox.module,v 1.25.2.13 2008/07/11 10:16:59 disterics Exp $ |
// $Id: shoutbox.module,v 1.25.2.14 2008/07/15 07:55:28 disterics Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 165 |
function shoutbox_perm() { |
function shoutbox_perm() { |
| 166 |
return array('post shouts', 'administer shoutbox', 'moderate shoutbox', |
return array('post shouts', 'administer shoutbox', 'moderate shoutbox', |
| 167 |
'post shouts without approval', 'delete own shouts', |
'post shouts without approval', 'delete own shouts', |
| 168 |
'edit own shouts',); |
'edit own shouts', ); |
| 169 |
} |
} |
| 170 |
|
|
| 171 |
|
|
| 311 |
foreach ($links as $link) { |
foreach ($links as $link) { |
| 312 |
$linkattributes = $link['linkattributes']; |
$linkattributes = $link['linkattributes']; |
| 313 |
$link_html = '<img src="'. $link['img'] .'" width="'. $link['img_width'] .'" height="'. $link['img_height'] .'" alt="'. $link['title'] .'" class="shoutbox-imglink">'; |
$link_html = '<img src="'. $link['img'] .'" width="'. $link['img_width'] .'" height="'. $link['img_height'] .'" alt="'. $link['title'] .'" class="shoutbox-imglink">'; |
| 314 |
$link_url = 'shoutbox/'. $shout->shout_id . '/' . $link['action']; |
$link_url = 'shoutbox/'. $shout->shout_id .'/'. $link['action']; |
| 315 |
$img_links = l($link_html, $link_url, array('html' => TRUE)) . $img_links; |
$img_links = l($link_html, $link_url, array('html' => TRUE)) . $img_links; |
| 316 |
} |
} |
| 317 |
} |
} |
| 413 |
$form['time_settings'] = array( |
$form['time_settings'] = array( |
| 414 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 415 |
'#title' => t('Time Settings'), |
'#title' => t('Time Settings'), |
| 416 |
'#collapsible' => true, |
'#collapsible' => TRUE, |
| 417 |
'#collapsed' => false |
'#collapsed' => FALSE, |
| 418 |
); |
); |
| 419 |
$form['time_settings']['shoutbox_refresh'] = array( |
$form['time_settings']['shoutbox_refresh'] = array( |
| 420 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 845 |
'defaultNick' => $default_nick, |
'defaultNick' => $default_nick, |
| 846 |
'defaultMsg' => $default_msg, |
'defaultMsg' => $default_msg, |
| 847 |
'defaultUrl' => $default_url, |
'defaultUrl' => $default_url, |
| 848 |
'refreshPath' => base_path() . 'shoutbox/js/view', |
'refreshPath' => base_path() .'shoutbox/js/view', |
| 849 |
); |
); |
| 850 |
|
|
| 851 |
drupal_add_js(array('shoutbox' => $js_settings), 'setting'); |
drupal_add_js(array('shoutbox' => $js_settings), 'setting'); |
| 877 |
// TODO: Output of this function should be single array |
// TODO: Output of this function should be single array |
| 878 |
$rows = array(); |
$rows = array(); |
| 879 |
// Figure out if we should display it in ascending or descending order. |
// Figure out if we should display it in ascending or descending order. |
| 880 |
$ascending = variable_get('shoutbox_ascending', false); |
$ascending = variable_get('shoutbox_ascending', FALSE); |
| 881 |
|
|
| 882 |
// Get the shouts from the database. |
// Get the shouts from the database. |
| 883 |
if (!$pager) { |
if (!$pager) { |
| 1030 |
// All filtering (including urls, email addresses, censored words, and |
// All filtering (including urls, email addresses, censored words, and |
| 1031 |
// emoticons) is handled by the drupal filter system. |
// emoticons) is handled by the drupal filter system. |
| 1032 |
$shout->nick = check_plain($shout->nick); |
$shout->nick = check_plain($shout->nick); |
| 1033 |
$format = variable_get('shoutbox_filter_format','PLAIN'); |
$format = variable_get('shoutbox_filter_format', 'PLAIN'); |
| 1034 |
if ( $format == 'PLAIN') { |
if ( $format == 'PLAIN') { |
| 1035 |
$shout->shout = check_plain($shout->shout); |
$shout->shout = check_plain($shout->shout); |
| 1036 |
} |
} |
| 1043 |
} |
} |
| 1044 |
|
|
| 1045 |
function _shoutbox_filter_form() { |
function _shoutbox_filter_form() { |
| 1046 |
$form = filter_form(variable_get('shoutbox_filter_format','FILTER_FORMAT_DEFAULT'), NULL, array('shoutbox_filter_format')); |
$form = filter_form(variable_get('shoutbox_filter_format', 'FILTER_FORMAT_DEFAULT'), NULL, array('shoutbox_filter_format')); |
| 1047 |
$formats = filter_formats(); |
$formats = filter_formats(); |
| 1048 |
|
|
| 1049 |
if (count($formats) > 1) { |
if (count($formats) > 1) { |