protected function _setup_data() { $opt = array('maximumSelectionSize' => $this->get_max_selection()); $this->add_data('opt', VP_Util_Text::make_opt($opt)); $this->add_data('opt_raw', $opt); parent::_setup_data(); }
protected function _setup_data() { $opt = array('format' => $this->get_format()); $this->add_data('opt', VP_Util_Text::make_opt($opt)); $this->add_data('opt_raw', $opt); parent::_setup_data(); }
protected function _setup_data() { $opt = array('min' => $this->get_min(), 'max' => $this->get_max(), 'step' => $this->get_step(), 'value' => $this->get_value()); $this->add_data('opt', VP_Util_Text::make_opt($opt)); $this->add_data('opt_raw', $opt); parent::_setup_data(); }
protected function _setup_data() { $opt = array('use_external_plugins' => $this->use_external_plugins(), 'disabled_externals_plugins' => implode(',', $this->get_disabled_externals_plugins()), 'disabled_internals_plugins' => implode(',', $this->get_disabled_internals_plugins())); $this->add_data('opt', VP_Util_Text::make_opt($opt)); $this->add_data('opt_raw', $opt); parent::_setup_data(); }
function _render_repeating_group($group) { $name = $group['name']; $uid = $group['indexed_name']; $oddity = $group['level'] % 2 === 0 ? 'even' : 'odd'; $dependency = isset($group['dependency']) ? $group['dependency']['function'] . '|' . $group['dependency']['field'] : ''; $html = ''; $html .= '<div id="wpa_loop-' . $uid . '" class="vp-wpa-loop level-' . $oddity . ' wpa_loop wpa_loop-' . $name . ' vp-repeating-loop vp-meta-group' . (isset($group['container_extra_classes']) ? ' ' . implode(' ', $group['container_extra_classes']) : '') . '"' . VP_Util_Text::return_if_exists(isset($dependency) ? $dependency : '', 'data-vp-dependency="%s"') . '>'; $icon = ''; if (isset($group['sortable']) and $group['sortable']) { $icon = '<i class="icon-move"></i> '; } foreach ($group['groups'] as $g) { $class = ''; $is_first = false; $is_last = false; if ($g === end($group['groups'])) { $is_last = true; $class = ' last tocopy'; } if ($g === reset($group['groups'])) { $is_first = true; $class = ' first'; } $html .= '<div id="' . $g['name'] . '" class="vp-wpa-group wpa_group wpa_group-' . $name . $class . '">'; $html .= '<div class="vp-wpa-group-heading"><a href="#" class="vp-wpa-group-title">' . $icon . $group['title'] . '</a><a href="#" class="dodelete vp-wpa-group-remove" title="' . __('Remove', SH_NAME) . '"><i class="icon-remove"></i> ' . __('Remove', SH_NAME) . '</a></div>'; $html .= '<div class="vp-controls' . (!$is_first ? ' vp-hide' : '') . '">'; if ($g === end($group['groups'])) { $tocopy = $g['name'] . '[tocopy]'; $html .= '<input type="hidden" class="tocopy-hidden" name="' . $tocopy . '" value="1">'; } foreach ($g['childs'] as $f) { if (is_array($f) and $f['repeating']) { $html .= $this->_render_repeating_group($f); } else { if (is_array($f) and !$f['repeating']) { $html .= $this->_render_group($f); } else { $html .= $this->_render_field($f); } } } $html .= '</div>'; $html .= '</div>'; } $html .= '<div class="vp-wpa-group-add">'; $html .= '<a href="#" class="button button-primary docopy-' . $name . '" style="width: 200px; margin: 0px auto;">' . __('Add More ', SH_NAME) . '' . $group['title'] . '</a>'; $html .= '</div>'; $html .= '</div>'; return $html; }
?> <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 } ?>
<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>
$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 }
/** * Setup and return needed attribute as array * @return Array Data array */ protected function _setup_data() { // Set Basic Data $this->add_data('name', $this->get_name()); $this->add_data('default', $this->get_default()); $this->add_data('value', $this->get_value()); // Determine Type $type = 'vp-' . strtolower(substr(get_class($this), strrpos(get_class($this), '_') + 1)); // Is hidden if ($this->is_hidden()) { $this->add_container_extra_classes('vp-hide'); } // Set Control Head Data $this->add_data('head_info', array('name' => $this->get_name(), 'type' => $type, 'container_extra_classes' => implode(' ', $this->get_container_extra_classes()), 'is_hidden' => $this->is_hidden(), 'validation' => $this->get_validation(), 'dependency' => $this->get_dependency(), 'binding' => $this->get_binding(), 'label' => $this->get_label(), 'description' => VP_Util_Text::parse_md($this->get_description()))); }
protected function _setup_data() { $opt = array('mode' => $this->get_editor_mode(), 'theme' => $this->get_editor_theme()); $this->add_data('opt', VP_Util_Text::make_opt($opt)); parent::_setup_data(); }
?> <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);
?> " 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'); }
<?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'); }
/** * 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 } }
protected function _setup_data() { $opt = array('minDate' => $this->get_min_date(), 'maxDate' => $this->get_max_date(), 'dateFormat' => $this->get_format(), 'value' => $this->get_value()); $this->add_data('opt', VP_Util_Text::make_opt($opt)); parent::_setup_data(); }