| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 | 
							- <?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], .selectlist").removeAttr("size").selectList(); });', array('type'=>'inline', 'scope'=>'header', 'group'=>JS_THEME));
 
- 	// }
 
- 	
 
- }
 
 
  |