From 5594bacfa981060b90bd76498b51d8f13d6bcb3c Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Sun, 19 Apr 2015 16:20:25 +0200 Subject: [PATCH] some js not commited a long time ago .... --- selectList.module | 62 +++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/selectList.module b/selectList.module index 683a9250..db62ac6a 100644 --- a/selectList.module +++ b/selectList.module @@ -1,56 +1,34 @@ 'inline', 'scope'=>'header', 'group'=>JS_DEFAULT)); - // } - - // $curr_uri = preg_replace('/\?.*$/', '', request_uri()); - // $curr_uri = preg_replace('/^(fr|en)/', '', ltrim($curr_uri, '/')); - // dsm($curr_uri, '$curr_uri'); - // $curr_uri_parts = explode('/', ltrim($curr_uri, '/')); - // dsm($curr_uri_parts, '$curr_uri_parts'); - // - // if ($curr_uri_parts[0] == 'admin' - // // || $curr_uri_parts[0] == 'batch' - // // || $curr_uri_parts[0] == 'imce' - // || (isset($curr_uri_parts[1]) && ($curr_uri_parts[1] == 'add')) - // || (isset($curr_uri_parts[2]) && ($curr_uri_parts[2] == 'edit')) - // ){ - // - - $mod_path = drupal_get_path('module', 'selectList'); - drupal_add_css($mod_path.'/selectList.css'); - - drupal_add_js($mod_path.'/jquery.selectlist.pack.js', array('type'=>'file', 'scope'=>'header', 'group'=>JS_LIBRARY)); + global $theme; + // dsm($theme, 'theme'); - drupal_add_js('jQuery(document).ready(function($) { $("select[multiple]:not(.autocomplete-deluxe-form), .selectlist").removeAttr("size").selectList(); });', array('type'=>'inline', 'scope'=>'header', 'group'=>JS_THEME)); + $admin_theme = variable_get('admin_theme', 0); + // dsm($admin_theme, "admin_theme"); - // } - + if($theme == $admin_theme){ + + + $mod_path = drupal_get_path('module', 'selectList'); + drupal_add_css($mod_path.'/selectList.css'); + + drupal_add_js($mod_path.'/jquery.selectlist.pack.js', array('type'=>'file', 'scope'=>'header', 'group'=>JS_LIBRARY)); + + drupal_add_js('jQuery(document).ready(function($) { $("select[multiple="multiple"]:not(.autocomplete-deluxe-form), .selectlist, select#edit-roles, select#edit-modules", ".page-admin").removeAttr("size").selectList(); });', array('type'=>'inline', 'scope'=>'header', 'group'=>JS_THEME)); + + } }