public function form($instance) { $instance = wp_parse_args($instance, $this->defaults); ?> <p> <?php wpsc_form_label(__('Title:', 'wpsc'), $this->get_field_id('title')); ?> <br /> <?php wpsc_form_input($this->get_field_name('title'), $instance['title'], array('id' => $this->get_field_id('title'), 'class' => 'widefat')); ?> </p> <?php }
</p> <p> <?php wpsc_form_checkbox($this->get_field_name('show_image'), 1, _x('Show Thumbnails', 'product category widget', 'wpsc'), !empty($instance['show_image'])); ?> </p> <ul style="margin-left:18px;"> <li> <?php printf(_x('%1$s %2$s %3$s', 'product category widget width / height option', 'wpsc'), wpsc_form_label(_x('Width:', 'product category widget', 'wpsc'), $this->get_field_id('width'), array(), false), wpsc_form_input($this->get_field_name('width'), $width, array('id' => $this->get_field_id('width'), 'size' => 3), false), __('px', 'wpsc')); ?> </li> <li> <?php printf(_x('%1$s %2$s %3$s', 'product category widget width / height option', 'wpsc'), wpsc_form_label(_x('Height:', 'product category widget', 'wpsc'), $this->get_field_id('height'), array(), false), wpsc_form_input($this->get_field_name('height'), $height, array('id' => $this->get_field_id('height'), 'size' => 3), false), __('px', 'wpsc')); ?> </li> </ul> <p> <?php echo _x('Select Categories:', 'product category widget', 'wpsc'); ?> <br /> <small><?php esc_html_e('Leave all unchecked if you want to display all', 'wpsc'); ?> </small><br> </p> <ul style="margin-left: 18px;">
</p> <p> <?php wpsc_form_checkbox($this->get_field_name('show_you_save'), 1, _x('Show "You save"', 'on sale widget', 'wp-e-commerce'), $instance['show_you_save']); ?> </p> <p> <?php wpsc_form_checkbox($this->get_field_name('show_description'), 1, _x('Show Description', 'on sale widget', 'wp-e-commerce'), $instance['show_description']); ?> </p> <p> <?php wpsc_form_checkbox($this->get_field_name('show_image'), 1, _x('Show Thumbnails', 'on sale widget', 'wp-e-commerce'), !empty($instance['show_image'])); ?> </p> <ul style="margin-left:18px;"> <li> <?php printf(_x('%1$s %2$s %3$s', 'on sale widget width / height option', 'wp-e-commerce'), wpsc_form_label(_x('Width:', 'on sale widget', 'wp-e-commerce'), $this->get_field_id('width'), array(), false), wpsc_form_input($this->get_field_name('width'), $instance['width'], array('id' => $this->get_field_id('width'), 'size' => 3), false), __('px', 'wp-e-commerce')); ?> </li> <li> <?php printf(_x('%1$s %2$s %3$s', 'on sale widget width / height option', 'wp-e-commerce'), wpsc_form_label(_x('Height:', 'on sale widget', 'wp-e-commerce'), $this->get_field_id('height'), array(), false), wpsc_form_input($this->get_field_name('height'), $instance['width'], array('id' => $this->get_field_id('height'), 'size' => 3), false), __('px', 'wp-e-commerce')); ?> </li> </ul>
function _wpsc_filter_control_before($output, $field, $args) { extract($field); $label_output = ''; $controls_without_labels = array('submit', 'checkbox', 'radio', 'hidden', 'heading'); if (!in_array($type, $controls_without_labels)) { $label_output .= $args['before_label']; $label_output .= wpsc_form_label($title, $id . '-control', array('id' => $id . '-label', 'class' => 'wpsc-control-label'), false); $label_output .= $args['after_label']; } $output = $label_output . $output; return $output; }
public function form($instance) { $instance = wp_parse_args($instance, $this->defaults); $terms = get_terms('wpsc_product_category', array('hide_empty' => false)); $options = array(); foreach ($terms as $term) { $options[$term->term_id] = $term->name; } ?> <p> <?php wpsc_form_label(_x('Title', 'widget title', 'wpsc'), $this->get_field_id('title')); ?> <br> <?php wpsc_form_input($this->get_field_name('title'), $instance['title'], array('id' => $this->get_field_id('title'), 'class' => 'widefat')); ?> </p> <p> <?php wpsc_form_label(__('Categories to display', 'wpsc'), $this->get_field_id('categories')); ?> <br> <span class="wpsc-cat-drill-down-all-actions wpsc-settings-all-none"> <?php printf(_x('Select: %1$s %2$s', 'select all / none', 'wpsc'), '<a href="#" data-for="' . esc_attr($this->get_field_id('categories')) . '" class="wpsc-multi-select-all">' . _x('All', 'select all', 'wpsc') . '</a>', '<a href="#" data-for="' . esc_attr($this->get_field_id('categories')) . '" class="wpsc-multi-select-none">' . __('None', 'wpsc') . '</a>'); ?> </span><br> <?php wpsc_form_select($this->get_field_name('categories') . '[]', $instance['categories'], $options, array('id' => $this->get_field_id('categories'), 'multiple' => 'multiple', 'size' => 5, 'class' => 'wpsc-multi-select widefat', 'data-placeholder' => __('Select categories', 'wpsc'))); ?> </p> <?php }