PluginProbe
WP Directory Kit / 1.1.0
WP Directory Kit v1.1.0
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / application / views / fields_edit / DROPDOWN.php

DROPDOWN.php in WP Directory Kit 1.1.0, at application/views/fields_edit/DROPDOWN.php

81 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Edit field DROPDOWN.
4 *
5 * This is the template that field layout for edit form
6 *
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12 ?>
13 <?php
14
15 //wmvc_dump($field);
16
17 if(isset($field->field))
18 {
19 $field_id = $field->field;
20 }
21 else
22 {
23 $field_id = 'field_'.$field->idfield;
24 }
25
26 if(!isset($field->hint))$field->hint = '';
27
28 $field_label = $field->field_label;
29
30 if(!isset($field->hint))$field->hint = '';
31 if(!isset($field->class))$field->class = '';
32 if(!isset($field->columns_number))$field->columns_number = '';
33 if(!isset($field->prefix))$field->prefix = '';
34 if(!isset($field->suffix))$field->suffix = '';
35
36 $required = '';
37 if(isset($field->is_required) && $field->is_required == 1)
38 $required = '*';
39
40 if(!empty($field->values) && is_array($field->values)){
41 $values = $field->values;
42 } else {
43 $values = array();
44 if(!empty($field->values_list)){
45 $values = explode(',', $field->values_list);
46 $values = array(''=> __('Not Selected', 'wpdirectorykit')) + array_combine($values, $values);
47 }
48 }
49
50 $button_suffix = '';
51
52 //var_dump($values);
53 //var_dump(wmvc_show_data($field_id, $db_data, ''));
54
55 ?>
56
57 <div class="wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>">
58 <label for="<?php echo esc_attr($field_id); ?>"><?php echo esc_html($field_label).esc_html($required); ?></label>
59 <div class="wdk-field-container">
60 <?php echo wmvc_select_option($field_id, $values, wmvc_show_data($field_id, $db_data, ''), "id='".$field_id."'"); ?>
61 <span class="suffix"><?php
62 echo esc_html($field->prefix);
63 if(!empty($field->prefix) && !empty($field->suffix)) echo ' / ';
64 echo esc_html($field->suffix);
65 ?><?php if(($field_id=='wdk_listing_page' || $field_id=='wdk_results_page')):?>
66 <?php if(!empty(wmvc_show_data($field_id, $db_data, '')) && get_post_status(wmvc_show_data($field_id, $db_data, '')) == 'publish'):?>
67 <a class="button button-primary" target="_blank" href="<?php echo get_permalink(wmvc_show_data($field_id, $db_data, ''));?>" style="margin-top: -5px;">
68 <?php echo esc_html__('View Page','wpdirectorykit');?>
69 </a>
70 <?php else:?>
71 <a class="button button-primary" target="_blank" href="<?php echo get_admin_url() . "admin.php?page=wdk_settings&function=import_demo"; ?>" style="margin-top: -5px;">
72 <?php echo esc_html__('Create Demo Page','wpdirectorykit');?>
73 </a>
74 <?php endif;?><?php endif;?></span>
75 <?php if(!empty($field->hint)):?>
76 <p class="wdk-hint">
77 <?php echo esc_html($field->hint); ?>
78 </p>
79 <?php endif;?>
80 </div>
81 </div>