예제 #1
0
/**
 * Date Picker OptionType
 *
 * @author 		SpyroSol
 * @category 	UI
 * @package 	Spyropress
 */
function spyropress_ui_datepicker($item, $id, $value, $is_widget = false, $is_builder = false)
{
    ob_start();
    // collecting attributes
    $atts = array();
    $atts['class'] = 'field';
    $atts['autocomplete'] = 'off';
    $atts['type'] = 'text';
    $atts['id'] = esc_attr($id);
    $atts['name'] = esc_attr($item['name']);
    if (isset($item['placeholder']) && $item['placeholder']) {
        $atts['placeholder'] = esc_attr($item['placeholder']);
    }
    $atts['value'] = esc_attr($value);
    echo '<div ' . build_section_class('section-datepicker', $item) . '>';
    build_heading($item, $is_widget);
    build_description($item);
    echo '<div class="controls">';
    printf('<input%s />', spyropress_build_atts($atts));
    echo '</div>';
    echo '</div>';
    $ui_content = ob_get_clean();
    $js = "panelUi.init_datepicker();";
    if ($is_widget) {
        if (!$is_builder) {
            add_jquery_ready($js);
        } else {
            $ui_content .= sprintf('<script type="text/javascript">%2$s//<![CDATA[%2$s %1$s %2$s//]]>%2$s</script>', $js, "\n");
        }
        return $ui_content;
    } else {
        echo $ui_content;
        add_jquery_ready($js);
    }
}
예제 #2
0
/**
 * Generate Markup
 */
function nivoslider_shortcode_handler($slider_id, $slides, $settings = '')
{
    // generate id
    $slider_id = 'nivoslider_' . $slider_id;
    add_jquery_ready('$("#' . $slider_id . '").nivoSlider();');
    $out = '<div class="nivo-slider"><div class="slider-wrapper theme-default"><div id="' . $slider_id . '" class="nivoSlider">';
    foreach ($slides as $slide) {
        // set content
        $out .= '<img src="' . $slide['image'] . '" data-thumb="' . $slide['image'] . '" alt="" />';
    }
    $out .= '</div></div></div>';
    return $out;
}
예제 #3
0
/**
 * Range Slider OptionType
 *
 * @author 		SpyroSol
 * @category 	UI
 * @package 	Spyropress
 */
function spyropress_ui_range_slider($item, $id, $value, $is_widget = false, $is_builder = false)
{
    ob_start();
    // collecting attributes
    $atts = array();
    $atts['class'] = 'field';
    $atts['type'] = 'text';
    $atts['name'] = esc_attr($item['name']);
    $atts['value'] = esc_attr($value);
    echo '<div ' . build_section_class('section-slider', $item) . '>';
    build_heading($item, $is_widget);
    build_description($item);
    echo '<div class="controls">';
    echo '<div class="range-slider clearfix">';
    printf('<div id="%s" class="slider"></div>', $id);
    printf('<input%s />', spyropress_build_atts($atts));
    echo '</div>';
    echo '</div>';
    echo '</div>';
    // content
    $ui_content = ob_get_clean();
    // js
    if (isset($item['max']) && $item['max'] != '') {
        $range_slider['max'] = $item['max'];
    }
    if (isset($item['min']) && $item['min'] != '') {
        $range_slider['min'] = $item['min'];
    }
    if (isset($item['step']) && $item['step'] != '') {
        $range_slider['step'] = $item['step'];
    }
    $range_slider['value'] = (int) $value;
    $range_slider['range'] = isset($item['range']) && $item['range'] != '' ? $item['range'] : 'min';
    $js = "panelUi.bind_range_slider( '{$id}', " . json_encode($range_slider) . ");";
    if ($is_widget) {
        $ui_content .= sprintf('<script type="text/javascript">%2$s//<![CDATA[%2$s %1$s %2$s//]]>%2$s</script>', $js, "\n");
        return $ui_content;
    } else {
        echo $ui_content;
        add_jquery_ready($js);
    }
}
예제 #4
0
/**
 * Color Picker OptionType
 *
 * @author 		SpyroSol
 * @category 	UI
 * @package 	Spyropress
 */
