shoutbox.inc in Heartbeat 7
File
modules/heartbeat_plugins/plugins/shoutbox.inc
View source
<?php
class HeartbeatShoutBoxPlugin extends HeartbeatBasePlugin implements iHeartbeatPlugin {
public function loadAttachments(HeartbeatActivity &$heartbeatActivity, $name = NULL) {
}
public function hasContent() {
return FALSE;
}
public function hasAttachmentsContent() {
return FALSE;
}
public function renderAttachmentsContent(HeartbeatActivity $heartbeatActivity) {
}
public function hasButtons() {
return FALSE;
}
public function hasAttachmentsButtons() {
return FALSE;
}
public function renderButtons(HeartbeatActivity $heartbeatActivity) {
}
public function isStreamAdaptor() {
return TRUE;
}
public function adaptsStream() {
return TRUE;
}
public function streamLoaded(HeartbeatStream $heartbeatStream) {
if (isset($heartbeatStream->config->settings['shoutbox']) && $heartbeatStream->config->settings['shoutbox']) {
theme('shoutbox_external_files');
$output = drupal_get_form('shoutbox_add_form');
$heartbeatStream->prefix = drupal_render($output);
_shoutbox_js_config();
}
}
public function pluginStreamForm(&$form, &$form_state) {
$form['settings']['fs_shoutbox'] = array(
'#type' => 'fieldset',
'#title' => t('Shoutbox'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'shoutbox' => array(
'#type' => 'checkbox',
'#title' => t('Prepend a shoutbox form to the stream'),
'#default_value' => isset($form_state['item']->settings['shoutbox']) ? $form_state['item']->settings['shoutbox'] : 0,
),
);
}
}