You are here

function heartbeat_ctools_modal_prepare in Heartbeat 7

Helper function to prepare a custom CTools Modal window.

3 calls to heartbeat_ctools_modal_prepare()
HeartbeatActivity::add_buttons in includes/heartbeatactivity.inc
Add buttons to the activity message.
HeartbeatStream::render in includes/heartbeatstream.inc
Render().
template_preprocess_views_view_row_heartbeat in ./heartbeat.views.inc
Template helper for theme_views_view_row_heartbeat.

File

./heartbeat.module, line 1574
Module file for heartbeat activity. Basic hook implementations and helper functions will be found here.

Code

function heartbeat_ctools_modal_prepare() {
  static $ran = FALSE;
  if (!$ran) {
    ctools_include('modal');
    ctools_include('ajax');

    // Add CTools' javascript to the page.
    ctools_modal_add_js();

    // Add the effects library.
    drupal_add_library('system', 'effects.highlight');
    drupal_add_library('system', 'effects.blind');

    // Create our own javascript that will be used to theme a modal.
    $style = array(
      'ctools-heartbeat-style' => array(
        'modalSize' => array(
          'type' => 'fixed',
          'width' => 500,
          'height' => 300,
          'addWidth' => 20,
          'addHeight' => 15,
        ),
        'modalOptions' => array(
          'opacity' => 0.5,
          'background-color' => '#111',
        ),
        'animation' => 'fadeIn',
        'modalTheme' => 'CToolsHeartbeatModal',
        'throbber' => theme('image', array(
          'path' => drupal_get_path('module', 'heartbeat') . '/images/ajax-loader.gif',
          'alt' => t('Loading...'),
          'title' => t('Loading'),
        )),
      ),
    );
    drupal_add_js($style, 'setting');
    $ran = TRUE;
  }
}