View source
<?php
define('SLICK_DEVEL', variable_get('slick_devel', FALSE));
define('SLICK_DEVEL_DEBUG', variable_get('slick_devel_debug', FALSE));
define('SLICK_DEVEL_REPLACE', variable_get('slick_devel_replace', FALSE));
define('SLICK_DEVEL_DISABLE', variable_get('slick_devel_disable', FALSE));
function slick_devel_menu() {
$items = array();
$items['admin/config/media/slick/devel'] = array(
'title' => 'Development',
'description' => 'Configure the Slick development module settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'slick_devel_form_settings',
),
'access arguments' => array(
'administer slick',
),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
'file' => 'includes/slick_devel.admin.inc',
);
return $items;
}
function slick_devel_library_alter(&$libraries, $module) {
if ($module != 'slick') {
return;
}
$slick_path = drupal_get_path('module', 'slick');
$slick_devel = drupal_get_path('module', 'slick_devel');
$min = $slick_path . '/js/slick.load.min.js';
$dev = $slick_path . '/js/slick.load.js';
if (SLICK_DEVEL && isset($libraries['slick'])) {
$libraries['slick']['js'] = array(
libraries_get_path('slick') . '/slick/slick.js' => array(
'group' => JS_LIBRARY,
'weight' => -4,
),
);
}
if (isset($libraries['load'])) {
if (SLICK_DEVEL_DEBUG) {
$libraries['load']['js'] = array(
$dev => array(
'group' => JS_DEFAULT,
'weight' => 0,
),
);
}
if (SLICK_DEVEL_REPLACE && !SLICK_DEVEL_DISABLE) {
$libraries['load']['js'] = array(
$slick_devel . '/js/slick.load.devel.js' => array(
'group' => JS_DEFAULT,
'weight' => 0,
),
);
}
elseif (SLICK_DEVEL_DISABLE) {
unset($libraries['load']['js']);
}
}
}