/**
  * Renders a list of all available weights for a selected font.
  *
  * @since  1.6.3
  * @param  string $font   The current selected font.
  * @param  string $weight The current selected weight.
  * @return void
  */
 public static function display_select_weight($font, $weight)
 {
     if ($font == 'Default') {
         echo '<option value="default">' . __('Default', 'fl-builder') . '</option>';
     } else {
         if (array_key_exists($font, FLBuilderFontFamilies::$system)) {
             foreach (FLBuilderFontFamilies::$system[$font]['weights'] as $variant) {
                 echo '<option value="' . $variant . '" ' . selected($variant, $weight) . '>' . FLBuilderFonts::get_weight_string($variant) . '</option>';
             }
         } else {
             foreach (FLBuilderFontFamilies::$google[$font] as $variant) {
                 echo '<option value="' . $variant . '" ' . selected($variant, $weight) . '>' . FLBuilderFonts::get_weight_string($variant) . '</option>';
             }
         }
     }
 }
 /**
  * Enqueue the styles and scripts for a single layout.
  *
  * @since 1.0
  * @param int $post_id The post ID for this layout.
  * @return void
  */
 public static function enqueue_layout_styles_scripts($post_id)
 {
     if (FLBuilderModel::is_builder_enabled()) {
         $nodes = FLBuilderModel::get_categorized_nodes();
         $asset_info = FLBuilderModel::get_asset_info();
         $asset_ver = FLBuilderModel::get_asset_version();
         // Enqueue required row CSS and JS
         foreach ($nodes['rows'] as $row) {
             if ($row->settings->bg_type == 'slideshow') {
                 wp_enqueue_script('yui3');
                 wp_enqueue_script('fl-slideshow');
                 wp_enqueue_style('fl-slideshow');
             } else {
                 if ($row->settings->bg_type == 'video') {
                     wp_enqueue_script('jquery-imagesloaded');
                 }
             }
         }
         // Enqueue required module CSS and JS
         foreach ($nodes['modules'] as $module) {
             $module->enqueue_icon_styles();
             $module->enqueue_font_styles();
             $module->enqueue_scripts();
             foreach ($module->css as $handle => $props) {
                 wp_enqueue_style($handle, $props[0], $props[1], $props[2], $props[3]);
             }
             foreach ($module->js as $handle => $props) {
                 wp_enqueue_script($handle, $props[0], $props[1], $props[2], $props[3]);
             }
             if (!empty($module->settings->animation)) {
                 wp_enqueue_script('jquery-waypoints');
             }
         }
         // Enqueue main CSS
         if (!file_exists($asset_info['css'])) {
             FLBuilder::render_css();
         }
         $deps = apply_filters('fl_builder_layout_style_dependencies', array());
         $media = apply_filters('fl_builder_layout_style_media', 'all');
         wp_enqueue_style('fl-builder-layout-' . $post_id, $asset_info['css_url'], $deps, $asset_ver, $media);
         // Enqueue Google Fonts
         FLBuilderFonts::enqueue_styles();
         // Enqueue main JS
         if (!file_exists($asset_info['js'])) {
             FLBuilder::render_js();
         }
         wp_enqueue_script('fl-builder-layout-' . $post_id, $asset_info['js_url'], array('jquery'), $asset_ver, true);
     }
 }
Example #3
0
	placeholder: '<?php 
esc_attr_e('Paste color here...', 'fl-builder');
?>
',
	removePresetConfirm: '<?php 
esc_attr_e('Are you sure?', 'fl-builder');
?>
',
	noneColorSelected: '<?php 
esc_attr_e('Please enter a color first.', 'fl-builder');
?>
',
	alreadySaved: '<?php 
esc_attr_e(' is already a saved preset.', 'fl-builder');
?>
',
	noPresets: '<?php 
esc_attr_e('Add a color preset first.', 'fl-builder');
?>
',
	presetAdded: '<?php 
esc_attr_e(' added to presets!', 'fl-builder');
?>
'
};

<?php 
FLBuilderFonts::js();
?>

</script>
Example #4
0
 /** 
  * Enqueues the needed styles for any font fields
  * in this module.
  *
  * @since 1.6.3
  * @return void
  */
 public function enqueue_font_styles()
 {
     FLBuilderFonts::add_fonts_for_module($this);
 }
Example #5
0
<div class="fl-font-field">
	<select name="<?php 
echo $name . '[][family]';
?>
" class="fl-font-field-font">
		<?php 
FLBuilderFonts::display_select_font($value['family']);
?>
	</select>
	<select name="<?php 
echo $name . '[][weight]';
?>
" class="fl-font-field-weight">
		<?php 
FLBuilderFonts::display_select_weight($value['family'], $value['weight']);
?>
	</select>
</div>
.fl-heading .fl-heading-text * {
	color: #<?php 
    echo $settings->color;
    ?>
;
}
<?php 
}
if (!empty($settings->font) && $settings->font['family'] != 'Default') {
    ?>
.fl-node-<?php 
    echo $id;
    ?>
 .fl-heading .fl-heading-text{
	<?php 
    FLBuilderFonts::font_css($settings->font);
    ?>
}
<?php 
}
if ($global_settings->responsive_enabled && ($settings->r_font_size == 'custom' || $settings->r_alignment == 'custom')) {
    ?>
@media (max-width: <?php 
    echo $global_settings->responsive_breakpoint;
    ?>
px) {
	
	<?php 
    if ($settings->r_font_size == 'custom') {
        ?>
	.fl-node-<?php