/**
     * Print the field based on field type
     * @param array $field 
     */
    public static function print_field($field)
    {
        $field = wp_parse_args($field, array('id' => '', 'name' => '', 'class' => ''));
        switch ($field['type']) {
            case 'text':
                ?>
				<input id="<?php 
                echo esc_attr($field['id']);
                ?>
" name="<?php 
                echo esc_attr($field['id']);
                ?>
" type="text" value="" class="<?php 
                echo esc_attr($field['class']);
                ?>
 tfb_lb_option">
				<?php 
                if (isset($field['description'])) {
                    echo wp_kses_post($field['description']);
                }
                break;
            case 'separator':
                if (isset($field['meta']['html']) && '' != $field['meta']['html']) {
                    echo wp_kses_post($field['meta']['html']);
                } else {
                    ?>
					<hr class="meta_fields_separator" />
					<?php 
                }
                break;
            case 'image':
                ?>
				<input id="<?php 
                echo esc_attr($field['id']);
                ?>
" name="<?php 
                echo esc_attr($field['id']);
                ?>
" placeholder="<?php 
                if (isset($field['value'])) {
                    echo esc_attr($field['value']);
                }
                ?>
" class="<?php 
                echo esc_attr($field['class']);
                ?>
 themify-builder-uploader-input tfb_lb_option" type="text" /><br />
				<input type="hidden" name="<?php 
                echo esc_attr($field['id'] . '_attach_id');
                ?>
" class="themify-builder-uploader-input-attach-id" value="">
				<div class="small">

					<?php 
                if (is_multisite() && !is_upload_space_available()) {
                    ?>
						<?php 
                    echo sprintf(__('Sorry, you have filled your %s MB storage quota so uploading has been disabled.', 'themify'), get_space_allowed());
                    ?>
					<?php 
                } else {
                    ?>
					<div class="themify-builder-plupload-upload-uic hide-if-no-js tf-upload-btn" id="<?php 
                    echo esc_attr($field['id']);
                    ?>
themify-builder-plupload-upload-ui">
							<input id="<?php 
                    echo esc_attr($field['id']);
                    ?>
themify-builder-plupload-browse-button" type="button" value="<?php 
                    esc_attr_e(__('Upload', 'themify'));
                    ?>
" class="builder_button" />
							<span class="ajaxnonceplu" id="ajaxnonceplu<?php 
                    echo wp_create_nonce($field['id'] . 'themify-builder-plupload');
                    ?>
"></span>
					</div> <?php 
                    _e('or', 'themify');
                    ?>
 <a href="#" class="themify-builder-media-uploader tf-upload-btn" data-uploader-title="<?php 
                    esc_attr_e('Upload an Image', 'themify');
                    ?>
" data-uploader-button-text="<?php 
                    esc_attr_e('Insert file URL', 'themify');
                    ?>
"><?php 
                    _e('Browse Library', 'themify');
                    ?>
</a>

					<?php 
                }
                ?>

				</div>
				
				<p class="thumb_preview">
					<span class="img-placeholder"></span>
					<a href="#" class="themify_builder_icon small delete themify-builder-delete-thumb"></a>
				</p>

				<?php 
                break;
            case 'select':
                ?>
				
				<select id="<?php 
                echo esc_attr($field['id']);
                ?>
" name="<?php 
                echo esc_attr($field['id']);
                ?>
" class="tfb_lb_option <?php 
                echo esc_attr($field['class']);
                ?>
">
					<?php 
                if (isset($field['default'])) {
                    ?>
					<option value="<?php 
                    echo esc_attr($field['default']);
                    ?>
"><?php 
                    echo esc_html($field['default']);
                    ?>
</option>
					<?php 
                }
                foreach ($field['meta'] as $option) {
                    ?>
					<option value="<?php 
                    echo esc_attr($option['value']);
                    ?>
"><?php 
                    echo esc_html($option['name']);
                    ?>
</option>
					<?php 
                }
                ?>

				</select>

				<?php 
                if (isset($field['description'])) {
                    echo wp_kses_post($field['description']);
                }
                ?>

			<?php 
                break;
            case 'font_select':
                $fonts = array_merge(themify_get_web_safe_font_list(), themify_get_google_web_fonts_list());
                ?>
				
				<select id="<?php 
                echo esc_attr($field['id']);
                ?>
" name="<?php 
                echo esc_attr($field['id']);
                ?>
" class="tfb_lb_option <?php 
                echo esc_attr($field['class']);
                ?>
">
					<?php 
                if (isset($field['default'])) {
                    ?>
					<option value="<?php 
                    echo esc_attr($field['default']);
                    ?>
"><?php 
                    echo esc_html($field['default']);
                    ?>
</option>
					<?php 
                }
                foreach ($fonts as $option) {
                    ?>
					<option value="<?php 
                    echo esc_attr($option['value']);
                    ?>
"><?php 
                    echo esc_html($option['name']);
                    ?>
</option>
					<?php 
                }
                ?>

				</select>

				<?php 
                if (isset($field['description'])) {
                    echo wp_kses_post($field['description']);
                }
                ?>

			<?php 
                break;
            case 'color':
                ?>
				<span class="builderColorSelect"><span></span></span>
				<input type="text" class="<?php 
                echo esc_attr($field['class']);
                ?>
 colordisplay"/>
				<input id="<?php 
                echo esc_attr($field['id']);
                ?>
" name="<?php 
                echo esc_attr($field['id']);
                ?>
" value="" class="builderColorSelectInput tfb_lb_option" type="text" />
			<?php 
                break;
            case 'radio':
                foreach ($field['meta'] as $option) {
                    ?>
					<input type="radio" id="<?php 
                    echo esc_attr($field['id'] . '_' . $option['value']);
                    ?>
" name="<?php 
                    echo esc_attr($field['id']);
                    ?>
" value="<?php 
                    echo esc_attr($option['value']);
                    ?>
" class="tfb_lb_option" <?php 
                    checked(isset($option['selected']) ? $option['selected'] : false, true);
                    ?>
> <label for="<?php 
                    echo esc_attr($field['id'] . '_' . $option['value']);
                    ?>
"><?php 
                    echo esc_html($option['name']);
                    ?>
</label>
				<?php 
                }
                break;
            case 'textarea':
                if (!array_key_exists('rows', $field) || empty($field['rows'])) {
                    $field['rows'] = '3';
                }
                ?>
				<textarea id="<?php 
                echo esc_attr($field['id']);
                ?>
" name="<?php 
                echo esc_attr($field['id']);
                ?>
" class="<?php 
                echo esc_attr($field['class']);
                ?>
 tfb_lb_option" rows="<?php 
                echo esc_attr($field['rows']);
                ?>
"></textarea>
				<?php 
                if (isset($field['description'])) {
                    ?>
				<small>
					<br>
					<small>
						<?php 
                    echo wp_kses_post($field['description']);
                    ?>
					</small>
				</small>
				<?php 
                }
                break;
        }
    }
    /**
     * Module Styling Fields
     * @param array $styling 
     * @return string
     */
    function themify_builder_styling_field($styling)
    {
        switch ($styling['type']) {
            case 'text':
                ?>
				<input id="<?php 
                echo esc_attr($styling['id']);
                ?>
" name="<?php 
                echo esc_attr($styling['id']);
                ?>
" type="text" value="" class="<?php 
                echo esc_attr($styling['class']);
                ?>
 tfb_lb_option">
				<?php 
                if (isset($styling['description'])) {
                    echo '<small>' . wp_kses_post($styling['description']) . '</small>';
                }
                ?>
				<?php 
                break;
            case 'textarea':
                ?>
				<textarea id="<?php 
                echo esc_attr($styling['id']);
                ?>
" name="<?php 
                echo esc_attr($styling['id']);
                ?>
" class="<?php 
                echo esc_attr($styling['class']);
                ?>
 tfb_lb_option"><?php 
                if (isset($styling['value'])) {
                    echo esc_textarea($styling['value']);
                }
                ?>
</textarea>
				<?php 
                if (isset($styling['description'])) {
                    echo '<small>' . wp_kses_post($styling['description']) . '</small>';
                }
                ?>
				<?php 
                break;
            case 'separator':
                echo isset($styling['meta']['html']) && '' != $styling['meta']['html'] ? $styling['meta']['html'] : '<hr class="meta_fields_separator" />';
                break;
            case 'image':
                ?>
				<input id="<?php 
                echo esc_attr($styling['id']);
                ?>
" name="<?php 
                echo esc_attr($styling['id']);
                ?>
" placeholder="<?php 
                if (isset($styling['value'])) {
                    echo esc_attr($styling['value']);
                }
                ?>
" class="<?php 
                echo esc_attr($styling['class']);
                ?>
 themify-builder-uploader-input tfb_lb_option" type="text" /><br />
								
				<div class="small">

					<?php 
                if (is_multisite() && !is_upload_space_available()) {
                    ?>
						<?php 
                    echo sprintf(__('Sorry, you have filled your %s MB storage quota so uploading has been disabled.', 'themify'), get_space_allowed());
                    ?>
					<?php 
                } else {
                    ?>
					<div class="themify-builder-plupload-upload-uic hide-if-no-js tf-upload-btn" id="<?php 
                    echo esc_attr($styling['id']);
                    ?>
themify-builder-plupload-upload-ui">
							<input id="<?php 
                    echo esc_attr($styling['id']);
                    ?>
themify-builder-plupload-browse-button" type="button" value="<?php 
                    esc_attr_e(__('Upload', 'themify'));
                    ?>
" class="builder_button" />
							<span class="ajaxnonceplu" id="ajaxnonceplu<?php 
                    echo wp_create_nonce($styling['id'] . 'themify-builder-plupload');
                    ?>
"></span>
					</div> <?php 
                    _e('or', 'themify');
                    ?>
 <a href="#" class="themify-builder-media-uploader tf-upload-btn" data-uploader-title="<?php 
                    esc_attr_e('Upload an Image', 'themify');
                    ?>
" data-uploader-button-text="<?php 
                    esc_attr_e('Insert file URL', 'themify');
                    ?>
"><?php 
                    _e('Browse Library', 'themify');
                    ?>
</a>

					<?php 
                }
                ?>

				</div>
				
				<p class="thumb_preview">
					<span class="img-placeholder"></span>
					<a href="#" class="themify_builder_icon small delete themify-builder-delete-thumb"></a>
				</p>


				<?php 
                break;
            case 'video':
                ?>
				<input id="<?php 
                echo esc_attr($styling['id']);
                ?>
" name="<?php 
                echo esc_attr($styling['id']);
                ?>
" placeholder="<?php 
                if (isset($styling['value'])) {
                    echo esc_attr($styling['value']);
                }
                ?>
" class="<?php 
                echo esc_attr($styling['class']);
                ?>
 themify-builder-uploader-input tfb_lb_option" type="text" /><br />

				<div class="small">

					<?php 
                if (is_multisite() && !is_upload_space_available()) {
                    ?>
						<?php 
                    echo sprintf(__('Sorry, you have filled your %s MB storage quota so uploading has been disabled.', 'themify'), get_space_allowed());
                    ?>
					<?php 
                } else {
                    ?>
					<div class="themify-builder-plupload-upload-uic hide-if-no-js tf-upload-btn" id="<?php 
                    echo esc_attr($styling['id']);
                    ?>
themify-builder-plupload-upload-ui" data-extensions="<?php 
                    echo esc_attr(implode(',', wp_get_video_extensions()));
                    ?>
">
						<input id="<?php 
                    echo esc_attr($styling['id']);
                    ?>
themify-builder-plupload-browse-button" type="button" value="<?php 
                    esc_attr_e(__('Upload', 'themify'));
                    ?>
" class="builder_button" />
						<span class="ajaxnonceplu" id="ajaxnonceplu<?php 
                    echo wp_create_nonce($styling['id'] . 'themify-builder-plupload');
                    ?>
"></span>
					</div> <?php 
                    _e('or', 'themify');
                    ?>
 <a href="#" class="themify-builder-media-uploader tf-upload-btn" data-uploader-title="<?php 
                    _e('Upload a Video', 'themify');
                    ?>
" data-uploader-button-text="<?php 
                    esc_attr_e('Insert file URL', 'themify');
                    ?>
" data-library-type="video"><?php 
                    _e('Browse Library', 'themify');
                    ?>
</a>

					<?php 
                }
                ?>

				</div>

				<?php 
                if (isset($styling['description'])) {
                    echo '<small>' . wp_kses_post($styling['description']) . '</small>';
                }
                ?>

				<?php 
                break;
            case 'select':
                ?>
				
				<select id="<?php 
                echo esc_attr($styling['id']);
                ?>
" name="<?php 
                echo esc_attr($styling['id']);
                ?>
" class="tfb_lb_option <?php 
                echo isset($styling['class']) ? esc_attr($styling['class']) : '';
                ?>
">
					<?php 
                if (isset($styling['default'])) {
                    ?>
					<option value="<?php 
                    echo esc_attr($styling['default']);
                    ?>
"><?php 
                    echo esc_html($styling['default']);
                    ?>
</option>
					<?php 
                }
                foreach ($styling['meta'] as $option) {
                    ?>
					<option value="<?php 
                    echo esc_attr($option['value']);
                    ?>
"><?php 
                    echo esc_html($option['name']);
                    ?>
</option>
					<?php 
                }
                ?>

				</select>

				<?php 
                if (isset($styling['description'])) {
                    echo wp_kses_post($styling['description']);
                }
                ?>

			<?php 
                break;
            case 'animation_select':
                ?>
				<?php 
                $class = isset($styling['class']) ? $styling['class'] : '';
                ?>
				<select id="<?php 
                echo esc_attr($styling['id']);
                ?>
" name="<?php 
                echo esc_attr($styling['id']);
                ?>
" class="tfb_lb_option <?php 
                echo esc_attr($class);
                ?>
">
					<option value=""></option>
					
					<?php 
                $animation = Themify_Builder_model::get_preset_animation();
                foreach ($animation as $group) {
                    ?>

						<optgroup label="<?php 
                    echo esc_attr($group['group_label']);
                    ?>
">
							<?php 
                    foreach ($group['options'] as $opt) {
                        ?>
								<option value="<?php 
                        echo esc_attr($opt['value']);
                        ?>
"><?php 
                        echo esc_html($opt['name']);
                        ?>
</option>
							<?php 
                    }
                    ?>
						</optgroup>

					<?php 
                }
                ?>

				</select>

				<?php 
                if (isset($styling['description'])) {
                    echo wp_kses_post($styling['description']);
                }
                ?>

			<?php 
                break;
            case 'font_select':
                $fonts = array_merge(themify_get_web_safe_font_list(), themify_get_google_web_fonts_list());
                ?>
				
				<select id="<?php 
                echo esc_attr($styling['id']);
                ?>
" name="<?php 
                echo esc_attr($styling['id']);
                ?>
" class="tfb_lb_option <?php 
                echo esc_attr($styling['class']);
                ?>
">
					<?php 
                if (isset($styling['default'])) {
                    ?>
					<option value="<?php 
                    echo esc_attr($styling['default']);
                    ?>
"><?php 
                    echo esc_html($styling['default']);
                    ?>
</option>
					<?php 
                }
                foreach ($fonts as $option) {
                    ?>
					<option value="<?php 
                    echo esc_attr($option['value']);
                    ?>
"><?php 
                    echo esc_html($option['name']);
                    ?>
</option>
					<?php 
                }
                ?>

				</select>

				<?php 
                if (isset($styling['description'])) {
                    echo wp_kses_post($styling['description']);
                }
                ?>

			<?php 
                break;
            case 'color':
                ?>
				<span class="builderColorSelect"><span></span></span>
				<input type="text" class="<?php 
                echo esc_attr($styling['class']);
                ?>
 colordisplay"/>
				<input id="<?php 
                echo esc_attr($styling['id']);
                ?>
" name="<?php 
                echo esc_attr($styling['id']);
                ?>
" value="" class="builderColorSelectInput tfb_lb_option" type="hidden" />
			<?php 
                break;
            case 'checkbox':
                if (isset($styling['before'])) {
                    echo wp_kses_post($styling['before']);
                }
                ?>
				<div id="<?php 
                echo esc_attr($styling['id']);
                ?>
" class="tfb_lb_option themify-checkbox">
				<?php 
                foreach ($styling['options'] as $opt) {
                    ?>
					<?php 
                    $checkbox_checked = '';
                    if (isset($styling['default']) && is_array($styling['default'])) {
                        $checkbox_checked = in_array($opt['name'], $styling['default']) ? 'checked="checked"' : '';
                    } elseif (isset($styling['default'])) {
                        $checkbox_checked = checked($styling['default'], $opt['name'], false);
                    }
                    ?>
					<input id="<?php 
                    echo esc_attr($styling['id'] . '_' . $opt['name']);
                    ?>
" name="<?php 
                    echo esc_attr($styling['id']);
                    ?>
" type="checkbox" class="tfb_lb_option tf-checkbox" value="<?php 
                    echo esc_attr($opt['name']);
                    ?>
" <?php 
                    echo $checkbox_checked;
                    ?>
 />
					<label for="<?php 
                    echo esc_attr($styling['id'] . '_' . $opt['name']);
                    ?>
" class="pad-right"><?php 
                    echo wp_kses_post($opt['value']);
                    ?>
</label>
					
					<?php 
                    if (isset($opt['help'])) {
                        ?>
					<small><?php 
                        echo wp_kses_post($opt['help']);
                        ?>
</small>
					<?php 
                    }
                    ?>
					
					<?php 
                    if (!isset($styling['new_line']) || $styling['new_line'] == true) {
                        ?>
					<br />
					<?php 
                    }
                    ?>

				<?php 
                }
                ?>
				</div>
				<?php 
                if (isset($styling['after'])) {
                    echo wp_kses_post($styling['after']);
                }
                break;
            case 'radio':
                $option_js = isset($styling['option_js']) && $styling['option_js'] == true ? 'tf-option-checkbox-js' : '';
                $option_js_wrap = isset($styling['option_js']) && $styling['option_js'] == true ? 'tf-option-checkbox-enable' : '';
                ?>
				<div id="<?php 
                echo esc_attr($styling['id']);
                ?>
" class="tfb_lb_option tf-radio-input-container <?php 
                echo esc_attr($option_js_wrap);
                ?>
">
				<?php 
                foreach ($styling['meta'] as $option) {
                    $checked = isset($option['selected']) && $option['selected'] == true ? 'checked="checked"' : '';
                    $data_el = isset($styling['option_js']) && $styling['option_js'] == true ? 'data-selected="tf-group-element-' . $option['value'] . '"' : '';
                    ?>
					<input type="radio" id="<?php 
                    echo esc_attr($styling['id'] . '_' . $option['value']);
                    ?>
" name="<?php 
                    echo esc_attr($styling['id']);
                    ?>
" value="<?php 
                    echo esc_attr($option['value']);
                    ?>
" class="tfb_lb_option <?php 
                    echo esc_attr($option_js);
                    ?>
" <?php 
                    echo $checked . ' ' . $data_el;
                    ?>
> <label for="<?php 
                    echo esc_attr($styling['id'] . '_' . $option['value']);
                    ?>
"><?php 
                    echo esc_html($option['name']);
                    ?>
</label>
				<?php 
                }
                ?>
					<?php 
                if (isset($styling['description'])) {
                    echo '<br/><small>' . wp_kses_post($styling['description']) . '</small>';
                }
                ?>
				</div>
				<?php 
                break;
        }
    }
