You are here

function slickgrid_init in Slickgrid 6

Implementation of hook_init(). The full lightbox2 does not work with jquery 1.4.3, so need to turn it off for slickgrid pages

File

./slickgrid.module, line 18

Code

function slickgrid_init() {
  global $conf;
  if (module_exists('lightbox2')) {

    // Is this a slickgrid callback?
    // JS files are added via ajax_load so need to set lightbox2_lite here too
    if (arg(0) == 'slickgrid' && arg(1) == 'callback') {
      $conf['lightbox2_lite'] = TRUE;
    }
    else {
      $menu_item = menu_get_item();

      // Is this a slickgrid view page?
      if ($menu_item['page_callback'] == 'views_page') {
        $view = views_get_view($menu_item['page_arguments'][0]);
        if ($view->display['default']->display_options['style_plugin'] == 'slickgrid') {

          // If it is set lightbox2_lite = true so the full lightbox JS won't get added to the page
          $conf['lightbox2_lite'] = TRUE;
        }
      }
    }
  }
}