示例#1
0
<div <?php 
VP_Util_Text::print_if_exists($section->get_name(), 'id="%s" ');
?>
	class="vp-section<?php 
echo !empty($container_extra_classes) ? ' ' . $container_extra_classes : '';
?>
"
	<?php 
echo VP_Util_Text::print_if_exists($section->get_dependency(), 'data-vp-dependency="%s"');
?>
 >
	<?php 
VP_Util_Text::print_if_exists($section->get_title(), '<h3>%s</h3>');
?>
	<?php 
VP_Util_Text::print_if_exists($section->get_description(), '<span class="description vp-js-tipsy" original-title="%s"></span>');
?>
	<div class="vp-controls">
		<?php 
foreach ($section->get_fields() as $field) {
    ?>
		<?php 
    echo $field->render();
    ?>
		<?php 
}
?>
	</div>
</div>
示例#2
0
                ?>
								<li>
								<?php 
            }
            ?>
									<a href="#<?php 
            echo $submenu->get_name();
            ?>
" class="vp-js-menu-goto vp-menu-goto">
										<?php 
            $sub_icon = $submenu->get_icon();
            $font_awesome = VP_Util_Res::is_font_awesome($sub_icon);
            if ($font_awesome !== false) {
                VP_Util_Text::print_if_exists($font_awesome, '<i class="fa %s"></i>');
            } else {
                VP_Util_Text::print_if_exists(VP_Util_Res::img($sub_icon), '<i class="custom-menu-icon" style="background-image: url(\'%s\');"></i>');
            }
            ?>
										<span><?php 
            echo $submenu->get_title();
            ?>
</span>
									</a>
								</li>
								<?php 
        }
        ?>
							</ul>
							<?php 
    }
    ?>
示例#3
0
        $icon_class = 'fa-check-circle';
        break;
    case 'warning':
        $icon_class = 'fa-exclamation-triangle';
        break;
    case 'error':
        $icon_class = 'fa-times-circle';
        break;
    default:
        $icon_class = 'fa-lightbulb-o';
        break;
}
?>
	<i class="fa <?php 
echo $icon_class;
?>
"></i>
	<div class="label"><?php 
echo $label;
?>
</div>
	<?php 
VP_Util_Text::print_if_exists($description, '<div class="description">%s</div>');
?>

<?php 
if (!$is_compact) {
    ?>
</div>
<?php 
}
示例#4
0
?>

<div class="vp-field <?php 
echo $type;
echo !empty($container_extra_classes) ? ' ' . $container_extra_classes : '';
?>
"
	data-vp-type="<?php 
echo $type;
?>
"
	<?php 
echo VP_Util_Text::print_if_exists(isset($binding) ? $binding : '', 'data-vp-bind="%s"');
?>
	<?php 
echo VP_Util_Text::print_if_exists(isset($dependency) ? $dependency : '', 'data-vp-dependency="%s"');
?>
	id="<?php 
echo $name;
?>
">
	<div class="field" style="height: <?php 
echo $height;
?>
;">
		<div class="input" id="<?php 
echo $name . '_dom';
?>
">
			<?php 
echo VP_WP_Util::kses_html($value);
示例#5
0
    ?>
" name="<?php 
    echo $name;
    ?>
" value="<?php 
    echo $item->value;
    ?>
" />
	<img src="<?php 
    echo VP_Util_Res::img($item->img);
    ?>
" alt="<?php 
    echo $item->label;
    ?>
" class="vp-js-tipsy image-item" style="<?php 
    VP_Util_Text::print_if_exists($item_max_width, 'max-width: %spx; ');
    VP_Util_Text::print_if_exists($item_max_height, 'max-height: %spx; ');
    ?>
" original-title="<?php 
    echo $item->label;
    ?>
" />
</label>
<?php 
}
?>

<?php 
if (!$is_compact) {
    echo VP_View::instance()->load('control/template_control_foot');
}
示例#6
0
<?php

//printr($header_data);
$header_info = sh_set($header_data, 'head_info');
//printr($header_info);
if (!$is_compact) {
    echo VP_View::instance()->load('control/template_control_head', $head_info);
}
?>
<div class="vp-section">
	<h3><?php 
echo sh_set($header_info, 'label');
?>
</h3>
    <?php 
VP_Util_Text::print_if_exists(sh_set($header_info, 'description'), '<span class="description vp-js-tipsy" original-title="%s"></span>');
?>
	
    <div class="vp-controls">
		<?php 
$alchemy->_setup();
?>
	</div>
    
</div>

<?php 
if (!$is_compact) {
    echo VP_View::instance()->load('control/template_control_foot');
}
示例#7
0
        /**
         * Output the settings update form.
         *
         * @see WP_Widget::form
         * @param array $instance Current settings.
         *
         * @access public
         * @return string
         */
        public function form($instance)
        {
            foreach ($this->controls as $control) {
                $control->addHtmlAttribute('id', $this->get_field_id($control->getName()));
                $control->addHtmlAttribute('class', 'widefat');
                $attributes = $control->getSettings();
                $attributes['name'] = $this->get_field_name($control->getName());
                // create field object
                $make = \VP_Util_Reflection::field_class_from_type($attributes['type']);
                $field = call_user_func("{$make}::withArray", $attributes);
                $default = $field->get_default();
                //@todo rebuild this!!!
                if ($attributes['type'] == 'checkbox') {
                    $value = isset($instance[$control->getName()]) ? $instance[$control->getName()] : '';
                    $field->set_value($value);
                } else {
                    if (isset($instance[$control->getName()]) && !empty($instance[$control->getName()])) {
                        $field->set_value($instance[$control->getName()]);
                    } else {
                        if (!is_null($default)) {
                            $field->set_value($default);
                        }
                    }
                }
                ?>
				<p>
					<label for="<?php 
                echo $this->get_field_id($field->get_name());
                ?>
">
						<?php 
                echo $field->get_label();
                ?>
						<?php 
                echo $field->render(true);
                ?>
						<?php 
                \VP_Util_Text::print_if_exists($field->get_description(), '<div class="description">%s</div>');
                ?>
					</label>
				</p>
				<?php 
            }
        }