You are here

function addtocopy_init in Add link to copied text 6

Implements hook_init().

File

./addtocopy.module, line 32

Code

function addtocopy_init() {
  if (!user_access('bypass addtocopy')) {
    if (module_exists('libraries')) {
      drupal_add_js(libraries_get_path('addtocopy') . '/addtocopy.js');
    }
    else {
      drupal_add_js('sites/all/libraries/addtocopy' . '/addtocopy.js');
    }
    drupal_add_js(drupal_get_path('module', 'addtocopy') . '/addtocopy.js');
    drupal_add_js(array(
      'addtocopy' => array(
        'selector' => variable_get('addtocopy_selector', '#container, #page'),
        'minlen' => variable_get('addtocopy_minlen', 25),
        'htmlcopytxt' => variable_get('addtocopy_htmlcopytxt', '<br>More: <a href="[link]">[link]</a><br>'),
        'addcopyfirst' => variable_get('addtocopy_addcopyfirst', 0),
      ),
    ), 'setting');
    drupal_add_css(drupal_get_path('module', 'addtocopy') . '/addtocopy.css');
  }
}