views_boxes.module 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Implements hook_ctools_plugin_api().
  4. */
  5. function views_boxes_ctools_plugin_api($module, $api) {
  6. if ($module == 'boxes' && $api == 'plugins') {
  7. return array('version' => 1);
  8. }
  9. }
  10. /**
  11. * Implements hook_boxes_plugins().
  12. */
  13. function views_boxes_boxes_plugins() {
  14. $info = array();
  15. $path = drupal_get_path('module', 'views_boxes') . '/plugins';
  16. $info['view'] = array(
  17. 'title' => 'View Box',
  18. 'handler' => array(
  19. 'parent' => 'box',
  20. 'class' => 'views_boxes_view',
  21. 'file' => 'views_boxes_view.inc',
  22. 'path' => $path,
  23. ),
  24. );
  25. return $info;
  26. }
  27. function views_boxes_view_id_callback($form, $form_state) {
  28. $key = $form_state['clicked_button']['#key'];
  29. $return['settings'] = $form['options']['settings']["{$key}_group"];
  30. return $return;
  31. }
  32. function views_boxes_view_settings_callback($form, $form_state) {
  33. $return['settings'] = array(
  34. '#type' => 'fieldset',
  35. '#title' => 'Settings',
  36. '#prefix' => '<div id="view_settings">',
  37. '#suffix' => '</div>',
  38. 'reload' => array(
  39. '#markup' => t('Please save and edit again to select settings'),
  40. ),
  41. );
  42. $return['settings'] = $form['options']['settings'];
  43. return $return;
  44. }
  45. /**
  46. * Implements hook_views_api().
  47. */
  48. function views_boxes_views_api() {
  49. return array(
  50. 'api' => views_api_version(), //should not be using this
  51. );
  52. }