View source
<?php
function addtocopy_perm() {
return array(
'bypass addtocopy',
);
}
function addtocopy_menu() {
$items = array(
'admin/settings/addtocopy' => array(
'title' => 'Add to Copy',
'description' => 'Configure Add to Copy settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'addtocopy_settings_form',
),
'access callback' => 'user_access',
'access arguments' => array(
'administer site configuration',
),
'file' => 'addtocopy.admin.inc',
'type' => MENU_NORMAL_ITEM,
),
);
return $items;
}
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');
}
}