Пример #3
0
/**
 * Section Meta Box Options
 * @param array $args
 * @return array
 * @since 1.0.7
 */
function themify_theme_section_meta_box($args = array())
{
    extract($args);
    return array(array('name' => 'separator_section_title_font', 'title' => '', 'description' => '', 'type' => 'separator', 'meta' => array('html' => '<h4>' . __('Section Title Font', 'themify') . '</h4><hr class="meta_fields_separator"/>')), array('type' => 'multi', 'name' => '_font_title', 'title' => __('Font', 'themify'), 'meta' => array('fields' => array(array('name' => 'title_font_size', 'label' => '', 'description' => '', 'type' => 'textbox', 'meta' => array('size' => 'small'), 'before' => '', 'after' => ''), array('name' => 'title_font_size_unit', 'label' => '', 'type' => 'dropdown', 'meta' => array(array('value' => 'px', 'name' => __('px', 'themify'), 'selected' => true), array('value' => 'em', 'name' => __('em', 'themify'))), 'before' => '', 'after' => ''), array('name' => 'title_font_family', 'label' => '', 'type' => 'dropdown', 'meta' => array_merge(themify_get_web_safe_font_list(), themify_get_google_web_fonts_list()), 'before' => '', 'after' => '')), 'description' => '', 'before' => '', 'after' => '', 'separator' => '')), array('name' => 'title_font_color', 'title' => __('Font Color', 'themify'), 'description' => '', 'type' => 'color', 'meta' => array('default' => null)), array('name' => 'separator_font', 'title' => '', 'description' => '', 'type' => 'separator', 'meta' => array('html' => '<h4>' . __('Section Font', 'themify') . '</h4><hr class="meta_fields_separator"/>')), array('type' => 'multi', 'name' => '_font', 'title' => __('Font', 'themify'), 'meta' => array('fields' => array(array('name' => 'font_size', 'label' => '', 'description' => '', 'type' => 'textbox', 'meta' => array('size' => 'small'), 'before' => '', 'after' => ''), array('name' => 'font_size_unit', 'label' => '', 'type' => 'dropdown', 'meta' => array(array('value' => 'px', 'name' => __('px', 'themify'), 'selected' => true), array('value' => 'em', 'name' => __('em', 'themify'))), 'before' => '', 'after' => ''), array('name' => 'font_family', 'label' => '', 'type' => 'dropdown', 'meta' => array_merge(themify_get_web_safe_font_list(), themify_get_google_web_fonts_list()), 'before' => '', 'after' => '')), 'description' => '', 'before' => '', 'after' => '', 'separator' => '')), array('name' => 'font_color', 'title' => __('Font Color', 'themify'), 'description' => '', 'type' => 'color', 'meta' => array('default' => null)), array('name' => 'link_color', 'title' => __('Link Color', 'themify'), 'description' => '', 'type' => 'color', 'meta' => array('default' => null)), array('name' => 'separator', 'title' => '', 'description' => '', 'type' => 'separator', 'meta' => array('html' => '<h4>' . __('Section Background', 'themify') . '</h4><hr class="meta_fields_separator"/>')), array('name' => 'background_color', 'title' => __('Background Color', 'themify'), 'description' => '', 'type' => 'color', 'meta' => array('default' => null)), array('name' => 'background_image', 'title' => '', 'type' => 'image', 'description' => '', 'meta' => array(), 'before' => '', 'after' => ''), array('name' => 'background_repeat', 'title' => __('Background Repeat', 'themify'), 'description' => '', 'type' => 'dropdown', 'meta' => array(array('value' => 'default', 'name' => '', 'selected' => true), array('value' => 'repeat', 'name' => __('Repeat', 'themify')), array('value' => 'repeat-x', 'name' => __('Repeat horizontally', 'themify')), array('value' => 'repeat-y', 'name' => __('Repeat vertically', 'themify')), array('value' => 'no-repeat', 'name' => __('Do not repeat', 'themify')))), array('type' => 'multi', 'name' => '_multi_bg_position', 'title' => __('Background Position', 'themify'), 'meta' => array('fields' => array(array('name' => 'background_position_x', 'label' => '', 'description' => '', 'type' => 'dropdown', 'meta' => array(array('value' => '', 'name' => '', 'selected' => true), array('value' => 'left', 'name' => __('Left', 'themify')), array('value' => 'center', 'name' => __('Center', 'themify')), array('value' => 'right', 'name' => __('Right', 'themify'))), 'before' => '', 'after' => ''), array('name' => 'background_position_y', 'label' => '', 'description' => '', 'type' => 'dropdown', 'meta' => array(array('value' => '', 'name' => '', 'selected' => true), array('value' => 'top', 'name' => __('Top', 'themify')), array('value' => 'center', 'name' => __('Center', 'themify')), array('value' => 'bottom', 'name' => __('Bottom', 'themify'))), 'before' => '', 'after' => '')), 'description' => '', 'before' => '', 'after' => '', 'separator' => '')));
}
/**
 * Theme Appearance Tab for Themify Custom Panel
 *
 * @since 1.0.0
 *
 * @param array $args
 *
 * @return array
 */
