You are here

function slickgrid_add_modal in Slickgrid 7

Same name and namespace in other branches
  1. 7.2 theme/theme.inc \slickgrid_add_modal()

Add ctools modal plugin

1 call to slickgrid_add_modal()
theme_slickgrid in theme/theme.inc
The main theme function for the slickgrid

File

./slickgrid.module, line 373

Code

function slickgrid_add_modal() {

  // Include the CTools tools that we need.
  ctools_include('ajax');
  ctools_include('modal');

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

  // Create our own javascript that will be used to theme a modal.
  $style_settings = array(
    'ctools-modal-slickgrid-fixed' => array(
      'modalSize' => array(
        'type' => 'fixed',
        'width' => 550,
        'height' => 300,
        'addWidth' => 20,
        'addHeight' => 15,
      ),
      'modalOptions' => array(
        'opacity' => 0.5,
        'background-color' => '#000',
      ),
      'animation' => 'fadeIn',
      'modalTheme' => 'SlickgridModal',
      'throbber' => theme('image', array(
        'path' => ctools_image_path('ajax-loader.gif', 'ctools_ajax_sample'),
        'alt' => t('Loading...'),
        'title' => t('Loading'),
      )),
    ),
    'ctools-modal-slickgrid-scale' => array(
      'modalSize' => array(
        'type' => 'scale',
      ),
      'modalOptions' => array(
        'opacity' => 0.5,
        'background-color' => '#000',
      ),
      'animation' => 'fadeIn',
      'modalTheme' => 'SlickgridModal',
      'throbber' => theme('image', array(
        'path' => ctools_image_path('ajax-loader.gif', 'ctools_ajax_sample'),
        'alt' => t('Loading...'),
        'title' => t('Loading'),
      )),
    ),
  );
  drupal_add_js($style_settings, 'setting');
}