materio_search_api_ajax.module 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * @file
  4. * This is the file description for materio_search_api_ajax module.
  5. *
  6. * In this more verbose, multi-line description, you can specify what this
  7. * file does exactly. Make sure to wrap your documentation in column 78 so
  8. * that the file can be displayed nicely in default-sized consoles.
  9. */
  10. /**
  11. * Implements hook_init().
  12. */
  13. function materio_search_api_ajax_init() {
  14. if (module_exists('locale')) {
  15. $languages = language_list('enabled');
  16. }
  17. drupal_add_js(array('materio_search_api_ajax' => array(
  18. 'module_path' => drupal_get_path('module', 'materio_search_api_ajax'),
  19. // 'strings'=>array(
  20. // 'sitetitle'=>,
  21. // 'siteslogan'=>,
  22. // ),
  23. 'languages' => isset($languages) ? $languages[1] : array(),
  24. )), 'setting');
  25. drupal_add_js(drupal_get_path('module', 'materio_search_api_ajax').'/js/dist/materio_search_api_ajax.min.js');
  26. }
  27. /**
  28. * Implements hook_menu().
  29. */
  30. function materio_search_api_ajax_menu() {
  31. $items = array();
  32. $base = array(
  33. 'type' => MENU_CALLBACK,
  34. 'file' => 'materio_search_api_ajax.pages.inc',
  35. );
  36. $items['materio_search_api_ajax/search'] = $base+array(
  37. 'title' => 'Matrio base ajax',
  38. 'page callback' => 'materio_search_api_ajax_search',
  39. 'page arguments' => array(2),
  40. 'access callback' => TRUE,
  41. 'access arguments' => array('use materio search api'),
  42. );
  43. $items['materio_search_api_ajax/viewmode/change'] = $base+array(
  44. 'page callback' => 'materio_search_api_ajax_viewmode_change',
  45. 'page argument' => array(3),
  46. 'access arguments' => array('use materio search api viewmode selection'),
  47. );
  48. $items['materio_search_api_ajax/actuality'] = $base+array(
  49. 'page callback' => 'materio_search_api_ajax_actuality',
  50. 'access callback' => TRUE,
  51. 'page arguments' => array(2),
  52. );
  53. $items['materio_search_api_ajax/node'] = $base+array(
  54. 'page callback' => 'materio_search_api_ajax_node',
  55. 'access callback' => TRUE,
  56. 'page arguments' => array(2),
  57. );
  58. return $items;
  59. }