function spyropress_ui_colorpicker($item, $id, $value, $is_widget = false, $is_builder = false)
{
    ob_start();
    // collecting attributes
    $atts = array();
    $atts['class'] = 'field';
    $atts['type'] = 'text';
    $atts['id'] = esc_attr($id);
    $atts['name'] = esc_attr($item['name']);
    $atts['value'] = esc_attr($value);
    $style = '';
    if ('' != $value) {
        $style = ' style="background:' . $value . ';border-color:' . $value . '"';
    }
    echo '<div ' . build_section_class('section-color', $item) . '>';
    build_heading($item, $is_widget);
    build_description($item);
    echo '<div class="controls">';
    echo '<div class="color-picker clearfix">';
    printf('<input%s />', spyropress_build_atts($atts));
    printf('<div class="color-box"><div%s></div></div>', $style);
    echo '</div>';
    echo '</div>';
    echo '</div>';
    $ui_content = ob_get_clean();
    $js = "panelUi.bind_colorpicker( '{$id}', '', '' );";
    if ($is_widget) {
        if (!$is_builder) {
            add_jquery_ready($js);
        } else {
            $ui_content .= sprintf('<script type="text/javascript">%2$s//<![CDATA[%2$s %1$s %2$s//]]>%2$s</script>', $js, "\n");
        }
        return $ui_content;
    } else {
        echo $ui_content;
        add_jquery_ready($js);
    }
}
예제 #5
0
    function widget($args, $instance)
    {
        // extracting info
        $instance = wp_parse_args($instance, array('zoom' => 5, 'maptype' => 'ROADMAP', 'height' => 400));
        extract($args);
        extract($instance);
        if (empty($markers)) {
            return;
        }
        wp_enqueue_script('gmap-api', 'http' . (is_ssl() ? 's' : '') . '://maps.google.com/maps/api/js?sensor=false', false, false, true);
        wp_enqueue_script('jquery-gmap', framework_url() . 'builder/modules/gmap/jquery.gmap.min.js', false, false, true);
        $pin_url = framework_url() . 'builder/modules/gmap/pin.png';
        echo '<style type="text/css">
        .google-map { height: ' . $height . 'px; }
        
        </style>';
        echo '<div class="google-map" id="googlemaps"></div>';
        $markers_js = '';
        $count = count($markers);
        foreach ($markers as $marker) {
            $anchor = '';
            if (!empty($marker['lat']) && !empty($marker['long'])) {
                $anchor = '<br><br><a href=\'#\' onclick=\'mapCenterAt({latitude: ' . $marker['lat'] . ', longitude: ' . $marker['long'] . ', zoom: 16}, event)\'>' . __('[+] zoom here', 'spyropress') . '</a>';
            }
            $popup = 1 == $count ? ',popup: true' : '';
            $markers_js .= '
            {
                address: "' . $marker['address'] . '",
				html: "<strong>' . $marker['title'] . '</strong><br>' . $marker['desc'] . $anchor . '",
				icon: {
					image: "' . $pin_url . '",
					iconsize: [26, 46],
					iconanchor: [12, 46]
				}
                ' . $popup . '
			},';
        }
        $markers_js = '// Map Markers' . "\n" . 'var mapMarkers = [' . $markers_js . '];';
        $init_lat = !empty($init_lat) ? $init_lat : 0;
        $init_long = !empty($init_long) ? $init_long : 0;
        $markers_js .= "\n\n" . '// Map Initial Location' . "\n";
        $markers_js .= 'var initLatitude = ' . $init_lat . ';' . "\n";
        $markers_js .= 'var initLongitude = ' . $init_long . ';' . "\n";
        $markers_js .= "\n\n" . '// Map Extended Settings' . "\n";
        $markers_js .= '
        var mapSettings = {
            controls: {
                panControl: true,
                zoomControl: true,
                mapTypeControl: true,
                scaleControl: true,
                streetViewControl: true,
                overviewMapControl: true
			},
            scrollwheel: false,
            maptype: "' . $maptype . '",
			markers: mapMarkers,
			latitude: initLatitude,
            longitude: initLongitude,
            zoom: ' . $zoom . '
        };

        var map = $("#googlemaps").gMap(mapSettings);
        
        // Add Markers
        jQuery.each( mapMarkers, function(index, value) {
            $("#googlemaps").gMap("addMarker", value);
        });
        ';
        $centerat_js = "\n\n" . '// Map Center At' . "\n";
        $centerat_js .= '
        var mapCenterAt = function(options, e) {
            e.preventDefault();
            jQuery("#googlemaps").gMap("centerAt", options);
        }';
        add_jquery_ready($markers_js);
        add_inline_js($centerat_js);
    }
예제 #6
0
/**
 * Typography OptionType
 *
 * @author 		SpyroSol
 * @category 	UI
 * @package 	Spyropress
 */
