示例#1
0
        protected function content($atts, $content = null)
        {
            global $ivan_custom_css;
            // Extract  atts and setup initial vars
            extract(shortcode_atts(array('infos_inside' => 'no', 'social_inside' => 'no', 'overlay' => 'no', 'opacity' => 'no', 'grayscale' => 'no', 'align' => '', 'image_id' => '', 'name' => '', 'job_title' => '', 'el_class' => ''), $atts));
            $output = '';
            $classes = '';
            // Output customizer rules
            foreach ($this->selectors as $key => $value) {
                if (isset($atts[$key]) && '' != $atts[$key]) {
                    preg_match("!\\{\\s*([^\\}]+)\\s*\\}!", $atts[$key], $match);
                    if (!empty($match[0])) {
                        $this->prefix = str_replace(array('{', '}'), '', $match[0]) . ' ';
                        $atts[$key] = str_replace($match[0], "", $atts[$key]);
                    }
                }
            }
            $infos_inside = $infos_inside;
            $social_inside = $social_inside;
            // Effects
            if ('yes' == $overlay) {
                $classes .= ' overlay-enabled';
            }
            if ('yes' == $opacity) {
                $classes .= ' opacity-enabled';
            }
            if ('yes' == $grayscale) {
                $classes .= ' gray-enabled';
            }
            $classes .= $align;
            // Add custom classes provided by users
            if ('' != $el_class) {
                $classes .= ' ' . $el_class;
            }
            // Social Markup
            $social_markup = '';
            // Social Icon List
            $ivan_icon_array = ivan_vc_staff_icons();
            foreach ($ivan_icon_array as $key => $value) {
                if (isset($atts[$key])) {
                    $social_markup .= '<a href="' . $atts[$key] . '" target="_blank"><i class="fa fa-' . str_replace('_', '-', $key) . '"></i></a>';
                }
            }
            // Output Form
            ob_start();
            ?>
			<div class="ivan-staff-main <?php 
            echo str_replace('.', '', $this->prefix);
            ?>
">
				<div class="ivan-staff-wrapper taphover <?php 
            echo $classes;
            ?>
">
					<?php 
            if ('' != $image_id) {
                ?>
						<div class="thumbnail">
							<?php 
                $url = wp_get_attachment_image_src($image_id, 'full');
                echo '<img src="' . $url['0'] . '" alt="">';
                ?>
							<span class="overlay"></span>
							<?php 
                if ('yes' == $infos_inside) {
                    ?>
								<div class="name"><?php 
                    echo $name;
                    ?>
</div>
								<?php 
                    if ('' != $job_title) {
                        ?>
									<div class="job-title"><?php 
                        echo $job_title;
                        ?>
</div>
								<?php 
                    }
                    ?>
							<?php 
                }
                ?>
							<?php 
                if ('yes' == $social_inside && '' != $social_markup) {
                    ?>
								<div class="social-icons-inside">
									<div class="social-icons-inner">
										<div class="centered">
											<?php 
                    echo $social_markup;
                    ?>
										</div>
									</div>
								</div>
							<?php 
                }
                ?>
						</div>
					<?php 
            }
            ?>
					<?php 
            if ('yes' != $infos_inside or '' != $content or 'yes' != $social_inside) {
                ?>
						<div class="infos">
							<?php 
                if ('yes' != $infos_inside) {
                    ?>
								<div class="name"><?php 
                    echo $name;
                    ?>
</div>
								<?php 
                    if ('' != $job_title) {
                        ?>
									<div class="job-title"><?php 
                        echo $job_title;
                        ?>
</div>
								<?php 
                    }
                    ?>
							<?php 
                }
                ?>
							<?php 
                if ('' != $content) {
                    ?>
								<div class="description">
									<?php 
                    echo do_shortcode($content);
                    ?>
								</div>
							<?php 
                }
                ?>
							<?php 
                if ('yes' != $social_inside && '' != $social_markup) {
                    ?>
								<div class="social-icons">
										<?php 
                    echo $social_markup;
                    ?>
								</div>
							<?php 
                }
                ?>
						</div>
					<?php 
            }
            ?>
				</div>
			</div>
			<?php 
            $output .= ob_get_clean();
            $style = '';
            foreach ($this->selectors as $key => $value) {
                if (isset($atts[$key]) && '' != $atts[$key]) {
                    $style .= ivan_vc_customizer_get_style($atts[$key], $this->selectors[$key], $this->prefix);
                }
            }
            // Print style
            if (is_admin()) {
                $output .= '<style type="text/css">' . $style . '</style>';
            } else {
                $ivan_custom_css .= $style;
            }
            return $output;
        }
