Browse Source

some js not commited a long time ago ....

Bachir Soussi Chiadmi 9 years ago
parent
commit
5594bacfa9
1 changed files with 22 additions and 44 deletions
  1. 22 44
      selectList.module

+ 22 - 44
selectList.module

@@ -1,56 +1,34 @@
 <?php
 // $Id$
-// 
+//
 //  jqplug.module
-//  
-// 
-// 
+//
+//
+//
 //  Created by Bach on 2008-04.
 //  Modified by bach on 2009-09-09
 //  Copyright 2009 gui. All rights reserved.
-// 
+//
 
 /**
  * Implementation of hook_init().
  */
 function selectList_init() {
-	// $activated = variable_get('jqplug', array());
-	// 
-	// $match = false;
-	// foreach($activated as $plug){
-	// 	if(stripos($plug, "selectlist")){
-	// 		$match = true;
-	// 		break;
-	// 	} 
-	// }
-	// 
-	// if($match){
-	// 	drupal_add_css(drupal_get_path('module', 'selectList').'/selectList.css');
-	// 
-	// 	drupal_add_js("(function ($) { $('select[multiple], .selectlist').removeAttr('size').selectList();})(jQuery);", array('type'=>'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));
-
-		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));
-
-	// }
-	
+		global $theme;
+		// dsm($theme, '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));
+
+		}
 }