function spyropress_ui_typography($item, $id, $value, $is_widget = false, $is_builder = false)
{
    ob_start();
    // setting default values
    $color = $cp_style = $tsc_style = '';
    $defaults = array('font-size' => '0px', 'line-height' => '0px', 'letter-spacing' => '0px', 'text-hshadow' => '0px', 'text-vshadow' => '0px', 'text-blur' => '0px', 'use' => 0, 'font-family' => '', 'font-style' => '', 'font-weight' => '', 'font-decoration' => '', 'font-transform' => '', 'font-google' => '', 'font-google-variant' => '', 'color' => '', 'text-shadowcolor' => '');
    $value = wp_parse_args($value, $defaults);
    // getting values
    if ($value['color']) {
        $cp_style = sprintf(' style="background:%1$s;border-color:%1$s"', $value['color']);
    }
    if ($value['text-shadowcolor']) {
        $tsc_style = sprintf(' style="background:%1$s;border-color:%1$s"', $value['text-shadowcolor']);
    }
    ?>

    <div id="<?php 
    echo $id;
    ?>
" <?php 
    echo build_section_class('section-typography section-full', $item);
    ?>
>
        <?php 
    build_heading($item, $is_widget);
    ?>

        <?php 
    build_description($item);
    ?>

        <div class="controls">
        <?php 
    // label for use google font
    printf('
                <label class="checkbox" for="%1$s-use">
                    <input type="checkbox" id="%1$s-use" name="%2$s[use]" value="1" %3$s />' . __('Use Google Fonts Instead', 'spyropress') . '</label>
            ', $id, $item['name'], checked($value['use'], 1, false));
    ?>

            <div class="row-fluid">
                <div class="span6">
                    <div class="pb10 web-font">
                        <strong class="sub"><?php 
    _e('Font Family', 'spyropress');
    ?>
</strong>
                        <select name="<?php 
    echo $item['name'];
    ?>
[font-family]" class="chosen-typo" data-placeholder="<?php 
    esc_attr_e('Select Font', 'spyropress');
    ?>
" data-css="font-family">
                        <?php 
    foreach (spyropress_panel_font_families() as $key => $family) {
        render_option(esc_attr($key), esc_html($family), array($value['font-family']));
    }
    ?>

                        </select>
                    </div>
                    <div class="pb10 web-font row-fluid">
                        <div class="span6">
                            <select name="<?php 
    echo $item['name'];
    ?>
[font-style]" class="chosen-typo" data-placeholder="<?php 
    esc_attr_e('Font Style', 'spyropress');
    ?>
" data-css="font-style">
                            <?php 
    foreach (spyropress_panel_font_styles() as $key => $style) {
        render_option(esc_attr($key), esc_html($style), array($value['font-style']));
    }
    ?>

                            </select>
                        </div>
                        <div class="span6">
                            <select name="<?php 
    echo $item['name'];
    ?>
[font-weight]" class="chosen-typo" data-placeholder="<?php 
    esc_attr_e('Font Weight', 'spyropress');
    ?>
" data-css="font-weight">
                            <?php 
    foreach (spyropress_panel_font_weights() as $key => $weight) {
        render_option(esc_attr($key), esc_html($weight), array($value['font-weight']));
    }
    ?>

                            </select>
                        </div>
                    </div>
                    <div class="pb10 google-font">
                        <strong class="sub"><?php 
    _e('Google Webfont Family', 'spyropress');
    ?>
</strong>
                        <select id="<?php 
    echo $id;
    ?>
-google" name="<?php 
    echo $item['name'];
    ?>
[font-google]" class="chosen-google-typo" data-placeholder="<?php 
    esc_attr_e('Google Webfont', 'spyropress');
    ?>
" data-selected="<?php 
    echo $value['font-google'];
    ?>
">
                        </select>
                    </div>
                    <div class="pb10 google-font">
                        <strong class="sub"><?php 
    _e('Google Webfont Variants', 'spyropress');
    ?>
</strong>
                        <select id="<?php 
    echo $id;
    ?>
-google-variant" name="<?php 
    echo $item['name'];
    ?>
[font-google-variant]" class="chosen-google-variant" data-placeholder="<?php 
    esc_attr_e('Google Webfont Variants', 'spyropress');
    ?>
" data-selected="<?php 
    echo $value['font-google-variant'];
    ?>
">
                        </select>
                    </div>
                </div>
                <div class="span6">
                    <div class="color-picker pb10 clearfix">
                        <strong class="sub">&nbsp;</strong>
                        <input type="text" class="field" name="<?php 
    echo $item['name'];
    ?>
[color]" id="<?php 
    echo $id;
    ?>
-colorpicker" value="<?php 
    echo $value['color'];
    ?>
" />
                        <div class="color-box"><div<?php 
    echo $cp_style;
    ?>
></div></div>
                    </div>
                    <div class="pb10 range-slider">
                        <strong class="sub"><?php 
    _e('Font Size:', 'spyropress');
    ?>
 <span><?php 
    echo $value['font-size'];
    ?>
</span></strong>
                        <div data-css="font-size" id="<?php 
    echo $id;
    ?>
-fontsize" class="slider"></div>
                        <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[font-size]" id="<?php 
    echo $id;
    ?>
-fontsize-value" value="<?php 
    echo $value['font-size'];
    ?>
" />
                    </div>
                </div>
            </div>
            <div id="<?php 
    echo $id;
    ?>
-preview" class="font-preview" style="<?php 
    spyropress_font_preview($value);
    ?>
">
                <?php 
    _e('Pack my box with five dozen liquor jugs.<br />The quick brown fox jumps over the lazy dog.', 'spyropress');
    ?>

            </div>
        </div>
        <div class="clear"></div>
        <a href="#" class="advance-settings"><?php 
    _e('Advance Settings', 'spyropress');
    ?>
</a>
        <div class="controls" style="display: none;">
            <div class="row-fluid">
                <div class="span3">
                    <select name="<?php 
    echo $item['name'];
    ?>
[font-decoration]" class="chosen-typo" data-placeholder="<?php 
    esc_attr_e('Text Decoration', 'spyropress');
    ?>
" data-css="text-decoration">
                    <?php 
    foreach (spyropress_panel_font_decoration() as $key => $decoration) {
        render_option(esc_attr($key), esc_html($decoration), array($value['font-decoration']));
    }
    ?>

                    </select>
                </div>
                <div class="span3">
                    <select name="<?php 
    echo $item['name'];
    ?>
[font-transform]" class="chosen-typo" data-placeholder="<?php 
    esc_attr_e('Text Transform', 'spyropress');
    ?>
" data-css="text-transform">
                    <?php 
    foreach (spyropress_panel_font_transform() as $key => $transform) {
        render_option(esc_attr($key), esc_html($transform), array($value['font-transform']));
    }
    ?>

                    </select>
                </div>
                <div class="span3 range-slider">
                    <strong class="sub"><?php 
    _e('Line Height:', 'spyropress');
    ?>
 <span><?php 
    echo $value['line-height'];
    ?>
</span></strong>
                    <div data-css="line-height" id="<?php 
    echo $id;
    ?>
-linehight" class="slider"></div>
                    <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[line-height]" id="<?php 
    echo $id;
    ?>
-lineheight-value" value="<?php 
    echo $value['line-height'];
    ?>
" />
                </div>
                <div class="span3 range-slider">
                    <strong class="sub"><?php 
    _e('Letter Spacing:', 'spyropress');
    ?>
 <span><?php 
    echo $value['letter-spacing'];
    ?>
</span></strong>
                    <div data-css="letter-spacing" id="<?php 
    echo $id;
    ?>
-letterspacing" class="slider"></div>
                    <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[letter-spacing]" id="<?php 
    echo $id;
    ?>
-letterspacing-value" value="<?php 
    echo $value['letter-spacing'];
    ?>
" />
                </div>
            </div>
            <br />
            <strong class="sub"><?php 
    _e('Text-Shadow', 'spyropress');
    ?>
</strong>
            <div class="row-fluid">
                <div class="span3 range-slider">
                    <strong class="sub"><?php 
    _e('h-Shadow:', 'spyropress');
    ?>
 <span><?php 
    echo $value['text-hshadow'];
    ?>
</span></strong>
                    <div data-css="text-shadow" id="<?php 
    echo $id;
    ?>
-hshadow" class="slider"></div>
                    <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[text-hshadow]" id="<?php 
    echo $id;
    ?>
-hshadow-value" value="<?php 
    echo $value['text-hshadow'];
    ?>
" />
                </div>
                <div class="span3 range-slider">
                    <strong class="sub"><?php 
    _e('v-Shadow:', 'spyropress');
    ?>
 <span><?php 
    echo $value['text-vshadow'];
    ?>
</span></strong>
                    <div data-css="text-shadow" id="<?php 
    echo $id;
    ?>
-vshadow" class="slider"></div>
                    <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[text-vshadow]" id="<?php 
    echo $id;
    ?>
-vshadow-value" value="<?php 
    echo $value['text-vshadow'];
    ?>
" />
                </div>
                <div class="span3 range-slider">
                    <strong class="sub"><?php 
    _e('Blur:', 'spyropress');
    ?>
 <span><?php 
    echo $value['text-blur'];
    ?>
</span></strong>
                    <div data-css="text-shadow" id="<?php 
    echo $id;
    ?>
-blur" class="slider"></div>
                    <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[text-blur]" id="<?php 
    echo $id;
    ?>
-blur-value" value="<?php 
    echo $value['text-blur'];
    ?>
" />
                </div>
                <div class="span3 color-picker clearfix">
                    <input type="text" class="field shadow" name="<?php 
    echo $item['name'];
    ?>
[text-shadowcolor]" id="<?php 
    echo $id;
    ?>
-shadowcolor" value="<?php 
    echo $value['text-shadowcolor'];
    ?>
" />
                    <div class="color-box"><div<?php 
    echo $tsc_style;
    ?>
></div></div>
                </div>
            </div>
        </div>
    </div>
<?php 
    /* content */
    $ui_content = ob_get_clean();
    /* js */
    $fontsize_value = str_replace('px', '', $value['font-size']);
    $line_height_value = str_replace('px', '', $value['line-height']);
    $letter_spacing_value = str_replace('px', '', $value['letter-spacing']);
    $slider_hshadow_value = str_replace('px', '', $value['text-hshadow']);
    $slider_vshadow_value = str_replace('px', '', $value['text-vshadow']);
    $slider_blur_value = str_replace('px', '', $value['text-blur']);
    $typo['colorpicker'] = array($id . '-colorpicker', $id . '-shadowcolor');
    $typo['slider'] = array("#{$id}-fontsize" => array('range' => 'min', 'min' => 1, 'max' => 120, 'value' => (int) $fontsize_value), "#{$id}-linehight" => array('range' => 'min', 'min' => 7, 'max' => 89, 'value' => (int) $line_height_value), "#{$id}-letterspacing" => array('min' => -20, 'max' => 20, 'value' => (int) $letter_spacing_value), "#{$id}-hshadow" => array('min' => -50, 'max' => 50, 'value' => (int) $slider_hshadow_value), "#{$id}-vshadow" => array('min' => -50, 'max' => 50, 'value' => (int) $slider_vshadow_value), "#{$id}-blur" => array('range' => 'min', 'min' => 0, 'max' => 100, 'value' => (int) $slider_blur_value));
    $js = "panelUi.bind_typography( '{$id}', " . json_encode($typo) . ");";
    if ($is_widget) {
        if (!$is_builder) {
            add_jquery_ready($js);
        } else {
            $ui_content .= sprintf('<script type="text/javascript">%2$s//<![CDATA[%2$s %1$s %2$s//]]>%2$s</script>', $js, "\n");
        }
        return $ui_content;
    } else {
        echo $ui_content;
        add_jquery_ready($js);
    }
}
예제 #7
0
/**
 * Background OptionType
 *
 * @author 		SpyroSol
 * @category 	UI
 * @package 	Spyropress
 */
function spyropress_ui_background($item, $id, $value, $is_widget = false, $is_builder = false)
{
    ob_start();
    // defaults
    $style = '';
    $defaults = array('background-color' => '', 'background-image' => '', 'background-repeat' => '', 'background-attachment' => '', 'background-position' => '', 'background-pattern' => '');
    $value = wp_parse_args($value, $defaults);
    // collecting colorpicker attributes
    $atts = array();
    $atts['class'] = 'field';
    $atts['type'] = 'text';
    $atts['id'] = esc_attr($id . '-colorpicker');
    $atts['name'] = esc_attr($item['name'] . '[background-color]');
    if ($value['background-color']) {
        $atts['value'] = esc_attr($value['background-color']);
    }
    $style = '';
    if ($value['background-color']) {
        $style = ' style="background:' . $value['background-color'] . ';border-color:' . $value['background-color'] . '"';
    }
    // collecting upload attributes
    $upload_attrs = array();
    $upload_attrs['class'] = 'field upload' . ($value != '' ? ' has-file' : '');
    $upload_attrs['type'] = 'text';
    $upload_attrs['id'] = esc_attr($id);
    $upload_attrs['name'] = esc_attr($item['name'] . '[background-image]');
    if ($value['background-image']) {
        $upload_attrs['value'] = esc_attr($value['background-image']);
    }
    ?>

    <div <?php 
    echo build_section_class('section-background', $item);
    ?>
>
        <?php 
    build_heading($item, $is_widget);
    ?>

        <?php 
    build_description($item);
    ?>

        <?php 
    build_section_reset();
    ?>

        <div class="controls">
            <div class="color-picker pb10 clearfix">
            <?php 
    printf('<input%s />', spyropress_build_atts($atts));
    printf('<div class="color-box"><div%s></div></div>', $style);
    ?>
                
            </div>
            <div class="pb10 row-fluid">
                <div class="span6">
                    <select name="<?php 
    echo $item['name'];
    ?>
[background-repeat]" class="chosen" data-placeholder="<?php 
    esc_attr_e('Background Repeat', 'spyropress');
    ?>
">
                        <?php 
    foreach (spyropress_panel_background_repeat() as $key => $repeat) {
        render_option(esc_attr($key), esc_html($repeat), array($value['background-repeat']));
    }
    ?>

                    </select>
                </div>
                <div class="span6">
                    <select name="<?php 
    echo $item['name'];
    ?>
[background-attachment]" class="chosen" data-placeholder="<?php 
    esc_attr_e('Background Attachment', 'spyropress');
    ?>
">
                        <?php 
    foreach (spyropress_panel_background_attachment() as $key => $attachment) {
        render_option(esc_attr($key), esc_html($attachment), array($value['background-attachment']));
    }
    ?>

                    </select>
                </div>
            </div>
            <div class="pb10">
                <select name="<?php 
    echo $item['name'];
    ?>
[background-position]" class="chosen" data-placeholder="<?php 
    esc_attr_e('Background Position', 'spyropress');
    ?>
">
                    <?php 
    foreach (spyropress_panel_background_position() as $key => $position) {
        render_option(esc_attr($key), esc_html($position), array($value['background-position']));
    }
    ?>

                </select>
            </div>
            <div class="uploader pb10 clearfix">
            <?php 
    printf('<input%s />', spyropress_build_atts($upload_attrs));
    printf('<input class="upload_button button-secondary" type="button" value="' . __('Upload', 'spyropress') . '" id="upload_%s" />', $id);
    if (is_array(@getimagesize($value['background-image']))) {
        ?>

                <div class="screenshot" id="<?php 
        echo $id;
        ?>
_image">
                <?php 
        if ($value['background-image'] != '') {
            $remove = '<a href="javascript:(void);" class="remove-media">Remove</a>';
            $image = preg_match('/(^.*\\.jpg|jpeg|png|gif|ico*)/i', $value['background-image']);
            if ($image) {
                echo '<img src="' . $value['background-image'] . '" alt="" />' . $remove . '';
            } else {
                $parts = explode("/", $value['background-image']);
                for ($i = 0; $i < sizeof($parts); ++$i) {
                    $title = $parts[$i];
                }
                echo '<div class="no_image"><a href="' . $value['background-image'] . '">' . $title . '</a>' . $remove . '</div>';
            }
        }
        ?>

                </div>
            <?php 
    }
    ?>

            </div>
            <?php 
    if (isset($item['use_pattern']) && $item['use_pattern'] && isset($item['patterns'])) {
        ?>

            <div class="section-radio-img section-pattern">
                <h3 class="heading"><?php 
        _e('Background Patterns', 'spyropress');
        ?>
</h3>
                <ul id="bg_patterns">
                <?php 
        foreach ($item['patterns'] as $path => $label) {
            printf('
                            <li><label class="radio-img%6$s" for="%1$s">
                                <input type="radio" id="%1$s" name="%3$s[background-pattern]" value="%2$s" %5$s />
                                <img src="%4$s">
                            </label></li>', $item['name'] . '_' . $label, $path, $item['name'], $path, checked($value['background-pattern'], $path, false), $value['background-pattern'] == $path ? ' selected' : '');
        }
        ?>

                </ul>
                <div class="clear"></div>
            </div>
            <?php 
    }
    ?>

        </div>
    </div>
<?php 
    $ui_content = ob_get_clean();
    $js = "panelUi.bind_colorpicker( '{$id}-colorpicker' );";
    if ($is_widget) {
        if (!$is_builder) {
            add_jquery_ready($js);
        } else {
            $ui_content .= sprintf('<script type="text/javascript">%2$s//<![CDATA[%2$s %1$s %2$s//]]>%2$s</script>', $js, "\n");
        }
        return $ui_content;
    } else {
        echo $ui_content;
        add_jquery_ready($js);
    }
}
예제 #8
0
/**
 * Margin/Padding OptionType
 *
 * @author 		SpyroSol
 * @category 	UI
 * @package 	Spyropress
 */
function spyropress_ui_padder($item, $id, $value, $is_widget = false, $is_builder = false)
{
    ob_start();
    // setting default values
    $cp_style = '';
    $defaults = array('top' => '0px', 'right' => '0px', 'bottom' => '0px', 'left' => '0px');
    $value = wp_parse_args($value, $defaults);
    ?>

    <div id="<?php 
    echo $id;
    ?>
" <?php 
    echo build_section_class('section-padder section-full', $item);
    ?>
>
        <?php 
    build_heading($item, $is_widget);
    ?>

        <?php 
    build_description($item);
    ?>

        <div class="controls row-fluid">
            <div class="span3 range-slider">
                <strong class="sub"><?php 
    _e('Top:', 'spyropress');
    ?>
 <span><?php 
    echo $value['top'];
    ?>
</span></strong>
                <div id="<?php 
    echo $id;
    ?>
-top" class="slider"></div>
                <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[top]" id="<?php 
    echo $id;
    ?>
-top-value" value="<?php 
    echo $value['top'];
    ?>
" />
            </div>
            <div class="span3 range-slider">
                <strong class="sub"><?php 
    _e('Bottom:', 'spyropress');
    ?>
 <span><?php 
    echo $value['bottom'];
    ?>
</span></strong>
                <div id="<?php 
    echo $id;
    ?>
-bottom" class="slider"></div>
                <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[bottom]" id="<?php 
    echo $id;
    ?>
-bottom-value" value="<?php 
    echo $value['bottom'];
    ?>
" />
            </div>
            <div class="span3 range-slider">
                <strong class="sub"><?php 
    _e('Left:', 'spyropress');
    ?>
 <span><?php 
    echo $value['left'];
    ?>
</span></strong>
                <div id="<?php 
    echo $id;
    ?>
-left" class="slider"></div>
                <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[left]" id="<?php 
    echo $id;
    ?>
-left-value" value="<?php 
    echo $value['left'];
    ?>
" />
            </div>
            <div class="span3 range-slider">
                <strong class="sub"><?php 
    _e('Right:', 'spyropress');
    ?>
 <span><?php 
    echo $value['right'];
    ?>
</span></strong>
                <div id="<?php 
    echo $id;
    ?>
-right" class="slider"></div>
                <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[right]" id="<?php 
    echo $id;
    ?>
-right-value" value="<?php 
    echo $value['right'];
    ?>
" />
            </div>
        </div>
    </div>                
<?php 
    // content
    $ui_content = ob_get_clean();
    /* js */
    $slider_top = str_replace('px', '', $value['top']);
    $slider_bottom = str_replace('px', '', $value['bottom']);
    $slider_left = str_replace('px', '', $value['left']);
    $slider_right = str_replace('px', '', $value['right']);
    $padder['slider'] = array("#{$id}-top" => array('value' => (int) $slider_top), "#{$id}-bottom" => array('value' => (int) $slider_bottom), "#{$id}-left" => array('value' => (int) $slider_left), "#{$id}-right" => array('value' => (int) $slider_right));
    $js = "panelUi.bind_padder( '{$id}', " . json_encode($padder) . ");";
    if ($is_widget) {
        if (!$is_builder) {
            add_jquery_ready($js);
        } else {
            $ui_content .= sprintf('<script type="text/javascript">%2$s//<![CDATA[%2$s %1$s %2$s//]]>%2$s</script>', $js, "\n");
        }
        return $ui_content;
    } else {
        echo $ui_content;
        add_jquery_ready($js);
    }
}
예제 #9
0
    $counter++;
}
if (!empty($works)) {
    $js = '
        // Circle Slider
    	if($("#fcSlideshow").get(0)) {
    		$("#fcSlideshow").flipshow();
    
    		setInterval( function() {
    			$("#fcSlideshow div.fc-right span:first").click();
    		}, 3000);
    
    	}
        
        theme.Spyropress.moveCloud();';
    add_jquery_ready($js);
    ?>

	<div class="col-md-4 col-md-offset-1">
		<div class="project-image">
			<div id="fcSlideshow" class="fc-slideshow">
				<ul class="fc-slides">
                <?php 
    foreach ($works as $work) {
        $work_url = '#';
        if (isset($work['url'])) {
            $work_url = $work['url'];
        } elseif (isset($work['link'])) {
            $work_url = get_permalink($work['link']);
        }
        echo '<li><a href="' . $work_url . '">' . get_image(array('class' => 'img-responsive', 'width' => 350, 'echo' => false, 'url' => $work['img'])) . '</a></li>';
예제 #10
0
/**
 * Border OptionType
 *
 * @author 		SpyroSol
 * @category 	UI
 * @package 	Spyropress
 */
function spyropress_ui_border($item, $id, $value, $is_widget = false, $is_builder = false)
{
    ob_start();
    /* setting default values */
    $cp_style = '';
    $defaults = array('top' => '0px', 'top-color' => '', 'top-style' => '', 'right' => '0px', 'right-color' => '', 'right-style' => '', 'bottom' => '0px', 'bottom-color' => '', 'bottom-style' => '', 'left' => '0px', 'left-color' => '', 'left-style' => '');
    $value = wp_parse_args($value, $defaults);
    /* getting values */
    $top_color_style = $bottom_color_style = $left_color_style = $right_color_style = '';
    if ($value['top-color']) {
        $top_color_style = sprintf(' style="background:%1$s;border-color:%1$s"', $value['top-color']);
    }
    if ($value['bottom-color']) {
        $bottom_color_style = sprintf(' style="background:%1$s;border-color:%1$s"', $value['bottom-color']);
    }
    if ($value['left-color']) {
        $left_color_style = sprintf(' style="background:%1$s;border-color:%1$s"', $value['left-color']);
    }
    if ($value['right-color']) {
        $right_color_style = sprintf(' style="background:%1$s;border-color:%1$s"', $value['right-color']);
    }
    ?>

    <div id="<?php 
    echo $id;
    ?>
" <?php 
    echo build_section_class('section-border section-full', $item);
    ?>
>
        <?php 
    build_heading($item, $is_widget);
    ?>

        <?php 
    build_description($item);
    ?>

        <div class="controls">
            <div class="row-fluid pb10">
                <div class="span6">
                    <strong class="sub"><?php 
    _e('Top Border:', 'spyropress');
    ?>
</strong>
                    <div class="range-slider pb10">
                        <strong class="sub"><?php 
    _e('Width:', 'spyropress');
    ?>
 <span><?php 
    echo $value['top'];
    ?>
</span></strong>
                        <div id="<?php 
    echo $id;
    ?>
-top" class="slider"></div>
                        <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[top]" id="<?php 
    echo $id;
    ?>
-top-value" value="<?php 
    echo $value['top'];
    ?>
" />
                    </div>
                    <br />
                    <div class="row-fluid">
                        <div class="span6">
                            <select class="chosen" name="<?php 
    echo $item['name'];
    ?>
[top-style]" id="<?php 
    echo $id;
    ?>
-top-style">
                            <?php 
    foreach (spyropress_panel_border_styles() as $key => $style) {
        render_option(esc_attr($key), esc_html($style), array($value['top-style']));
    }
    ?>

                            </select>
                        </div>
                        <div class="span6">
                            <div class="color-picker clearfix">
                                <input type="text" class="field" name="<?php 
    echo $item['name'];
    ?>
[top-color]" id="<?php 
    echo $id;
    ?>
-top-colorpicker" value="<?php 
    echo $value['top-color'];
    ?>
" />
                                <div class="color-box"><div<?php 
    echo $top_color_style;
    ?>
></div></div>
                            </div>
                        </div>
                    </div>                
                </div>
                <div class="span6">
                    <strong class="sub"><?php 
    _e('Bottom Border:', 'spyropress');
    ?>
</strong>
                    <div class="range-slider pb10">
                        <strong class="sub"><?php 
    _e('Width:', 'spyropress');
    ?>
 <span><?php 
    echo $value['bottom'];
    ?>
</span></strong>
                        <div id="<?php 
    echo $id;
    ?>
-bottom" class="slider"></div>
                        <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[bottom]" id="<?php 
    echo $id;
    ?>
-bottom-value" value="<?php 
    echo $value['bottom'];
    ?>
" />
                    </div>
                    <br />
                    <div class="row-fluid">
                        <div class="span6">
                            <select class="chosen" name="<?php 
    echo $item['name'];
    ?>
[bottom-style]" id="<?php 
    echo $id;
    ?>
-bottom-style">
                            <?php 
    foreach (spyropress_panel_border_styles() as $key => $style) {
        render_option(esc_attr($key), esc_html($style), array($value['bottom-style']));
    }
    ?>

                            </select>
                        </div>
                        <div class="span6">
                            <div class="color-picker clearfix">
                                <input type="text" class="field" name="<?php 
    echo $item['name'];
    ?>
[bottom-color]" id="<?php 
    echo $id;
    ?>
-bottom-colorpicker" value="<?php 
    echo $value['bottom-color'];
    ?>
" />
                                <div class="color-box"><div<?php 
    echo $bottom_color_style;
    ?>
></div></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <br />
            <div class="row-fluid">
                <div class="span6">
                    <strong class="sub"><?php 
    _e('Left Border:', 'spyropress');
    ?>
</strong>
                    <div class="range-slider pb10">
                        <strong class="sub"><?php 
    _e('Width:', 'spyropress');
    ?>
 <span><?php 
    echo $value['left'];
    ?>
</span></strong>
                        <div id="<?php 
    echo $id;
    ?>
-left" class="slider"></div>
                        <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[left]" id="<?php 
    echo $id;
    ?>
-left-value" value="<?php 
    echo $value['left'];
    ?>
" />
                    </div>
                    <br />
                    <div class="row-fluid">
                        <div class="span6">
                            <select class="chosen" name="<?php 
    echo $item['name'];
    ?>
[left-style]" id="<?php 
    echo $id;
    ?>
-left-style">
                            <?php 
    foreach (spyropress_panel_border_styles() as $key => $style) {
        render_option(esc_attr($key), esc_html($style), array($value['left-style']));
    }
    ?>

                            </select>
                        </div>
                        <div class="span6">
                            <div class="color-picker clearfix">
                                <input type="text" class="field" name="<?php 
    echo $item['name'];
    ?>
[left-color]" id="<?php 
    echo $id;
    ?>
-left-colorpicker" value="<?php 
    echo $value['left-color'];
    ?>
" />
                                <div class="color-box"><div<?php 
    echo $left_color_style;
    ?>
></div></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="span6">
                    <strong class="sub"><?php 
    _e('Right Border:', 'spyropress');
    ?>
</strong>
                    <div class="range-slider pb10">
                        <strong class="sub"><?php 
    _e('Width:', 'spyropress');
    ?>
 <span><?php 
    echo $value['right'];
    ?>
</span></strong>
                        <div id="<?php 
    echo $id;
    ?>
-right" class="slider"></div>
                        <input type="hidden" name="<?php 
    echo $item['name'];
    ?>
[right]" id="<?php 
    echo $id;
    ?>
-right-value" value="<?php 
    echo $value['right'];
    ?>
" />
                    </div>
                    <br />
                    <div class="row-fluid">
                        <div class="span6">
                            <select class="chosen" name="<?php 
    echo $item['name'];
    ?>
[right-style]" id="<?php 
    echo $id;
    ?>
-right-style">
                            <?php 
    foreach (spyropress_panel_border_styles() as $key => $style) {
        render_option(esc_attr($key), esc_html($style), array($value['right-style']));
    }
    ?>

                            </select>
                        </div>
                        <div class="span6">
                            <div class="color-picker clearfix">
                                <input type="text" class="field" name="<?php 
    echo $item['name'];
    ?>
[right-color]" id="<?php 
    echo $id;
    ?>
-right-colorpicker" value="<?php 
    echo $value['right-color'];
    ?>
" />
                                <div class="color-box"><div<?php 
    echo $right_color_style;
    ?>
></div></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>                
<?php 
    /* content */
    $ui_content = ob_get_clean();
    /* js */
    $slider_top = str_replace('px', '', $value['top']);
    $slider_bottom = str_replace('px', '', $value['bottom']);
    $slider_left = str_replace('px', '', $value['left']);
    $slider_right = str_replace('px', '', $value['right']);
    $border['colorpicker'] = array($id . '-top-colorpicker', $id . '-bottom-colorpicker', $id . '-left-colorpicker', $id . '-right-colorpicker');
    $border['slider'] = array("#{$id}-top" => array('value' => (int) $slider_top), "#{$id}-bottom" => array('value' => (int) $slider_bottom), "#{$id}-left" => array('value' => (int) $slider_left), "#{$id}-right" => array('value' => (int) $slider_right));
    $js = "panelUi.bind_border( '{$id}', " . json_encode($border) . ");";
    if ($is_widget) {
        if (!$is_builder) {
            add_jquery_ready($js);
        } else {
            $ui_content .= sprintf('<script type="text/javascript">%2$s//<![CDATA[%2$s %1$s %2$s//]]>%2$s</script>', $js, "\n");
        }
        return $ui_content;
    } else {
        echo $ui_content;
        add_jquery_ready($js);
    }
}