PATH:
home
/
fengshp
/
www
/
wp-content
/
plugins
/
builder-button
/
templates
<?php /** * Template Button Pro * * Access original fields: $args['mod_settings'] */ defined( 'ABSPATH' ) || exit; $mod_name = $args['mod_name']; $element_id = $args['module_ID']; $fields_args = $args['mod_settings']+array( 'type_button' => 'external', 'link_label' => '', 'icon_button' => '', 'color_button' => 'tb_default_color', 'color_button_hover' => 'tb_default_color', 'appearance_button' => '', 'link_button' => '', 'lightbox_width' => '', 'lightbox_height' => '', 'lightbox_size_unit_width' => 'px', 'lightbox_size_unit_height' => 'px', 'param_button' => '', 'content_modal_button' => '', 'modules_reveal_behavior_button' => 'toggle', 'show_less_label_button' => '', 'add_css_button' => '', 'animation_effect' => '' ); $fields_args['param_button'] = $fields_args['param_button'] !== '' ? array_values(explode('|', $fields_args['param_button'])) : array(); $fields_args['param_button'] = isset($fields_args['param_button'][0]) ? $fields_args['param_button'][0] : false; //convert old checkbox type to radio type if (isset($fields_args['appearance_button'])) { $fields_args['appearance_button'] = self::get_checkbox_data($fields_args['appearance_button']); } $container_class = apply_filters('themify_builder_module_classes', array( 'module', 'module-' . $mod_name, $element_id, 'button-link-' . $fields_args['type_button'], $fields_args['add_css_button'] ), $mod_name, $element_id, $fields_args); if (!empty($fields_args['global_styles']) && Themify_Builder::$frontedit_active === false) { $container_class[] = $fields_args['global_styles']; } if($fields_args['color_button']==='default'){ $fields_args['color_button']='tb_default_color'; } if($fields_args['color_button_hover']==='default'){ $fields_args['color_button_hover']='tb_default_color'; } $container_class[] = $fields_args['color_button_hover']; $atts = array( 'class' => array('ui builder_button',$fields_args['color_button']), 'href' => $fields_args['link_button'] ); if ($fields_args['appearance_button'] !== '') { $atts['class'][] = $fields_args['appearance_button']; } if ('row_scroll' === $fields_args['type_button']) { $atts['href'] = '#'; $atts['class'][] = 'scroll-next-row'; } elseif ('modules_reveal' === $fields_args['type_button']) { $atts['href'] = '#'; $atts['class'][] = 'modules-reveal'; $atts['data-behavior'] = $fields_args['modules_reveal_behavior_button']; $atts['data-label'] = $fields_args['link_label']; $atts['data-lesslabel'] = $fields_args['show_less_label_button']; } else { if ($fields_args['param_button'] === 'lightbox' || 'modal' === $fields_args['type_button']) { $atts['class'][] = 'themify_lightbox'; if ('modal' === $fields_args['type_button']) { $modal_id = TB_Button_Module::modal_id($element_id); $atts['href'] = '#' . $modal_id; } if ($fields_args['lightbox_width'] !== '' || $fields_args['lightbox_height'] !== '') { $lightbox_settings = array(); if ($fields_args['lightbox_width'] !== '') { $lightbox_settings[] = $fields_args['lightbox_width'] . $fields_args['lightbox_size_unit_width']; } if ($fields_args['lightbox_height'] !== '') { $lightbox_settings[] = $fields_args['lightbox_height'] . $fields_args['lightbox_size_unit_height']; } $atts['data-zoom-config'] = implode('|', $lightbox_settings); } } elseif ($fields_args['param_button'] === 'newtab') { $atts['target'] = '_blank'; } } if (method_exists('Themify_Builder_Model', 'load_color_css')) { if ($fields_args['appearance_button'] !== '') { Themify_Builder_Model::load_appearance_css($fields_args['appearance_button']); } if ($fields_args['color_button_hover'] !== 'tb_default_color') { Themify_Builder_Model::load_color_css($fields_args['color_button_hover']); } if ($fields_args['color_button'] !== 'tb_default_color') { Themify_Builder_Model::load_color_css($fields_args['color_button']); } } $container_props = apply_filters('themify_builder_module_container_props', self::parse_animation_effect($fields_args, array( 'id' => $element_id, 'class' => implode(' ', $container_class), )), $fields_args, $mod_name, $element_id); if (Themify_Builder::$frontedit_active === false) { $container_props['data-lazy'] = 1; } $atts['class'] = implode(' ', $atts['class']); ?> <!-- module button pro --> <div <?php echo self::get_element_attributes(self::sticky_element_props($container_props, $fields_args)); ?>> <?php $container_props = $container_class = $args=null; do_action('themify_builder_before_template_content_render'); ?> <a <?php echo self::get_element_attributes($atts); ?>> <?php if ('' !== $fields_args['icon_button']) : ?><span><?php echo themify_get_icon($fields_args['icon_button']); ?></span> <?php endif; ?> <span><?php echo $fields_args['link_label']; ?></span> </a> <?php if (isset($modal_id)) : ?> <div id="<?php echo $modal_id; ?>" class="tf_hide"> <?php echo apply_filters('themify_builder_module_content', $fields_args['content_modal_button']); ?> </div> <?php endif; ?> <?php do_action('themify_builder_after_template_content_render'); ?> </div> <!-- /module button pro -->
[+]
..
[-] template-button.php
[edit]