You are here

function outline_designer_init in Outline Designer 6

Same name and namespace in other branches
  1. 7 outline_designer.module \outline_designer_init()

Implementation of hook_init().

File

./outline_designer.module, line 37
Massive usability improvement for quickly structuring / creating content.

Code

function outline_designer_init() {
  if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'book' && (arg(3) == '' || arg(3) == 'list')) {
    drupal_add_css(drupal_get_path('module', 'outline_designer') . '/css/outline_designer.css');
    $js = '
  function od_add_book(){
    window.location="' . base_path() . '?q=node/add/' . variable_get('book_child_type', 'book') . '";
  }
  $(document).ready(function(){$(".sticky-table").before(' . "'" . '<div style="width:120px;" class="context-menu context-menu-theme-' . variable_get('outline_designer_theme', 'vista') . '"><div title="" class="context-menu-item"><div style="background-image: url(' . base_path() . drupal_get_path('module', 'outline_designer') . '/images/add_content.png);" class="context-menu-item-inner" onclick="od_add_book();">' . t('add book') . '</div></div></div>' . "');\n  });";
    drupal_add_js($js, 'inline');
  }
}