vamtam-tec.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. class VamtamTecModule extends FLBuilderModule {
  3. public function __construct() {
  4. $path = trailingslashit( 'modules/' . basename( dirname( __FILE__ ) ) );
  5. parent::__construct(array(
  6. 'name' => esc_html__( 'The Events Calendar', 'vamtam-elements-b' ),
  7. 'description' => '',
  8. 'category' => esc_html__( 'VamTam Modules', 'vamtam-elements-b' ),
  9. 'partial_refresh' => true,
  10. 'dir' => VAMTAMEL_B_DIR . $path,
  11. 'url' => VAMTAMEL_B_URL . $path,
  12. 'enabled' => function_exists( 'tribe_get_events' ) && current_theme_supports( 'vamtam-tribe-events' ),
  13. ));
  14. }
  15. }
  16. /**
  17. * Register the module and its form settings.
  18. */
  19. FLBuilder::register_module( 'VamtamTecModule', array(
  20. 'layout' => array(
  21. 'title' => esc_html__( 'General', 'vamtam-elements-b' ),
  22. 'sections' => array(
  23. 'general' => array(
  24. 'title' => '',
  25. 'fields' => array(
  26. 'posts_per_page' => array(
  27. 'label' => esc_html__( 'Number of Events', 'vamtam-elements-b' ),
  28. 'type' => 'unit',
  29. 'min' => 1,
  30. 'max' => 100,
  31. 'default' => 4,
  32. ),
  33. 'columns' => array(
  34. 'label' => esc_html__( 'Columns', 'vamtam-elements-b' ),
  35. 'type' => 'unit',
  36. 'min' => 1,
  37. 'max' => 4,
  38. 'default' => 4,
  39. ),
  40. 'category' => array(
  41. 'label' => esc_html__( 'Categories (optional)', 'vamtam-elements-b' ),
  42. 'desc' => esc_html__( 'All categories will be shown if none are selected. Please note that if you do not see categories, there are none created most probably. You can use ctr + click to select multiple categories.', 'vamtam-elements-b' ),
  43. 'data' => 'tribe_events_cat',
  44. 'action' => 'fl_as_terms',
  45. 'type' => 'suggest',
  46. ),
  47. ),
  48. ),
  49. ),
  50. ),
  51. ) );