selectList.module 921 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. // $Id$
  3. //
  4. // jqplug.module
  5. //
  6. //
  7. //
  8. // Created by Bach on 2008-04.
  9. // Modified by bach on 2009-09-09
  10. // Copyright 2009 gui. All rights reserved.
  11. //
  12. /**
  13. * Implementation of hook_init().
  14. */
  15. function selectList_init() {
  16. global $theme;
  17. // dsm($theme, 'theme');
  18. $admin_theme = variable_get('admin_theme', 0);
  19. // dsm($admin_theme, "admin_theme");
  20. if($theme == $admin_theme){
  21. $mod_path = drupal_get_path('module', 'selectList');
  22. drupal_add_css($mod_path.'/selectList.css');
  23. drupal_add_js($mod_path.'/jquery.selectlist.pack.js', array('type'=>'file', 'scope'=>'header', 'group'=>JS_LIBRARY));
  24. 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));
  25. }
  26. }