示例#2
0
vc_map(array('name' => __('Title Wrapper', '_sdomain'), 'base' => 'ivan_title', 'icon' => 'vc_info_box', 'class' => 'ivan_title_wrapper', 'category' => 'VC Customizer', 'description' => 'Display a styled title wrapper great to create different titles types.', 'controls' => 'full', 'show_settings_on_create' => true, 'params' => array(array("type" => "textarea", "class" => "", "heading" => __("Title", 'iv_js_composer'), "param_name" => "content", "description" => __("Define the text and icons to be displayed. Use strong tag to display the text highlighted. Shortcodes and HTML tags accepted.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Icon Family", 'iv_js_composer'), "param_name" => "ico_family", "value" => array('Font Awesome' => 'fa fa-', 'Elegant Icons' => 'el el-', 'Custom' => 'custom'), "description" => __("Select the icon family.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Custom Icon Class", 'iv_js_composer'), "param_name" => "ico_custom", "description" => __("Type a custom icon class to be used in the icon.", 'iv_js_composer'), 'dependency' => array('element' => 'ico_family', 'value' => 'custom')), array("type" => "textfield", "heading" => __("Icon Name", 'iv_js_composer'), "param_name" => "ico", "description" => __("Type icon name without prefixes, e.g. cogs or eye.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Above Icon?", 'iv_js_composer'), "param_name" => "above_icon", "value" => array('No' => 'no', 'Yes' => 'yes'), "description" => __("Display icon above title.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Align", 'iv_js_composer'), "param_name" => "align", "value" => array('Default' => ' default-align', 'Center' => ' to-center', 'Left' => ' to-left', 'Right' => ' to-right'), "description" => __("Select main alignment of title.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Display", 'iv_js_composer'), "param_name" => "display", "value" => array('Default' => ' default-display', 'Inline' => ' inline-block'), "description" => __("Select the display type of title.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Mark", 'iv_js_composer'), "param_name" => "mark", "value" => array('Default' => ' default-mark', 'Center' => ' mark mark-center', 'Left' => ' mark mark-left', 'Right' => ' mark mark-right'), "description" => __("Select the alignment of the mark below the title.", 'iv_js_composer')), array("type" => "textarea", "class" => "", "heading" => __("Sub Title", 'iv_js_composer'), "param_name" => "sub", "description" => __("Define the text to be displayed below main title. Use strong tag to display the text highlighted. Shortcodes and HTML tags accepted.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Extra class name", 'iv_js_composer'), "param_name" => "el_class", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Title", 'iv_js_composer'), "param_name" => "title_css", "customize" => $ivan_vc_title_wrapper->selectors['title_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Highlight/Link", 'iv_js_composer'), "param_name" => "highlight_css", "customize" => $ivan_vc_title_wrapper->selectors['highlight_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Sub Title", 'iv_js_composer'), "param_name" => "subtitle_css", "customize" => $ivan_vc_title_wrapper->selectors['subtitle_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Mark", 'iv_js_composer'), "param_name" => "mark_css", "customize" => $ivan_vc_title_wrapper->selectors['mark_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Icon", 'iv_js_composer'), "param_name" => "icon_css", "customize" => $ivan_vc_title_wrapper->selectors['icon_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')))));
// #map end
/***
 * Testimonial
***/
// Call global var to use selectors array
global $ivan_vc_testimonial;
vc_map(array('name' => __('Testimonial', '_sdomain'), 'base' => 'ivan_testimonial', 'icon' => 'vc_info_box', 'class' => 'ivan_testimonial', 'category' => 'VC Customizer', 'description' => 'Display a styled title wrapper great to create different titles types.', 'controls' => 'full', 'show_settings_on_create' => true, 'params' => array(array("type" => "textarea", "class" => "", "heading" => __("Testimonial", 'iv_js_composer'), "param_name" => "content", "description" => __("What did the customer said, here you define what will be displayed.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Quote Align", 'iv_js_composer'), "param_name" => "align", "value" => array('Default' => ' default-align', 'Center' => ' to-center', 'Left' => ' to-left', 'Right' => ' to-right'), "description" => __("Select main alignment of quote.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Meta Align", 'iv_js_composer'), "param_name" => "meta_align", "value" => array('Default' => ' default-align', 'Center' => ' to-center', 'Left' => ' to-left', 'Right' => ' to-right'), "description" => __("Select main alignment of meta.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Author", 'iv_js_composer'), "param_name" => "author", "description" => __("The author name, e.g. Carl James via Twitter.", 'iv_js_composer')), array("type" => "attach_image", "class" => "", "heading" => __("Author Image", 'iv_js_composer'), "param_name" => "image_id", "value" => "", "description" => __("Upload or select background image from media gallery. Use a size like 100x100 for example.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Author Image Position", 'iv_js_composer'), "param_name" => "image_position", "value" => array('Default' => 'default', 'Left' => 'left', 'Right' => 'right'), "description" => __("Select the optional position of author image.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Extra class name", 'iv_js_composer'), "param_name" => "el_class", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Main Block", 'iv_js_composer'), "param_name" => "main_css", "customize" => $ivan_vc_testimonial->selectors['main_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Quote", 'iv_js_composer'), "param_name" => "quote_css", "customize" => $ivan_vc_testimonial->selectors['quote_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Author", 'iv_js_composer'), "param_name" => "meta_css", "customize" => $ivan_vc_testimonial->selectors['meta_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Image", 'iv_js_composer'), "param_name" => "img_css", "customize" => $ivan_vc_testimonial->selectors['img_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')))));
// #map end
/***
 * Staff
***/
// Call global var to use selectors array
global $ivan_vc_staff;
// Social Icon List
$ivan_icon_array = ivan_vc_staff_icons();
$staff_icons_fields = array();
foreach ($ivan_icon_array as $key => $value) {
    $staff_icons_fields[] = array("type" => "textfield", "heading" => $value, "param_name" => $key, "description" => __("Type your social address with http:// prefix or other.", 'iv_js_composer'), "group" => __('Social Icons', 'iv_js_composer'));
}
vc_map(array('name' => __('Staff Member', '_sdomain'), 'base' => 'ivan_staff', 'icon' => 'vc_info_box', 'class' => 'ivan_staff', 'category' => 'VC Customizer', 'description' => 'Display a staff member with support to effects and social icons.', 'controls' => 'full', 'show_settings_on_create' => true, 'params' => array_merge(array(array("type" => "textarea_html", "class" => "", "heading" => __("Description", 'iv_js_composer'), "param_name" => "content", "description" => __("Optional description to this staff member.", 'iv_js_composer')), array("type" => "attach_image", "class" => "", "heading" => __("Staff Image", 'iv_js_composer'), "param_name" => "image_id", "value" => "", "description" => __("Upload or select a photo from media gallery.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Name", 'iv_js_composer'), "param_name" => "name", "description" => __("Type your staff member name.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Job Title", 'iv_js_composer'), "param_name" => "job_title", "description" => __("Type your staff member job title, e.g. Manager.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Infos Position", 'iv_js_composer'), "param_name" => "infos_inside", "value" => array('Outside' => 'no', 'Inside Thumbnail' => 'yes'), "description" => __("Select the name and job title position.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Social Icons Position", 'iv_js_composer'), "param_name" => "social_inside", "value" => array('Outside' => 'no', 'Inside Thumbnail' => 'yes'), "description" => __("Select the social icons position.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Effect: Overlay", 'iv_js_composer'), "param_name" => "overlay", "value" => array('No' => 'no', 'Yes' => 'yes'), "description" => __("Enable the effect on this modules.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Effect: Opacity", 'iv_js_composer'), "param_name" => "opacity", "value" => array('No' => 'no', 'Yes' => 'yes'), "description" => __("Enable the effect on this modules.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Effect: Grayscale", 'iv_js_composer'), "param_name" => "grayscale", "value" => array('No' => 'no', 'Yes' => 'yes'), "description" => __("Enable the effect on this modules.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Align", 'iv_js_composer'), "param_name" => "align", "value" => array('Default' => ' to-default', 'Center' => ' to-center'), "description" => __("Define alignment of infos.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Extra class name", 'iv_js_composer'), "param_name" => "el_class", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Main Block", 'iv_js_composer'), "param_name" => "main_css", "customize" => $ivan_vc_staff->selectors['main_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Image", 'iv_js_composer'), "param_name" => "image_css", "customize" => $ivan_vc_staff->selectors['image_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Name", 'iv_js_composer'), "param_name" => "name_css", "customize" => $ivan_vc_staff->selectors['name_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Job Title", 'iv_js_composer'), "param_name" => "job_title_css", "customize" => $ivan_vc_staff->selectors['job_title_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Content", 'iv_js_composer'), "param_name" => "content_css", "customize" => $ivan_vc_staff->selectors['content_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Social Icons", 'iv_js_composer'), "param_name" => "social_css", "customize" => $ivan_vc_staff->selectors['social_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer'))), $staff_icons_fields)));
// #map end
/***
 * Info Box
***/
// Call global var to use selectors array
global $ivan_vc_info_box;
vc_map(array('name' => __('Info Box', '_sdomain'), 'base' => 'ivan_info_box', 'icon' => 'vc_info_box', 'class' => 'ivan_info_box', 'category' => 'VC Customizer', 'description' => 'Display a styled box with support to icons.', 'controls' => 'full', 'show_settings_on_create' => true, 'params' => array(array("type" => "textarea_html", "class" => "", "heading" => __("Description", 'iv_js_composer'), "param_name" => "content", "description" => __("Insert here the description to be inserted in the info box.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Icon Family", 'iv_js_composer'), "param_name" => "ico_family", "value" => array('Font Awesome' => 'fa fa-', 'Elegant Icons' => 'el el-', 'Custom' => 'custom'), "description" => __("Select the icon family.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Custom Icon Class", 'iv_js_composer'), "param_name" => "ico_custom", "description" => __("Type a custom icon class to be used in the icon.", 'iv_js_composer'), 'dependency' => array('element' => 'ico_family', 'value' => 'custom')), array("type" => "attach_image", "class" => "", "heading" => __("Custom Icon Image", 'iv_js_composer'), "param_name" => "ico_img", "value" => "", "description" => __("Upload a image to be used as icon.", 'iv_js_composer'), 'dependency' => array('element' => 'ico_family', 'value' => 'custom')), array("type" => "textfield", "heading" => __("Icon Name", 'iv_js_composer'), "param_name" => "ico", "description" => __("Type icon name without prefixes, e.g. cogs or eye.", 'iv_js_composer')), array("type" => "textfield", "heading" => __("Title", 'iv_js_composer'), "param_name" => "title"), array("type" => "dropdown", "class" => "", "heading" => __("Icon Position", 'iv_js_composer'), "param_name" => "position", "value" => array('Left' => 'left', 'Right' => 'right', 'Above/Top' => 'top'), "description" => __("Defines icon position in the box.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Enable V-Align?", 'iv_js_composer'), "param_name" => "vertical", "value" => array('No' => 'no', 'Yes' => 'yes'), "description" => __("When enabled, the icon will be vertically aligned.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Text Align", 'iv_js_composer'), "param_name" => "align", "value" => array('Default' => ' default-align', 'Center' => ' to-center', 'Left' => ' to-left', 'Right' => ' to-right'), "description" => __("Select main alignment of title and description.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Style", 'iv_js_composer'), "param_name" => "style", "value" => array('None' => 'none', 'Boxed' => 'boxed', 'Circle' => 'circle'), "description" => __("Define icon style.", 'iv_js_composer')), array("type" => "dropdown", "class" => "", "heading" => __("Icon Size", 'iv_js_composer'), "param_name" => "size", "value" => array('32x32' => '32', '64x64' => '64', '96x96' => '96', '128x128' => '128', '256x256' => '256'), "description" => __("Define icon wrapper size. You can customize the icon size in Customizer tab.", 'iv_js_composer'), 'dependency' => array('element' => 'style', 'value' => array('boxed', 'circle'))), $ivan_add_css_animation, array("type" => "textfield", "heading" => __("Extra class name", 'iv_js_composer'), "param_name" => "el_class", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Main Block", 'iv_js_composer'), "param_name" => "main_css", "customize" => $ivan_vc_info_box->selectors['main_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Icon", 'iv_js_composer'), "param_name" => "icon_css", "customize" => $ivan_vc_info_box->selectors['icon_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Title", 'iv_js_composer'), "param_name" => "title_css", "customize" => $ivan_vc_info_box->selectors['title_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')), array("type" => "ivan_customizer", "class" => "", "heading" => __("Description", 'iv_js_composer'), "param_name" => "content_css", "customize" => $ivan_vc_info_box->selectors['content_css'], "value" => "", "group" => __('Customizer', 'iv_js_composer')))));
// #map end
/***
 * Button