vamtam-projects.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <?php
  2. /**
  3. * @class VamtamProjectsModule
  4. */
  5. class VamtamProjectsModule extends FLBuilderModule {
  6. /**
  7. * @method __construct
  8. */
  9. public function __construct() {
  10. $path = trailingslashit( 'modules/' . basename( dirname( __FILE__ ) ) );
  11. parent::__construct(array(
  12. 'name' => esc_html__( 'Projects', 'vamtam-elements-b' ),
  13. 'description' => esc_html__( 'Display your Jetpack projects.', 'vamtam-elements-b' ),
  14. 'category' => esc_html__( 'VamTam Modules', 'vamtam-elements-b' ),
  15. 'partial_refresh' => true,
  16. 'enabled' => class_exists( 'Jetpack_Portfolio' ),
  17. 'dir' => VAMTAMEL_B_DIR . $path,
  18. 'url' => VAMTAMEL_B_URL . $path,
  19. ));
  20. }
  21. /**
  22. * @method enqueue_scripts
  23. */
  24. public function enqueue_scripts() {
  25. if ( FLBuilderModel::is_builder_active() ) {
  26. $this->add_js( 'cubeportfolio' );
  27. $this->add_css( 'cubeportfolio' );
  28. }
  29. }
  30. }
  31. /**
  32. * Register the module and its form settings.
  33. */
  34. FLBuilder::register_module('VamtamProjectsModule', array(
  35. 'layout' => array(
  36. 'title' => __( 'Layout', 'vamtam-elements-b' ),
  37. 'sections' => array(
  38. 'general' => array(
  39. 'title' => '',
  40. 'fields' => array(
  41. 'layout' => array(
  42. 'type' => 'select',
  43. 'label' => __( 'Layout', 'vamtam-elements-b' ),
  44. 'default' => 'small',
  45. 'options' => array(
  46. 'grid' => esc_html__( 'Static', 'wpv' ),
  47. 'mosaic' => esc_html__( 'Mosaic', 'wpv' ),
  48. 'scrollable' => esc_html__( 'Scrollable', 'wpv' ),
  49. ),
  50. 'toggle' => array(
  51. 'grid' => array(
  52. 'sections' => array( 'grid' ),
  53. 'fields' => array( 'link_opens', 'type_filter', 'pagination' ),
  54. ),
  55. 'mosaic' => array(
  56. 'sections' => array( 'grid' ),
  57. 'fields' => array( 'link_opens', 'type_filter', 'pagination', 'lightbox_button' ),
  58. ),
  59. 'scrollable' => array(
  60. 'sections' => array( 'grid' ),
  61. ),
  62. ),
  63. ),
  64. 'hover_animation' => array(
  65. 'label' => esc_html__( 'Hover Animation Type', 'wpv' ),
  66. 'default' => 'hover-animation-1',
  67. 'type' => 'select',
  68. 'options' => array(
  69. 'hover-animation-1' => esc_html__( 'Type 1', 'vamtam-elements-b' ),
  70. 'hover-animation-2' => esc_html__( 'Type 2', 'vamtam-elements-b' ),
  71. 'hover-animation-3' => esc_html__( 'Type 3', 'vamtam-elements-b' ),
  72. 'hover-animation-4' => esc_html__( 'Type 4', 'vamtam-elements-b' ),
  73. ),
  74. ),
  75. 'pagination' => array(
  76. 'label' => __( 'Pagination', 'vamtam-elements-b' ),
  77. 'default' => 'true',
  78. 'type' => 'select',
  79. 'options' => array(
  80. 'true' => esc_html__( 'On', 'vamtam-elements-b' ),
  81. 'false' => esc_html__( 'Off', 'vamtam-elements-b' ),
  82. ),
  83. ),
  84. 'posts_per_page' => array(
  85. 'type' => 'unit',
  86. 'label' => esc_html__( 'Projects Per Page', 'vamtam-elements-b' ),
  87. 'default' => 10,
  88. 'min' => -1,
  89. 'max' => 100,
  90. ),
  91. 'type_filter' => array(
  92. 'label' => esc_html__( 'Type Filter', 'wpv' ),
  93. 'default' => 'false',
  94. 'type' => 'select',
  95. 'options' => array(
  96. 'true' => esc_html__( 'On', 'vamtam-elements-b' ),
  97. 'false' => esc_html__( 'Off', 'vamtam-elements-b' ),
  98. ),
  99. 'toggle' => array(
  100. 'true' => array(
  101. 'fields' => array( 'title_filter' ),
  102. ),
  103. ),
  104. ),
  105. 'title_filter' => array(
  106. 'label' => esc_html__( 'Title Filter', 'wpv' ),
  107. 'default' => 'false',
  108. 'type' => 'select',
  109. 'options' => array(
  110. 'true' => esc_html__( 'On', 'vamtam-elements-b' ),
  111. 'false' => esc_html__( 'Off', 'vamtam-elements-b' ),
  112. ),
  113. ),
  114. 'lightbox_button' => array(
  115. 'label' => esc_html__( 'Lightbox Button', 'wpv' ),
  116. 'default' => 'true',
  117. 'type' => 'select',
  118. 'options' => array(
  119. 'true' => esc_html__( 'On', 'vamtam-elements-b' ),
  120. 'false' => esc_html__( 'Off', 'vamtam-elements-b' ),
  121. ),
  122. ),
  123. ),
  124. ),
  125. 'grid' => array(
  126. 'title' => esc_html__( 'Grid', 'vamtam-elements-b' ),
  127. 'fields' => array(
  128. 'columns' => array(
  129. 'type' => 'unit',
  130. 'label' => esc_html__( 'Columns', 'vamtam-elements-b' ),
  131. 'default' => 3,
  132. 'min' => 2,
  133. 'max' => 4,
  134. ),
  135. 'gap' => array(
  136. 'type' => 'select',
  137. 'label' => esc_html__( 'Gap Between Items', 'vamtam-elements-b' ),
  138. 'default' => 'false',
  139. 'options' => array(
  140. 'true' => esc_html__( 'On', 'vamtam-elements-b' ),
  141. 'false' => esc_html__( 'Off', 'vamtam-elements-b' ),
  142. ),
  143. ),
  144. ),
  145. ),
  146. 'content' => array(
  147. 'title' => esc_html__( 'Content', 'vamtam-elements-b' ),
  148. 'fields' => array(
  149. 'link_opens' => array(
  150. 'label' => esc_html__( 'Item Link Opens', 'wpv' ),
  151. 'default' => 'single',
  152. 'type' => 'select',
  153. 'options' => array(
  154. 'single' => esc_html__( 'Single project page', 'wpv' ),
  155. 'ajax' => esc_html__( 'Simplified project page in a modal', 'wpv' ),
  156. ),
  157. ),
  158. 'show_title' => array(
  159. 'label' => esc_html__( 'Title', 'wpv' ),
  160. 'desc' => esc_html__( 'If the option is on, it will display the title of the project.', 'wpv' ),
  161. 'default' => 'false',
  162. 'type' => 'select',
  163. 'options' => array(
  164. '0' => esc_html__( 'Hide', 'wpv' ),
  165. '1' => esc_html__( 'Show', 'wpv' ),
  166. ),
  167. ),
  168. 'description' => array(
  169. 'label' => esc_html__( 'Description', 'wpv' ),
  170. 'desc' => esc_html__( 'If the option is on, it will display short description of the project.', 'wpv' ),
  171. 'default' => 'false',
  172. 'type' => 'select',
  173. 'options' => array(
  174. '0' => esc_html__( 'Hide', 'wpv' ),
  175. '1' => esc_html__( 'Show', 'wpv' ),
  176. ),
  177. ),
  178. ),
  179. ),
  180. ),
  181. ),
  182. 'content' => array(
  183. 'title' => esc_html__( 'Query', 'vamtam-elements-b' ),
  184. 'file' => plugin_dir_path( __FILE__ ) . 'includes/loop-settings.php',
  185. ),
  186. ));