This repository has been archived by the owner on Mar 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
translations.js
executable file
·210 lines (184 loc) · 6.21 KB
/
translations.js
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
function ct_check_actions() {
return true;
//return confirm(contexflow.__('confmsg'));
}
function custom_type_update_admin(params) {
var data = {
action: 'update_admin',
content_type: params['name'],
'public': jQuery('#public').attr('checked'),
show_ui: jQuery('#show_ui').attr('checked'),
fields_to_show_in_table: jQuery('#fields_to_show_in_table').val(),
admin_menu_position: jQuery('#admin_menu_position').val(),
admin_menu_icon: jQuery('#admin_menu_icon').val()
};
jQuery.post(params['url'], data, function(response) {
alert(contexflow.__('aupd'));
});
}
function custom_type_update_permissions(params) {
var data = {
action: 'update_permissions',
content_type: params['name']
};
contexflow.permissions(data);
jQuery.post(params['url'], data, function(response) {
alert(contexflow.__('pupd'));
});
}
function custom_type_update_visibility(params) {
var data = {
action: 'update_visibility',
content_type: params['name'],
query_var: jQuery('#query-var').attr('checked'),
exclude_from_search: jQuery('#include-in-search').attr('checked')
};
jQuery.post(params['url'], data, function(response) {
alert(contexflow.__('vupd'));
});
}
function custom_type_update_labels(params) {
var data = {
action: 'update_labels',
content_type: params['name']
};
contexflow.labels_list(data);
jQuery.post(params['url'], data, function(response) {
alert(contexflow.__('lupd'));
});
}
function custom_type_update_category(params) {
if (confirm(contexflow.__('updmsg'))) {
var data = {
action: 'update_category',
content_type: params['type'],
category: params['item'].value,
checked: params['item'].checked
};
jQuery.post(params['url'], data, function(response) {
jQuery('#category-list').html(response);
});
}
else
item.checked=!item.checked;
}
function custom_type_edit_category(params) {
var data = {
action: 'edit_category',
content_type: params['name'],
category: params['category']
};
var msg={};
msg[contexflow.__('cmsg')]=function() {
jQuery(this).dialog('close');
}
jQuery.post(params['url'], data, function(response) {
jQuery("#addcategory_dialog").dialog('destroy');
jQuery('#addcategory_dialog').html(response);
jQuery("#addcategory_dialog").dialog({
resizable: false,
modal: true,
buttons: msg
});
});
}
function custom_type_edit_field(params) {
var data = {
action: 'edit_field',
content_type: params['name'],
field_name: params['field_name']
};
var msg={};
msg[contexflow.__('cmsg')]=function() {
jQuery(this).dialog('close');
}
jQuery.post(params['url'], data, function(response) {
jQuery('#addfield_dialog').html(response);
jQuery("#addfield_dialog").dialog({
resizable: false,
modal: true,
buttons: msg
});
});
}
function custom_type_update_field(params) {
var data = {
action: 'update_field',
content_type: params['name'],
order: jQuery('#fields_order').val()
};
jQuery.post(params['url'], data, function(response) {
jQuery('#fields_content').html(response);
alert(contexflow.__('fupd'));
});
}
function custom_type_add_field(params) {
var data = {
action: 'edit_field',
content_type: params['name']
};
var msg={};
msg[contexflow.__('cmsg')]=function() {
jQuery(this).dialog('close');
}
jQuery.post(params['url'], data, function(response) {
jQuery('#addfield_dialog').html(response);
jQuery("#addfield_dialog").dialog({
resizable: false,
modal: true,
buttons: msg
});
});
}
function custom_type_add_category(params) {
var data = {
action: 'edit_category',
content_type: params['name']
};
var msg={};
msg[contexflow.__('cmsg')]=function() {
jQuery(this).dialog('close');
}
jQuery.post(params['url'], data, function(response) {
jQuery("#addcategory_dialog").dialog('destroy');
jQuery('#addcategory_dialog').html(response);
jQuery("#addcategory_dialog").dialog({
resizable: false,
modal: true,
buttons: msg
});
});
}
function custom_type_delete_content(params) {
var data = {
action: 'delete_content',
content_type: params['name'],
passthru: params['passthru']
};
jQuery.post(params['url'], data, function(response) {
jQuery('#delete_dialog').html(response);
if (data['passthru']==1) {
reload_page_content(params['url'])
jQuery("#menu-post a[href*='"+params['name']+"']").parent("li#menu-post").remove();
return;
}
var msg={};
msg[contexflow.__('dmsg')]=function() {
jQuery(this).dialog('close');
params['passthru']=1;
custom_type_delete_content(params);
}
msg[contexflow.__('mmsg')]=function() {
jQuery(this).dialog('close');
custom_type_move_content(params);
}
msg[contexflow.__('cmsg')]=function() {
jQuery(this).dialog('close');
}
jQuery("#delete_dialog").dialog({
resizable: false,
modal: true,
buttons: msg
});
});
}