function themify_theme_page_theme_design_meta_box($args = array())
{
    return array(array('name' => 'body_background_color', 'title' => __('Body Background', 'themify'), 'description' => '', 'type' => 'color', 'meta' => array('default' => null)), array('name' => 'body_background_image', 'title' => '', 'type' => 'image', 'description' => '', 'meta' => array(), 'before' => '', 'after' => ''), array('name' => 'body_background_repeat', 'title' => '', 'description' => __('Background Repeat', 'themify'), 'type' => 'dropdown', 'meta' => array(array('value' => 'fullcover', 'name' => __('Fullcover', 'themify')), array('value' => 'repeat', 'name' => __('Repeat', 'themify')), array('value' => 'no-repeat', 'name' => __('No Repeat', 'themify')), array('value' => 'repeat-x', 'name' => __('Repeat horizontally', 'themify')), array('value' => 'repeat-y', 'name' => __('Repeat vertically', 'themify')))), array('name' => 'color_scheme_mode', 'title' => __('Accent Color', 'themify'), 'description' => '', 'type' => 'radio', 'show_title' => true, 'meta' => array(array('value' => 'color-presets', 'name' => __('Presets', 'themify'), 'selected' => true), array('value' => 'color-custom', 'name' => __('Custom', 'themify'))), 'enable_toggle' => true), array('name' => 'color_design', 'title' => '', 'description' => '', 'type' => 'layout', 'show_title' => true, 'meta' => $args['color_design_options'], 'toggle' => 'color-presets-toggle'), array('name' => 'scheme_color', 'title' => '', 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'after' => __('Accent Font Color', 'themify'), 'toggle' => 'color-custom-toggle'), array('name' => 'scheme_link', 'title' => '', 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'after' => __('Accent Link Color', 'themify'), 'toggle' => 'color-custom-toggle'), array('name' => 'scheme_background', 'title' => '', 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'after' => __('Accent Background Color', 'themify'), 'toggle' => 'color-custom-toggle'), array('name' => 'typography_mode', 'title' => __('Typography', 'themify'), 'description' => '', 'type' => 'radio', 'show_title' => true, 'meta' => array(array('value' => 'typography-presets', 'name' => __('Presets', 'themify'), 'selected' => true), array('value' => 'typography-custom', 'name' => __('Custom', 'themify'))), 'enable_toggle' => true), array('name' => 'font_design', 'title' => '', 'description' => '', 'type' => 'layout', 'show_title' => true, 'meta' => $args['font_design_options'], 'toggle' => 'typography-presets-toggle'), array('name' => 'body_font', 'title' => '', 'description' => '', 'type' => 'dropdown', 'meta' => array_merge(themify_get_web_safe_font_list(), themify_get_google_web_fonts_list()), 'after' => ' ' . __('Body Font', 'themify'), 'toggle' => 'typography-custom-toggle'), array('name' => 'body_text_color', 'title' => '', 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'after' => __('Body Font Color', 'themify'), 'toggle' => 'typography-custom-toggle'), array('name' => 'body_link_color', 'title' => '', 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'after' => __('Body Link Color', 'themify'), 'toggle' => 'typography-custom-toggle'), array('name' => 'heading_font', 'title' => '', 'description' => '', 'type' => 'dropdown', 'meta' => array_merge(themify_get_web_safe_font_list(), themify_get_google_web_fonts_list()), 'after' => ' ' . __('Heading (h1 to h6)', 'themify'), 'toggle' => 'typography-custom-toggle'), array('name' => 'heading_color', 'title' => '', 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'after' => __('Heading Font Color', 'themify'), 'toggle' => 'typography-custom-toggle'), array('name' => 'header_design', 'title' => __('Header Design', 'themify'), 'description' => '', 'type' => 'layout', 'show_title' => true, 'meta' => $args['header_design_options'], 'hide' => 'none header-leftpane header-minbar boxed-content'), array('name' => 'fixed_header', 'title' => __('Sticky Header', 'themify'), 'description' => '', 'type' => 'radio', 'meta' => themify_ternary_options(), 'class' => 'hide-if none header-leftpane header-minbar boxed-content'), array('name' => 'full_height_header', 'title' => __('Full Height Header', 'themify'), 'description' => __('Full height will display the container in 100% viewport height', 'themify'), 'type' => 'radio', 'meta' => themify_ternary_options(), 'class' => 'hide-if none header-horizontal header-leftpane header-minbar boxed-content'), array('name' => '_multi_header_elements', 'title' => __('Header Elements', 'themify'), 'description' => '', 'type' => 'multi', 'class' => 'hide-if none', 'meta' => array('fields' => array(array('name' => 'exclude_site_logo', 'description' => '', 'title' => __('Show Site Logo', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_site_tagline', 'description' => '', 'title' => __('Show Site Tagline', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_search_form', 'description' => '', 'title' => __('Show Search Form', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_rss', 'description' => '', 'title' => __('Show RSS Link', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_header_widgets', 'description' => '', 'title' => __('Show Header Widgets', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_social_widget', 'description' => '', 'title' => __('Show Social Widget', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_menu_navigation', 'description' => '', 'title' => __('Show Menu Navigation', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>')), 'description' => '', 'before' => '', 'after' => '<div class="clear"></div>', 'separator' => '')), array('name' => 'header_wrap', 'title' => __('Header Background', 'themify'), 'description' => '', 'type' => 'radio', 'show_title' => true, 'meta' => array(array('value' => 'solid', 'name' => __('Solid Background', 'themify'), 'selected' => true), array('value' => 'transparent', 'name' => __('Transparent Background', 'themify')), array('value' => 'slider', 'name' => __('Slider', 'themify')), array('value' => 'video', 'name' => __('Video', 'themify')), array('value' => 'colors', 'name' => __('Animating Colors', 'themify'))), 'enable_toggle' => true, 'class' => 'hide-if none clear'), array('name' => '_animated_colors', 'title' => __('Animating Colors', 'themify'), 'description' => sprintf(__('Animating Colors can be configured at <a href="%s">Themify > Settings > Theme Settings</a>', 'themify'), esc_url(add_query_arg('page', 'themify', admin_url('admin.php')))), 'type' => 'post_id_info', 'toggle' => 'colors-toggle'), array('name' => 'background_gallery', 'title' => __('Header Slider', 'themify'), 'description' => '', 'type' => 'gallery_shortcode', 'toggle' => 'slider-toggle'), array('type' => 'multi', 'name' => '_video_select', 'title' => __('Video', 'themify'), 'meta' => array('fields' => array(array('name' => 'video_file', 'title' => __('Video File', 'themify'), 'description' => '', 'type' => 'video', 'meta' => array())), 'description' => __('Video format: mp4. Note: video background does not play on mobile, background image will be used as fallback.', 'themify'), 'before' => '', 'after' => '', 'separator' => ''), 'toggle' => 'video-toggle'), array('name' => 'background_color', 'title' => '', 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'toggle' => array('solid-toggle', 'slider-toggle', 'video-toggle'), 'class' => 'hide-if none'), array('name' => 'background_image', 'title' => '', 'type' => 'image', 'description' => '', 'meta' => array(), 'before' => '', 'after' => '', 'toggle' => array('solid-toggle', 'video-toggle'), 'class' => 'hide-if none'), array('name' => 'background_repeat', 'title' => '', 'description' => __('Background Repeat', 'themify'), 'type' => 'dropdown', 'meta' => array(array('value' => 'fullcover', 'name' => __('Fullcover', 'themify')), array('value' => 'repeat', 'name' => __('Repeat', 'themify')), array('value' => 'no-repeat', 'name' => __('No Repeat', 'themify')), array('value' => 'repeat-x', 'name' => __('Repeat horizontally', 'themify')), array('value' => 'repeat-y', 'name' => __('Repeat vertically', 'themify'))), 'toggle' => array('solid-toggle', 'video-toggle'), 'class' => 'hide-if none'), array('name' => 'headerwrap_text_color', 'title' => __('Header Text Color', 'themify'), 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'class' => 'hide-if none'), array('name' => 'headerwrap_link_color', 'title' => __('Header Link Color', 'themify'), 'description' => '', 'type' => 'color', 'meta' => array('default' => null), 'class' => 'hide-if none'), array('name' => 'footer_design', 'title' => __('Footer Design', 'themify'), 'description' => '', 'type' => 'layout', 'show_title' => true, 'meta' => $args['footer_design_options'], 'hide' => 'none'), array('name' => '_multi_footer_elements', 'title' => __('Footer Elements', 'themify'), 'description' => '', 'type' => 'multi', 'class' => 'hide-if none', 'meta' => array('fields' => array(array('name' => 'exclude_footer_site_logo', 'description' => '', 'title' => __('Show Site Logo', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_footer_widgets', 'description' => '', 'title' => __('Show Footer Widgets', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_footer_menu_navigation', 'description' => '', 'title' => __('Show Menu Navigation', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_footer_texts', 'description' => '', 'title' => __('Show Footer Text', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>'), array('name' => 'exclude_footer_back', 'description' => '', 'title' => __('Show Back to Top Arrow', 'themify'), 'type' => 'dropdownbutton', 'states' => themify_ternary_states(array('icon_no' => THEMIFY_URI . '/img/ddbtn-check.png', 'icon_yes' => THEMIFY_URI . '/img/ddbtn-cross.png')), 'class' => 'hide-if none', 'after' => '<div class="clear"></div>')), 'description' => '', 'before' => '', 'after' => '<div class="clear"></div>', 'separator' => '')));
}
    function themify_get_web_safe_font_list($only_names = false)
    {
        $web_safe_font_names = array('Arial, Helvetica, sans-serif', 'Verdana, Geneva, sans-serif', 'Georgia, \'Times New Roman\', Times, serif', '\'Times New Roman\', Times, serif', 'Tahoma, Geneva, sans-serif', '\'Trebuchet MS\', Arial, Helvetica, sans-serif', 'Palatino, \'Palatino Linotype\', \'Book Antiqua\', serif', '\'Lucida Sans Unicode\', \'Lucida Grande\', sans-serif');
        if (!$only_names) {
            $web_safe_fonts = array(array('value' => 'default', 'name' => '', 'selected' => true), array('value' => '', 'name' => '--- ' . __('Web Safe Fonts', 'themify') . ' ---'));
            foreach ($web_safe_font_names as $font) {
                $web_safe_fonts[] = array('value' => $font, 'name' => str_replace('\'', '"', $font));
            }
        } else {
            $web_safe_fonts = $web_safe_font_names;
        }
        return apply_filters('themify_get_web_safe_font_list', $web_safe_fonts);
    }
}
// Return Google Web Fonts list
$google_fonts_list = themify_get_google_web_fonts_list();
// Return Web Safe Fonts list
$fonts_list = themify_get_web_safe_font_list();
///////////////////////////////////////
// Setup Write Panel Options
///////////////////////////////////////
/** Definition for tri-state hide meta buttons
 *  @var array */
$states = array(array('name' => __('Hide', 'themify'), 'value' => 'yes', 'icon' => THEMIFY_URI . '/img/ddbtn-check.png', 'title' => __('Hide this meta', 'themify')), array('name' => __('Do not hide', 'themify'), 'value' => 'no', 'icon' => THEMIFY_URI . '/img/ddbtn-cross.png', 'title' => __('Show this meta', 'themify')), array('name' => __('Theme default', 'themify'), 'value' => '', 'icon' => THEMIFY_URI . '/img/ddbtn-blank.png', 'title' => __('Use theme settings', 'themify'), 'default' => true));
// Common Fields ///////////////////////////////////////
$post_image = array('name' => 'post_image', 'title' => __('Featured Image', 'themify'), 'description' => '', 'type' => 'image', 'meta' => array());
$featured_image_size = array('name' => 'feature_size', 'title' => __('Image Size', 'themify'), 'description' => __('Image sizes can be set at <a href="options-media.php">Media Settings</a> and <a href="admin.php?page=themify_regenerate-thumbnails">Regenerated</a>', 'themify'), 'type' => 'featimgdropdown');
$external_link = array('name' => 'external_link', 'title' => __('External Link', 'themify'), 'description' => __('Link Featured Image and Post Title to external URL', 'themify'), 'type' => 'textbox', 'meta' => array());
$post_image_dimensions = array(array('name' => 'image_width', 'label' => __('width', 'themify'), 'description' => '', 'type' => 'textbox', 'meta' => array('size' => 'small'), 'before' => '', 'after' => ''), array('name' => 'image_height', 'label' => __('height', 'themify'), 'type' => 'textbox', 'meta' => array('size' => 'small'), 'before' => '', 'after' => ''));
$nav_menus = array(array('name' => '', 'value' => '', 'selected' => true));
foreach (get_terms('nav_menu') as $menu) {