PageRenderTime 54ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/fusion-core/admin/page-builder/includes/elements/builder-elements/class-tagline-box.php

https://gitlab.com/webkod3r/tripolis
PHP | 285 lines | 233 code | 34 blank | 18 comment | 1 complexity | d0abe9d4e8bb05d4ec7b4b3a1d9edb6d MD5 | raw file
  1. <?php
  2. /**
  3. * TaglineBox block implementation, it extends DDElementTemplate like all other elements
  4. */
  5. class TF_TaglineBox extends DDElementTemplate {
  6. public function __construct() {
  7. parent::__construct();
  8. }
  9. // Implementation for the element structure.
  10. public function create_element_structure() {
  11. // Add name of the class to deserialize it again when the element is sent back to the server from the web page
  12. $this->config['php_class'] = get_class($this);
  13. // element id
  14. $this->config['id'] = 'tagline_box';
  15. // element name
  16. $this->config['name'] = __('Tagline Box', 'fusion-core');
  17. // element icon
  18. $this->config['icon_url'] = "icons/sc-text_block.png";
  19. // css class related to this element
  20. $this->config['css_class'] = "fusion_element_box";
  21. // element icon class
  22. $this->config['icon_class'] = 'fusion-icon builder-options-icon fusiona-list-alt';
  23. // tooltip that will be displyed upon mouse over the element
  24. //$this->config['tool_tip'] = 'Creates a Tagline Box';
  25. // any special html data attribute (i.e. data-width) needs to be passed
  26. // drop_level: elements with higher drop level can be dropped in elements with lower drop_level,
  27. // i.e. element with drop_level = 2 can be dropped in element with drop_level = 0 or 1 only.
  28. $this->config['data'] = array("drop_level" => "4");
  29. }
  30. // override default implemenation for this function as this element have special view
  31. public function create_visual_editor( $params ) {
  32. $innerHtml = '<div class="fusion_iconbox textblock_element textblock_element_style" id="fusion_tagline_box">';
  33. $innerHtml .= '<div class="bilder_icon_container"><span class="fusion_iconbox_icon"><i class="fusiona-list-alt"></i><sub class="sub">'.__('Tagline Box', 'fusion-core').'</sub><p class="tagline_title">Tagline title text will go here...</p></span></div>';
  34. $innerHtml .= '</div>';
  35. $this->config['innerHtml'] = $innerHtml;
  36. }
  37. //function to create shadow opacity data
  38. function create_shadow_opacity_data() {
  39. $opacity_data = array();
  40. $options = .1;
  41. while ($options < 1) {
  42. $opacity_data["fusion_".$options] = $options;
  43. $options = $options + .1;
  44. }
  45. return $opacity_data;
  46. }
  47. //this function defines TextBlock sub elements or structure
  48. function popup_elements() {
  49. $reverse_choices = FusionHelper::get_reversed_choice_data();
  50. $animation_speed = FusionHelper::get_animation_speed_data();
  51. $animation_direction = FusionHelper::get_animation_direction_data();
  52. $animation_type = FusionHelper::get_animation_type_data();
  53. $opacity_data = $this->create_shadow_opacity_data();
  54. $this->config['subElements'] = array(
  55. array("name" => __('Background Color', 'fusion-core'),
  56. "desc" => __('Controls the background color. Leave blank for theme option selection.', 'fusion-core'),
  57. "id" => "fusion_backgroundcolor",
  58. "type" => ElementTypeEnum::COLOR,
  59. "value" => ""
  60. ),
  61. array("name" => __('Shadow', 'fusion-core'),
  62. "desc" => __('Show the shadow below the box', 'fusion-core'),
  63. "id" => "fusion_shadow",
  64. "type" => ElementTypeEnum::SELECT,
  65. "value" => "no",
  66. "allowedValues" => $reverse_choices
  67. ),
  68. array("name" => __('Shadow Opacity', 'fusion-core'),
  69. "desc" => __('Choose the opacity of the shadow', 'fusion-core'),
  70. "id" => "fusion_shadowopacity",
  71. "type" => ElementTypeEnum::SELECT,
  72. "value" => "0.7",
  73. "allowedValues" => $opacity_data
  74. ),
  75. array("name" => __('Border', 'fusion-core'),
  76. "desc" => __('In pixels (px), ex: 1px', 'fusion-core'),
  77. "id" => "fusion_border",
  78. "type" => ElementTypeEnum::INPUT,
  79. "value" => "1px"
  80. ),
  81. array("name" => __('Border Color', 'fusion-core'),
  82. "desc" => __('Controls the border color. Leave blank for theme option selection.', 'fusion-core'),
  83. "id" => "fusion_bordercolor",
  84. "type" => ElementTypeEnum::COLOR,
  85. "value" => ""
  86. ),
  87. array("name" => __('Highlight Border Position', 'fusion-core'),
  88. "desc" => __('Choose the position of the highlight. This border highlight is from theme options primary color and does not take the color from border color above', 'fusion-core'),
  89. "id" => "fusion_highlightposition",
  90. "type" => ElementTypeEnum::SELECT,
  91. "value" => "top",
  92. "allowedValues" => array('top' => __('Top', 'fusion-core'),
  93. 'bottom' => __('Bottom', 'fusion-core'),
  94. 'left' => __('Left', 'fusion-core'),
  95. 'right' => __('Right', 'fusion-core'),
  96. 'none' => __('None', 'fusion-core'))
  97. ),
  98. array("name" => __('Content Alignment', 'fusion-core'),
  99. "desc" => __('Choose how the content should be displayed.', 'fusion-core'),
  100. "id" => "fusion_contentalignment",
  101. "type" => ElementTypeEnum::SELECT,
  102. "value" => "",
  103. "allowedValues" => array('left' => __('Left', 'fusion-core'),
  104. 'center' => __('Center', 'fusion-core'),
  105. 'right' => __('Right', 'fusion-core'))
  106. ),
  107. array("name" => __('Button Text', 'fusion-core'),
  108. "desc" => __('Insert the text that will display in the button', 'fusion-core'),
  109. "id" => "fusion_button",
  110. "type" => ElementTypeEnum::INPUT,
  111. "value" => ""
  112. ),
  113. array("name" => __('Link', 'fusion-core'),
  114. "desc" => __('The url the button will link to', 'fusion-core'),
  115. "id" => "fusion_url",
  116. "type" => ElementTypeEnum::INPUT,
  117. "value" => ""),
  118. array("name" => __('Link Target', 'fusion-core'),
  119. "desc" => __('_self = open in same window<br>_blank = open in new window', 'fusion-core'),
  120. "id" => "fusion_target",
  121. "type" => ElementTypeEnum::SELECT,
  122. "value" => "_self",
  123. "allowedValues" => array('_self' =>'_self',
  124. '_blank' =>'_blank')
  125. ),
  126. array("name" => __('Modal Window Anchor', 'fusion-core'),
  127. "desc" => __('Add the class name of the modal window you want to open on button click.', 'fusion-core'),
  128. "id" => "fusion_modalanchor",
  129. "type" => ElementTypeEnum::INPUT,
  130. "value" => ""),
  131. array("name" => __('Button Size', 'fusion-core'),
  132. "desc" => __('Select the button\'s size.', 'fusion-core'),
  133. "id" => "fusion_buttonsize",
  134. "type" => ElementTypeEnum::SELECT,
  135. "value" => "",
  136. "allowedValues" => array('' =>__('Default', 'fusion-core'),
  137. 'small' =>__('Small', 'fusion-core'),
  138. 'medium' =>__('Medium', 'fusion-core'),
  139. 'large' => __('Large', 'fusion-core'),
  140. 'xlarge' => __('XLarge', 'fusion-core'))
  141. ),
  142. array("name" => __('Button Type', 'fusion-core'),
  143. "desc" => __('Select the button\'s type.', 'fusion-core'),
  144. "id" => "fusion_buttontype",
  145. "type" => ElementTypeEnum::SELECT,
  146. "value" => "",
  147. "allowedValues" => array('' =>__('Default', 'fusion-core'),
  148. 'flat' =>__('Flat', 'fusion-core'),
  149. '3D' =>'3D')
  150. ),
  151. array("name" => __('Button Shape', 'fusion-core'),
  152. "desc" => __('Select the button\'s shape.', 'fusion-core'),
  153. "id" => "fusion_buttonshape",
  154. "type" => ElementTypeEnum::SELECT,
  155. "value" => "",
  156. "allowedValues" => array('' =>__('Default', 'fusion-core'),
  157. 'square' => __('Square', 'fusion-core'),
  158. 'pill' => __('Pill', 'fusion-core'),
  159. 'round' => __('Round', 'fusion-core'))
  160. ),
  161. array("name" => __('Button Color', 'fusion-core'),
  162. "desc" => __('Choose the button color<br>Default uses theme option selection', 'fusion-core'),
  163. "id" => "fusion_buttoncolor",
  164. "type" => ElementTypeEnum::SELECT,
  165. "value" => "",
  166. "allowedValues" => array('' => __('Default', 'fusion-core'),
  167. 'green' => __('Green', 'fusion-core'),
  168. 'darkgreen' => __('Dark Green', 'fusion-core'),
  169. 'orange' => __('Orange', 'fusion-core'),
  170. 'blue' => __('Blue', 'fusion-core'),
  171. 'red' => __('Red', 'fusion-core'),
  172. 'pink' => __('Pink', 'fusion-core'),
  173. 'darkgray' => __('Dark Gray', 'fusion-core'),
  174. 'lightgray' => __('Light Gray', 'fusion-core'))
  175. ),
  176. array("name" => __('Tagline Title', 'fusion-core'),
  177. "desc" => __('Insert the title text', 'fusion-core'),
  178. "id" => "fusion_title",
  179. "type" => ElementTypeEnum::TEXTAREA,
  180. "value" => ""
  181. ),
  182. array("name" => __('Tagline Description', 'fusion-core'),
  183. "desc" => __('Insert the description text', 'fusion-core'),
  184. "id" => "fusion_description",
  185. "type" => ElementTypeEnum::TEXTAREA,
  186. "value" => ""
  187. ),
  188. array("name" => __('Additional Content', 'fusion-core'),
  189. "desc" => __('This is additional content you can add to the tagline box. This will show below the title and description if one is used.', 'fusion-core'),
  190. "id" => "fusion_additionalcontent",
  191. "type" => ElementTypeEnum::HTML_EDITOR,
  192. "value" => ""
  193. ),
  194. array("name" => __('Margin Top', 'fusion-core'),
  195. "desc" => __('Add a custom top margin. In pixels.', 'fusion-core'),
  196. "id" => "fusion_margin_top",
  197. "type" => ElementTypeEnum::INPUT,
  198. "value" => ""),
  199. array("name" => __('Margin Bottom', 'fusion-core'),
  200. "desc" => __('Add a custom bottom margin. In pixels.', 'fusion-core'),
  201. "id" => "fusion_margin_bottom",
  202. "type" => ElementTypeEnum::INPUT,
  203. "value" => ""),
  204. array("name" => __('Animation Type', 'fusion-core'),
  205. "desc" => __('Select the type on animation to use on the shortcode', 'fusion-core'),
  206. "id" => "fusion_animation_type",
  207. "type" => ElementTypeEnum::SELECT,
  208. "value" => "",
  209. "allowedValues" => $animation_type
  210. ),
  211. array("name" => __('Direction of Animation', 'fusion-core'),
  212. "desc" => __('Select the incoming direction for the animation', 'fusion-core'),
  213. "id" => "fusion_animation_direction",
  214. "type" => ElementTypeEnum::SELECT,
  215. "value" => "",
  216. "allowedValues" => $animation_direction
  217. ),
  218. array("name" => __('Speed of Animation', 'fusion-core'),
  219. "desc" => __('Type in speed of animation in seconds (0.1 - 1)', 'fusion-core'),
  220. "id" => "fusion_animation_speed",
  221. "type" => ElementTypeEnum::INPUT,
  222. "value" => "0.1",
  223. "allowedValues" => $animation_speed
  224. ),
  225. array("name" => __( 'Offset of Animation', 'fusion-core' ),
  226. "desc" => __( 'Choose when the animation shoul start.', 'fusion-core' ),
  227. "id" => "fusion_animation_offset",
  228. "type" => ElementTypeEnum::SELECT,
  229. "value" => "",
  230. "allowedValues" => array(
  231. '' => __( 'Default', 'fusion-core' ),
  232. 'top-into-view' => __( 'Top of element hits bottom of viewport', 'fusion-core' ),
  233. 'top-mid-of-view' => __( 'Top of element hits middle of viewport', 'fusion-core' ),
  234. 'bottom-in-view' => __( 'Bottom of element enters viewport', 'fusion-core' ),
  235. )
  236. ),
  237. array("name" => __('CSS Class', 'fusion-core'),
  238. "desc" => __('Add a class to the wrapping HTML element.', 'fusion-core'),
  239. "id" => "fusion_class",
  240. "type" => ElementTypeEnum::INPUT,
  241. "value" => ""
  242. ),
  243. array("name" => __('CSS ID', 'fusion-core'),
  244. "desc" => __('Add an ID to the wrapping HTML element.', 'fusion-core'),
  245. "id" => "fusion_id",
  246. "type" => ElementTypeEnum::INPUT,
  247. "value" => ""
  248. ),
  249. );
  250. }
  251. }