jqplug.module.svn-base 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. // $Id$
  3. //
  4. // jqplug.module
  5. //
  6. //
  7. //
  8. // Created by Bach on 2008-04.
  9. // Copyright 2008 gui. All rights reserved.
  10. //
  11. /**
  12. * @file
  13. * Loads plugins for jQuery
  14. *
  15. *
  16. *
  17. */
  18. /**
  19. *
  20. * hook_perm()
  21. *
  22. */
  23. function jqplug_perm(){
  24. return array('administer jqplug');
  25. }
  26. /**
  27. * Implementation of hook_init().
  28. */
  29. function jqplug_init() {
  30. # Add the JS for this module.
  31. $mod_path = drupal_get_path('module', 'jqplug');
  32. /*drupal_add_js($mod_path.'/js/jquery.dimensions.pack.js', 'module', 'header', FALSE, TRUE);*/
  33. drupal_add_js($mod_path.'/js/jquery.mousewheel.pack.js', 'module', 'header', FALSE, TRUE);
  34. drupal_add_js($mod_path.'/js/jqem-compressed.js', 'module', 'header', FALSE, TRUE);
  35. drupal_add_js($mod_path.'/js/jScrollPane.js', 'module', 'header', FALSE, TRUE);
  36. drupal_add_css($mod_path.'/css/jScrollPane.css', 'module', 'all', FALSE);
  37. // http://plugins.jquery.com/project/Easing
  38. drupal_add_js($mod_path.'/js/jquery.easing.1.2.js', 'module', 'header', FALSE, TRUE);
  39. drupal_add_js($mod_path.'/js/jquery.checkbox.js', 'module', 'header', FALSE, TRUE);
  40. drupal_add_js($mod_path.'/js/jquery.cookie.js', 'module', 'header', FALSE, TRUE);
  41. drupal_add_js($mod_path.'/js/jquery.color.js', 'module', 'header', FALSE, TRUE);
  42. // url = http://davecardwell.co.uk/javascript/jquery/plugins/jquery-minmax/
  43. drupal_add_js($mod_path.'/js/jqminmax-compressed.js', 'module', 'header', FALSE, TRUE);
  44. //
  45. drupal_add_js($mod_path.'/js/AC_OETags.js', 'module', 'header', FALSE, TRUE);
  46. drupal_add_js($mod_path.'/js/swfobject.js', 'module', 'header', FALSE, TRUE);
  47. }
  48. /**
  49. *
  50. * Implementation of hook_menu().
  51. *
  52. */
  53. function jqplug_menu($may_cache = false) {
  54. /*
  55. $items = array();
  56. if ($may_cache) {
  57. #
  58. }
  59. else {
  60. # Add the JS for this module.
  61. $mod_path = drupal_get_path('module', 'jqplug');
  62. drupal_add_js($mod_path.'/js/jquery.dimensions.pack.js', 'module', 'header', FALSE, TRUE);
  63. drupal_add_js($mod_path.'/js/jquery.mousewheel.pack.js', 'module', 'header', FALSE, TRUE);
  64. drupal_add_js($mod_path.'/js/jqem-compressed.js', 'module', 'header', FALSE, TRUE);
  65. drupal_add_js($mod_path.'/js/jScrollPane.js', 'module', 'header', FALSE, TRUE);
  66. drupal_add_css($mod_path.'/css/jScrollPane.css', 'module', 'all', FALSE);
  67. drupal_add_js($mod_path.'/js/jquery.easing.1.2.js', 'module', 'header', FALSE, TRUE);
  68. drupal_add_js($mod_path.'/js/jquery.checkbox.js', 'module', 'header', FALSE, TRUE);
  69. drupal_add_js($mod_path.'/js/jquery.cookie.js', 'module', 'header', FALSE, TRUE);
  70. drupal_add_js($mod_path.'/js/AC_OETags.js', 'module', 'header', FALSE, TRUE);
  71. drupal_add_js($mod_path.'/js/swfobject.js', 'module', 'header', FALSE, TRUE);
  72. }
  73. return $items;
  74. */
  75. }
  76. /**
  77. * nouveaute_admin
  78. *
  79. * */
  80. function jqplug_admin(){
  81. /*
  82. drupal_set_title('nouveaute administration');
  83. $form = array();
  84. $form['nouveautes']['#tree'] = TRUE;
  85. $form['nouveautes']['nouveaute_bouton_ic_presetid'] = array(
  86. '#type' => 'select',
  87. '#title' => t('image_bouton'),
  88. '#multiple' => FALSE,
  89. '#description' => t('Select the imageCache preset which will be choose for image bouton.'),
  90. '#options' => $presetsname,
  91. '#default_value' => array_search(variable_get('nouveaute_bouton_ic_presetid', 0), $presetsid),
  92. );
  93. $form['hidden'] = array('#type' => 'value', '#value' => $presetsid);
  94. return system_settings_form($form);
  95. }
  96. */
  97. }
  98. function jqplug_admin_submit($form_id, $form_values){
  99. /*
  100. print('<pre>');
  101. print_r($form_values);
  102. print('</pre>');
  103. */
  104. //
  105. /*
  106. foreach($form_values['nouveautes'] as $var => $pos){
  107. variable_set($var, $form_values['hidden'][$pos]);
  108. }
  109. drupal_set_message(t('nouveaute configuration has been saved.'));
  110. */
  111. }