module-settings.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. $global_settings = FLBuilderModel::get_global_settings();
  3. FLBuilder::register_settings_form('module_advanced', array(
  4. 'title' => __( 'Advanced', 'fl-builder' ),
  5. 'sections' => array(
  6. 'margins' => array(
  7. 'title' => __( 'Spacing', 'fl-builder' ),
  8. 'fields' => array(
  9. 'margin' => array(
  10. 'type' => 'dimension',
  11. 'label' => __( 'Margins', 'fl-builder' ),
  12. 'description' => 'px',
  13. 'preview' => array(
  14. 'type' => 'none',
  15. ),
  16. 'responsive' => array(
  17. 'placeholder' => array(
  18. 'default' => ( isset( $global_settings->module_margins ) ) ? $global_settings->module_margins : '',
  19. 'medium' => ( isset( $global_settings->module_margins_medium ) ) ? $global_settings->module_margins_medium : '',
  20. 'responsive' => ( isset( $global_settings->module_margins_responsive ) ) ? $global_settings->module_margins_responsive : '',
  21. ),
  22. ),
  23. ),
  24. ),
  25. ),
  26. 'responsive' => array(
  27. 'title' => __( 'Responsive Layout', 'fl-builder' ),
  28. 'fields' => array(
  29. 'responsive_display' => array(
  30. 'type' => 'select',
  31. 'label' => __( 'Display', 'fl-builder' ),
  32. 'options' => array(
  33. '' => __( 'Always', 'fl-builder' ),
  34. 'desktop' => __( 'Large Devices Only', 'fl-builder' ),
  35. 'desktop-medium' => __( 'Large &amp; Medium Devices Only', 'fl-builder' ),
  36. 'medium' => __( 'Medium Devices Only', 'fl-builder' ),
  37. 'medium-mobile' => __( 'Medium &amp; Small Devices Only', 'fl-builder' ),
  38. 'mobile' => __( 'Small Devices Only', 'fl-builder' ),
  39. ),
  40. 'help' => __( 'Choose whether to show or hide this module at different device sizes.', 'fl-builder' ),
  41. 'preview' => array(
  42. 'type' => 'none',
  43. ),
  44. ),
  45. ),
  46. ),
  47. 'visibility' => array(
  48. 'title' => __( 'Visibility', 'fl-builder' ),
  49. 'fields' => array(
  50. 'visibility_display' => array(
  51. 'type' => 'select',
  52. 'label' => __( 'Display', 'fl-builder' ),
  53. 'options' => array(
  54. '' => __( 'Always', 'fl-builder' ),
  55. 'logged_out' => __( 'Logged Out User', 'fl-builder' ),
  56. 'logged_in' => __( 'Logged In User', 'fl-builder' ),
  57. '0' => __( 'Never', 'fl-builder' ),
  58. ),
  59. 'toggle' => array(
  60. 'logged_in' => array(
  61. 'fields' => array( 'visibility_user_capability' ),
  62. ),
  63. ),
  64. 'preview' => array(
  65. 'type' => 'none',
  66. ),
  67. ),
  68. 'visibility_user_capability' => array(
  69. 'type' => 'text',
  70. 'label' => __( 'User Capability', 'fl-builder' ),
  71. 'description' => sprintf( __( 'Optional. Set the <a%s>capability</a> required for users to view this module.', 'fl-builder' ), ' href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table" target="_blank"' ),
  72. 'preview' => array(
  73. 'type' => 'none',
  74. ),
  75. ),
  76. ),
  77. ),
  78. 'animation' => array(
  79. 'title' => __( 'Animation', 'fl-builder' ),
  80. 'fields' => array(
  81. 'animation' => array(
  82. 'type' => 'select',
  83. 'label' => __( 'Style', 'fl-builder' ),
  84. 'options' => array(
  85. '' => _x( 'None', 'Animation style.', 'fl-builder' ),
  86. 'fade-in' => _x( 'Fade In', 'Animation style.', 'fl-builder' ),
  87. 'slide-left' => _x( 'Slide Left', 'Animation style.', 'fl-builder' ),
  88. 'slide-right' => _x( 'Slide Right', 'Animation style.', 'fl-builder' ),
  89. 'slide-up' => _x( 'Slide Up', 'Animation style.', 'fl-builder' ),
  90. 'slide-down' => _x( 'Slide Down', 'Animation style.', 'fl-builder' ),
  91. ),
  92. 'preview' => array(
  93. 'type' => 'none',
  94. ),
  95. ),
  96. 'animation_delay' => array(
  97. 'type' => 'text',
  98. 'label' => __( 'Delay', 'fl-builder' ),
  99. 'default' => '0.0',
  100. 'maxlength' => '4',
  101. 'size' => '5',
  102. 'description' => _x( 'seconds', 'Value unit for form field of time in seconds. Such as: "5 seconds"', 'fl-builder' ),
  103. 'help' => __( 'The amount of time in seconds before this animation starts.', 'fl-builder' ),
  104. 'preview' => array(
  105. 'type' => 'none',
  106. ),
  107. ),
  108. ),
  109. ),
  110. 'css_selectors' => array(
  111. 'title' => __( 'HTML Element', 'fl-builder' ),
  112. 'fields' => array(
  113. 'id' => array(
  114. 'type' => 'text',
  115. 'label' => __( 'ID', 'fl-builder' ),
  116. 'help' => __( "A unique ID that will be applied to this module's HTML. Must start with a letter and only contain dashes, underscores, letters or numbers. No spaces.", 'fl-builder' ),
  117. 'preview' => array(
  118. 'type' => 'none',
  119. ),
  120. ),
  121. 'class' => array(
  122. 'type' => 'text',
  123. 'label' => __( 'Class', 'fl-builder' ),
  124. 'help' => __( "A class that will be applied to this module's HTML. Must start with a letter and only contain dashes, underscores, letters or numbers. Separate multiple classes with spaces.", 'fl-builder' ),
  125. 'preview' => array(
  126. 'type' => 'none',
  127. ),
  128. ),
  129. ),
  130. ),
  131. ),
  132. ));