-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitem-post.php
More file actions
192 lines (186 loc) · 9.12 KB
/
Copy pathitem-post.php
File metadata and controls
192 lines (186 loc) · 9.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php
use shopclass\includes\frm\tfcItemForm;
$action = 'item_add_post';
$edit = false;
if ( Params::getParam( 'action' ) == 'item_edit' ) {
$action = 'item_edit_post';
$edit = true;
}
osc_current_web_theme_path( 'head.php' ); ?>
<body>
<!-- end only item-post.php -->
<?php osc_current_web_theme_path( 'header.php' ); ?>
<form class="tfc-form" name="item" action="<?php echo osc_base_url( true ); ?>" method="post"
enctype="multipart/form-data">
<input type="hidden" name="action" value="<?php echo $action; ?>"/>
<?php if ( $edit ) { ?>
<input type="hidden" name="id" value="<?php echo osc_item_id(); ?>"/>
<input type="hidden" name="secret" value="<?php echo osc_item_secret(); ?>"/>
<?php } ?>
<input type="hidden" name="page" value="item"/>
<div class="content add_item row">
<div class="main-content col-md-8 tfc-item">
<h3><?php _e( 'Publish a listing' , 'shopclass' ); ?></h3>
<div class="general_info col-md-12">
<h4><i class="fa fa-info-circle"></i><?php _e( 'General Information' , 'shopclass' ); ?></h4>
<div class="form-group">
<label><?php _e( 'Category' , 'shopclass' ); ?> *</label>
<div>
<?php if ( tfc_getPref( 'cat_selection' ) ) {
tfcItemForm::category_multiple_selects();
} else {
tfcItemForm::category_select( null , null , __( 'Select a category' , 'shopclass' ) );
} ?>
</div>
</div>
<?php tfcItemForm::multilanguage_title_description(); ?>
</div>
<div class="custom form-group col-md-12">
<?php
if ( $edit ) {
ItemForm::plugin_edit_item();
} else {
ItemForm::plugin_post_item();
} ?>
</div>
<?php if ( osc_images_enabled_at_items() ) { ?>
<div class="photos box form-group col-md-12">
<h4><i class="fa fa-camera"></i><?php _e( 'Photos' , 'shopclass' ); ?></h4>
<div class="form-group">
<?php if ( osc_images_enabled_at_items() ) {
ItemForm::ajax_photos();
} ?>
</div>
</div>
<?php } ?>
</div>
<div class="side-content col-md-4">
<div class="col-md-12 tfc-item">
<div class="seller-info form-group">
<?php if ( ! osc_is_web_user_logged_in() ) { ?>
<h4><i class="fa fa-user"></i><?php _e( 'Your info' , 'shopclass' ); ?></h4>
<div class="form-group">
<label for="contactName"><?php _e( 'Name' , 'shopclass' ); ?></label>
<?php tfcItemForm::contact_name_text(); ?>
</div>
<div class="form-group">
<label for="contactEmail"><?php _e( 'E-mail' , 'shopclass' ); ?> *</label>
<?php tfcItemForm::contact_email_text(); ?>
</div>
<div class="form-group checkbox">
<label for="showEmail"><?php tfcItemForm::show_email_checkbox(); ?><?php _e( 'Show e-mail on the item page' , 'shopclass' ); ?></label>
</div>
<?php }; ?>
</div>
<?php if ( osc_price_enabled_at_items() ) { ?>
<div class="row">
<div class="price form-group">
<h4 class="col-xs-12"><i class="fa fa-money"></i><?php _e( 'Price' , 'shopclass' ); ?></h4>
<div class="col-xs-7">
<?php tfcItemForm::price_input_text(); ?>
</div>
<div class="col-xs-5">
<?php tfcItemForm::currency_select(); ?>
</div>
</div>
</div>
<?php } ?>
<div class="location form-group">
<h4><i class="fa fa-map-marker"></i><?php _e( 'Item Location' , 'shopclass' ); ?></h4>
<div class="form-group">
<label for="countryId"><?php _e( 'Country' , 'shopclass' ); ?></label>
<?php tfcItemForm::country_select( osc_get_countries() , osc_user() ); ?>
</div>
<?php if ( ! ( tfc_getPref( 'searchbar_layout' ) ) ) { ?>
<div class="form-group">
<label for="region"><?php _e( 'State/Region' , 'shopclass' ); ?></label>
<?php tfcItemForm::region_text( osc_user() ); ?>
</div>
<div class="form-group">
<label for="city"><?php _e( 'City' , 'shopclass' ); ?></label>
<?php tfcItemForm::city_text( osc_user() ); ?>
</div>
<?php } else {
if ( $edit ) { ?>
<div class="form-group">
<label for="regionId"><?php _e( 'State/Region' , 'shopclass' ); ?></label>
<?php tfcItemForm::region_select( osc_get_regions( osc_item_country() ) , osc_user() ); ?>
</div>
<div class="form-group">
<label for="cityId"><?php _e( 'City' , 'shopclass' ); ?></label>
<?php tfcItemForm::city_select( osc_get_cities( osc_item_region_id() ) , osc_user() ); ?>
</div>
<?php } else { ?>
<div class="form-group">
<label for="regionId"><?php _e( 'State/Region' , 'shopclass' ); ?></label>
<?php tfcItemForm::region_select( osc_get_regions( osc_user_country() ) , osc_user() ); ?>
</div>
<div class="form-group">
<label for="cityId"><?php _e( 'City' , 'shopclass' ); ?></label>
<?php tfcItemForm::city_select( osc_get_cities( osc_user_region_id() ) , osc_user() ); ?>
</div>
<?php }
} ?>
<div class="form-group">
<label for="cityArea"><?php _e( 'City Area' , 'shopclass' ); ?></label>
<?php tfcItemForm::city_area_text( osc_user() ); ?>
</div>
<div class="form-group">
<label for="address"><?php _e( 'Address' , 'shopclass' ); ?></label>
<?php tfcItemForm::address_text( osc_user() ); ?>
</div>
</div>
<div class=" form-group">
<?php osc_run_hook( 'tf_after_form' ); ?>
</div>
<?php if ( osc_recaptcha_items_enabled() ) { ?>
<div class="form-group">
<div class="recaptcha">
<?php osc_show_recaptcha(); ?>
</div>
</div>
<?php } ?>
<?php if ( $edit ) { ?>
<button class="item-submit btn btn-danger"
type="submit"><?php _e( 'Update' , 'shopclass' ); ?></button>
<a class=" btn btn-warning" href="javascript:history.back(-1)"
class="go_back"><?php _e( 'Cancel' , 'shopclass' ); ?></a>
<?php } else { ?>
<button class="item-submit btn btn-success"
type="submit"><?php _e( 'Publish' , 'shopclass' ); ?></button>
<?php } ?>
<div class="form-group"></div>
</div>
</div>
</div>
</form>
<?php osc_current_web_theme_path( 'footer.php' ); ?>
<!-- only item-post.php -->
<?php $searchbar_layout = tfc_getPref( 'searchbar_layout' );
switch ( $searchbar_layout ) {
case 1:
tfcItemForm::location_javascript();
break;
case 2:
tfcItemForm::location_javascript();
break;
default:
tfcItemForm::location_javascript_new();
}
?>
<script>
$(document).ready(function () {
$('#price').on('keypress', function (ev) {
var keyCode = window.event ? ev.keyCode : ev.which;
//codes for 0-9
if (keyCode < 48 || keyCode > 57) {
//codes for backspace, delete, enter, decimals
if (keyCode != 46 && keyCode != 0 && keyCode != 8 && keyCode != 13 && !ev.ctrlKey) {
ev.preventDefault();
}
}
});
});
</script>
</body>
</html>