You are here

class HeartbeatShoutBoxPlugin in Heartbeat 7

Class HeartbeatShoutBoxPlugin.

Hierarchy

Expanded class hierarchy of HeartbeatShoutBoxPlugin

File

modules/heartbeat_plugins/plugins/shoutbox.inc, line 10

View source
class HeartbeatShoutBoxPlugin extends HeartbeatBasePlugin implements iHeartbeatPlugin {

  /**
   * loadAttachments().
   * Loads extra attachments onto a heartbeat activity message.
   */
  public function loadAttachments(HeartbeatActivity &$heartbeatActivity, $name = NULL) {
  }

  /**
   * hasContent().
   * True if a plugin provides attachments.
   */
  public function hasContent() {
    return FALSE;
  }

  /**
   * hasAttachmentsContent().
   * True if the message has attachments content.
   */
  public function hasAttachmentsContent() {
    return FALSE;
  }

  /**
   * renderAttachmentsContent().
   */
  public function renderAttachmentsContent(HeartbeatActivity $heartbeatActivity) {
  }

  /**
   * hasButtons().
   * True if a plugin provides attachments.
   */
  public function hasButtons() {
    return FALSE;
  }

  /**
   * hasAttachmentsButtons().
   * True if a message has attachment buttons.
   */
  public function hasAttachmentsButtons() {
    return FALSE;
  }

  /**
   * renderButtons().
   */
  public function renderButtons(HeartbeatActivity $heartbeatActivity) {
  }

  /**
   * isStreamAdaptor().
   */
  public function isStreamAdaptor() {
    return TRUE;
  }

  /**
   * adaptsStream().
   */
  public function adaptsStream() {
    return TRUE;
  }

  /**
   * streamLoaded().
   */
  public function streamLoaded(HeartbeatStream $heartbeatStream) {
    if (isset($heartbeatStream->config->settings['shoutbox']) && $heartbeatStream->config->settings['shoutbox']) {

      // Load externals.
      theme('shoutbox_external_files');
      $output = drupal_get_form('shoutbox_add_form');
      $heartbeatStream->prefix = drupal_render($output);
      _shoutbox_js_config();

      //$output = shoutbox_view(TRUE);

      //$heartbeatStream->prefix = drupal_render($output);
    }
  }

  /**
   * pluginStreamForm().
   */
  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,
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HeartbeatBasePlugin::$label protected property
HeartbeatBasePlugin::$settings protected property
HeartbeatBasePlugin::$stream protected property
HeartbeatBasePlugin::activityRemoved public function activityRemoved(). 1
HeartbeatBasePlugin::addSettings public function addSettings().
HeartbeatBasePlugin::getAttachments public function getAttachments(). 2
HeartbeatBasePlugin::getLabel public function getLabel().
HeartbeatBasePlugin::getMenuItems public function getMenuItems(). 1
HeartbeatBasePlugin::getSettings public function getSettings().
HeartbeatBasePlugin::pluginAttachmentForm public function pluginAttachmentForm(). The form to add attachments to templates. 2
HeartbeatBasePlugin::pluginUIForm public function pluginUIForm(). 2
HeartbeatBasePlugin::setLabel public function setLabel().
HeartbeatBasePlugin::setStream final public function setStream().
HeartbeatBasePlugin::__construct public function __construct(). 1
HeartbeatShoutBoxPlugin::adaptsStream public function adaptsStream(). Overrides iHeartbeatPlugin::adaptsStream
HeartbeatShoutBoxPlugin::hasAttachmentsButtons public function hasAttachmentsButtons(). True if a message has attachment buttons. Overrides iHeartbeatPlugin::hasAttachmentsButtons
HeartbeatShoutBoxPlugin::hasAttachmentsContent public function hasAttachmentsContent(). True if the message has attachments content. Overrides iHeartbeatPlugin::hasAttachmentsContent
HeartbeatShoutBoxPlugin::hasButtons public function hasButtons(). True if a plugin provides attachments. Overrides iHeartbeatPlugin::hasButtons
HeartbeatShoutBoxPlugin::hasContent public function hasContent(). True if a plugin provides attachments. Overrides iHeartbeatPlugin::hasContent
HeartbeatShoutBoxPlugin::isStreamAdaptor public function isStreamAdaptor(). Overrides iHeartbeatPlugin::isStreamAdaptor
HeartbeatShoutBoxPlugin::loadAttachments public function loadAttachments(). Loads extra attachments onto a heartbeat activity message. Overrides iHeartbeatPlugin::loadAttachments
HeartbeatShoutBoxPlugin::pluginStreamForm public function pluginStreamForm(). Overrides HeartbeatBasePlugin::pluginStreamForm
HeartbeatShoutBoxPlugin::renderAttachmentsContent public function renderAttachmentsContent(). Overrides iHeartbeatPlugin::renderAttachmentsContent
HeartbeatShoutBoxPlugin::renderButtons public function renderButtons(). Overrides iHeartbeatPlugin::renderButtons
HeartbeatShoutBoxPlugin::streamLoaded public function streamLoaded(). Overrides iHeartbeatPlugin::streamLoaded