Version Description
- added Serbian translation. props Borisa Djuraskovic
- fixed spinner in admin box. props yamablam
- fixed JavaScript error related to Backbone. props ericandrewlewis
- made 'p2p_connected_title' filter work for users too. props MZAWeb
- added support for 'dropdown_title' labels. props GaryJones
- made
get_related()
consider all connected items
Download this release
Release Info
Developer | scribu |
Plugin | Posts 2 Posts |
Version | 1.6.3 |
Comparing to | |
See all releases |
Code changes from version 1.6.2 to 1.6.3
- CONTRIBUTING.md +4 -30
- admin/box.css +2 -3
- admin/box.js +60 -88
- admin/box.php +5 -1
- admin/column-factory.php +3 -0
- admin/column.php +3 -4
- admin/dropdown.php +13 -1
- admin/field-title.php +2 -2
- admin/field.php +3 -0
- core/directed-connection-type.php +5 -1
- core/item.php +3 -0
- lang/posts-to-posts-es_ES.po +134 -53
- lang/posts-to-posts-sr_RS.mo +0 -0
- lang/posts-to-posts-sr_RS.po +190 -0
- posts-to-posts.php +7 -2
- readme.txt +10 -2
CONTRIBUTING.md
CHANGED
@@ -5,44 +5,18 @@ This guide is meant for developers wanting to work on the plugin code.
|
|
5 |
Make a fork and clone it:
|
6 |
|
7 |
```
|
8 |
-
git clone --
|
9 |
```
|
10 |
|
11 |
You can now work on the PHP and CSS files. Please follow the [WordPress Coding Standards](http://make.wordpress.org/core/handbook/coding-standards/).
|
12 |
|
13 |
-
### JavaScript
|
14 |
-
|
15 |
-
Don't modify `admin/box.js` directly. Instead:
|
16 |
-
|
17 |
-
- [Install node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager).
|
18 |
-
|
19 |
-
- Install [CoffeeScript](http://coffeescript.org):
|
20 |
-
|
21 |
-
```
|
22 |
-
npm install -g coffee-script
|
23 |
-
```
|
24 |
-
|
25 |
-
and edit the `admin/box.coffee` file. To compile it, run:
|
26 |
-
|
27 |
-
```
|
28 |
-
coffee -c admin
|
29 |
-
```
|
30 |
-
|
31 |
### Unit Tests
|
32 |
|
33 |
If you want to add a new feature, please consider adding a new test for it as well.
|
34 |
|
35 |
The following instructions assume a UNIX-like environment (OS X, Linux, etc.).
|
36 |
|
37 |
-
Step 1:
|
38 |
-
|
39 |
-
```bash
|
40 |
-
export WP_TESTS_DIR=/tmp/wordpress-tests/
|
41 |
-
```
|
42 |
-
|
43 |
-
This step will be needed each time you want to run the tests, so you might want to put it in your `.bashrc` file, to be executed automatically.
|
44 |
-
|
45 |
-
Step 2: Install and configure the official WordPress testing suite:
|
46 |
|
47 |
```bash
|
48 |
./bin/install-wp-tests
|
@@ -50,13 +24,13 @@ Step 2: Install and configure the official WordPress testing suite:
|
|
50 |
|
51 |
Note that all data in the test DB will be _deleted_ once you run the tests.
|
52 |
|
53 |
-
Step
|
54 |
|
55 |
```bash
|
56 |
php composer.phar install --dev
|
57 |
```
|
58 |
|
59 |
-
Step
|
60 |
|
61 |
```bash
|
62 |
./vendor/bin/phpunit
|
5 |
Make a fork and clone it:
|
6 |
|
7 |
```
|
8 |
+
git clone --recursive git@github.com:{YOUR GITHUB USERNAME}/wp-posts-to-posts.git posts-to-posts
|
9 |
```
|
10 |
|
11 |
You can now work on the PHP and CSS files. Please follow the [WordPress Coding Standards](http://make.wordpress.org/core/handbook/coding-standards/).
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
### Unit Tests
|
14 |
|
15 |
If you want to add a new feature, please consider adding a new test for it as well.
|
16 |
|
17 |
The following instructions assume a UNIX-like environment (OS X, Linux, etc.).
|
18 |
|
19 |
+
Step 1: Install and configure the official WordPress testing suite:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
```bash
|
22 |
./bin/install-wp-tests
|
24 |
|
25 |
Note that all data in the test DB will be _deleted_ once you run the tests.
|
26 |
|
27 |
+
Step 2: Install PHPUnit via [Composer](https://getcomposer.org):
|
28 |
|
29 |
```bash
|
30 |
php composer.phar install --dev
|
31 |
```
|
32 |
|
33 |
+
Step 3: Run the tests:
|
34 |
|
35 |
```bash
|
36 |
./vendor/bin/phpunit
|
admin/box.css
CHANGED
@@ -13,8 +13,7 @@
|
|
13 |
/* Tabs */
|
14 |
|
15 |
.p2p-box .tabs-panel {
|
16 |
-
border
|
17 |
-
border-style: solid;
|
18 |
display: none;
|
19 |
padding: 10px;
|
20 |
}
|
@@ -83,7 +82,7 @@ td.p2p-col-create {
|
|
83 |
text-align: left;
|
84 |
}
|
85 |
|
86 |
-
.p2p-connections td input {
|
87 |
width: 100%;
|
88 |
}
|
89 |
|
13 |
/* Tabs */
|
14 |
|
15 |
.p2p-box .tabs-panel {
|
16 |
+
border: 1px solid #DFDFDF;
|
|
|
17 |
display: none;
|
18 |
padding: 10px;
|
19 |
}
|
82 |
text-align: left;
|
83 |
}
|
84 |
|
85 |
+
.p2p-connections td input[type="text"] {
|
86 |
width: 100%;
|
87 |
}
|
88 |
|
admin/box.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
// Generated by CoffeeScript 1.6.2
|
2 |
(function() {
|
3 |
var Candidate, Candidates, CandidatesView, Connection, Connections, ConnectionsView, CreatePostView, ENTER_KEY, MetaboxView, get_mustache_template, remove_row, row_wait;
|
4 |
|
@@ -10,7 +9,6 @@
|
|
10 |
|
11 |
remove_row = function($td) {
|
12 |
var $table;
|
13 |
-
|
14 |
$table = $td.closest('table');
|
15 |
$td.closest('tr').remove();
|
16 |
if (!$table.find('tbody tr').length) {
|
@@ -28,23 +26,19 @@
|
|
28 |
|
29 |
Candidates = Backbone.Model.extend({
|
30 |
sync: function() {
|
31 |
-
var params,
|
32 |
-
_this = this;
|
33 |
-
|
34 |
params = {
|
35 |
subaction: 'search'
|
36 |
};
|
37 |
return this.ajax_request(params, function(response) {
|
38 |
-
var _ref;
|
39 |
-
|
40 |
-
_this.
|
41 |
-
return _this.trigger('sync', response);
|
42 |
});
|
43 |
},
|
44 |
validate: function(attrs) {
|
45 |
-
var _ref;
|
46 |
-
|
47 |
-
if ((0 < (_ref = attrs['paged']) && _ref <= this.total_pages)) {
|
48 |
return null;
|
49 |
}
|
50 |
return 'invalid page';
|
@@ -54,50 +48,42 @@
|
|
54 |
Connections = Backbone.Collection.extend({
|
55 |
model: Connection,
|
56 |
createItemAndConnect: function(title) {
|
57 |
-
var data,
|
58 |
-
_this = this;
|
59 |
-
|
60 |
data = {
|
61 |
subaction: 'create_post',
|
62 |
post_title: title
|
63 |
};
|
64 |
return this.ajax_request(data, function(response) {
|
65 |
-
|
66 |
});
|
67 |
},
|
68 |
create: function(candidate) {
|
69 |
-
var data,
|
70 |
-
_this = this;
|
71 |
-
|
72 |
data = {
|
73 |
subaction: 'connect',
|
74 |
to: candidate.get('id')
|
75 |
};
|
76 |
return this.ajax_request(data, function(response) {
|
77 |
-
|
78 |
});
|
79 |
},
|
80 |
"delete": function(connection) {
|
81 |
-
var data,
|
82 |
-
_this = this;
|
83 |
-
|
84 |
data = {
|
85 |
subaction: 'disconnect',
|
86 |
p2p_id: connection.get('id')
|
87 |
};
|
88 |
return this.ajax_request(data, function(response) {
|
89 |
-
|
90 |
});
|
91 |
},
|
92 |
clear: function() {
|
93 |
-
var data,
|
94 |
-
_this = this;
|
95 |
-
|
96 |
data = {
|
97 |
subaction: 'clear_connections'
|
98 |
};
|
99 |
return this.ajax_request(data, function(response) {
|
100 |
-
|
101 |
});
|
102 |
}
|
103 |
});
|
@@ -108,20 +94,20 @@
|
|
108 |
'click td.p2p-col-delete .p2p-icon': 'delete'
|
109 |
},
|
110 |
initialize: function(options) {
|
|
|
111 |
this.maybe_make_sortable();
|
112 |
this.collection.on('create', this.afterCreate, this);
|
113 |
-
|
114 |
},
|
115 |
maybe_make_sortable: function() {
|
116 |
if (this.$('th.p2p-col-order').length) {
|
117 |
-
|
118 |
handle: 'td.p2p-col-order',
|
119 |
helper: function(e, ui) {
|
120 |
ui.children().each(function() {
|
121 |
var $this;
|
122 |
-
|
123 |
$this = jQuery(this);
|
124 |
-
|
125 |
});
|
126 |
return ui;
|
127 |
}
|
@@ -130,21 +116,19 @@
|
|
130 |
},
|
131 |
clear: function(ev) {
|
132 |
var $td;
|
133 |
-
|
134 |
ev.preventDefault();
|
135 |
if (!confirm(P2PAdminL10n.deleteConfirmMessage)) {
|
136 |
return;
|
137 |
}
|
138 |
$td = jQuery(ev.target).closest('td');
|
139 |
row_wait($td);
|
140 |
-
|
141 |
},
|
142 |
afterClear: function() {
|
143 |
-
|
144 |
},
|
145 |
"delete": function(ev) {
|
146 |
var $td, req;
|
147 |
-
|
148 |
ev.preventDefault();
|
149 |
$td = jQuery(ev.target).closest('td');
|
150 |
row_wait($td);
|
@@ -152,13 +136,12 @@
|
|
152 |
id: $td.find('input').val()
|
153 |
}));
|
154 |
req.done(function() {
|
155 |
-
|
156 |
});
|
157 |
-
return null;
|
158 |
},
|
159 |
afterCreate: function(response) {
|
160 |
this.$el.show().find('tbody').append(response.row);
|
161 |
-
|
162 |
}
|
163 |
});
|
164 |
|
@@ -171,64 +154,58 @@
|
|
171 |
'click td.p2p-col-create div': 'promote'
|
172 |
},
|
173 |
initialize: function(options) {
|
|
|
174 |
this.spinner = options.spinner;
|
175 |
options.connections.on('delete', this.afterCandidatesRefreshed, this);
|
176 |
options.connections.on('clear', this.afterCandidatesRefreshed, this);
|
177 |
this.collection.on('sync', this.afterCandidatesRefreshed, this);
|
178 |
this.collection.on('error', this.afterInvalid, this);
|
179 |
-
|
180 |
},
|
181 |
promote: function(ev) {
|
182 |
-
var $td, req,
|
183 |
-
_this = this;
|
184 |
-
|
185 |
ev.preventDefault();
|
186 |
$td = jQuery(ev.target).closest('td');
|
187 |
row_wait($td);
|
188 |
-
|
189 |
id: $td.find('div').data('item-id')
|
190 |
-
})
|
|
|
191 |
req.done(function() {
|
192 |
if (_this.options.duplicate_connections) {
|
193 |
-
|
194 |
} else {
|
195 |
-
|
196 |
}
|
197 |
});
|
198 |
-
return null;
|
199 |
},
|
200 |
handleReturn: function(ev) {
|
201 |
if (ev.keyCode === ENTER_KEY) {
|
202 |
ev.preventDefault();
|
203 |
}
|
204 |
-
return null;
|
205 |
},
|
206 |
handleSearch: function(ev) {
|
207 |
var $searchInput, delayed,
|
208 |
_this = this;
|
209 |
-
|
210 |
if (delayed !== void 0) {
|
211 |
clearTimeout(delayed);
|
212 |
}
|
213 |
$searchInput = jQuery(ev.target);
|
214 |
delayed = setTimeout(function() {
|
215 |
var searchStr;
|
216 |
-
|
217 |
searchStr = $searchInput.val();
|
218 |
if (searchStr === _this.collection.get('s')) {
|
219 |
return;
|
220 |
}
|
221 |
-
_this.spinner.insertAfter(
|
222 |
-
|
223 |
's': searchStr,
|
224 |
'paged': 1
|
225 |
});
|
226 |
}, 400);
|
227 |
-
return null;
|
228 |
},
|
229 |
changePage: function(ev) {
|
230 |
var $navButton, new_page;
|
231 |
-
|
232 |
$navButton = jQuery(ev.currentTarget);
|
233 |
new_page = this.collection.get('paged');
|
234 |
if ($navButton.hasClass('p2p-prev')) {
|
@@ -237,7 +214,7 @@
|
|
237 |
new_page++;
|
238 |
}
|
239 |
this.spinner.appendTo(this.$('.p2p-navigation'));
|
240 |
-
|
241 |
},
|
242 |
afterCandidatesRefreshed: function(response) {
|
243 |
this.spinner.remove();
|
@@ -245,10 +222,10 @@
|
|
245 |
if ('string' !== typeof response) {
|
246 |
response = this.template(response);
|
247 |
}
|
248 |
-
|
249 |
},
|
250 |
afterInvalid: function() {
|
251 |
-
|
252 |
}
|
253 |
});
|
254 |
|
@@ -258,20 +235,18 @@
|
|
258 |
'keypress :text': 'handleReturn'
|
259 |
},
|
260 |
initialize: function(options) {
|
|
|
261 |
this.createButton = this.$('button');
|
262 |
-
|
263 |
},
|
264 |
handleReturn: function(ev) {
|
265 |
if (ev.keyCode === ENTER_KEY) {
|
266 |
this.createButton.click();
|
267 |
ev.preventDefault();
|
268 |
}
|
269 |
-
return null;
|
270 |
},
|
271 |
createItem: function(ev) {
|
272 |
-
var req, title,
|
273 |
-
_this = this;
|
274 |
-
|
275 |
ev.preventDefault();
|
276 |
if (this.createButton.hasClass('inactive')) {
|
277 |
return false;
|
@@ -285,9 +260,8 @@
|
|
285 |
req = this.collection.createItemAndConnect(title);
|
286 |
req.done(function() {
|
287 |
_this.createInput.val('');
|
288 |
-
|
289 |
});
|
290 |
-
return null;
|
291 |
}
|
292 |
});
|
293 |
|
@@ -297,15 +271,15 @@
|
|
297 |
'click .wp-tab-bar li': 'setActiveTab'
|
298 |
},
|
299 |
initialize: function(options) {
|
|
|
300 |
this.spinner = options.spinner;
|
301 |
this.initializedCandidates = false;
|
302 |
options.connections.on('append', this.afterConnectionAppended, this);
|
303 |
options.connections.on('clear', this.afterConnectionDeleted, this);
|
304 |
-
|
305 |
},
|
306 |
toggleTabs: function(ev) {
|
307 |
var $tabs;
|
308 |
-
|
309 |
ev.preventDefault();
|
310 |
$tabs = this.$('.p2p-create-connections-tabs');
|
311 |
$tabs.toggle();
|
@@ -313,25 +287,23 @@
|
|
313 |
this.options.candidates.sync();
|
314 |
this.initializedCandidates = true;
|
315 |
}
|
316 |
-
return null;
|
317 |
},
|
318 |
setActiveTab: function(ev) {
|
319 |
var $tab;
|
320 |
-
|
321 |
ev.preventDefault();
|
322 |
$tab = jQuery(ev.currentTarget);
|
323 |
this.$('.wp-tab-bar li').removeClass('wp-tab-active');
|
324 |
$tab.addClass('wp-tab-active');
|
325 |
-
|
326 |
},
|
327 |
afterConnectionAppended: function(response) {
|
328 |
if ('one' === this.options.cardinality) {
|
329 |
-
|
330 |
}
|
331 |
},
|
332 |
afterConnectionDeleted: function(response) {
|
333 |
if ('one' === this.options.cardinality) {
|
334 |
-
|
335 |
}
|
336 |
}
|
337 |
});
|
@@ -344,34 +316,30 @@
|
|
344 |
|
345 |
jQuery(function() {
|
346 |
var clearVal, setVal;
|
347 |
-
|
348 |
if (!jQuery('<input placeholder="1" />')[0].placeholder) {
|
349 |
setVal = function() {
|
350 |
var $this;
|
351 |
-
|
352 |
$this = jQuery(this);
|
353 |
if (!$this.val()) {
|
354 |
$this.val($this.attr('placeholder'));
|
355 |
$this.addClass('p2p-placeholder');
|
356 |
}
|
357 |
-
return void 0;
|
358 |
};
|
359 |
clearVal = function() {
|
360 |
var $this;
|
361 |
-
|
362 |
$this = jQuery(this);
|
363 |
if ($this.hasClass('p2p-placeholder')) {
|
364 |
$this.val('');
|
365 |
$this.removeClass('p2p-placeholder');
|
366 |
}
|
367 |
-
return void 0;
|
368 |
};
|
369 |
jQuery('.p2p-search input[placeholder]').each(setVal).focus(clearVal).blur(setVal);
|
370 |
}
|
|
|
371 |
Mustache.compilePartial('table-row', get_mustache_template('table-row'));
|
372 |
-
return jQuery('.p2p-box').each(function() {
|
373 |
-
var $metabox, $spinner, ajax_request, candidates, candidatesView, connections, connectionsView, createPostView, ctype, metaboxView;
|
374 |
|
|
|
|
|
375 |
$metabox = jQuery(this);
|
376 |
$spinner = jQuery('<img>', {
|
377 |
'src': P2PAdminL10n.spinner,
|
@@ -387,16 +355,15 @@
|
|
387 |
direction: $metabox.data('direction'),
|
388 |
from: jQuery('#post_ID').val()
|
389 |
};
|
390 |
-
ajax_request = function(options, callback) {
|
391 |
-
var params;
|
392 |
|
393 |
-
|
|
|
394 |
action: 'p2p_box',
|
395 |
nonce: P2PAdminL10n.nonce
|
396 |
});
|
|
|
397 |
return jQuery.post(ajaxurl, params, function(response) {
|
398 |
var e;
|
399 |
-
|
400 |
try {
|
401 |
response = jQuery.parseJSON(response);
|
402 |
} catch (_error) {
|
@@ -412,15 +379,18 @@
|
|
412 |
return callback(response);
|
413 |
}
|
414 |
});
|
415 |
-
}
|
|
|
416 |
candidates.ajax_request = ajax_request;
|
417 |
-
|
|
|
418 |
connections.ajax_request = ajax_request;
|
419 |
connectionsView = new ConnectionsView({
|
420 |
el: $metabox.find('.p2p-connections'),
|
421 |
collection: connections,
|
422 |
candidates: candidates
|
423 |
});
|
|
|
424 |
candidatesView = new CandidatesView({
|
425 |
el: $metabox.find('.p2p-tab-search'),
|
426 |
collection: candidates,
|
@@ -428,10 +398,12 @@
|
|
428 |
spinner: $spinner,
|
429 |
duplicate_connections: $metabox.data('duplicate_connections')
|
430 |
});
|
|
|
431 |
createPostView = new CreatePostView({
|
432 |
el: $metabox.find('.p2p-tab-create-post'),
|
433 |
collection: connections
|
434 |
});
|
|
|
435 |
metaboxView = new MetaboxView({
|
436 |
el: $metabox,
|
437 |
spinner: $spinner,
|
@@ -439,11 +411,11 @@
|
|
439 |
candidates: candidates,
|
440 |
connections: connections
|
441 |
});
|
442 |
-
|
|
|
443 |
candidates: candidates,
|
444 |
connections: connections
|
445 |
};
|
446 |
});
|
447 |
});
|
448 |
-
|
449 |
-
}).call(this);
|
|
|
1 |
(function() {
|
2 |
var Candidate, Candidates, CandidatesView, Connection, Connections, ConnectionsView, CreatePostView, ENTER_KEY, MetaboxView, get_mustache_template, remove_row, row_wait;
|
3 |
|
9 |
|
10 |
remove_row = function($td) {
|
11 |
var $table;
|
|
|
12 |
$table = $td.closest('table');
|
13 |
$td.closest('tr').remove();
|
14 |
if (!$table.find('tbody tr').length) {
|
26 |
|
27 |
Candidates = Backbone.Model.extend({
|
28 |
sync: function() {
|
29 |
+
var params, _this = this;
|
|
|
|
|
30 |
params = {
|
31 |
subaction: 'search'
|
32 |
};
|
33 |
return this.ajax_request(params, function(response) {
|
34 |
+
var _ref = response.navigation;
|
35 |
+
_this.total_pages = (_ref ? _ref['total-pages-raw'] : void 0) || 1;
|
36 |
+
_this.trigger('sync', response);
|
|
|
37 |
});
|
38 |
},
|
39 |
validate: function(attrs) {
|
40 |
+
var _ref = attrs.paged;
|
41 |
+
if (0 < _ref && _ref <= this.total_pages) {
|
|
|
42 |
return null;
|
43 |
}
|
44 |
return 'invalid page';
|
48 |
Connections = Backbone.Collection.extend({
|
49 |
model: Connection,
|
50 |
createItemAndConnect: function(title) {
|
51 |
+
var data, _this = this;
|
|
|
|
|
52 |
data = {
|
53 |
subaction: 'create_post',
|
54 |
post_title: title
|
55 |
};
|
56 |
return this.ajax_request(data, function(response) {
|
57 |
+
_this.trigger('create', response);
|
58 |
});
|
59 |
},
|
60 |
create: function(candidate) {
|
61 |
+
var data, _this = this;
|
|
|
|
|
62 |
data = {
|
63 |
subaction: 'connect',
|
64 |
to: candidate.get('id')
|
65 |
};
|
66 |
return this.ajax_request(data, function(response) {
|
67 |
+
_this.trigger('create', response);
|
68 |
});
|
69 |
},
|
70 |
"delete": function(connection) {
|
71 |
+
var data, _this = this;
|
|
|
|
|
72 |
data = {
|
73 |
subaction: 'disconnect',
|
74 |
p2p_id: connection.get('id')
|
75 |
};
|
76 |
return this.ajax_request(data, function(response) {
|
77 |
+
_this.trigger('delete', response, connection);
|
78 |
});
|
79 |
},
|
80 |
clear: function() {
|
81 |
+
var data, _this = this;
|
|
|
|
|
82 |
data = {
|
83 |
subaction: 'clear_connections'
|
84 |
};
|
85 |
return this.ajax_request(data, function(response) {
|
86 |
+
_this.trigger('clear', response);
|
87 |
});
|
88 |
}
|
89 |
});
|
94 |
'click td.p2p-col-delete .p2p-icon': 'delete'
|
95 |
},
|
96 |
initialize: function(options) {
|
97 |
+
this.options = options;
|
98 |
this.maybe_make_sortable();
|
99 |
this.collection.on('create', this.afterCreate, this);
|
100 |
+
this.collection.on('clear', this.afterClear, this);
|
101 |
},
|
102 |
maybe_make_sortable: function() {
|
103 |
if (this.$('th.p2p-col-order').length) {
|
104 |
+
this.$('tbody').sortable({
|
105 |
handle: 'td.p2p-col-order',
|
106 |
helper: function(e, ui) {
|
107 |
ui.children().each(function() {
|
108 |
var $this;
|
|
|
109 |
$this = jQuery(this);
|
110 |
+
$this.width($this.width());
|
111 |
});
|
112 |
return ui;
|
113 |
}
|
116 |
},
|
117 |
clear: function(ev) {
|
118 |
var $td;
|
|
|
119 |
ev.preventDefault();
|
120 |
if (!confirm(P2PAdminL10n.deleteConfirmMessage)) {
|
121 |
return;
|
122 |
}
|
123 |
$td = jQuery(ev.target).closest('td');
|
124 |
row_wait($td);
|
125 |
+
this.collection.clear();
|
126 |
},
|
127 |
afterClear: function() {
|
128 |
+
this.$el.hide().find('tbody').html('');
|
129 |
},
|
130 |
"delete": function(ev) {
|
131 |
var $td, req;
|
|
|
132 |
ev.preventDefault();
|
133 |
$td = jQuery(ev.target).closest('td');
|
134 |
row_wait($td);
|
136 |
id: $td.find('input').val()
|
137 |
}));
|
138 |
req.done(function() {
|
139 |
+
remove_row($td);
|
140 |
});
|
|
|
141 |
},
|
142 |
afterCreate: function(response) {
|
143 |
this.$el.show().find('tbody').append(response.row);
|
144 |
+
this.collection.trigger('append', response);
|
145 |
}
|
146 |
});
|
147 |
|
154 |
'click td.p2p-col-create div': 'promote'
|
155 |
},
|
156 |
initialize: function(options) {
|
157 |
+
this.options = options;
|
158 |
this.spinner = options.spinner;
|
159 |
options.connections.on('delete', this.afterCandidatesRefreshed, this);
|
160 |
options.connections.on('clear', this.afterCandidatesRefreshed, this);
|
161 |
this.collection.on('sync', this.afterCandidatesRefreshed, this);
|
162 |
this.collection.on('error', this.afterInvalid, this);
|
163 |
+
this.collection.on('invalid', this.afterInvalid, this);
|
164 |
},
|
165 |
promote: function(ev) {
|
166 |
+
var $td, req, _this = this;
|
|
|
|
|
167 |
ev.preventDefault();
|
168 |
$td = jQuery(ev.target).closest('td');
|
169 |
row_wait($td);
|
170 |
+
var candidate = new Candidate({
|
171 |
id: $td.find('div').data('item-id')
|
172 |
+
});
|
173 |
+
req = this.options.connections.create(candidate);
|
174 |
req.done(function() {
|
175 |
if (_this.options.duplicate_connections) {
|
176 |
+
$td.find('.p2p-icon').css('background-image', '');
|
177 |
} else {
|
178 |
+
remove_row($td);
|
179 |
}
|
180 |
});
|
|
|
181 |
},
|
182 |
handleReturn: function(ev) {
|
183 |
if (ev.keyCode === ENTER_KEY) {
|
184 |
ev.preventDefault();
|
185 |
}
|
|
|
186 |
},
|
187 |
handleSearch: function(ev) {
|
188 |
var $searchInput, delayed,
|
189 |
_this = this;
|
|
|
190 |
if (delayed !== void 0) {
|
191 |
clearTimeout(delayed);
|
192 |
}
|
193 |
$searchInput = jQuery(ev.target);
|
194 |
delayed = setTimeout(function() {
|
195 |
var searchStr;
|
|
|
196 |
searchStr = $searchInput.val();
|
197 |
if (searchStr === _this.collection.get('s')) {
|
198 |
return;
|
199 |
}
|
200 |
+
_this.spinner.insertAfter($searchInput).show();
|
201 |
+
_this.collection.save({
|
202 |
's': searchStr,
|
203 |
'paged': 1
|
204 |
});
|
205 |
}, 400);
|
|
|
206 |
},
|
207 |
changePage: function(ev) {
|
208 |
var $navButton, new_page;
|
|
|
209 |
$navButton = jQuery(ev.currentTarget);
|
210 |
new_page = this.collection.get('paged');
|
211 |
if ($navButton.hasClass('p2p-prev')) {
|
214 |
new_page++;
|
215 |
}
|
216 |
this.spinner.appendTo(this.$('.p2p-navigation'));
|
217 |
+
this.collection.save('paged', new_page);
|
218 |
},
|
219 |
afterCandidatesRefreshed: function(response) {
|
220 |
this.spinner.remove();
|
222 |
if ('string' !== typeof response) {
|
223 |
response = this.template(response);
|
224 |
}
|
225 |
+
this.$el.append(response);
|
226 |
},
|
227 |
afterInvalid: function() {
|
228 |
+
this.spinner.remove();
|
229 |
}
|
230 |
});
|
231 |
|
235 |
'keypress :text': 'handleReturn'
|
236 |
},
|
237 |
initialize: function(options) {
|
238 |
+
this.options = options;
|
239 |
this.createButton = this.$('button');
|
240 |
+
this.createInput = this.$(':text');
|
241 |
},
|
242 |
handleReturn: function(ev) {
|
243 |
if (ev.keyCode === ENTER_KEY) {
|
244 |
this.createButton.click();
|
245 |
ev.preventDefault();
|
246 |
}
|
|
|
247 |
},
|
248 |
createItem: function(ev) {
|
249 |
+
var req, title, _this = this;
|
|
|
|
|
250 |
ev.preventDefault();
|
251 |
if (this.createButton.hasClass('inactive')) {
|
252 |
return false;
|
260 |
req = this.collection.createItemAndConnect(title);
|
261 |
req.done(function() {
|
262 |
_this.createInput.val('');
|
263 |
+
_this.createButton.removeClass('inactive');
|
264 |
});
|
|
|
265 |
}
|
266 |
});
|
267 |
|
271 |
'click .wp-tab-bar li': 'setActiveTab'
|
272 |
},
|
273 |
initialize: function(options) {
|
274 |
+
this.options = options;
|
275 |
this.spinner = options.spinner;
|
276 |
this.initializedCandidates = false;
|
277 |
options.connections.on('append', this.afterConnectionAppended, this);
|
278 |
options.connections.on('clear', this.afterConnectionDeleted, this);
|
279 |
+
options.connections.on('delete', this.afterConnectionDeleted, this);
|
280 |
},
|
281 |
toggleTabs: function(ev) {
|
282 |
var $tabs;
|
|
|
283 |
ev.preventDefault();
|
284 |
$tabs = this.$('.p2p-create-connections-tabs');
|
285 |
$tabs.toggle();
|
287 |
this.options.candidates.sync();
|
288 |
this.initializedCandidates = true;
|
289 |
}
|
|
|
290 |
},
|
291 |
setActiveTab: function(ev) {
|
292 |
var $tab;
|
|
|
293 |
ev.preventDefault();
|
294 |
$tab = jQuery(ev.currentTarget);
|
295 |
this.$('.wp-tab-bar li').removeClass('wp-tab-active');
|
296 |
$tab.addClass('wp-tab-active');
|
297 |
+
this.$el.find('.tabs-panel').hide().end().find($tab.data('ref')).show().find(':text').focus();
|
298 |
},
|
299 |
afterConnectionAppended: function(response) {
|
300 |
if ('one' === this.options.cardinality) {
|
301 |
+
this.$('.p2p-create-connections').hide();
|
302 |
}
|
303 |
},
|
304 |
afterConnectionDeleted: function(response) {
|
305 |
if ('one' === this.options.cardinality) {
|
306 |
+
this.$('.p2p-create-connections').show();
|
307 |
}
|
308 |
}
|
309 |
});
|
316 |
|
317 |
jQuery(function() {
|
318 |
var clearVal, setVal;
|
|
|
319 |
if (!jQuery('<input placeholder="1" />')[0].placeholder) {
|
320 |
setVal = function() {
|
321 |
var $this;
|
|
|
322 |
$this = jQuery(this);
|
323 |
if (!$this.val()) {
|
324 |
$this.val($this.attr('placeholder'));
|
325 |
$this.addClass('p2p-placeholder');
|
326 |
}
|
|
|
327 |
};
|
328 |
clearVal = function() {
|
329 |
var $this;
|
|
|
330 |
$this = jQuery(this);
|
331 |
if ($this.hasClass('p2p-placeholder')) {
|
332 |
$this.val('');
|
333 |
$this.removeClass('p2p-placeholder');
|
334 |
}
|
|
|
335 |
};
|
336 |
jQuery('.p2p-search input[placeholder]').each(setVal).focus(clearVal).blur(setVal);
|
337 |
}
|
338 |
+
|
339 |
Mustache.compilePartial('table-row', get_mustache_template('table-row'));
|
|
|
|
|
340 |
|
341 |
+
jQuery('.p2p-box').each(function() {
|
342 |
+
var $metabox, $spinner, candidates, candidatesView, connections, connectionsView, createPostView, ctype, metaboxView;
|
343 |
$metabox = jQuery(this);
|
344 |
$spinner = jQuery('<img>', {
|
345 |
'src': P2PAdminL10n.spinner,
|
355 |
direction: $metabox.data('direction'),
|
356 |
from: jQuery('#post_ID').val()
|
357 |
};
|
|
|
|
|
358 |
|
359 |
+
function ajax_request(options, callback) {
|
360 |
+
var params = _.extend({}, options, candidates.attributes, ctype, {
|
361 |
action: 'p2p_box',
|
362 |
nonce: P2PAdminL10n.nonce
|
363 |
});
|
364 |
+
|
365 |
return jQuery.post(ajaxurl, params, function(response) {
|
366 |
var e;
|
|
|
367 |
try {
|
368 |
response = jQuery.parseJSON(response);
|
369 |
} catch (_error) {
|
379 |
return callback(response);
|
380 |
}
|
381 |
});
|
382 |
+
}
|
383 |
+
|
384 |
candidates.ajax_request = ajax_request;
|
385 |
+
|
386 |
+
connections = new Connections();
|
387 |
connections.ajax_request = ajax_request;
|
388 |
connectionsView = new ConnectionsView({
|
389 |
el: $metabox.find('.p2p-connections'),
|
390 |
collection: connections,
|
391 |
candidates: candidates
|
392 |
});
|
393 |
+
|
394 |
candidatesView = new CandidatesView({
|
395 |
el: $metabox.find('.p2p-tab-search'),
|
396 |
collection: candidates,
|
398 |
spinner: $spinner,
|
399 |
duplicate_connections: $metabox.data('duplicate_connections')
|
400 |
});
|
401 |
+
|
402 |
createPostView = new CreatePostView({
|
403 |
el: $metabox.find('.p2p-tab-create-post'),
|
404 |
collection: connections
|
405 |
});
|
406 |
+
|
407 |
metaboxView = new MetaboxView({
|
408 |
el: $metabox,
|
409 |
spinner: $spinner,
|
411 |
candidates: candidates,
|
412 |
connections: connections
|
413 |
});
|
414 |
+
|
415 |
+
P2PAdmin.boxes[ctype.p2p_type] = {
|
416 |
candidates: candidates,
|
417 |
connections: connections
|
418 |
};
|
419 |
});
|
420 |
});
|
421 |
+
}());
|
|
admin/box.php
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
class P2P_Box {
|
4 |
private $ctype;
|
5 |
|
@@ -158,7 +161,8 @@ class P2P_Box {
|
|
158 |
}
|
159 |
|
160 |
protected function connection_row( $p2p_id, $item, $render = false ) {
|
161 |
-
|
|
|
162 |
|
163 |
$data = array();
|
164 |
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* A metabox in wp-admin
|
5 |
+
*/
|
6 |
class P2P_Box {
|
7 |
private $ctype;
|
8 |
|
161 |
}
|
162 |
|
163 |
protected function connection_row( $p2p_id, $item, $render = false ) {
|
164 |
+
|
165 |
+
$item->title = apply_filters( 'p2p_connected_title', $item->get_title(), $item->get_object(), $this->ctype );
|
166 |
|
167 |
$data = array();
|
168 |
|
admin/column-factory.php
CHANGED
@@ -15,6 +15,9 @@ class P2P_Column_Factory extends P2P_Factory {
|
|
15 |
$class = 'P2P_Column_' . ucfirst( $object_type );
|
16 |
$column = new $class( $directed );
|
17 |
|
|
|
|
|
|
|
18 |
add_action( 'admin_print_styles', array( $column, 'styles' ) );
|
19 |
}
|
20 |
}
|
15 |
$class = 'P2P_Column_' . ucfirst( $object_type );
|
16 |
$column = new $class( $directed );
|
17 |
|
18 |
+
$screen = get_current_screen();
|
19 |
+
|
20 |
+
add_filter( "manage_{$screen->id}_columns", array( $column, 'add_column' ) );
|
21 |
add_action( 'admin_print_styles', array( $column, 'styles' ) );
|
22 |
}
|
23 |
}
|
admin/column.php
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
abstract class P2P_Column {
|
4 |
|
5 |
protected $ctype;
|
@@ -13,10 +16,6 @@ abstract class P2P_Column {
|
|
13 |
$this->ctype->get_direction(),
|
14 |
$this->ctype->name
|
15 |
);
|
16 |
-
|
17 |
-
$screen = get_current_screen();
|
18 |
-
|
19 |
-
add_filter( "manage_{$screen->id}_columns", array( $this, 'add_column' ) );
|
20 |
}
|
21 |
|
22 |
function add_column( $columns ) {
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* A column in a list table in wp-admin
|
5 |
+
*/
|
6 |
abstract class P2P_Column {
|
7 |
|
8 |
protected $ctype;
|
16 |
$this->ctype->get_direction(),
|
17 |
$this->ctype->name
|
18 |
);
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
function add_column( $columns ) {
|
admin/dropdown.php
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
abstract class P2P_Dropdown {
|
4 |
|
5 |
protected $ctype;
|
@@ -17,11 +20,20 @@ abstract class P2P_Dropdown {
|
|
17 |
protected function render_dropdown() {
|
18 |
$direction = $this->ctype->flip_direction()->get_direction();
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
return scbForms::input( array(
|
21 |
'type' => 'select',
|
22 |
'name' => array( 'p2p', $this->ctype->name, $direction ),
|
23 |
'choices' => self::get_choices( $this->ctype ),
|
24 |
-
'text' => $
|
25 |
), $_GET );
|
26 |
}
|
27 |
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* A dropdown above a list table in wp-admin
|
5 |
+
*/
|
6 |
abstract class P2P_Dropdown {
|
7 |
|
8 |
protected $ctype;
|
20 |
protected function render_dropdown() {
|
21 |
$direction = $this->ctype->flip_direction()->get_direction();
|
22 |
|
23 |
+
$labels = $this->ctype->get( 'current', 'labels' );
|
24 |
+
|
25 |
+
if ( isset( $labels->dropdown_title ) )
|
26 |
+
$title = $labels->dropdown_title;
|
27 |
+
elseif ( isset( $labels->column_title ) )
|
28 |
+
$title = $labels->column_title;
|
29 |
+
else
|
30 |
+
$title = $this->title;
|
31 |
+
|
32 |
return scbForms::input( array(
|
33 |
'type' => 'select',
|
34 |
'name' => array( 'p2p', $this->ctype->name, $direction ),
|
35 |
'choices' => self::get_choices( $this->ctype ),
|
36 |
+
'text' => $title,
|
37 |
), $_GET );
|
38 |
}
|
39 |
|
admin/field-title.php
CHANGED
@@ -14,8 +14,8 @@ abstract class P2P_Field_Title implements P2P_Field {
|
|
14 |
|
15 |
function render( $p2p_id, $item ) {
|
16 |
$data = array_merge( $this->get_data( $item ), array(
|
17 |
-
'title' => $item->
|
18 |
-
'url'
|
19 |
) );
|
20 |
|
21 |
return P2P_Mustache::render( 'column-title', $data );
|
14 |
|
15 |
function render( $p2p_id, $item ) {
|
16 |
$data = array_merge( $this->get_data( $item ), array(
|
17 |
+
'title' => $item->title,
|
18 |
+
'url' => $item->get_editlink(),
|
19 |
) );
|
20 |
|
21 |
return P2P_Mustache::render( 'column-title', $data );
|
admin/field.php
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
interface P2P_Field {
|
4 |
function get_title();
|
5 |
function render( $p2p_id, $item );
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* A P2P admin metabox is composed of several "fields".
|
5 |
+
*/
|
6 |
interface P2P_Field {
|
7 |
function get_title();
|
8 |
function render( $p2p_id, $item );
|
core/directed-connection-type.php
CHANGED
@@ -93,10 +93,14 @@ class P2P_Directed_Connection_Type {
|
|
93 |
*/
|
94 |
public function get_related( $item, $extra_qv = array(), $output = 'raw' ) {
|
95 |
$extra_qv['fields'] = 'ids';
|
|
|
96 |
|
97 |
$connected = $this->get_connected( $item, $extra_qv, 'abstract' );
|
98 |
|
99 |
-
$additional_qv = array(
|
|
|
|
|
|
|
100 |
|
101 |
return $this->flip_direction()->get_connected( $connected->items, $additional_qv, $output );
|
102 |
}
|
93 |
*/
|
94 |
public function get_related( $item, $extra_qv = array(), $output = 'raw' ) {
|
95 |
$extra_qv['fields'] = 'ids';
|
96 |
+
$extra_qv['p2p:per_page'] = -1;
|
97 |
|
98 |
$connected = $this->get_connected( $item, $extra_qv, 'abstract' );
|
99 |
|
100 |
+
$additional_qv = array(
|
101 |
+
'p2p:exclude' => _p2p_normalize( $item ),
|
102 |
+
'p2p:per_page' => -1
|
103 |
+
);
|
104 |
|
105 |
return $this->flip_direction()->get_connected( $connected->items, $additional_qv, $output );
|
106 |
}
|
core/item.php
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
abstract class P2P_Item {
|
4 |
|
5 |
protected $item;
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* A uniform wrapper for various types of WP objects, i.e. posts or users.
|
5 |
+
*/
|
6 |
abstract class P2P_Item {
|
7 |
|
8 |
protected $item;
|
lang/posts-to-posts-es_ES.po
CHANGED
@@ -1,72 +1,153 @@
|
|
1 |
-
#
|
2 |
-
#
|
3 |
-
# This file is distributed under the same license as the Posts 2 Posts package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
5 |
-
#
|
6 |
msgid ""
|
7 |
msgstr ""
|
8 |
-
"Project-Id-Version:
|
9 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/
|
10 |
-
"POT-Creation-Date:
|
11 |
-
"PO-Revision-Date: 2010-10-18 22:03-0500\n"
|
12 |
-
"Last-Translator: \n"
|
13 |
-
"Language-Team: wikichaves.com <info@wikichaves.com>\n"
|
14 |
-
"Language: \n"
|
15 |
"MIME-Version: 1.0\n"
|
16 |
"Content-Type: text/plain; charset=UTF-8\n"
|
17 |
"Content-Transfer-Encoding: 8bit\n"
|
18 |
-
"
|
19 |
-
"
|
20 |
-
"
|
21 |
|
22 |
-
#:
|
23 |
-
msgid "
|
24 |
-
msgstr "
|
25 |
|
26 |
-
#:
|
27 |
-
|
28 |
-
|
29 |
-
msgstr "Guardar Cambios"
|
30 |
|
31 |
-
#:
|
32 |
-
msgid "
|
33 |
-
msgstr "
|
34 |
|
35 |
-
#:
|
36 |
-
msgid "
|
37 |
-
msgstr "
|
38 |
|
39 |
-
#:
|
40 |
-
msgid "
|
41 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
-
#:
|
44 |
-
msgid "
|
45 |
-
msgstr "
|
46 |
|
47 |
-
#:
|
48 |
-
msgid "
|
49 |
-
msgstr "
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
msgid "Posts 2 Posts"
|
53 |
-
msgstr ""
|
54 |
|
55 |
-
|
56 |
-
msgid "
|
57 |
-
msgstr ""
|
58 |
|
59 |
-
|
60 |
-
msgid "
|
61 |
-
msgstr ""
|
62 |
|
63 |
-
|
64 |
-
msgid "
|
65 |
-
msgstr ""
|
66 |
|
67 |
-
|
68 |
-
msgid "
|
69 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
70 |
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2013
|
2 |
+
# This file is distributed under the same license as the package.
|
|
|
|
|
|
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: \n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/p2p\n"
|
7 |
+
"POT-Creation-Date: 2013-02-17 08:06:11+00:00\n"
|
|
|
|
|
|
|
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
|
12 |
+
"Last-Translator: Alejandro Schwartz <alejandro@alejandroschwartz.com>\n"
|
13 |
+
"Language-Team: Español <LL@li.org>\n"
|
14 |
|
15 |
+
#: admin/box.php:45
|
16 |
+
msgid "Are you sure you want to delete all connections?"
|
17 |
+
msgstr "¿Está seguro de que desea borrar todas las conexiones?"
|
18 |
|
19 |
+
#: admin/box.php:136
|
20 |
+
msgid "Search"
|
21 |
+
msgstr "Buscar"
|
|
|
22 |
|
23 |
+
#: admin/box.php:213
|
24 |
+
msgid "previous"
|
25 |
+
msgstr "anterior"
|
26 |
|
27 |
+
#: admin/box.php:214
|
28 |
+
msgid "next"
|
29 |
+
msgstr "siguiente"
|
30 |
|
31 |
+
#: admin/box.php:215
|
32 |
+
msgid "of"
|
33 |
+
msgstr "desactivado"
|
34 |
+
|
35 |
+
#: admin/dropdown-user.php:32
|
36 |
+
msgid "Filter"
|
37 |
+
msgstr "Filtrar"
|
38 |
+
|
39 |
+
#: admin/factory.php:88
|
40 |
+
msgid " (from)"
|
41 |
+
msgstr " (desde)"
|
42 |
+
|
43 |
+
#: admin/factory.php:89
|
44 |
+
msgid " (to)"
|
45 |
+
msgstr " (hasta)"
|
46 |
+
|
47 |
+
#: admin/field-delete.php:7
|
48 |
+
msgid "Delete all connections"
|
49 |
+
msgstr "Borrar todas las conexiones"
|
50 |
+
|
51 |
+
#: admin/field-delete.php:16
|
52 |
+
msgid "Delete connection"
|
53 |
+
msgstr "Borrar conexión"
|
54 |
+
|
55 |
+
#: admin/tools-page.php:7
|
56 |
+
msgid "Connection Types"
|
57 |
+
msgstr "Tipos de conexiones"
|
58 |
+
|
59 |
+
#: admin/tools-page.php:41
|
60 |
+
msgid "<em>%s</em> is not a registered connection type."
|
61 |
+
msgstr "<em>%s</em> no es un tipo de conexión registrada."
|
62 |
+
|
63 |
+
#: admin/tools-page.php:50
|
64 |
+
msgid "Converted %1$s connections from <em>%2$s</em> to <em>%3$s</em>."
|
65 |
+
msgstr "Se han convertido %1$s conexiones de <em>%2$s</em> a <em>%3$s</em>."
|
66 |
+
|
67 |
+
#: admin/tools-page.php:64
|
68 |
+
msgid "Name"
|
69 |
+
msgstr "Nombre"
|
70 |
+
|
71 |
+
#: admin/tools-page.php:65
|
72 |
+
msgid "Information"
|
73 |
+
msgstr "Información"
|
74 |
+
|
75 |
+
#: admin/tools-page.php:66
|
76 |
+
msgid "Connections"
|
77 |
+
msgstr "Conexiones"
|
78 |
+
|
79 |
+
#: admin/tools-page.php:74
|
80 |
+
msgid "No connection types registered."
|
81 |
+
msgstr "No hay ningún tipo de conexiones registradas"
|
82 |
|
83 |
+
#: admin/tools-page.php:76
|
84 |
+
msgid "To register a connection type, see <a href=\"%s\">the wiki</a>."
|
85 |
+
msgstr "Para registrar un tipo de conexión, vea <a href=\"%s\">the wiki</a>."
|
86 |
|
87 |
+
#: admin/tools-page.php:93
|
88 |
+
msgid "Convert to registered connection type:"
|
89 |
+
msgstr "Convertir a un tipo de conexión registrada:"
|
90 |
|
91 |
+
#: admin/tools-page.php:129
|
92 |
+
msgid "Go"
|
93 |
+
msgstr "Ir"
|
94 |
+
|
95 |
+
#: core/connection-type.php:102
|
96 |
+
msgid "Create connections"
|
97 |
+
msgstr "Crear conexiones"
|
98 |
+
|
99 |
+
#: core/connection-type.php:120
|
100 |
+
msgid "Connected %s"
|
101 |
+
msgstr "Conexiones de %s"
|
102 |
+
|
103 |
+
#: core/side-user.php:16
|
104 |
+
msgid "Users"
|
105 |
+
msgstr "Usuarios"
|
106 |
+
|
107 |
+
#: core/side-user.php:25
|
108 |
+
msgid "User"
|
109 |
+
msgstr "Usuario"
|
110 |
+
|
111 |
+
#: core/side-user.php:26
|
112 |
+
msgid "Search Users"
|
113 |
+
msgstr "Buscar usuarios"
|
114 |
+
|
115 |
+
#: core/side-user.php:27
|
116 |
+
msgid "No users found."
|
117 |
+
msgstr "No se encontraron usuarios"
|
118 |
+
|
119 |
+
#: core/widget.php:16
|
120 |
msgid "Posts 2 Posts"
|
121 |
+
msgstr "Posts 2 Posts"
|
122 |
|
123 |
+
#: core/widget.php:17
|
124 |
+
msgid "A list of posts connected to the current post"
|
125 |
+
msgstr "Una lista de los posts conectados al post actual"
|
126 |
|
127 |
+
#: core/widget.php:34
|
128 |
+
msgid "Title:"
|
129 |
+
msgstr "Título"
|
130 |
|
131 |
+
#: core/widget.php:41
|
132 |
+
msgid "Connection type:"
|
133 |
+
msgstr "Tipo de conexión:"
|
134 |
|
135 |
+
#: core/widget.php:46
|
136 |
+
msgid "Connection listing:"
|
137 |
+
msgstr "Lista de conexiones:"
|
138 |
+
|
139 |
+
#: core/widget.php:52
|
140 |
+
msgid "connected"
|
141 |
+
msgstr "Conectado"
|
142 |
|
143 |
+
#: core/widget.php:53
|
144 |
+
msgid "related"
|
145 |
+
msgstr "relacionados"
|
146 |
+
|
147 |
+
#: scb/AdminPage.php:227
|
148 |
+
msgid "Settings <strong>saved</strong>."
|
149 |
+
msgstr "Configuración <strong>guardada</strong>."
|
150 |
+
|
151 |
+
#: scb/AdminPage.php:466
|
152 |
+
msgid "Settings"
|
153 |
+
msgstr "Configuración"
|
lang/posts-to-posts-sr_RS.mo
ADDED
Binary file
|
lang/posts-to-posts-sr_RS.po
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Translation of the WordPress plugin Posts 2 Posts by scribu.
|
2 |
+
# Copyright (C) 2012
|
3 |
+
# This file is distributed under the same license as the Posts 2 Posts package.
|
4 |
+
msgid ""
|
5 |
+
msgstr ""
|
6 |
+
"Project-Id-Version: Posts 2 Posts\n"
|
7 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/p2p\n"
|
8 |
+
"POT-Creation-Date: 2011-12-01 16:28:04+00:00\n"
|
9 |
+
"PO-Revision-Date: 2014-01-09 13:46+0100\n"
|
10 |
+
"Last-Translator: Borisa Djuraskovic <borisad@webhostinghub.com>\n"
|
11 |
+
"Language-Team: \n"
|
12 |
+
"Language: Serbian\n"
|
13 |
+
"MIME-Version: 1.0\n"
|
14 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
+
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
"X-Generator: Poedit 1.5.7\n"
|
17 |
+
|
18 |
+
#: admin/box.php:38
|
19 |
+
msgid "Are you sure you want to delete all connections?"
|
20 |
+
msgstr "Da li ste sigurni da želite da izbrišete sve konekcije?"
|
21 |
+
|
22 |
+
#: admin/box.php:114
|
23 |
+
msgid "Search"
|
24 |
+
msgstr "Pretraga"
|
25 |
+
|
26 |
+
#: admin/box.php:191
|
27 |
+
msgid "previous"
|
28 |
+
msgstr "prethodno"
|
29 |
+
|
30 |
+
#: admin/box.php:192
|
31 |
+
msgid "next"
|
32 |
+
msgstr "sledeće"
|
33 |
+
|
34 |
+
#: admin/box.php:193
|
35 |
+
msgid "of"
|
36 |
+
msgstr "od"
|
37 |
+
|
38 |
+
#: admin/box.php:236
|
39 |
+
msgid "Can't create connection: %s"
|
40 |
+
msgstr "Ne može se povezati sa: %s"
|
41 |
+
|
42 |
+
#: admin/factory.php:30
|
43 |
+
msgid " (from)"
|
44 |
+
msgstr "(od)"
|
45 |
+
|
46 |
+
#: admin/factory.php:31
|
47 |
+
msgid " (to)"
|
48 |
+
msgstr "(za)"
|
49 |
+
|
50 |
+
#: admin/fields.php:30
|
51 |
+
msgid "Delete all connections"
|
52 |
+
msgstr "Obrisati sve konekcije"
|
53 |
+
|
54 |
+
#: admin/fields.php:39
|
55 |
+
msgid "Delete connection"
|
56 |
+
msgstr "Obrisati konekciju"
|
57 |
+
|
58 |
+
#: admin/tools.php:7
|
59 |
+
msgid "Connection Types"
|
60 |
+
msgstr "Tipovi konekcija"
|
61 |
+
|
62 |
+
#: admin/tools.php:41
|
63 |
+
#, php-format
|
64 |
+
msgid "<em>%s</em> is not a registered connection type."
|
65 |
+
msgstr "<em>%s</em>nije registrovan tip konekcije."
|
66 |
+
|
67 |
+
#: admin/tools.php:50
|
68 |
+
msgid "Converted %1$s connections from <em>%2$s</em> to <em>%3$s</em>."
|
69 |
+
msgstr "Konvertovano %1$s konekcija od<em>%2$s</em>do<em>%3$s</em>."
|
70 |
+
|
71 |
+
#: admin/tools.php:64
|
72 |
+
msgid "Name"
|
73 |
+
msgstr "Ime"
|
74 |
+
|
75 |
+
#: admin/tools.php:65
|
76 |
+
msgid "Information"
|
77 |
+
msgstr "Informacija"
|
78 |
+
|
79 |
+
#: admin/tools.php:66
|
80 |
+
msgid "Connections"
|
81 |
+
msgstr "Konekcije"
|
82 |
+
|
83 |
+
#: admin/tools.php:74
|
84 |
+
msgid "No connection types registered."
|
85 |
+
msgstr "Nijedan tip konekcija nije registrovan."
|
86 |
+
|
87 |
+
#: admin/tools.php:76
|
88 |
+
#, php-format
|
89 |
+
msgid "To register a connection type, see <a href=\"%s\">the wiki</a>."
|
90 |
+
msgstr ""
|
91 |
+
"Da biste registrovali tip konekcije, pogledajte<a href=\"%s\">the wiki</a>."
|
92 |
+
|
93 |
+
#: admin/tools.php:93
|
94 |
+
msgid "Convert to registered connection type:"
|
95 |
+
msgstr "Konvertuj na registrovani tip konekcije:"
|
96 |
+
|
97 |
+
#: admin/tools.php:129
|
98 |
+
msgid "Go"
|
99 |
+
msgstr "Kreni"
|
100 |
+
|
101 |
+
#: core/widget.php:15
|
102 |
+
msgid "Posts 2 Posts"
|
103 |
+
msgstr "Posts 2 Posts"
|
104 |
+
|
105 |
+
#: core/widget.php:16
|
106 |
+
msgid "A list of posts connected to the current post"
|
107 |
+
msgstr "Lista postova konektovanih sa trenutnim postom"
|
108 |
+
|
109 |
+
#: core/extra.php:34
|
110 |
+
msgid "Title:"
|
111 |
+
msgstr "Naslov:"
|
112 |
+
|
113 |
+
#: admin/box.php:115
|
114 |
+
msgid "Create connections:"
|
115 |
+
msgstr "Kreiraj konekcije:"
|
116 |
+
|
117 |
+
#: core/type.php:79
|
118 |
+
msgid "Create connections"
|
119 |
+
msgstr "Kreiraj konekcije"
|
120 |
+
|
121 |
+
#: admin/box.php:136
|
122 |
+
msgid "View All"
|
123 |
+
msgstr "Pregledaj sve"
|
124 |
+
|
125 |
+
#: admin/fields.php:16
|
126 |
+
msgid "Create connection"
|
127 |
+
msgstr "Napraviti konekciju"
|
128 |
+
|
129 |
+
#: scb/AdminPage.php:165
|
130 |
+
msgid "Settings <strong>saved</strong>."
|
131 |
+
msgstr "Postavke<strong> sačuvane</strong>."
|
132 |
+
|
133 |
+
#: scb/AdminPage.php:178 scb/AdminPage.php:189
|
134 |
+
msgid "Save Changes"
|
135 |
+
msgstr "Sačuvaj promene"
|
136 |
+
|
137 |
+
#: scb/AdminPage.php:350
|
138 |
+
msgid "Settings"
|
139 |
+
msgstr "Postavke"
|
140 |
+
|
141 |
+
#: core/type.php:65
|
142 |
+
msgid "Connected %s"
|
143 |
+
msgstr "Konektovano %s"
|
144 |
+
|
145 |
+
#: core/widget.php:37
|
146 |
+
msgid "Connection type:"
|
147 |
+
msgstr "Tip konekcija:"
|
148 |
+
|
149 |
+
#: core/widget.php:41
|
150 |
+
msgid "Connection listing:"
|
151 |
+
msgstr "Listing konekcija:"
|
152 |
+
|
153 |
+
#: core/widget.php:47
|
154 |
+
msgid "connected"
|
155 |
+
msgstr "konektovano"
|
156 |
+
|
157 |
+
#: core/widget.php:48
|
158 |
+
msgid "related"
|
159 |
+
msgstr "vezano za"
|
160 |
+
|
161 |
+
#: core/widget.php:73
|
162 |
+
msgid "Related %s"
|
163 |
+
msgstr "Vezano za %s"
|
164 |
+
|
165 |
+
#: core/storage.php:35
|
166 |
+
msgid "Upgraded %d connections."
|
167 |
+
msgstr "Upgrade-ovano %d konekcija"
|
168 |
+
|
169 |
+
#: core/storage.php:38
|
170 |
+
msgid ""
|
171 |
+
"The Posts 2 Posts connections need to be upgraded. <a href=\"%s\">Proceed.</"
|
172 |
+
"a>"
|
173 |
+
msgstr ""
|
174 |
+
" Posts 2 Posts konekcije treba da se upgrade-uju.<a href=\"%s\"> Nastavi.</a>"
|
175 |
+
|
176 |
+
#: core/side.php:110
|
177 |
+
msgid "Users"
|
178 |
+
msgstr "Korisnici"
|
179 |
+
|
180 |
+
#: core/side.php:115
|
181 |
+
msgid "User"
|
182 |
+
msgstr "Korisnik"
|
183 |
+
|
184 |
+
#: core/side.php:116
|
185 |
+
msgid "Search Users"
|
186 |
+
msgstr "Pretraga korisnika"
|
187 |
+
|
188 |
+
#: core/side.php:117
|
189 |
+
msgid "No users found."
|
190 |
+
msgstr "Nijedan korisnik nije pronadjen"
|
posts-to-posts.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Posts 2 Posts
|
4 |
Description: Create many-to-many relationships between all types of posts.
|
5 |
-
Version: 1.6.
|
6 |
Author: scribu
|
7 |
Author URI: http://scribu.net/
|
8 |
Plugin URI: http://scribu.net/wordpress/posts-to-posts
|
@@ -10,7 +10,7 @@ Text Domain: posts-to-posts
|
|
10 |
Domain Path: /lang
|
11 |
*/
|
12 |
|
13 |
-
define( 'P2P_PLUGIN_VERSION', '1.6.
|
14 |
|
15 |
define( 'P2P_TEXTDOMAIN', 'posts-to-posts' );
|
16 |
|
@@ -19,6 +19,11 @@ require_once dirname( __FILE__ ) . '/scb/load.php';
|
|
19 |
function _p2p_load() {
|
20 |
load_plugin_textdomain( P2P_TEXTDOMAIN, '', basename( dirname( __FILE__ ) ) . '/lang' );
|
21 |
|
|
|
|
|
|
|
|
|
|
|
22 |
require_once dirname( __FILE__ ) . '/core/init.php';
|
23 |
|
24 |
register_uninstall_hook( __FILE__, array( 'P2P_Storage', 'uninstall' ) );
|
2 |
/*
|
3 |
Plugin Name: Posts 2 Posts
|
4 |
Description: Create many-to-many relationships between all types of posts.
|
5 |
+
Version: 1.6.3
|
6 |
Author: scribu
|
7 |
Author URI: http://scribu.net/
|
8 |
Plugin URI: http://scribu.net/wordpress/posts-to-posts
|
10 |
Domain Path: /lang
|
11 |
*/
|
12 |
|
13 |
+
define( 'P2P_PLUGIN_VERSION', '1.6.3' );
|
14 |
|
15 |
define( 'P2P_TEXTDOMAIN', 'posts-to-posts' );
|
16 |
|
19 |
function _p2p_load() {
|
20 |
load_plugin_textdomain( P2P_TEXTDOMAIN, '', basename( dirname( __FILE__ ) ) . '/lang' );
|
21 |
|
22 |
+
// Prevent activation issues if a bundled version of P2P core is already loaded.
|
23 |
+
if ( function_exists( 'p2p_register_connection_type' ) ) {
|
24 |
+
return;
|
25 |
+
}
|
26 |
+
|
27 |
require_once dirname( __FILE__ ) . '/core/init.php';
|
28 |
|
29 |
register_uninstall_hook( __FILE__, array( 'P2P_Storage', 'uninstall' ) );
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
Contributors: scribu, ciobi
|
4 |
Tags: connections, custom post types, relationships, many-to-many, users
|
5 |
Requires at least: 3.5
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -57,6 +57,14 @@ Additional info can be found on the [wiki](http://github.com/scribu/wp-posts-to-
|
|
57 |
|
58 |
== Changelog ==
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
= 1.6.2 =
|
61 |
* fixed URL query handling. props ntns
|
62 |
* store `WP_Error` instance instead of calling `trigger_error()`. props MZAWeb
|
3 |
Contributors: scribu, ciobi
|
4 |
Tags: connections, custom post types, relationships, many-to-many, users
|
5 |
Requires at least: 3.5
|
6 |
+
Tested up to: 3.9
|
7 |
+
Stable tag: 1.6.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
57 |
|
58 |
== Changelog ==
|
59 |
|
60 |
+
= 1.6.3 =
|
61 |
+
* added Serbian translation. props Borisa Djuraskovic
|
62 |
+
* fixed spinner in admin box. props yamablam
|
63 |
+
* fixed JavaScript error related to Backbone. props ericandrewlewis
|
64 |
+
* made 'p2p_connected_title' filter work for users too. props MZAWeb
|
65 |
+
* added support for 'dropdown_title' labels. props GaryJones
|
66 |
+
* made `get_related()` consider all connected items
|
67 |
+
|
68 |
= 1.6.2 =
|
69 |
* fixed URL query handling. props ntns
|
70 |
* store `WP_Error` instance instead of calling `trigger_error()`. props MZAWeb
|